html_url
stringlengths
51
51
title
stringlengths
6
280
comments
stringlengths
67
24.7k
body
stringlengths
51
36.2k
__index_level_0__
int64
1
1.17k
comment_length
int64
16
1.45k
text
stringlengths
190
38.3k
embeddings
sequence
https://github.com/huggingface/datasets/issues/3227
Error in `Json(datasets.ArrowBasedBuilder)` class
:open_mouth: you're right, that did it! I just put everything on a single line (my file only has a single example) and that fixed the error. Thank you so much!
## Describe the bug When a json file contains a `text` field that is larger than the block_size, the JSON dataset builder fails. ## Steps to reproduce the bug Create a folder that contains the following: ``` . β”œβ”€β”€ testdata β”‚Β Β  └── mydata.json └── test.py ``` Please download [this file](https://github.com/huggingface/datasets/files/7491797/mydata.txt) as `mydata.json`. (The error does not occur in JSON files with shorter text, but it is reproducible when the text is long as in the file I provide) :exclamation: :exclamation: GitHub doesn't allow me to upload JSON so this file is a TXT, and you should rename it to `.json`! `test.py` simply contains: ```python from datasets import load_dataset my_dataset = load_dataset("testdata") ``` To reproduce the error, simply run ``` python test.py ``` ## Expected results The data should load correctly without error. ## Actual results The dataset builder fails with: ``` Using custom data configuration testdata-d490389b8ab4fd82 Downloading and preparing dataset json/testdata to /home/junshern.chan/.cache/huggingface/datasets/json/testdata-d490389b8ab4fd82/0.0.0/3333a8af0db9764dfcff43a42ff26228f0f2e267f0d8a0a294452d188beadb34... 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 2264.74it/s] 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 447.01it/s] Failed to read file '/home/junshern.chan/hf-json-bug/testdata/mydata.json' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Missing a name for object member. in row 0 Traceback (most recent call last): File "test.py", line 28, in <module> my_dataset = load_dataset("testdata") File "/home/junshern.chan/.casio/miniconda/envs/hf-json-bug/lib/python3.8/site-packages/datasets/load.py", line 1632, in load_dataset builder_instance.download_and_prepare( File "/home/junshern.chan/.casio/miniconda/envs/hf-json-bug/lib/python3.8/site-packages/datasets/builder.py", line 607, in download_and_prepare self._download_and_prepare( File "/home/junshern.chan/.casio/miniconda/envs/hf-json-bug/lib/python3.8/site-packages/datasets/builder.py", line 697, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/junshern.chan/.casio/miniconda/envs/hf-json-bug/lib/python3.8/site-packages/datasets/builder.py", line 1156, in _prepare_split for key, table in utils.tqdm( File "/home/junshern.chan/.casio/miniconda/envs/hf-json-bug/lib/python3.8/site-packages/tqdm/std.py", line 1168, in __iter__ for obj in iterable: File "/home/junshern.chan/.casio/miniconda/envs/hf-json-bug/lib/python3.8/site-packages/datasets/packaged_modules/json/json.py", line 146, in _generate_tables raise ValueError( ValueError: Not able to read records in the JSON file at /home/junshern.chan/hf-json-bug/testdata/mydata.json. You should probably indicate the field of the JSON file containing your records. This JSON file contain the following fields: ['text']. Select the correct one and provide it as `field='XXX'` to the dataset loading method. ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.15.1 - Platform: Linux-5.8.0-63-generic-x86_64-with-glibc2.17 - Python version: 3.8.12 - PyArrow version: 6.0.0
1,124
30
Error in `Json(datasets.ArrowBasedBuilder)` class ## Describe the bug When a json file contains a `text` field that is larger than the block_size, the JSON dataset builder fails. ## Steps to reproduce the bug Create a folder that contains the following: ``` . β”œβ”€β”€ testdata β”‚Β Β  └── mydata.json └── test.py ``` Please download [this file](https://github.com/huggingface/datasets/files/7491797/mydata.txt) as `mydata.json`. (The error does not occur in JSON files with shorter text, but it is reproducible when the text is long as in the file I provide) :exclamation: :exclamation: GitHub doesn't allow me to upload JSON so this file is a TXT, and you should rename it to `.json`! `test.py` simply contains: ```python from datasets import load_dataset my_dataset = load_dataset("testdata") ``` To reproduce the error, simply run ``` python test.py ``` ## Expected results The data should load correctly without error. ## Actual results The dataset builder fails with: ``` Using custom data configuration testdata-d490389b8ab4fd82 Downloading and preparing dataset json/testdata to /home/junshern.chan/.cache/huggingface/datasets/json/testdata-d490389b8ab4fd82/0.0.0/3333a8af0db9764dfcff43a42ff26228f0f2e267f0d8a0a294452d188beadb34... 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 2264.74it/s] 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 447.01it/s] Failed to read file '/home/junshern.chan/hf-json-bug/testdata/mydata.json' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Missing a name for object member. in row 0 Traceback (most recent call last): File "test.py", line 28, in <module> my_dataset = load_dataset("testdata") File "/home/junshern.chan/.casio/miniconda/envs/hf-json-bug/lib/python3.8/site-packages/datasets/load.py", line 1632, in load_dataset builder_instance.download_and_prepare( File "/home/junshern.chan/.casio/miniconda/envs/hf-json-bug/lib/python3.8/site-packages/datasets/builder.py", line 607, in download_and_prepare self._download_and_prepare( File "/home/junshern.chan/.casio/miniconda/envs/hf-json-bug/lib/python3.8/site-packages/datasets/builder.py", line 697, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/junshern.chan/.casio/miniconda/envs/hf-json-bug/lib/python3.8/site-packages/datasets/builder.py", line 1156, in _prepare_split for key, table in utils.tqdm( File "/home/junshern.chan/.casio/miniconda/envs/hf-json-bug/lib/python3.8/site-packages/tqdm/std.py", line 1168, in __iter__ for obj in iterable: File "/home/junshern.chan/.casio/miniconda/envs/hf-json-bug/lib/python3.8/site-packages/datasets/packaged_modules/json/json.py", line 146, in _generate_tables raise ValueError( ValueError: Not able to read records in the JSON file at /home/junshern.chan/hf-json-bug/testdata/mydata.json. You should probably indicate the field of the JSON file containing your records. This JSON file contain the following fields: ['text']. Select the correct one and provide it as `field='XXX'` to the dataset loading method. ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.15.1 - Platform: Linux-5.8.0-63-generic-x86_64-with-glibc2.17 - Python version: 3.8.12 - PyArrow version: 6.0.0 :open_mouth: you're right, that did it! I just put everything on a single line (my file only has a single example) and that fixed the error. Thank you so much!
[ -1.0981725454330444, -0.8957386016845703, -0.8776326775550842, 1.4748728275299072, -0.06334543228149414, -1.270065426826477, 0.1679607629776001, -1.0915708541870117, 1.7226824760437012, -0.6693846583366394, 0.2722286283969879, -1.7230216264724731, -0.03758775442838669, -0.5650842785835266, -0.8119940161705017, -0.9013184309005737, -0.39567553997039795, -0.8235345482826233, 0.9319093823432922, 2.485309600830078, 1.280824899673462, -1.3003833293914795, 2.73295259475708, 0.6713560223579407, -0.2711417078971863, -1.002329707145691, 0.5056994557380676, -0.001721689011901617, -1.244065284729004, -0.48927924036979675, -0.8717097640037537, -0.05465883016586304, -0.5641364455223083, -0.5895553231239319, 0.09488853812217712, 0.45415055751800537, -0.31277820467948914, -0.42307183146476746, -0.5232317447662354, -0.7428877353668213, 0.431959867477417, -0.3382464647293091, 0.9492993950843811, -0.33906522393226624, 1.8202217817306519, -0.6004139184951782, 0.3335840404033661, 0.7146595120429993, 1.3787829875946045, 0.15882709622383118, 0.04782789200544357, 0.3713717758655548, 0.3453403413295746, 0.05959402024745941, 0.4859759211540222, 1.2357094287872314, 0.6018677353858948, 0.4854051172733307, 0.7271718382835388, -2.151916742324829, 1.2847076654434204, -0.9431002140045166, 0.33107465505599976, 1.2559136152267456, -0.8707332611083984, 0.34306448698043823, -1.8131544589996338, -0.024747133255004883, 0.5510943531990051, -2.167855978012085, 0.282664954662323, -1.2941937446594238, -0.4747246503829956, 0.9875184893608093, 0.22215507924556732, -1.1926372051239014, 0.23509865999221802, -0.4968793988227844, 1.0547833442687988, 0.38925468921661377, 1.2130088806152344, -1.7167869806289673, -0.040195390582084656, -0.301522821187973, 0.13301289081573486, -1.3224340677261353, -1.52639639377594, 0.548910915851593, 0.6042916178703308, 0.731682300567627, -0.12800996005535126, 1.0434433221817017, -1.0247374773025513, 0.7974424958229065, -1.0044403076171875, -1.771536111831665, -1.3769454956054688, -2.1456780433654785, -2.282336950302124, 0.7331071496009827, -0.48503047227859497, -0.537934422492981, 2.054016590118408, -0.8966277241706848, -1.7883498668670654, 1.0273364782333374, 0.33883315324783325, -0.027903588488698006, 2.4034180641174316, 0.23512744903564453, -0.7273702621459961, 0.44397708773612976, -0.6103067398071289, 0.8191298842430115, -0.3579237461090088, 1.3667320013046265, 0.43392306566238403, -0.9882993698120117, 1.6274901628494263, -0.4035457372665405, 0.6222748756408691, -0.7572572231292725, -0.5208534002304077, -0.8300049304962158, 0.25444284081459045, 1.9235641956329346, -0.3826110064983368, 1.5614264011383057, -0.39289161562919617, -1.5775725841522217, -1.6036393642425537, 0.8721052408218384, 0.5188686847686768, -0.8388650417327881, 0.05363820493221283, -0.410967081785202, 0.09017089754343033, -0.02048363909125328, 1.093337059020996, 1.2475138902664185, 0.7472245693206787, -0.2940765917301178, -0.7633565664291382, 0.21634744107723236, -0.04918403923511505, -0.7402459979057312, -1.8276270627975464, -0.294556200504303, 0.16458693146705627, 0.6286101937294006, -1.243742823600769, 1.6677101850509644, 0.8697530031204224, 1.9639618396759033, 1.047426462173462, -0.3513689339160919, 1.5235750675201416, -0.036646876484155655, 1.9233348369598389, -0.48178723454475403, 0.6088761687278748, -0.39474931359291077, -1.1432727575302124, 0.8578178882598877, -0.3097779452800751, -2.079242706298828, -0.7888674139976501, -0.7679600715637207, -0.17895345389842987, -0.7231064438819885, 0.8368033170700073, -0.2560785710811615, -1.529452919960022, 0.21347388625144958, -0.6556721329689026, 0.14480909705162048, -1.2662248611450195, 0.2700430750846863, 0.7342280149459839, -0.6203330755233765, 0.07787147909402847, -0.2375982254743576, -1.3231154680252075, -0.44954243302345276, 0.32505810260772705, 1.928298830986023, -0.8282786011695862, 0.9101225137710571, 1.0002659559249878, -0.7259458303451538, 0.09606435894966125, 0.3190769553184509, -0.3266925811767578, 0.7586193680763245, -1.1528702974319458, -0.3842702805995941, 1.0749832391738892, -0.10397396981716156, -0.6400192975997925, 1.4310169219970703, 0.8040782809257507, -1.0541421175003052, -0.1407819390296936, -0.17490148544311523, -0.8578886985778809, 0.015431482344865799, -1.5908446311950684, -0.08845672011375427, 0.35970962047576904, -1.439596176147461, -0.4575008451938629, -0.25530391931533813, 1.2213777303695679, -0.2514011561870575, 1.4251500368118286, -0.2936340868473053, -0.22340643405914307, -0.33369383215904236, -0.4460641145706177, 0.07712867856025696, -0.27866944670677185, -0.5866140723228455, 0.2016739547252655, -0.7046543955802917, 0.4110836088657379, 1.3697073459625244, 0.3222615718841553, 0.01860303431749344, 0.47588953375816345, 1.1682506799697876, 0.369041383266449, -0.028627285733819008, -0.9114707708358765, -1.4831877946853638, 2.0213704109191895, -1.480367660522461, 1.9228237867355347, 0.7215482592582703, 0.010476021096110344, -1.7738964557647705, -1.9444855451583862, 1.4185771942138672, 1.183510661125183, 2.3634419441223145, 0.6262074112892151, 0.4172413945198059, -0.8074043989181519, -0.7333307266235352, 0.27408766746520996, -1.0550751686096191, -0.7217021584510803, 0.1526266485452652, 2.4134349822998047, 1.7176778316497803, -0.5243474841117859, -0.2348737120628357, -1.025601863861084, 1.354009747505188, -0.15588165819644928, 0.17918053269386292, 2.0764079093933105, -0.23276802897453308, -1.0640169382095337, 1.2089601755142212, -2.332017660140991, 0.16846904158592224, 2.0320630073547363, 0.22839437425136566, 0.12698839604854584, -1.459648609161377, -0.6187170147895813, -0.14925597608089447, -0.44518083333969116, -1.2422653436660767, 0.5749281644821167, -0.25021839141845703, -0.7971968650817871, -1.5830576419830322, 0.11553225666284561, -1.1295417547225952, -1.6049953699111938, 0.2516535222530365, 2.001046657562256, 1.9998199939727783, -0.7255619764328003, 1.5743939876556396, -0.3105854094028473, 0.08256235718727112, 1.252522349357605, 1.253914475440979, 3.0921630859375, 1.897734522819519, -1.2443037033081055, 0.6857306361198425, -0.1953435093164444, -0.5415052771568298, 1.1172966957092285, -1.2026647329330444, 1.1291037797927856, -0.2292977124452591, -1.1365110874176025, -1.2381360530853271, 0.9999597072601318, 0.4737880825996399, 0.03222639858722687, -0.4832121431827545, 1.2792346477508545, 0.07950006425380707, 1.290191888809204, 0.5394735336303711, -0.3394116759300232, 0.6457350850105286, -0.3471109867095947, -0.47202134132385254, 1.5786652565002441, 0.2500019073486328, -1.3343449831008911, -2.418668031692505, -0.25792720913887024, -0.8345824480056763, 0.07012724876403809, -0.5296431183815002, -1.0263234376907349, 1.7323811054229736, 0.4282682538032532, -1.292903184890747, -0.21543572843074799, -0.2518169581890106, -0.5981250405311584, 2.6662800312042236, -1.3842359781265259, -0.19309669733047485, -0.9582881331443787, -0.5367212891578674, 1.6714099645614624, -1.0803865194320679, -0.2545974552631378, -0.9937977194786072, -0.6027904152870178, -1.3225585222244263, -0.6527627110481262, 0.030572595074772835, -0.8315054774284363, 0.8726725578308105, 0.21117505431175232, -1.185321569442749, -0.26911166310310364, -0.9611825346946716, 0.9463828802108765, -0.06499897688627243, 0.26563432812690735, 1.9489799737930298, 0.46815919876098633, -0.4574674069881439, 0.7563598155975342, 1.1905064582824707, 0.555974543094635, -0.6893180012702942, 0.1834496259689331, -0.7107080221176147, 0.2824212610721588, -1.4013831615447998, 0.2649311423301697, -2.8042633533477783, 0.7172490954399109, -0.08281385153532028, -0.016349224373698235, -0.04629918187856674, -1.3393423557281494, 1.1460776329040527, 2.669893980026245, -1.2023323774337769, 0.48142364621162415, 0.32481497526168823, 1.3112497329711914, -1.6172914505004883, 0.25841453671455383, -0.45995569229125977, 2.0468475818634033, 0.16637861728668213, 1.2139859199523926, -0.46520721912384033, -2.2268338203430176, 0.5588915348052979, -1.3056936264038086, -1.1708619594573975, 0.857711911201477, -0.8729928731918335, 0.10095379501581192, -1.4394032955169678, -0.24617594480514526, -0.9609261155128479, -1.2390615940093994, 0.7257964611053467, 0.14770106971263885, 0.4574573040008545, -0.6165502071380615, 0.3524453341960907, -2.1467583179473877, -1.4190257787704468, -0.23698635399341583, -1.03617262840271, 0.43912091851234436, -0.3601178824901581, 0.7154104709625244, -0.10715700685977936, 0.040130943059921265, 0.4069499969482422, 1.4158591032028198, 3.3507091999053955, 0.16458946466445923, 0.26749706268310547, -0.2360531985759735, -0.9886243343353271, 1.3535395860671997, 0.8661940693855286, -0.12967078387737274, -0.5905137658119202, -0.9942789673805237, 1.1408936977386475, 2.064832925796509, 1.0876067876815796, 0.002071474678814411, -0.8533398509025574, -0.7600423693656921, 0.058715805411338806, 0.2155275046825409, 0.58762526512146, 0.9458556771278381, 0.11073184758424759, 0.0583927258849144, 1.3753694295883179, 1.1507501602172852, -0.4149552285671234, 0.4807184040546417, -0.8526415824890137, -0.4767524302005768, 0.3836439847946167, 0.21375614404678345, 0.06229527294635773, 0.34838780760765076, -1.0507524013519287, -0.28309184312820435, -0.37609153985977173, -0.9329056143760681, -0.8112345337867737, -0.4068789780139923, -0.3940921723842621, 1.671509027481079, 0.05468476563692093, -0.5050980448722839, -0.0070326486602425575, -0.6921466588973999, -0.09310692548751831, -1.0205332040786743, 0.34633511304855347, -0.2066146284341812, -0.13343678414821625, -0.028961049392819405, 1.8050130605697632, -0.9749792218208313, -2.0068626403808594, 0.30647358298301697, 0.2149907946586609, -0.3239593207836151, 0.27257809042930603, 1.5900089740753174, 0.6234959959983826, 1.4203534126281738, 1.347121238708496, 0.9741429090499878, -0.7618519067764282, -1.3021656274795532, 0.5930421948432922, 0.9574601054191589, -1.3652006387710571, 0.7793189883232117, -0.015014149248600006, -0.47891032695770264, 0.6267169117927551, 1.360133171081543, 0.4151419997215271, -2.0760977268218994, 0.7296729683876038, -0.8817261457443237, 0.7167800664901733, 0.7133661508560181, 0.7004727721214294, 0.25752121210098267, 0.7609225511550903, -1.1497769355773926, -1.1568639278411865, -0.7676464319229126, -0.6812926530838013, 1.8962788581848145, -0.22261592745780945, 0.5656752586364746, 0.024271929636597633, -1.3554757833480835, -0.14590850472450256, 0.7621560096740723, 0.4078231751918793, -0.5190349817276001, 0.772808849811554, -0.5435326099395752, -1.0786370038986206, -1.3081296682357788, -0.514118492603302, -1.0820391178131104, -1.0138916969299316, 0.9552243947982788, 0.8985565304756165, 0.33593761920928955, 1.8520556688308716, 0.7202775478363037, 0.26106658577919006, -2.702788829803467, 0.9317378401756287, 0.2798917293548584, -0.10140816867351532, 0.9155765771865845, 0.34547218680381775, 1.0187910795211792, -0.029958846047520638, 0.6425982713699341, -2.344032049179077, 2.294804573059082, -0.25178012251853943, 0.6598500609397888, 0.06286541372537613, -0.23576626181602478, 1.0955270528793335, 0.42936745285987854, 0.5599693059921265, -1.0797263383865356, 0.6603277921676636, -0.6862651109695435, 1.172790288925171, 0.8719754219055176, -0.8719248175621033, 0.052889592945575714, 1.2981756925582886, 0.45438435673713684, -0.46164458990097046, -0.9219010472297668, -0.974138081073761, 0.9816066026687622, 1.7390365600585938, -0.09006568044424057, 0.012640325352549553, 0.9378308653831482, 0.6044775247573853, -1.2972174882888794, 0.12282834202051163, -0.7913324236869812, -0.6924294829368591, 1.6677968502044678, 2.0784854888916016, -0.1471148431301117, -0.11961914598941803, -0.8150846362113953, -1.180587649345398, 0.7697398662567139, 0.04243025928735733, 0.1387910097837448, 0.6066153645515442, -0.7162778973579407, 1.1964613199234009, 0.8044829368591309, 1.0029988288879395, 0.07476344704627991, 0.4380030632019043, 0.3222552239894867, -0.37476372718811035, -1.16665780544281, -0.2411612868309021, -0.9976071715354919, -2.4420242309570312, 0.44543126225471497, -0.2592085003852844, -1.3740977048873901, 0.07499934732913971, -0.9750666618347168, 0.9022022485733032, -0.5584236979484558, -1.0691920518875122, -1.574887752532959, 0.2978229522705078, -0.1116415336728096, 0.9202492237091064, -1.557604193687439, -0.049325697124004364, 1.2755885124206543, 0.9390643239021301, -0.7217965722084045, 0.9911504983901978, 0.30993062257766724, 0.9651445746421814, 0.8573791980743408, -0.33546316623687744, 0.4910722076892853, 0.055347949266433716, -1.2719664573669434, 0.4342690408229828, 1.1492289304733276, 0.1768166869878769, 1.527777910232544, -0.5849406123161316, -0.013375496491789818, 0.40150588750839233, -0.4904596209526062, -0.42707693576812744, -0.5447853803634644, 0.6655036807060242, 0.08249691873788834, -1.0122171640396118, 0.07304376363754272, -0.07326657325029373, -0.12064170837402344, 0.22157683968544006, -1.5599359273910522, -0.23833712935447693, -0.3467763066291809, -0.5786036849021912, -1.1931101083755493, 0.01998998038470745, 1.3095182180404663, -0.6846051812171936, -0.24786697328090668, 0.432295024394989, 0.44077005982398987, 0.540088415145874, 0.5992745161056519, -0.636942446231842, -0.4460502564907074, -0.2799764573574066, -0.37638652324676514, 0.3173961341381073, 1.2877581119537354, -0.102786585688591, -1.0120441913604736, 0.7564966082572937, -0.510044276714325, 0.0029301075264811516, 1.8745826482772827, 0.024848932400345802, -0.784503698348999, 0.343894362449646, -0.7252625226974487, 1.9085875749588013, 1.7981102466583252, 1.3526577949523926, -0.13761714100837708, -0.9680983424186707, 0.6102189421653748, -0.29278939962387085, -0.3457627296447754, 0.9497661590576172, 0.3771005868911743, -0.1378983110189438, -1.4307568073272705, 0.600024402141571, 1.2943739891052246, -0.8916865587234497, -0.853130578994751, 0.11192559450864792, -0.8096258044242859, 1.0673094987869263, 0.6904336810112, 0.337614506483078, 0.22168973088264465, 1.425883412361145, 0.7660024166107178, -0.38826829195022583, 0.5240284204483032, 0.43161049485206604, -0.1837357133626938, -2.0668606758117676, -1.1069904565811157, 0.30582761764526367, -0.37033599615097046, -1.6600921154022217, 1.3802188634872437, -1.1490362882614136, -0.8879989385604858, 0.5146991610527039, 0.08358140289783478, 1.4295029640197754, 0.3316044509410858, 1.5774955749511719, 2.083012819290161, 0.9001423716545105, 0.2988405227661133, 1.262721061706543, -0.11530124396085739, -0.5050111413002014, 1.859607458114624, -0.4821014702320099, 0.48288315534591675, 0.9895898103713989, -0.34386157989501953, -1.0987638235092163, -0.8434754014015198, -1.2651195526123047, -0.6785770654678345, 1.1556270122528076, 0.08516983687877655, -1.2592076063156128, 0.3105871081352234, 1.6050810813903809, 0.1521032452583313, -0.3127821981906891, 0.6813101768493652, 0.4700024425983429, -0.8130476474761963, -0.07426553219556808, -0.8212640285491943, 0.45731642842292786, -0.19699034094810486, -0.3392970561981201, 0.3299935758113861, 0.4823777675628662, 1.2560192346572876, 0.03686518222093582, -0.015003026463091373, 1.1517448425292969, -1.3819061517715454, 1.5515464544296265, -0.5928376317024231, 0.361869215965271, -2.4283735752105713, 1.4096035957336426, -0.7828704714775085, 1.8769091367721558, -2.610323429107666, 0.4044457972049713, -0.5996148586273193, -0.36395978927612305, 0.25839903950691223, -0.3061528503894806, 0.22431913018226624, -0.14516574144363403, -1.0513423681259155, -0.07489932328462601, -0.7776215672492981, 0.5933330655097961, 1.0476278066635132, 1.323486566543579, -0.9970945119857788, -0.3561376631259918, -1.7747050523757935, -0.17855165898799896, -0.6105884909629822, 0.3311091959476471, -2.0071892738342285, -0.18565215170383453, -1.9428050518035889, -2.3734734058380127, -1.4084553718566895, -0.8607338666915894, 1.005457878112793, 0.15673387050628662, -0.8853783011436462, 1.231644868850708, -0.3821587860584259, -1.8472425937652588, 1.1291825771331787, -2.1199231147766113 ]
https://github.com/huggingface/datasets/issues/3210
ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.15.1/datasets/wmt16/wmt16.py
Hi ! Do you have some kind of proxy in your browser that gives you access to internet ? Maybe you're having this error because you don't have access to this URL from python ?
when I use python examples/pytorch/translation/run_translation.py --model_name_or_path examples/pytorch/translation/opus-mt-en-ro --do_train --do_eval --source_lang en --target_lang ro --dataset_name wmt16 --dataset_config_name ro-en --output_dir /tmp/tst-translation --per_device_train_batch_size=4 --per_device_eval_batch_size=4 --overwrite_output_dir --predict_with_generate to finetune translation model on huggingface, I get the issue"ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.15.1/datasets/wmt16/wmt16.py".But I can open the https://raw.githubusercontent.com/huggingface/datasets/1.15.1/datasets/wmt16/wmt16.py by using website. What should I do to solve the issue?
1,127
35
ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.15.1/datasets/wmt16/wmt16.py when I use python examples/pytorch/translation/run_translation.py --model_name_or_path examples/pytorch/translation/opus-mt-en-ro --do_train --do_eval --source_lang en --target_lang ro --dataset_name wmt16 --dataset_config_name ro-en --output_dir /tmp/tst-translation --per_device_train_batch_size=4 --per_device_eval_batch_size=4 --overwrite_output_dir --predict_with_generate to finetune translation model on huggingface, I get the issue"ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.15.1/datasets/wmt16/wmt16.py".But I can open the https://raw.githubusercontent.com/huggingface/datasets/1.15.1/datasets/wmt16/wmt16.py by using website. What should I do to solve the issue? Hi ! Do you have some kind of proxy in your browser that gives you access to internet ? Maybe you're having this error because you don't have access to this URL from python ?
[ -1.2624717950820923, -0.8579744100570679, -0.6754687428474426, 1.47709321975708, -0.04013143479824066, -1.3197208642959595, 0.07438872009515762, -0.8613892197608948, 1.4901608228683472, -0.7189950346946716, 0.2859741151332855, -1.6582257747650146, -0.029970398172736168, -0.5216056108474731, -0.6552090644836426, -0.765789806842804, -0.3618985116481781, -0.7487509846687317, 1.0924626588821411, 2.4693045616149902, 1.1790854930877686, -1.33449125289917, 2.841559410095215, 0.635338544845581, -0.21752294898033142, -1.0203373432159424, 0.5605879426002502, 0.10890750586986542, -1.2859013080596924, -0.3733203113079071, -0.8357139825820923, -0.01378618273884058, -0.6109116673469543, -0.4874636232852936, -0.008947553113102913, 0.43516775965690613, -0.2340148240327835, -0.31091201305389404, -0.4633541405200958, -0.7124913930892944, 0.551458477973938, -0.2566329836845398, 0.7943761348724365, -0.320106565952301, 1.7288918495178223, -0.6160404086112976, 0.4804938733577728, 0.7279754877090454, 1.1723220348358154, 0.19907614588737488, 0.047046951949596405, 0.22116659581661224, 0.4081968665122986, 0.04819025099277496, 0.6046999096870422, 1.1587644815444946, 0.6753479838371277, 0.5575228929519653, 0.5338643789291382, -2.2181005477905273, 1.4173040390014648, -0.8839752078056335, 0.21038511395454407, 1.3697246313095093, -0.9472598433494568, 0.4431471526622772, -1.8242086172103882, -0.033419493585824966, 0.4876517951488495, -2.268893241882324, 0.24294832348823547, -1.320184350013733, -0.5372167229652405, 0.938735842704773, 0.28538623452186584, -1.2819081544876099, 0.11097786575555801, -0.40435338020324707, 1.1351869106292725, 0.563923180103302, 1.124987244606018, -1.6401177644729614, -0.0021481364965438843, -0.1287810206413269, 0.1217588409781456, -1.2739473581314087, -1.6109178066253662, 0.4416334927082062, 0.6077198386192322, 0.6465744376182556, -0.028105292469263077, 0.8347288370132446, -1.1246129274368286, 0.8586175441741943, -0.9772272109985352, -1.641917109489441, -1.4136713743209839, -2.4846277236938477, -2.328141212463379, 0.7585770487785339, -0.5168637037277222, -0.448364794254303, 1.9709078073501587, -1.1229557991027832, -1.8034542798995972, 1.0814416408538818, 0.3147386908531189, 0.11843780428171158, 2.4173121452331543, 0.21625055372714996, -0.8596085906028748, 0.5148656964302063, -0.8365184664726257, 0.6971198916435242, -0.30683937668800354, 1.2734307050704956, 0.5888425707817078, -0.9829289317131042, 1.566319465637207, -0.4485068619251251, 0.6316590905189514, -0.7356101870536804, -0.5096604228019714, -0.7328405976295471, 0.21901094913482666, 1.8822805881500244, -0.23171257972717285, 1.594908356666565, -0.30848249793052673, -1.475766658782959, -1.414837121963501, 0.8309565186500549, 0.46554693579673767, -0.9330033659934998, 0.09284073114395142, -0.4432387948036194, 0.1395294964313507, 0.04464615881443024, 1.0896716117858887, 1.2604049444198608, 0.7826141119003296, -0.36373308300971985, -0.8418429493904114, 0.18461327254772186, -0.0946500301361084, -0.5080358386039734, -1.8776551485061646, -0.23240013420581818, 0.26018738746643066, 0.6608967781066895, -1.1328494548797607, 1.7526661157608032, 0.8364066481590271, 1.9702540636062622, 0.9992161989212036, -0.4199286997318268, 1.4417959451675415, -0.05080871284008026, 1.9220123291015625, -0.4506920874118805, 0.6803166270256042, -0.31593209505081177, -1.13406240940094, 0.7680988311767578, -0.31576040387153625, -2.0925517082214355, -0.705079972743988, -0.8353087902069092, -0.15416783094406128, -0.783180832862854, 0.9358399510383606, -0.2142411321401596, -1.3909505605697632, 0.12852458655834198, -0.650144100189209, 0.2076709121465683, -1.2981750965118408, 0.17585530877113342, 0.8159775137901306, -0.6391408443450928, -0.07440636307001114, -0.2863725423812866, -1.331579566001892, -0.5728929042816162, 0.49206361174583435, 1.8648020029067993, -0.5511406660079956, 0.9860686659812927, 1.0660923719406128, -0.6986667513847351, 0.05098756402730942, 0.3771752715110779, -0.312449187040329, 0.8163360953330994, -0.9766895771026611, -0.4131087064743042, 1.123337745666504, -0.3062642812728882, -0.6679275035858154, 1.462448239326477, 0.8075032234191895, -0.9949231743812561, -0.324699729681015, -0.13005085289478302, -0.8981001973152161, 0.040233366191387177, -1.593393325805664, -0.18987780809402466, 0.14846110343933105, -1.511308193206787, -0.40560659766197205, -0.13213035464286804, 1.415632963180542, -0.18817666172981262, 1.4437146186828613, -0.3710307478904724, -0.15779703855514526, -0.44337594509124756, -0.5877830386161804, 0.18159489333629608, -0.17716318368911743, -0.5933452844619751, 0.25557243824005127, -0.8218847513198853, 0.2557676434516907, 1.4633322954177856, 0.3506821393966675, 0.1313442438840866, 0.4484821856021881, 1.0797877311706543, 0.3570510745048523, -0.04762227088212967, -0.8231025338172913, -1.6973307132720947, 1.98499596118927, -1.5287206172943115, 2.088221311569214, 0.7393613457679749, -0.15989448130130768, -1.7403935194015503, -1.8519909381866455, 1.3264970779418945, 1.1106246709823608, 2.422785520553589, 0.5072260499000549, 0.3594914674758911, -0.801682710647583, -0.80800461769104, 0.39381760358810425, -0.9046223759651184, -0.760650634765625, 0.07703335583209991, 2.3289544582366943, 1.7672820091247559, -0.4921659827232361, -0.22753584384918213, -0.9547303915023804, 1.3444459438323975, -0.1993347555398941, 0.27017611265182495, 2.0326590538024902, -0.29279282689094543, -0.9730883836746216, 1.2808102369308472, -2.4301857948303223, 0.4146495759487152, 2.0900638103485107, 0.3904108703136444, 0.09562794119119644, -1.373440146446228, -0.5867959856987, -0.2784897983074188, -0.4165474772453308, -1.2285008430480957, 0.5955252647399902, -0.23019416630268097, -0.9480652809143066, -1.3993219137191772, -0.061120547354221344, -1.1091915369033813, -1.805719017982483, 0.5149002075195312, 1.8583768606185913, 2.1378116607666016, -0.7862662076950073, 1.3590881824493408, -0.24811580777168274, 0.1307336539030075, 1.2888516187667847, 1.3081080913543701, 3.1146416664123535, 1.8953328132629395, -1.3044838905334473, 0.7378436923027039, -0.11942145228385925, -0.5524002909660339, 1.1459851264953613, -1.103545904159546, 1.2148289680480957, -0.20153281092643738, -1.1860020160675049, -1.2713663578033447, 1.107087254524231, 0.48122039437294006, -0.01248120702803135, -0.5335014462471008, 1.1620903015136719, 0.18175910413265228, 1.3333625793457031, 0.5518683791160583, -0.35434138774871826, 0.5094695091247559, -0.41991204023361206, -0.6677380800247192, 1.5513744354248047, 0.08276160806417465, -1.6029001474380493, -2.29341721534729, -0.26568853855133057, -0.8748527765274048, -0.05881094932556152, -0.6871063709259033, -1.0164875984191895, 1.5412241220474243, 0.539509654045105, -1.1736342906951904, -0.23405636847019196, -0.41321083903312683, -0.5314626693725586, 2.6776256561279297, -1.3249298334121704, -0.14319810271263123, -0.9880010485649109, -0.5593092441558838, 1.5220259428024292, -1.2732101678848267, -0.17874488234519958, -0.9761841297149658, -0.7186733484268188, -1.3045333623886108, -0.3733821213245392, -0.06709820032119751, -0.8774785995483398, 0.6946976184844971, 0.004627391695976257, -1.1291873455047607, -0.3082197308540344, -0.9244372248649597, 0.9705761671066284, -0.15977729856967926, 0.1823781430721283, 1.8230229616165161, 0.15368272364139557, -0.3601439297199249, 0.7066156268119812, 1.1309995651245117, 0.5561978220939636, -0.6094022989273071, 0.1632920801639557, -0.5739417672157288, 0.42522096633911133, -1.300561547279358, 0.27492067217826843, -2.977952003479004, 0.743767261505127, -0.07861980050802231, -0.10242953151464462, -0.2417808622121811, -1.4733301401138306, 1.1259485483169556, 2.5071661472320557, -1.1078007221221924, 0.5971428155899048, 0.3852272927761078, 1.0790616273880005, -1.5819758176803589, 0.32135602831840515, -0.5876327157020569, 2.0984725952148438, 0.1536436825990677, 1.1425784826278687, -0.5589273571968079, -2.2389652729034424, 0.6122347116470337, -1.0947761535644531, -0.9656928181648254, 0.8299896717071533, -0.8657192587852478, 0.26624491810798645, -1.2705192565917969, -0.14774508774280548, -1.0421711206436157, -1.2715965509414673, 0.7015734910964966, 0.10574211180210114, 0.46474313735961914, -0.59676593542099, 0.34481778740882874, -2.212214946746826, -1.3229504823684692, -0.24230797588825226, -0.9234675168991089, 0.4834187924861908, -0.383823961019516, 0.5645748376846313, 0.0295607540756464, 0.1367138922214508, 0.2535289227962494, 1.4256303310394287, 3.2797656059265137, 0.11595556885004044, 0.28268688917160034, -0.17413781583309174, -1.0335885286331177, 1.5472512245178223, 0.9613993763923645, -0.16013005375862122, -0.6159881353378296, -0.9450811147689819, 1.3357042074203491, 1.961997151374817, 1.1178693771362305, 0.052411019802093506, -0.9540165662765503, -0.7199615836143494, 0.12988333404064178, 0.07355253398418427, 0.5401074290275574, 1.0569244623184204, 0.028935613110661507, 0.2237968146800995, 1.421907663345337, 1.2158799171447754, -0.288989782333374, 0.4027932286262512, -0.9783914685249329, -0.32642239332199097, 0.409394770860672, 0.3252944350242615, -0.052287109196186066, 0.4030691385269165, -1.060646891593933, -0.22495952248573303, -0.24293875694274902, -0.854667603969574, -0.7769944071769714, -0.4849989414215088, -0.4003555178642273, 1.647731900215149, 0.07302957028150558, -0.4999643862247467, 0.06357482820749283, -0.7760817408561707, -0.13538819551467896, -1.0660492181777954, 0.23999294638633728, -0.12357637286186218, 0.003201989457011223, -0.16650977730751038, 1.6843165159225464, -0.9591660499572754, -2.2246572971343994, 0.2875521183013916, 0.30785104632377625, -0.3131905496120453, 0.03934450447559357, 1.7861915826797485, 0.45151421427726746, 1.3215816020965576, 1.3458877801895142, 1.031698226928711, -0.5745055675506592, -1.3166260719299316, 0.7072446346282959, 0.9730412364006042, -1.3497989177703857, 0.9233338236808777, -0.19380900263786316, -0.4824521243572235, 0.7344470620155334, 1.3145629167556763, 0.28623583912849426, -1.9782569408416748, 0.89484041929245, -1.0024789571762085, 0.8583078980445862, 0.6566169261932373, 0.7577165365219116, 0.1559455543756485, 0.9314622282981873, -1.246415138244629, -1.0743314027786255, -0.6665744781494141, -0.6326924562454224, 1.8413639068603516, -0.2964920997619629, 0.4813769459724426, -0.11772749572992325, -1.2584458589553833, -0.06418436765670776, 0.7977327704429626, 0.3492465019226074, -0.3235441744327545, 0.8685423731803894, -0.6668079495429993, -1.0752068758010864, -1.2889556884765625, -0.38968297839164734, -0.9870355725288391, -0.9082486629486084, 0.9785260558128357, 0.7100861668586731, 0.4667589068412781, 1.9067142009735107, 0.5801084041595459, 0.28498896956443787, -2.7147557735443115, 0.8878711462020874, 0.26626476645469666, 0.004607755690813065, 0.8802036643028259, 0.18762335181236267, 1.114588737487793, -0.06832240521907806, 0.5780654549598694, -2.3573291301727295, 2.2456655502319336, -0.23470474779605865, 0.6909818649291992, 0.003549729473888874, -0.1194915845990181, 1.0716131925582886, 0.641568124294281, 0.6501701474189758, -1.1947256326675415, 0.8770739436149597, -0.5836154222488403, 1.151360034942627, 0.8851019740104675, -0.8342748880386353, 0.02614944986999035, 1.3754966259002686, 0.38725775480270386, -0.4430757761001587, -0.8949007987976074, -0.8331242799758911, 0.9561479687690735, 1.7264927625656128, 0.015737978741526604, -0.034110963344573975, 0.8232994079589844, 0.6977270841598511, -1.196938157081604, 0.09419141709804535, -0.7032859325408936, -0.6206296682357788, 1.7337692975997925, 2.074653148651123, 0.030382560566067696, -0.14576509594917297, -0.7220712900161743, -1.2900643348693848, 0.6998715996742249, -0.026946019381284714, 0.05834753066301346, 0.7293499708175659, -0.6310073733329773, 1.0939406156539917, 0.6222677230834961, 0.9801336526870728, 0.028127377852797508, 0.1589055210351944, 0.2723504304885864, -0.2945541739463806, -1.2754024267196655, -0.48907342553138733, -1.0661821365356445, -2.573673963546753, 0.347176730632782, -0.2913873791694641, -1.489740014076233, 0.07783441245555878, -0.9952373504638672, 0.7333594560623169, -0.5563958287239075, -1.1681134700775146, -1.3639147281646729, 0.22480516135692596, -0.19129393994808197, 0.8059321641921997, -1.6189229488372803, -0.19267667829990387, 1.2601662874221802, 0.8789758086204529, -0.5987294912338257, 1.017717719078064, 0.314069002866745, 0.8992148041725159, 0.7522321343421936, -0.4631393849849701, 0.4935339391231537, 0.23367679119110107, -1.3753175735473633, 0.45894646644592285, 1.372694969177246, 0.2056245058774948, 1.3701571226119995, -0.5388764142990112, 0.14483170211315155, 0.4382007122039795, -0.6602610349655151, -0.6243479251861572, -0.5232639312744141, 0.8451839089393616, -0.08372947573661804, -1.0292015075683594, -0.06550942361354828, -0.16416263580322266, -0.1650366485118866, 0.25134792923927307, -1.5122052431106567, -0.24637839198112488, -0.36533817648887634, -0.5084595084190369, -1.427042007446289, -0.035359110683202744, 1.3311001062393188, -0.8873933553695679, -0.131440207362175, 0.5436902642250061, 0.3550047278404236, 0.5971173644065857, 0.6355741024017334, -0.6361846923828125, -0.19113709032535553, -0.21527177095413208, -0.29249653220176697, 0.36913439631462097, 1.1292699575424194, -0.11678393185138702, -0.9718112945556641, 0.6657363176345825, -0.36188092827796936, 0.14709007740020752, 1.9644865989685059, -0.055333368480205536, -0.771868109703064, 0.4286525249481201, -0.7232790589332581, 1.8545434474945068, 1.621566653251648, 1.3650901317596436, -0.15592139959335327, -0.8649658560752869, 0.571146547794342, -0.28343871235847473, -0.3437430262565613, 0.9114637970924377, 0.4953517019748688, -0.3286081850528717, -1.3456770181655884, 0.623557984828949, 1.216331958770752, -0.8867247104644775, -0.7839810848236084, 0.10941074043512344, -0.8749003410339355, 1.2596771717071533, 0.6014467477798462, 0.3040415048599243, 0.3054080307483673, 1.6044607162475586, 0.6897931098937988, -0.5701373815536499, 0.46759918332099915, 0.5081633925437927, -0.21330764889717102, -1.9877792596817017, -0.9995627403259277, 0.33007222414016724, -0.44324272871017456, -1.515561580657959, 1.3772382736206055, -1.2349138259887695, -1.1306370496749878, 0.5984678864479065, 0.179051473736763, 1.3062760829925537, 0.3142494559288025, 1.7325294017791748, 2.015216588973999, 0.8966758251190186, 0.4639528691768646, 1.2093204259872437, -0.17070823907852173, -0.4233279824256897, 1.7798223495483398, -0.4067974388599396, 0.6756227612495422, 1.0746699571609497, -0.4562247395515442, -1.1894327402114868, -0.9153421521186829, -1.1290785074234009, -0.6638776063919067, 1.2150241136550903, 0.1623479574918747, -1.0941476821899414, 0.1863042116165161, 1.5780144929885864, 0.1753820776939392, -0.18527907133102417, 0.6410784721374512, 0.36614102125167847, -0.5994318723678589, -0.057074032723903656, -1.0650098323822021, 0.5690174698829651, -0.23566383123397827, -0.3627261221408844, 0.17357054352760315, 0.4972865879535675, 1.1841148138046265, -0.010431835427880287, 0.1575615406036377, 1.2079049348831177, -1.3994044065475464, 1.5031585693359375, -0.7177218198776245, 0.35860949754714966, -2.3884546756744385, 1.4484426975250244, -0.7957278490066528, 1.955182671546936, -2.6048498153686523, 0.3919742703437805, -0.5855950713157654, -0.5997198820114136, 0.23972442746162415, -0.288379043340683, 0.023793404921889305, -0.1464664787054062, -1.0148625373840332, -0.06969904899597168, -0.8745908141136169, 0.5274685621261597, 1.2369807958602905, 1.3595011234283447, -1.0911967754364014, -0.2757328450679779, -1.6750998497009277, -0.19397296011447906, -0.74715656042099, 0.33699068427085876, -1.8965710401535034, -0.1685047149658203, -2.0484488010406494, -2.380990982055664, -1.3883657455444336, -0.9723722338676453, 1.1452324390411377, 0.21323831379413605, -0.8786523342132568, 1.0775418281555176, -0.36202332377433777, -1.816011905670166, 1.175027847290039, -2.0713210105895996 ]
https://github.com/huggingface/datasets/issues/3210
ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.15.1/datasets/wmt16/wmt16.py
You don't need authentication to access those github hosted files Please check that you can access this URL from your browser and also from your terminal
when I use python examples/pytorch/translation/run_translation.py --model_name_or_path examples/pytorch/translation/opus-mt-en-ro --do_train --do_eval --source_lang en --target_lang ro --dataset_name wmt16 --dataset_config_name ro-en --output_dir /tmp/tst-translation --per_device_train_batch_size=4 --per_device_eval_batch_size=4 --overwrite_output_dir --predict_with_generate to finetune translation model on huggingface, I get the issue"ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.15.1/datasets/wmt16/wmt16.py".But I can open the https://raw.githubusercontent.com/huggingface/datasets/1.15.1/datasets/wmt16/wmt16.py by using website. What should I do to solve the issue?
1,127
26
ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.15.1/datasets/wmt16/wmt16.py when I use python examples/pytorch/translation/run_translation.py --model_name_or_path examples/pytorch/translation/opus-mt-en-ro --do_train --do_eval --source_lang en --target_lang ro --dataset_name wmt16 --dataset_config_name ro-en --output_dir /tmp/tst-translation --per_device_train_batch_size=4 --per_device_eval_batch_size=4 --overwrite_output_dir --predict_with_generate to finetune translation model on huggingface, I get the issue"ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.15.1/datasets/wmt16/wmt16.py".But I can open the https://raw.githubusercontent.com/huggingface/datasets/1.15.1/datasets/wmt16/wmt16.py by using website. What should I do to solve the issue? You don't need authentication to access those github hosted files Please check that you can access this URL from your browser and also from your terminal
[ -1.2663935422897339, -0.8743477463722229, -0.672553539276123, 1.4626193046569824, -0.03271476924419403, -1.3178071975708008, 0.09855976700782776, -0.8768602609634399, 1.476055383682251, -0.7340610027313232, 0.30316418409347534, -1.6504809856414795, -0.028396867215633392, -0.5077969431877136, -0.6634429693222046, -0.7658385038375854, -0.3494448661804199, -0.7481580376625061, 1.1388109922409058, 2.429060697555542, 1.1932607889175415, -1.3535969257354736, 2.8407468795776367, 0.6347481608390808, -0.22123385965824127, -1.0298937559127808, 0.5555728077888489, 0.110222227871418, -1.3017010688781738, -0.3644045293331146, -0.8283535242080688, 0.005857096053659916, -0.599111795425415, -0.47554415464401245, -0.0016841888427734375, 0.4242454767227173, -0.21330974996089935, -0.3235783278942108, -0.45696860551834106, -0.6982340812683105, 0.539087176322937, -0.22169673442840576, 0.7778099775314331, -0.30591490864753723, 1.7545711994171143, -0.6072900891304016, 0.4797346293926239, 0.6985943913459778, 1.167785406112671, 0.19083094596862793, 0.050102971494197845, 0.2123837023973465, 0.39590731263160706, 0.05563288554549217, 0.593332827091217, 1.157886266708374, 0.6773157715797424, 0.5435550808906555, 0.5459610819816589, -2.1885502338409424, 1.417908787727356, -0.8625953197479248, 0.1872309148311615, 1.383118987083435, -0.9804812073707581, 0.4562504291534424, -1.8021177053451538, -0.04326648265123367, 0.497446745634079, -2.275700330734253, 0.22358597815036774, -1.3191888332366943, -0.5197219252586365, 0.948691189289093, 0.29807335138320923, -1.2791640758514404, 0.10976032167673111, -0.4172116816043854, 1.117737054824829, 0.5627478957176208, 1.1300523281097412, -1.6336772441864014, 0.013760284520685673, -0.1276462972164154, 0.14359235763549805, -1.2948720455169678, -1.629188895225525, 0.4392843246459961, 0.626127302646637, 0.649919867515564, -0.048200905323028564, 0.8358955383300781, -1.1338316202163696, 0.8572480082511902, -0.9621710181236267, -1.6202428340911865, -1.4078553915023804, -2.498446464538574, -2.3437142372131348, 0.7751036882400513, -0.5054014921188354, -0.4512128531932831, 1.9683493375778198, -1.1105881929397583, -1.8127363920211792, 1.05903160572052, 0.2974202036857605, 0.11046121269464493, 2.4171669483184814, 0.20427867770195007, -0.8521186113357544, 0.5262853503227234, -0.8604510426521301, 0.7040867209434509, -0.2826186716556549, 1.2873557806015015, 0.5827559232711792, -0.9681774377822876, 1.5640392303466797, -0.43254953622817993, 0.631784200668335, -0.736657977104187, -0.5215914845466614, -0.7348377108573914, 0.17701734602451324, 1.9030463695526123, -0.22169549763202667, 1.6073685884475708, -0.3304288685321808, -1.4793976545333862, -1.411719560623169, 0.813035786151886, 0.4447662830352783, -0.9079511165618896, 0.08995073288679123, -0.4354347586631775, 0.1284525990486145, 0.04437803849577904, 1.0724395513534546, 1.2801581621170044, 0.7617400288581848, -0.3838981091976166, -0.8412233591079712, 0.1903410255908966, -0.09651686251163483, -0.5297152996063232, -1.8767179250717163, -0.2201138138771057, 0.26558008790016174, 0.6649690866470337, -1.1534090042114258, 1.7501654624938965, 0.831579327583313, 2.000314712524414, 0.9734331369400024, -0.43484196066856384, 1.4419573545455933, -0.06070147082209587, 1.9461312294006348, -0.4409492313861847, 0.680027961730957, -0.30697694420814514, -1.145446538925171, 0.7731656432151794, -0.3129171133041382, -2.073476552963257, -0.6804836988449097, -0.8493269681930542, -0.16382528841495514, -0.7733272910118103, 0.9497582316398621, -0.21979939937591553, -1.4415313005447388, 0.12447628378868103, -0.6541352272033691, 0.2249196171760559, -1.299197793006897, 0.159441739320755, 0.818045973777771, -0.6426868438720703, -0.08957456797361374, -0.2773111164569855, -1.3319720029830933, -0.5475664138793945, 0.48810169100761414, 1.868084192276001, -0.5582160353660583, 0.9927168488502502, 1.059247374534607, -0.6911939978599548, 0.060507047921419144, 0.3527992069721222, -0.3193965554237366, 0.8261768817901611, -0.9932032823562622, -0.3898729383945465, 1.1334037780761719, -0.31959789991378784, -0.6283537149429321, 1.4649235010147095, 0.8117324709892273, -0.98409104347229, -0.3103400468826294, -0.09670441597700119, -0.8788026571273804, 0.04584898799657822, -1.5971273183822632, -0.20922710001468658, 0.12378464639186859, -1.5098258256912231, -0.4100407660007477, -0.14935076236724854, 1.4030359983444214, -0.1879962980747223, 1.4577453136444092, -0.3615226447582245, -0.16752825677394867, -0.4335200786590576, -0.5820527076721191, 0.17767903208732605, -0.18421564996242523, -0.5858584642410278, 0.26331833004951477, -0.8227739334106445, 0.263500452041626, 1.480273723602295, 0.36190155148506165, 0.13115227222442627, 0.45686185359954834, 1.0895698070526123, 0.3667011260986328, -0.05613284930586815, -0.8027383685112, -1.7298163175582886, 1.9968445301055908, -1.5308640003204346, 2.096527099609375, 0.7352938055992126, -0.17899639904499054, -1.7231706380844116, -1.843050241470337, 1.321658968925476, 1.120972990989685, 2.40950608253479, 0.5076994895935059, 0.33521348237991333, -0.808918297290802, -0.8267262578010559, 0.36088162660598755, -0.8747744560241699, -0.7509492635726929, 0.09614149481058121, 2.303663492202759, 1.741873860359192, -0.5011391043663025, -0.21417978405952454, -0.9656050801277161, 1.322889804840088, -0.22488372027873993, 0.2786940038204193, 2.018878221511841, -0.3013994097709656, -0.9757771492004395, 1.276130199432373, -2.441690683364868, 0.4401734471321106, 2.0930542945861816, 0.3900188207626343, 0.09201796352863312, -1.3584071397781372, -0.5946999788284302, -0.29657500982284546, -0.4225282371044159, -1.213008999824524, 0.5588904619216919, -0.20626024901866913, -0.940214991569519, -1.393907070159912, -0.06558818370103836, -1.0930225849151611, -1.8175301551818848, 0.5231110453605652, 1.8591490983963013, 2.119570732116699, -0.7879949808120728, 1.331577181816101, -0.2452089488506317, 0.12833411991596222, 1.288984775543213, 1.3034331798553467, 3.0947282314300537, 1.8637009859085083, -1.2986996173858643, 0.759279191493988, -0.11281055212020874, -0.5444948673248291, 1.1392942667007446, -1.111681580543518, 1.2301816940307617, -0.2034159153699875, -1.2072007656097412, -1.2892800569534302, 1.0962064266204834, 0.47287899255752563, -0.006767939776182175, -0.5207700729370117, 1.1792597770690918, 0.21033643186092377, 1.3380656242370605, 0.5772050023078918, -0.3469931185245514, 0.5211713910102844, -0.3968200981616974, -0.6859500408172607, 1.5418559312820435, 0.06697069853544235, -1.619828462600708, -2.285405158996582, -0.2714168429374695, -0.8988617062568665, -0.07857399433851242, -0.6939834952354431, -1.0136622190475464, 1.5374099016189575, 0.5434014797210693, -1.1369667053222656, -0.23677532374858856, -0.4016408920288086, -0.5140208601951599, 2.6831207275390625, -1.3352129459381104, -0.12577179074287415, -0.9989009499549866, -0.5797936320304871, 1.5232774019241333, -1.2724995613098145, -0.19673816859722137, -0.9954027533531189, -0.7319526672363281, -1.2948753833770752, -0.36488035321235657, -0.05686198174953461, -0.883121132850647, 0.6546540260314941, -0.003545696847140789, -1.1291111707687378, -0.2998240292072296, -0.937585175037384, 0.9988921284675598, -0.16002407670021057, 0.1944066882133484, 1.7991629838943481, 0.14432409405708313, -0.36387497186660767, 0.7231852412223816, 1.1279776096343994, 0.5678209066390991, -0.5958530306816101, 0.1634797900915146, -0.557563304901123, 0.43077343702316284, -1.299819827079773, 0.2737940549850464, -2.9682042598724365, 0.7345820069313049, -0.09865354001522064, -0.10510019212961197, -0.23949778079986572, -1.5055123567581177, 1.150123119354248, 2.5154664516448975, -1.1065592765808105, 0.6047585606575012, 0.3819667398929596, 1.0819073915481567, -1.5776135921478271, 0.31202763319015503, -0.5933673977851868, 2.102658271789551, 0.17530758678913116, 1.1370911598205566, -0.5641440749168396, -2.2204484939575195, 0.6363461017608643, -1.0920054912567139, -0.9446858167648315, 0.8360161185264587, -0.8635901212692261, 0.2764086127281189, -1.2506346702575684, -0.16042523086071014, -1.0406980514526367, -1.2651811838150024, 0.6390846371650696, 0.06592711806297302, 0.4674936830997467, -0.5960482358932495, 0.3445383310317993, -2.235883951187134, -1.3100674152374268, -0.1969526708126068, -0.962898850440979, 0.4885255694389343, -0.41395118832588196, 0.5644766092300415, 0.022128477692604065, 0.1284964233636856, 0.24308203160762787, 1.4379154443740845, 3.2873997688293457, 0.13318780064582825, 0.29037192463874817, -0.14652098715305328, -1.0436160564422607, 1.5650004148483276, 0.9465873837471008, -0.16124877333641052, -0.6100834608078003, -0.9201033711433411, 1.3267041444778442, 1.969931960105896, 1.1429369449615479, 0.031134944409132004, -0.9484831690788269, -0.726247251033783, 0.13660801947116852, 0.08463364094495773, 0.538460910320282, 1.0793529748916626, 0.03663300350308418, 0.2356504499912262, 1.4292974472045898, 1.2201389074325562, -0.31483587622642517, 0.42578938603401184, -0.9982033967971802, -0.32084226608276367, 0.4222954511642456, 0.31947386264801025, -0.028158124536275864, 0.4331554174423218, -1.0652228593826294, -0.20906370878219604, -0.2421097606420517, -0.8643050193786621, -0.7705571055412292, -0.46262478828430176, -0.40761053562164307, 1.6548453569412231, 0.0536944679915905, -0.503986120223999, 0.05455714836716652, -0.7637840509414673, -0.1236916109919548, -1.0555901527404785, 0.23952262103557587, -0.09747106581926346, 0.021103020757436752, -0.15002234280109406, 1.6430672407150269, -0.9494214057922363, -2.2187182903289795, 0.2852718234062195, 0.3072246015071869, -0.31973394751548767, 0.03052380681037903, 1.7890428304672241, 0.44198906421661377, 1.3544427156448364, 1.341740369796753, 1.019806981086731, -0.5881271362304688, -1.33083176612854, 0.7117904424667358, 0.9479901194572449, -1.357009768486023, 0.9270244240760803, -0.19221167266368866, -0.5029495358467102, 0.7195991277694702, 1.3240174055099487, 0.28282642364501953, -1.9953413009643555, 0.8957924842834473, -0.9897010326385498, 0.8518561124801636, 0.6693224906921387, 0.7799962759017944, 0.146418958902359, 0.9393709301948547, -1.2419099807739258, -1.0493557453155518, -0.6625153422355652, -0.6357948780059814, 1.8250609636306763, -0.2848207950592041, 0.48708227276802063, -0.12047997117042542, -1.2366334199905396, -0.03814215213060379, 0.7817158102989197, 0.34057483077049255, -0.3184957802295685, 0.8703905940055847, -0.6882906556129456, -1.0795087814331055, -1.287408709526062, -0.3979029953479767, -1.0021302700042725, -0.9043006300926208, 0.9854802489280701, 0.6781740784645081, 0.45567700266838074, 1.904354214668274, 0.5582048892974854, 0.2721503973007202, -2.7336437702178955, 0.9035650491714478, 0.23279349505901337, 0.012526228092610836, 0.8907836079597473, 0.17116311192512512, 1.153310775756836, -0.06673088669776917, 0.592750072479248, -2.3799679279327393, 2.2418200969696045, -0.22343005239963531, 0.6743878722190857, -0.005917425267398357, -0.1308138221502304, 1.0757718086242676, 0.6888982057571411, 0.6438215374946594, -1.2278597354888916, 0.9130473136901855, -0.5948500037193298, 1.1465015411376953, 0.8640848994255066, -0.8351454138755798, 0.038467708975076675, 1.3666752576828003, 0.38601821660995483, -0.4143190085887909, -0.9104447960853577, -0.8355141878128052, 0.9469991326332092, 1.6839457750320435, 0.009392675943672657, -0.03687301650643349, 0.8051185607910156, 0.6957205533981323, -1.2200608253479004, 0.10154414176940918, -0.7200433015823364, -0.6274207234382629, 1.738086223602295, 2.0494635105133057, 0.039962075650691986, -0.15501374006271362, -0.7231464982032776, -1.2863590717315674, 0.6803713440895081, -0.02155795879662037, 0.05868690088391304, 0.7262366414070129, -0.6463432908058167, 1.0990954637527466, 0.6189180016517639, 0.9667308330535889, 0.02657068893313408, 0.1474153995513916, 0.27132394909858704, -0.2702074944972992, -1.2654263973236084, -0.46789056062698364, -1.0710266828536987, -2.572747230529785, 0.35371947288513184, -0.3302437961101532, -1.5172423124313354, 0.10521755367517471, -0.9870502352714539, 0.7308850884437561, -0.5622351765632629, -1.1738073825836182, -1.3721108436584473, 0.22764819860458374, -0.1902397871017456, 0.8041478991508484, -1.6236759424209595, -0.17947787046432495, 1.2696008682250977, 0.8638257384300232, -0.5836045145988464, 1.023064136505127, 0.28933748602867126, 0.8994559645652771, 0.7300841808319092, -0.4468372166156769, 0.49532458186149597, 0.2593182325363159, -1.3978712558746338, 0.4680255651473999, 1.3631317615509033, 0.21453197300434113, 1.3481372594833374, -0.5230884552001953, 0.16289715468883514, 0.4524480104446411, -0.6560858488082886, -0.6603895425796509, -0.5118438005447388, 0.8553985953330994, -0.10729704052209854, -1.0295891761779785, -0.05783132463693619, -0.17233149707317352, -0.16509297490119934, 0.26340755820274353, -1.5251784324645996, -0.25930845737457275, -0.37846264243125916, -0.5145599842071533, -1.4311550855636597, -0.017829224467277527, 1.326610803604126, -0.897863507270813, -0.11835681647062302, 0.5346968173980713, 0.3483339548110962, 0.5882204174995422, 0.6662203073501587, -0.627457320690155, -0.18466679751873016, -0.20509642362594604, -0.2780504822731018, 0.3841172754764557, 1.1212878227233887, -0.13704103231430054, -0.9871890544891357, 0.6548948884010315, -0.35613933205604553, 0.15710808336734772, 1.950164556503296, -0.04639175161719322, -0.7608266472816467, 0.4262271523475647, -0.7130935788154602, 1.8498355150222778, 1.6251635551452637, 1.3831584453582764, -0.13647538423538208, -0.8757983446121216, 0.5740362405776978, -0.26594361662864685, -0.3375168740749359, 0.9038764834403992, 0.4968315064907074, -0.3421815037727356, -1.3318650722503662, 0.6318683624267578, 1.214769959449768, -0.8949149250984192, -0.7741621732711792, 0.10765188932418823, -0.8766340613365173, 1.2645294666290283, 0.603899359703064, 0.3228241205215454, 0.32171714305877686, 1.583179235458374, 0.6836215853691101, -0.5411073565483093, 0.46399691700935364, 0.4961789548397064, -0.24318720400333405, -1.9842381477355957, -0.9883424043655396, 0.2992636561393738, -0.44838324189186096, -1.49172842502594, 1.3891046047210693, -1.2391304969787598, -1.11591637134552, 0.5736922025680542, 0.20890158414840698, 1.2892475128173828, 0.33396288752555847, 1.749685287475586, 2.0387704372406006, 0.8859456181526184, 0.4170309603214264, 1.1849780082702637, -0.16313904523849487, -0.4273981750011444, 1.7617592811584473, -0.40442654490470886, 0.6904771327972412, 1.0735143423080444, -0.4645864963531494, -1.1716063022613525, -0.9288055300712585, -1.139838695526123, -0.6376640796661377, 1.2161641120910645, 0.16650502383708954, -1.1073229312896729, 0.18639715015888214, 1.5695686340332031, 0.17182494699954987, -0.1824084371328354, 0.6564741730690002, 0.3706248700618744, -0.6088061332702637, -0.07444830983877182, -1.060368537902832, 0.5550535917282104, -0.2523553967475891, -0.3595956563949585, 0.15200039744377136, 0.5060520172119141, 1.2030279636383057, -0.003488006070256233, 0.16813373565673828, 1.2310595512390137, -1.412624478340149, 1.5134780406951904, -0.733942449092865, 0.3679291307926178, -2.378877878189087, 1.4414727687835693, -0.8112521171569824, 1.9837850332260132, -2.6052820682525635, 0.40426620841026306, -0.581729531288147, -0.6065086722373962, 0.24319316446781158, -0.2920774519443512, 0.0520549900829792, -0.1464562714099884, -0.9959588050842285, -0.07936547696590424, -0.8887053728103638, 0.5125911831855774, 1.227156400680542, 1.3440974950790405, -1.0700868368148804, -0.27891644835472107, -1.684253454208374, -0.20927897095680237, -0.73228520154953, 0.3620244562625885, -1.8791415691375732, -0.16865740716457367, -2.0528006553649902, -2.402790069580078, -1.3470951318740845, -0.9748508930206299, 1.1467593908309937, 0.2176779806613922, -0.8733274340629578, 1.0910967588424683, -0.3752155601978302, -1.8044935464859009, 1.1755952835083008, -2.070429801940918 ]
https://github.com/huggingface/datasets/issues/3204
FileNotFoundError for TupleIE dataste
@mariosasko @lhoestq Could you give me an update on how to load the dataset after the fix? Thanks.
Hi, `dataset = datasets.load_dataset('tuple_ie', 'all')` returns a FileNotFound error. Is the data not available? Many thanks.
1,128
18
FileNotFoundError for TupleIE dataste Hi, `dataset = datasets.load_dataset('tuple_ie', 'all')` returns a FileNotFound error. Is the data not available? Many thanks. @mariosasko @lhoestq Could you give me an update on how to load the dataset after the fix? Thanks.
[ -1.2971563339233398, -0.96475750207901, -0.6569271683692932, 1.5173453092575073, -0.29272112250328064, -1.069276213645935, 0.22054529190063477, -1.0165016651153564, 1.7253628969192505, -0.85631263256073, 0.11518372595310211, -1.6789261102676392, -0.1664426177740097, -0.4555756747722626, -0.6351447105407715, -0.9071283340454102, -0.43835359811782837, -0.6924766898155212, 1.1451560258865356, 2.4284775257110596, 0.9352119565010071, -1.2430564165115356, 2.872671365737915, 0.7853630185127258, -0.1422499716281891, -1.112363576889038, 0.5783492922782898, 0.03847604617476463, -1.1960774660110474, -0.32971513271331787, -1.2084078788757324, -0.08024753630161285, -0.556326687335968, -0.5046588182449341, -0.006488577462732792, 0.4270608723163605, -0.2932446599006653, -0.5251675844192505, -0.5657486319541931, -0.640640914440155, 0.4813024401664734, -0.4266297221183777, 0.8769144415855408, -0.3298562169075012, 1.8314746618270874, -0.3974120020866394, 0.44271185994148254, 0.7194400429725647, 1.3278834819793701, 0.32973775267601013, 0.021666154265403748, 0.39980340003967285, 0.46532341837882996, -0.1313251405954361, 0.4311104416847229, 1.1261374950408936, 0.44179996848106384, 0.6061612963676453, 0.7092961072921753, -2.2899577617645264, 1.2985085248947144, -1.17363703250885, 0.24687689542770386, 1.3994053602218628, -1.04364013671875, 0.4715241491794586, -1.7329609394073486, 0.057677190750837326, 0.5334727168083191, -2.150750160217285, 0.26727163791656494, -1.2101852893829346, -0.5884629487991333, 0.8959518671035767, 0.38860318064689636, -1.28280508518219, 0.129454106092453, -0.3205881416797638, 1.057916522026062, 0.40352028608322144, 1.1170532703399658, -1.7655996084213257, 0.13866135478019714, -0.3957919776439667, 0.15965817868709564, -1.3334981203079224, -1.542569637298584, 0.5749706625938416, 0.5410181283950806, 0.7256877422332764, -0.20767804980278015, 0.8591020703315735, -0.8653727769851685, 0.7775521278381348, -1.0241541862487793, -1.5384447574615479, -1.2397124767303467, -2.210247755050659, -2.382923126220703, 0.7552371621131897, -0.47660496830940247, -0.5748801231384277, 1.9665369987487793, -1.0394991636276245, -1.795487642288208, 1.3577040433883667, 0.26048529148101807, -0.046319421380758286, 2.446763277053833, 0.3450208902359009, -0.5767882466316223, 0.40983766317367554, -0.8950999975204468, 0.9029703140258789, -0.4596715271472931, 1.4861960411071777, 0.5182216167449951, -0.969361424446106, 1.7607938051223755, -0.43936967849731445, 0.7071215510368347, -0.6224783062934875, -0.6611045598983765, -0.8511672616004944, 0.24029093980789185, 1.971909523010254, -0.2541903257369995, 1.5435807704925537, -0.5381608605384827, -1.6247401237487793, -1.6844110488891602, 1.080054759979248, 0.4280177056789398, -0.8029865622520447, 0.2620128095149994, -0.2842337489128113, 0.07058965414762497, 0.021564293652772903, 1.1596776247024536, 1.2878462076187134, 0.7729378938674927, -0.261747807264328, -0.8836511373519897, 0.03613603860139847, -0.09246315807104111, -0.6333853602409363, -1.8423932790756226, -0.38202041387557983, -0.0521477572619915, 0.7294543981552124, -1.1771968603134155, 1.4959113597869873, 0.9801809787750244, 1.8734177350997925, 0.9761869311332703, -0.40745294094085693, 1.3496285676956177, 0.056728679686784744, 1.8623661994934082, -0.7270258665084839, 0.6813498139381409, -0.34143638610839844, -0.9877381920814514, 0.736891508102417, -0.1988566368818283, -1.8903541564941406, -0.8856862783432007, -0.8995617628097534, -0.24455882608890533, -0.6729923486709595, 0.8852751851081848, -0.4107840359210968, -1.557309865951538, 0.26371780037879944, -0.5364056825637817, 0.2823314964771271, -1.3025814294815063, 0.5081303119659424, 0.6469990015029907, -0.6734610795974731, 0.12091345340013504, -0.16640028357505798, -1.3618428707122803, -0.4479227066040039, 0.361244261264801, 1.916082739830017, -0.7664837837219238, 0.8647597432136536, 0.8319736123085022, -0.99219810962677, -0.1076512336730957, 0.1944570690393448, -0.09488718956708908, 0.6218867301940918, -1.0363600254058838, -0.4703226089477539, 1.364895224571228, -0.1957649439573288, -0.5703265070915222, 1.4452811479568481, 0.7276477813720703, -1.0443696975708008, -0.1424662172794342, -0.4543934762477875, -0.7833589911460876, -0.1747361123561859, -1.5731844902038574, -0.3308762013912201, 0.3302742540836334, -1.4239531755447388, -0.6429751515388489, -0.33783820271492004, 1.2634636163711548, -0.0669102892279625, 1.2639368772506714, -0.28815749287605286, -0.2716330587863922, -0.28836125135421753, -0.4357752799987793, 0.3288438022136688, -0.24655383825302124, -0.5040907859802246, 0.0910334512591362, -0.8362131118774414, 0.283334881067276, 1.5354700088500977, 0.3199704587459564, 0.07757028937339783, 0.6209381818771362, 1.0323406457901, 0.41881585121154785, 0.017194021493196487, -0.92006516456604, -1.461346983909607, 1.8543777465820312, -1.4354430437088013, 1.927635908126831, 0.5758386850357056, -0.16341425478458405, -1.7732748985290527, -1.790713906288147, 1.3212488889694214, 1.2393494844436646, 2.3104724884033203, 0.6080588698387146, 0.3700653910636902, -0.7934898734092712, -0.6850085854530334, 0.15623579919338226, -1.0351135730743408, -0.7007418274879456, 0.2635687291622162, 2.398465394973755, 1.5971795320510864, -0.6299371123313904, -0.1674046367406845, -1.0376862287521362, 1.3520840406417847, -0.1964123547077179, 0.32102590799331665, 1.9403622150421143, -0.48501503467559814, -1.196785569190979, 1.1160540580749512, -2.324570655822754, 0.04441167786717415, 1.9899200201034546, 0.2799651622772217, 0.1763826310634613, -1.3924720287322998, -0.8972765803337097, -0.09295962005853653, -0.5187963247299194, -1.371199607849121, 0.5619669556617737, -0.3378086984157562, -0.8243346810340881, -1.4948946237564087, 0.0823652520775795, -1.0108695030212402, -1.488137125968933, 0.2918170690536499, 2.0104851722717285, 1.9092737436294556, -0.8788504600524902, 1.5365684032440186, -0.05993206799030304, 0.11987116187810898, 1.3127617835998535, 1.0338940620422363, 2.968824625015259, 1.8645071983337402, -1.222623586654663, 0.7646645307540894, -0.0673055499792099, -0.5697594285011292, 1.2244974374771118, -1.0761222839355469, 1.2220189571380615, -0.17192888259887695, -1.022597074508667, -1.3882651329040527, 0.8214083313941956, 0.49213188886642456, -0.04050462320446968, -0.24167925119400024, 1.385916829109192, 0.10808708518743515, 1.3669683933258057, 0.5355069041252136, -0.4966382682323456, 0.6571030020713806, -0.3818833827972412, -0.43038514256477356, 1.729627251625061, 0.27041152119636536, -1.3477327823638916, -2.268479108810425, -0.24797558784484863, -0.7557900547981262, 0.04352492094039917, -0.5303341150283813, -0.8552370071411133, 1.6360729932785034, 0.469357430934906, -1.2122572660446167, -0.22911033034324646, -0.5084812045097351, -0.48481106758117676, 2.5921926498413086, -1.4021364450454712, -0.28151819109916687, -0.7308082580566406, -0.5263864994049072, 1.6619174480438232, -1.1383939981460571, -0.26344820857048035, -1.0216234922409058, -0.5714638233184814, -1.394806981086731, -0.4877757430076599, 0.12584662437438965, -0.9697387218475342, 0.8033695816993713, 0.22440439462661743, -1.0861743688583374, -0.2730112671852112, -0.85397869348526, 0.8641995191574097, -0.11931517720222473, 0.3511411249637604, 1.9881105422973633, 0.5188633799552917, -0.45098286867141724, 0.7321407198905945, 1.2599847316741943, 0.5155836939811707, -0.5954240560531616, 0.29603391885757446, -0.6450867056846619, 0.3511156737804413, -1.341497778892517, 0.12123995274305344, -3.1194686889648438, 0.540947437286377, -0.02550489827990532, -0.17710553109645844, -0.04596017301082611, -1.4400765895843506, 1.1231499910354614, 2.4930663108825684, -1.2523999214172363, 0.3805749714374542, 0.2655941843986511, 1.282212257385254, -1.451454997062683, 0.29426321387290955, -0.4753229320049286, 1.9849292039871216, 0.3345380425453186, 1.0359673500061035, -0.5501469373703003, -2.328547239303589, 0.44703933596611023, -1.2018730640411377, -1.3539406061172485, 0.7900689840316772, -0.9835736751556396, 0.03860406577587128, -1.5024774074554443, -0.1408669352531433, -0.8812592625617981, -1.2618542909622192, 0.8848258256912231, 0.456019788980484, 0.5030621886253357, -0.7012296319007874, 0.46468064188957214, -2.145423412322998, -1.326546549797058, -0.3184988796710968, -0.8441156148910522, 0.5567402839660645, -0.40431296825408936, 0.6393303275108337, -0.1739756017923355, 0.07973849028348923, 0.3720707595348358, 1.4488314390182495, 3.180262327194214, 0.13899178802967072, 0.3215211033821106, -0.1884480118751526, -0.9232083559036255, 1.4920942783355713, 1.1436314582824707, -0.1420227736234665, -0.5590513944625854, -1.0383747816085815, 1.2295198440551758, 1.7462360858917236, 0.96685791015625, 0.0591680072247982, -0.6320593953132629, -0.4319058358669281, 0.11683712154626846, 0.20441222190856934, 0.37079334259033203, 0.8338381052017212, 0.09660453349351883, 0.05151193216443062, 1.4337642192840576, 1.2286735773086548, -0.5289625525474548, 0.41129690408706665, -0.8540068864822388, -0.48589080572128296, 0.4703063666820526, 0.3485042452812195, -0.08364129811525345, 0.25917086005210876, -0.8172186613082886, -0.2565828859806061, -0.23498734831809998, -1.0331289768218994, -0.6921056509017944, -0.4318390190601349, -0.4706593155860901, 1.5246703624725342, 0.20845001935958862, -0.6161377429962158, -0.2271513193845749, -0.7692164182662964, -0.09259574860334396, -1.0643935203552246, 0.3080373704433441, -0.15517853200435638, -0.11253989487886429, -0.10157719999551773, 1.7849409580230713, -0.9961024522781372, -2.1349122524261475, 0.21121428906917572, 0.3163982629776001, -0.32089725136756897, 0.19702374935150146, 1.540773630142212, 0.42676204442977905, 1.4899641275405884, 1.3870295286178589, 0.8944875597953796, -0.5833132266998291, -1.2299195528030396, 0.6086573600769043, 0.789295494556427, -1.3177733421325684, 0.7362026572227478, 0.05540363863110542, -0.5084386467933655, 0.6152795553207397, 1.1696687936782837, 0.4364020824432373, -1.828268051147461, 0.7553781867027283, -0.8672658205032349, 0.8073868751525879, 0.813788890838623, 0.8920701146125793, 0.1468764990568161, 0.8987018465995789, -1.0192925930023193, -1.3636986017227173, -0.8400989174842834, -0.7287867665290833, 2.0547897815704346, -0.231916606426239, 0.5661849975585938, -0.15737944841384888, -0.9740599989891052, 0.013031414709985256, 0.6604759097099304, 0.41331052780151367, -0.49571889638900757, 0.7131848335266113, -0.5700395107269287, -1.1799620389938354, -1.3891223669052124, -0.47840312123298645, -1.1294728517532349, -0.9571509957313538, 1.041076898574829, 0.9279544353485107, 0.3080063462257385, 1.871622920036316, 0.4570541977882385, 0.3304329216480255, -2.6697330474853516, 0.8637164235115051, 0.27259567379951477, -0.05483808368444443, 0.8126533031463623, 0.47282177209854126, 0.9456019997596741, -0.11773677915334702, 0.55491703748703, -2.251447916030884, 2.294386148452759, -0.3097797632217407, 0.6813709735870361, -0.13970543444156647, 0.05341039225459099, 1.1402844190597534, 0.4879556894302368, 0.49180668592453003, -1.0780351161956787, 0.6750099062919617, -0.45605766773223877, 1.2383941411972046, 1.0400588512420654, -0.8315344452857971, -0.03373442590236664, 1.5322904586791992, 0.6219543218612671, -0.48662668466567993, -0.8190172910690308, -0.8530970215797424, 0.8621987700462341, 1.6965020895004272, -0.21818090975284576, 0.04901574179530144, 0.7693235278129578, 0.5703916549682617, -1.364877462387085, -0.026112806051969528, -0.8182151317596436, -0.6409844160079956, 1.6179606914520264, 2.1071953773498535, -0.11986127495765686, -0.14347483217716217, -0.6770039796829224, -1.1877683401107788, 0.8145156502723694, 0.12408638745546341, 0.19836504757404327, 0.6803790926933289, -0.7588640451431274, 1.1936659812927246, 0.6933382153511047, 0.7339458465576172, 0.17961977422237396, 0.517324686050415, 0.4356701672077179, -0.21474865078926086, -1.101469874382019, -0.14319460093975067, -1.1125578880310059, -2.4224770069122314, 0.3379514217376709, -0.2359292209148407, -1.486940622329712, 0.02774335816502571, -1.1086399555206299, 0.9690865278244019, -0.5216476321220398, -1.168806791305542, -1.4823652505874634, 0.0496843121945858, -0.02654073014855385, 0.860470175743103, -1.7176491022109985, 0.022766388952732086, 1.2155145406723022, 0.9201535582542419, -0.7825325727462769, 1.0721558332443237, 0.445194274187088, 1.069827914237976, 0.8345035910606384, -0.3398894965648651, 0.5468558073043823, -0.16986887156963348, -1.3102132081985474, 0.494712769985199, 1.1067299842834473, 0.13103985786437988, 1.5942105054855347, -0.5659570097923279, -0.1266702115535736, 0.42479369044303894, -0.6633283495903015, -0.5599314570426941, -0.37225642800331116, 0.5402960181236267, 0.11634146422147751, -0.8546362519264221, 0.07474970072507858, 0.04661749303340912, -0.17390963435173035, 0.12360768765211105, -1.4187475442886353, -0.38561487197875977, -0.42870432138442993, -0.5055062770843506, -1.407637357711792, -0.11480157822370529, 1.3413106203079224, -0.6513328552246094, -0.09813608974218369, 0.5764790177345276, 0.49078112840652466, 0.38762032985687256, 0.5444908738136292, -0.6676592230796814, -0.24987345933914185, -0.2614184021949768, -0.3211868107318878, 0.3228476941585541, 1.440508246421814, -0.28146883845329285, -1.0128835439682007, 0.6565797328948975, -0.2312774360179901, 0.03304600343108177, 1.821466088294983, 0.0032056011259555817, -0.8701168894767761, 0.1767570823431015, -0.8420869708061218, 2.026726007461548, 1.7723196744918823, 1.4594714641571045, -0.03330188989639282, -0.9075444340705872, 0.5248223543167114, -0.3777115046977997, -0.35368138551712036, 0.8701774477958679, 0.4851645827293396, -0.3059253394603729, -1.232398271560669, 0.6393659710884094, 1.3041455745697021, -0.7440199851989746, -0.7845069169998169, 0.024701375514268875, -0.6324461698532104, 1.0424296855926514, 0.7207295298576355, 0.3105296194553375, 0.24662825465202332, 1.7043488025665283, 0.7566256523132324, -0.4079785943031311, 0.748394250869751, 0.5947064161300659, -0.022538088262081146, -2.135636568069458, -1.3192952871322632, 0.4080940783023834, -0.529063880443573, -1.652635097503662, 1.3961068391799927, -1.0211855173110962, -1.1350373029708862, 0.5932931303977966, 0.11251966655254364, 1.5855549573898315, 0.4463130235671997, 1.5059410333633423, 2.0419445037841797, 0.9310051798820496, 0.37526655197143555, 1.5393588542938232, -0.12922009825706482, -0.4682006239891052, 1.9454059600830078, -0.4318483769893646, 0.38228559494018555, 1.0897444486618042, -0.22015418112277985, -0.9396904110908508, -0.8669033050537109, -1.2826322317123413, -0.8572590351104736, 1.1389087438583374, 0.10480854660272598, -1.1704270839691162, 0.2931846082210541, 1.6593753099441528, 0.12452229112386703, -0.3455677032470703, 0.7957467436790466, 0.47362658381462097, -0.8819507360458374, 0.0938575342297554, -1.0645455121994019, 0.44297072291374207, -0.38885682821273804, -0.5001166462898254, 0.32407957315444946, 0.48780587315559387, 1.2863720655441284, -0.05618229880928993, 0.15179084241390228, 1.234159231185913, -1.4113448858261108, 1.5269124507904053, -0.6115574240684509, 0.22935141623020172, -2.381392240524292, 1.5189584493637085, -0.651352047920227, 1.859561800956726, -2.87137770652771, 0.6233488321304321, -0.5856013298034668, -0.4453701078891754, 0.26105108857154846, -0.4103136658668518, 0.12704217433929443, -0.03579839691519737, -1.1658978462219238, 0.03319818526506424, -0.7433695793151855, 0.5114912390708923, 1.1294515132904053, 1.1897460222244263, -1.162928819656372, -0.3037940561771393, -1.7311028242111206, -0.22392578423023224, -0.659999668598175, 0.3936014771461487, -2.184481382369995, -0.33825114369392395, -1.8068184852600098, -2.290048122406006, -1.1268324851989746, -0.7210455536842346, 1.1182223558425903, -0.10329348593950272, -0.8783181309700012, 1.1884194612503052, -0.4018411636352539, -1.9478833675384521, 1.1050686836242676, -2.1025350093841553 ]
https://github.com/huggingface/datasets/issues/3204
FileNotFoundError for TupleIE dataste
Hi @arda-vianai, first, you can try: ```python import datasets dataset = datasets.load_dataset('tuple_ie', 'all', revision="master") ``` If this doesn't work, your version of `datasets` is missing some features that are required to run the dataset script, so install the master version with the following command: ``` pip install git+https://github.com/huggingface/datasets.git ``` and then: ```python import datasets dataset = datasets.load_dataset('tuple_ie', 'all') ``` should work (even without `revision`).
Hi, `dataset = datasets.load_dataset('tuple_ie', 'all')` returns a FileNotFound error. Is the data not available? Many thanks.
1,128
64
FileNotFoundError for TupleIE dataste Hi, `dataset = datasets.load_dataset('tuple_ie', 'all')` returns a FileNotFound error. Is the data not available? Many thanks. Hi @arda-vianai, first, you can try: ```python import datasets dataset = datasets.load_dataset('tuple_ie', 'all', revision="master") ``` If this doesn't work, your version of `datasets` is missing some features that are required to run the dataset script, so install the master version with the following command: ``` pip install git+https://github.com/huggingface/datasets.git ``` and then: ```python import datasets dataset = datasets.load_dataset('tuple_ie', 'all') ``` should work (even without `revision`).
[ -1.19724702835083, -0.983649492263794, -0.7403799295425415, 1.5107733011245728, -0.24288323521614075, -1.270204782485962, 0.12432678043842316, -1.0554274320602417, 1.8113406896591187, -0.8188554644584656, 0.22508582472801208, -1.7623807191848755, -0.08189405500888824, -0.6775622963905334, -0.7506119608879089, -0.8872641921043396, -0.314241498708725, -0.7818429470062256, 1.0011472702026367, 2.3619704246520996, 1.0491808652877808, -1.3342427015304565, 2.6778528690338135, 0.7070649862289429, -0.07191561907529831, -1.0614469051361084, 0.5567264556884766, -0.06628238409757614, -1.1531909704208374, -0.3781048059463501, -0.9896776676177979, -0.11555255204439163, -0.5454075336456299, -0.6515626907348633, -0.05548176169395447, 0.5299516320228577, -0.40635260939598083, -0.501492440700531, -0.4739057719707489, -0.7639127373695374, 0.43188968300819397, -0.31959280371665955, 0.946549117565155, -0.3964436650276184, 1.856612205505371, -0.42986759543418884, 0.3808337152004242, 0.6463420391082764, 1.3791260719299316, 0.22692111134529114, 0.026025326922535896, 0.3236906826496124, 0.34503453969955444, 0.1093297153711319, 0.505378782749176, 1.1119331121444702, 0.5324269533157349, 0.5519111156463623, 0.756982147693634, -2.3547825813293457, 1.2377532720565796, -1.1058332920074463, 0.2456536442041397, 1.3288956880569458, -0.9114512205123901, 0.32243555784225464, -1.761703610420227, 0.08224622160196304, 0.5120131373405457, -2.161701202392578, 0.36924296617507935, -1.2541266679763794, -0.4181917607784271, 1.0589228868484497, 0.408447802066803, -1.1821582317352295, 0.18156340718269348, -0.20202165842056274, 1.0315377712249756, 0.4164946377277374, 1.0555223226547241, -1.7687294483184814, 0.14873026311397552, -0.3574105203151703, 0.05016448348760605, -1.259244680404663, -1.4837760925292969, 0.48590248823165894, 0.6550728678703308, 0.7684569954872131, -0.22960567474365234, 1.0386412143707275, -0.9154541492462158, 0.6261638402938843, -1.0138089656829834, -1.685845136642456, -1.2868080139160156, -2.1710870265960693, -2.371755838394165, 0.7449058294296265, -0.48581400513648987, -0.5177664160728455, 2.049436330795288, -0.9571607708930969, -1.8972930908203125, 1.0748809576034546, 0.3544701933860779, 0.0005299802869558334, 2.309748411178589, 0.24354834854602814, -0.678347110748291, 0.4534332752227783, -0.8143972158432007, 0.7339136600494385, -0.32454800605773926, 1.5163708925247192, 0.5454025864601135, -1.094145655632019, 1.6966345310211182, -0.4500791132450104, 0.6604638695716858, -0.6768656969070435, -0.547658383846283, -0.893695592880249, 0.29311713576316833, 1.9134305715560913, -0.2642041742801666, 1.5212241411209106, -0.4019324481487274, -1.5726784467697144, -1.5499143600463867, 1.0070221424102783, 0.3978399634361267, -0.7493321299552917, 0.12422198057174683, -0.3118179738521576, 0.10599219799041748, -0.11665552109479904, 1.2396198511123657, 1.141461968421936, 0.7152723670005798, -0.33500003814697266, -0.797009289264679, 0.2464725226163864, 0.02177647314965725, -0.6091880202293396, -1.7864474058151245, -0.33195099234580994, 0.11366872489452362, 0.6248652935028076, -1.063285231590271, 1.6479130983352661, 0.81500643491745, 1.8873448371887207, 0.9717914462089539, -0.30257105827331543, 1.365472435951233, 0.03046349249780178, 2.004621744155884, -0.619566798210144, 0.6501242518424988, -0.2746717929840088, -1.1253427267074585, 0.8890663981437683, -0.28314006328582764, -1.9921895265579224, -0.8442607522010803, -0.9289236664772034, -0.24190393090248108, -0.7508882284164429, 0.9400731325149536, -0.4229658246040344, -1.5544569492340088, 0.19174334406852722, -0.6737953424453735, 0.27825745940208435, -1.2218492031097412, 0.29959389567375183, 0.7599504590034485, -0.7214063405990601, 0.05396256595849991, -0.2658410668373108, -1.291808009147644, -0.4689035713672638, 0.4307005703449249, 1.9436968564987183, -0.7536978125572205, 0.9453145861625671, 0.9899733662605286, -0.8775804042816162, -0.06537269800901413, 0.1975058615207672, -0.16251114010810852, 0.7876195311546326, -1.0497889518737793, -0.5393044948577881, 1.2837677001953125, -0.1616062968969345, -0.6843597292900085, 1.4452717304229736, 0.771888256072998, -0.9960137009620667, -0.049290068447589874, -0.2993907034397125, -0.7815366387367249, -0.04693549871444702, -1.5570753812789917, -0.10267432779073715, 0.47996440529823303, -1.4525998830795288, -0.53937166929245, -0.22355873882770538, 1.2306270599365234, -0.21357284486293793, 1.2506498098373413, -0.24681898951530457, -0.25326818227767944, -0.3258625566959381, -0.445739209651947, 0.15686440467834473, -0.20828783512115479, -0.690290093421936, 0.16880112886428833, -0.7719205021858215, 0.40533143281936646, 1.3522640466690063, 0.2605208456516266, -0.005255249794572592, 0.6234567761421204, 1.1807043552398682, 0.41836342215538025, 0.0469062477350235, -0.8554784059524536, -1.543445110321045, 1.8878345489501953, -1.4557801485061646, 1.8676999807357788, 0.4212048053741455, -0.030651744455099106, -1.739524006843567, -1.859550952911377, 1.5030899047851562, 1.1754634380340576, 2.320960760116577, 0.7113794088363647, 0.3503492474555969, -0.8906084895133972, -0.6745366454124451, 0.27625709772109985, -0.9727303385734558, -0.6389362812042236, 0.15185298025608063, 2.368640422821045, 1.813582181930542, -0.5631000399589539, -0.3212600350379944, -1.0526413917541504, 1.333580732345581, -0.2633906602859497, 0.3094339966773987, 2.050663709640503, -0.422477126121521, -1.096885323524475, 1.3390252590179443, -2.4423418045043945, 0.11299104243516922, 2.0425689220428467, 0.2570430338382721, 0.21429523825645447, -1.4154508113861084, -0.7459629774093628, -0.08971307426691055, -0.5056791305541992, -1.3437833786010742, 0.5778061747550964, -0.2717331051826477, -0.655057430267334, -1.4053558111190796, 0.24529515206813812, -1.0250742435455322, -1.6431026458740234, 0.25536972284317017, 1.9241083860397339, 1.9498995542526245, -0.7160205841064453, 1.6115102767944336, -0.22394053637981415, 0.3484705686569214, 1.3660188913345337, 1.227291226387024, 3.025329113006592, 1.8113288879394531, -1.2501808404922485, 0.7606744170188904, -0.06039472669363022, -0.5755448937416077, 1.4440150260925293, -1.1296164989471436, 1.1394063234329224, -0.21590100228786469, -1.1573110818862915, -1.336326003074646, 0.7813067436218262, 0.5527910590171814, 0.052753567695617676, -0.43010178208351135, 1.254663109779358, -0.0008726883679628372, 1.213578701019287, 0.5410513877868652, -0.5087941288948059, 0.6265156865119934, -0.35949385166168213, -0.5039594173431396, 1.5164058208465576, 0.22287704050540924, -1.2608720064163208, -2.27474308013916, -0.2514168918132782, -0.81703120470047, -0.03486159071326256, -0.5267289876937866, -0.8793591856956482, 1.6930582523345947, 0.40622472763061523, -1.2216745615005493, -0.11595794558525085, -0.33596616983413696, -0.5491107106208801, 2.6797280311584473, -1.303952932357788, -0.30966514348983765, -1.0188785791397095, -0.6185570359230042, 1.725148320198059, -1.1164097785949707, -0.21254462003707886, -1.060855507850647, -0.5850088596343994, -1.4963905811309814, -0.5552516579627991, 0.07989278435707092, -0.8954294919967651, 0.9563325047492981, 0.23259909451007843, -1.2459416389465332, -0.31399020552635193, -0.9179310202598572, 1.0289386510849, -0.24268268048763275, 0.27561190724372864, 1.952142357826233, 0.49391305446624756, -0.39820006489753723, 0.7485666275024414, 1.1281485557556152, 0.5998167991638184, -0.6370015740394592, 0.45332401990890503, -0.6928133964538574, 0.24884910881519318, -1.436884880065918, 0.1935119926929474, -2.9500083923339844, 0.6359604597091675, -0.007714214734733105, -0.07093814760446548, 0.02220461331307888, -1.4478156566619873, 1.0619171857833862, 2.52339768409729, -1.356141448020935, 0.37934789061546326, 0.30868691205978394, 1.2677634954452515, -1.5248832702636719, 0.2885900139808655, -0.4453674852848053, 2.1104674339294434, 0.17411789298057556, 1.1517632007598877, -0.4016888737678528, -2.2796859741210938, 0.5283675193786621, -1.3106093406677246, -1.2380051612854004, 0.799585223197937, -0.8921650052070618, 0.17670932412147522, -1.447005271911621, -0.1525045782327652, -0.9120033979415894, -1.2559691667556763, 0.9435446858406067, 0.230021670460701, 0.35729077458381653, -0.5924006104469299, 0.5039089918136597, -2.011674642562866, -1.2650755643844604, -0.24245187640190125, -0.8943097591400146, 0.49526071548461914, -0.2597014605998993, 0.5922853946685791, -0.20118370652198792, 0.013524306938052177, 0.359868586063385, 1.5112673044204712, 3.421076536178589, 0.1720336675643921, 0.3288942277431488, -0.08857003599405289, -0.9608017206192017, 1.5094141960144043, 1.0201385021209717, -0.10394148528575897, -0.4488223195075989, -1.0481685400009155, 1.186647891998291, 1.9148285388946533, 1.0107699632644653, 0.022043457254767418, -0.8184133768081665, -0.6312721967697144, 0.08792200684547424, 0.1798500418663025, 0.4833783805370331, 0.7415807247161865, 0.18873797357082367, 0.009588085114955902, 1.2853933572769165, 1.0821670293807983, -0.39566656947135925, 0.3082796633243561, -0.8458877801895142, -0.502353847026825, 0.6090261340141296, 0.2253744900226593, 0.03997112065553665, 0.3248220384120941, -0.9518702626228333, -0.2321852296590805, -0.34834718704223633, -0.9593155384063721, -0.643844485282898, -0.5570812821388245, -0.4224558472633362, 1.4940588474273682, 0.06408276408910751, -0.6474363803863525, -0.10428055375814438, -0.7622877955436707, -0.07095056772232056, -1.005376935005188, 0.22111253440380096, -0.18418115377426147, -0.16040396690368652, -0.11900583654642105, 1.6302769184112549, -0.996570348739624, -2.033674955368042, 0.20565293729305267, 0.41278737783432007, -0.33237290382385254, 0.21788717806339264, 1.5313904285430908, 0.5444061160087585, 1.4098076820373535, 1.3997669219970703, 1.0246295928955078, -0.5816662311553955, -1.3471813201904297, 0.6222626566886902, 0.8948127627372742, -1.3599140644073486, 0.8898780345916748, 0.11551116406917572, -0.5282854437828064, 0.549471378326416, 1.3438926935195923, 0.5030695199966431, -1.9240397214889526, 0.6683212518692017, -0.8418449759483337, 0.7717888355255127, 0.7188959717750549, 0.8571727275848389, 0.14127524197101593, 0.8501642346382141, -1.1769710779190063, -1.2300631999969482, -0.7830684781074524, -0.6975658535957336, 1.8686975240707397, -0.20768168568611145, 0.5846351981163025, -0.1634197235107422, -1.2586686611175537, -0.12434422224760056, 0.7278168201446533, 0.384777694940567, -0.5702231526374817, 0.814106822013855, -0.5888899564743042, -1.044737696647644, -1.3573640584945679, -0.47451865673065186, -1.0936310291290283, -0.963454008102417, 1.001307725906372, 0.9034651517868042, 0.32226189970970154, 1.8048689365386963, 0.6702147126197815, 0.21991609036922455, -2.566485643386841, 0.8725391626358032, 0.22177185118198395, -0.04511462152004242, 0.7205231785774231, 0.42515766620635986, 1.0913619995117188, -0.09674576669931412, 0.7284013628959656, -2.2744717597961426, 2.2852816581726074, -0.23918022215366364, 0.47584986686706543, -0.07754587382078171, -0.2458411455154419, 1.1282519102096558, 0.3966923654079437, 0.5264683961868286, -1.0362170934677124, 0.6858547329902649, -0.6150513887405396, 1.2065000534057617, 1.035403847694397, -0.9386128187179565, -0.0667368471622467, 1.4569196701049805, 0.5297593474388123, -0.5102088451385498, -0.9198749661445618, -0.9577251076698303, 1.0058097839355469, 1.5954080820083618, -0.08164407312870026, -0.16016356647014618, 0.9681163430213928, 0.6813251376152039, -1.2594997882843018, 0.07690569758415222, -0.7386991381645203, -0.5479124784469604, 1.741381049156189, 1.925113320350647, -0.17400553822517395, -0.22367213666439056, -0.8344037532806396, -1.0503991842269897, 0.7511787414550781, 0.17601227760314941, -0.05522182583808899, 0.7812885642051697, -0.6658574342727661, 1.1180036067962646, 0.8524518013000488, 0.828281581401825, 0.12113946676254272, 0.47608110308647156, 0.40675607323646545, -0.32913246750831604, -1.1764256954193115, -0.22511284053325653, -1.0959815979003906, -2.59041690826416, 0.423032283782959, -0.28751081228256226, -1.3867101669311523, 0.02004648745059967, -1.1130332946777344, 1.0386343002319336, -0.5826269388198853, -1.1967920064926147, -1.433138132095337, 0.17511482536792755, -0.01004400011152029, 0.8633371591567993, -1.6710526943206787, -0.004216765984892845, 1.331252932548523, 0.9421977400779724, -0.8933166265487671, 0.9961145520210266, 0.2635340392589569, 1.134880781173706, 0.8286594152450562, -0.41144150495529175, 0.5478886365890503, -0.029222438111901283, -1.3883501291275024, 0.5566928386688232, 1.0884747505187988, 0.1286216527223587, 1.4603190422058105, -0.47439563274383545, 0.010249624028801918, 0.3980180323123932, -0.5956995487213135, -0.5108175873756409, -0.6382506489753723, 0.6026694774627686, 0.07847262918949127, -0.8040475249290466, 0.14321847259998322, 0.17572642862796783, -0.18914201855659485, 0.13167767226696014, -1.5566766262054443, -0.2685520350933075, -0.2719641625881195, -0.6154040694236755, -1.2437242269515991, -0.13442887365818024, 1.313568353652954, -0.6694656014442444, -0.15430445969104767, 0.6186302304267883, 0.25395306944847107, 0.3909083604812622, 0.49996405839920044, -0.6491740345954895, -0.2351425290107727, -0.32831063866615295, -0.4224366247653961, 0.2980494797229767, 1.3290138244628906, -0.1485205888748169, -1.0620529651641846, 0.7433732748031616, -0.30684545636177063, 0.0066347885876894, 1.7767137289047241, -0.13736841082572937, -0.962603747844696, 0.2518407702445984, -0.6957659125328064, 1.8953347206115723, 1.794703722000122, 1.3683406114578247, -0.04422859102487564, -0.8847776651382446, 0.5572514533996582, -0.34279927611351013, -0.4413967430591583, 0.9537373185157776, 0.4176563322544098, -0.14547407627105713, -1.2379341125488281, 0.8037056922912598, 1.3302836418151855, -0.8125211596488953, -0.8849195837974548, 0.13488231599330902, -0.7791948914527893, 1.0086393356323242, 0.6405744552612305, 0.34392666816711426, 0.36889830231666565, 1.5147490501403809, 0.6813198924064636, -0.29742661118507385, 0.6309314966201782, 0.5209437012672424, -0.1404305398464203, -2.0622618198394775, -1.312977910041809, 0.32312270998954773, -0.5632326602935791, -1.6936179399490356, 1.3410465717315674, -1.1793320178985596, -0.8818176984786987, 0.5734370946884155, 0.21004259586334229, 1.4793940782546997, 0.5060589909553528, 1.4410725831985474, 2.0437233448028564, 0.7638881206512451, 0.3681413233280182, 1.3519814014434814, -0.11791438609361649, -0.4619903862476349, 1.817663311958313, -0.44397279620170593, 0.4971936345100403, 1.0642716884613037, -0.19378972053527832, -1.0815773010253906, -0.8424786329269409, -1.353086233139038, -0.7040944695472717, 1.1496119499206543, 0.1334754079580307, -1.2382886409759521, 0.2749868631362915, 1.6340153217315674, 0.042225711047649384, -0.27309417724609375, 0.8485528826713562, 0.3447760343551636, -0.9102467894554138, 0.029681241139769554, -0.9365567564964294, 0.4867267608642578, -0.205984964966774, -0.2495671957731247, 0.3593083918094635, 0.5010805726051331, 1.2906336784362793, 0.04735041409730911, 0.18857860565185547, 1.0662267208099365, -1.2803189754486084, 1.5791468620300293, -0.6648513078689575, 0.2707061469554901, -2.469646692276001, 1.3902039527893066, -0.771267294883728, 1.9043805599212646, -2.6925461292266846, 0.47320234775543213, -0.5065483450889587, -0.44426071643829346, 0.31692373752593994, -0.4530090093612671, 0.08870477229356766, -0.09457214921712875, -1.193534016609192, 0.01396431028842926, -0.7261642217636108, 0.5860193967819214, 1.1990855932235718, 1.299506664276123, -1.1773227453231812, -0.3360022306442261, -1.8560582399368286, -0.2198154181241989, -0.642289400100708, 0.4570540487766266, -2.0734894275665283, -0.18282297253608704, -1.8497424125671387, -2.48791241645813, -1.1689670085906982, -0.7736340761184692, 1.1567069292068481, -0.02333887666463852, -0.8915172219276428, 1.221938967704773, -0.3095604479312897, -1.9121787548065186, 1.0763639211654663, -2.1713218688964844 ]
https://github.com/huggingface/datasets/issues/3204
FileNotFoundError for TupleIE dataste
@mariosasko Thanks, it is working now. I actually did that before but I didn't restart the kernel. I restarted it and it works now. My bad!!! Many thanks and great job! -arda
Hi, `dataset = datasets.load_dataset('tuple_ie', 'all')` returns a FileNotFound error. Is the data not available? Many thanks.
1,128
32
FileNotFoundError for TupleIE dataste Hi, `dataset = datasets.load_dataset('tuple_ie', 'all')` returns a FileNotFound error. Is the data not available? Many thanks. @mariosasko Thanks, it is working now. I actually did that before but I didn't restart the kernel. I restarted it and it works now. My bad!!! Many thanks and great job! -arda
[ -1.3785902261734009, -0.9492223262786865, -0.593754768371582, 1.3794021606445312, -0.28973710536956787, -1.1257926225662231, 0.1259804517030716, -1.0615161657333374, 1.6905467510223389, -0.9296573996543884, 0.15422511100769043, -1.6453397274017334, -0.12109380215406418, -0.39468082785606384, -0.7153751850128174, -0.9302241802215576, -0.4277600347995758, -0.790695309638977, 1.1953048706054688, 2.452742338180542, 0.9929171800613403, -1.4546409845352173, 2.7637321949005127, 0.7597619295120239, -0.13011839985847473, -1.1650093793869019, 0.6236696839332581, 0.09494692087173462, -1.288499355316162, -0.29207706451416016, -1.1381231546401978, -0.10375139862298965, -0.4638115465641022, -0.49301236867904663, -0.07239224016666412, 0.40191563963890076, -0.18263573944568634, -0.5961638689041138, -0.4608742296695709, -0.5686566233634949, 0.47017166018486023, -0.39647385478019714, 0.9318115711212158, -0.36434194445610046, 1.8484548330307007, -0.3631311357021332, 0.37808746099472046, 0.742167055606842, 1.4283170700073242, 0.23952728509902954, -0.03593054413795471, 0.2681117057800293, 0.5330914258956909, -0.19084285199642181, 0.38000303506851196, 1.0303305387496948, 0.49305975437164307, 0.6038309931755066, 0.6999961733818054, -2.1757185459136963, 1.2627503871917725, -1.1649161577224731, 0.23574098944664001, 1.5278418064117432, -1.1464167833328247, 0.43218159675598145, -1.6981812715530396, 0.10510683059692383, 0.5135921835899353, -2.1174187660217285, 0.304862380027771, -1.1279312372207642, -0.518385648727417, 0.9774109125137329, 0.30326730012893677, -1.3227134943008423, 0.08663707971572876, -0.28901854157447815, 1.032231092453003, 0.39040324091911316, 1.1381198167800903, -1.7368395328521729, 0.09009747952222824, -0.40246185660362244, 0.1586572676897049, -1.2959848642349243, -1.475798487663269, 0.46599823236465454, 0.5794553756713867, 0.7291161417961121, -0.1152760237455368, 0.9246615171432495, -0.9358096718788147, 0.7612608075141907, -1.0040420293807983, -1.4467082023620605, -1.379683017730713, -2.313718557357788, -2.3868279457092285, 0.7068524956703186, -0.41155102849006653, -0.52885502576828, 1.9559009075164795, -1.0664442777633667, -1.7379562854766846, 1.281959056854248, 0.19487830996513367, 0.057990074157714844, 2.4546010494232178, 0.26043200492858887, -0.6209968328475952, 0.43920043110847473, -0.8342198729515076, 0.8227970600128174, -0.5667442679405212, 1.4584156274795532, 0.5415027141571045, -0.8956202268600464, 1.7664963006973267, -0.3725544214248657, 0.6229410767555237, -0.6277620792388916, -0.5370515584945679, -0.8906794190406799, 0.3128304183483124, 1.9546644687652588, -0.2573355734348297, 1.5242815017700195, -0.49568620324134827, -1.5419710874557495, -1.634325385093689, 1.0311466455459595, 0.403812974691391, -0.8849207162857056, 0.21028469502925873, -0.32881027460098267, 0.06256147474050522, -0.07438059151172638, 1.0256783962249756, 1.3567019701004028, 0.7625951170921326, -0.12495902180671692, -0.9164972305297852, 0.19169186055660248, -0.0885922759771347, -0.5523847937583923, -1.790428638458252, -0.40257903933525085, -0.10283829271793365, 0.744164764881134, -1.1253302097320557, 1.7282599210739136, 0.9881330132484436, 1.8540809154510498, 0.9217122793197632, -0.4469163417816162, 1.3876432180404663, 0.1583091914653778, 1.9477901458740234, -0.5383824706077576, 0.7463392615318298, -0.3220892548561096, -1.1459141969680786, 0.767771303653717, -0.31940969824790955, -1.788139820098877, -0.8352383375167847, -0.8583170175552368, -0.15518155694007874, -0.7525684833526611, 0.9259445667266846, -0.3647884428501129, -1.5154809951782227, 0.270395427942276, -0.5091562271118164, 0.38743463158607483, -1.1693302392959595, 0.44653233885765076, 0.7283535599708557, -0.5871635675430298, 0.11230814456939697, -0.23668602108955383, -1.3456460237503052, -0.5308641791343689, 0.41818922758102417, 1.8990651369094849, -0.7417393326759338, 0.8813475966453552, 0.8680853843688965, -0.778255045413971, -0.07794088125228882, 0.13112519681453705, -0.11817660927772522, 0.6701063513755798, -1.1113468408584595, -0.4728250801563263, 1.3752068281173706, -0.3289283812046051, -0.5101346969604492, 1.4785563945770264, 0.7271810173988342, -0.9343052506446838, -0.038457080721855164, -0.35080453753471375, -0.7157542109489441, -0.07522673159837723, -1.654089331626892, -0.1545839011669159, 0.3748413622379303, -1.4330148696899414, -0.5945743322372437, -0.2135239839553833, 1.3290694952011108, -0.12076523900032043, 1.3348922729492188, -0.39491719007492065, -0.20449043810367584, -0.3660164773464203, -0.4209406077861786, 0.4178953766822815, -0.30718299746513367, -0.521390974521637, 0.23956796526908875, -0.8581520915031433, 0.3260878920555115, 1.5622518062591553, 0.3190110921859741, 0.12025977671146393, 0.616330623626709, 0.9982619285583496, 0.40475764870643616, -0.03446531668305397, -0.9339032173156738, -1.4520858526229858, 1.9593429565429688, -1.5440946817398071, 2.0018749237060547, 0.5214062929153442, -0.1810091733932495, -1.6961745023727417, -1.7455906867980957, 1.354746699333191, 1.2106249332427979, 2.28320050239563, 0.6807551980018616, 0.3147897720336914, -0.7950344681739807, -0.6395931839942932, 0.2335541546344757, -1.022506594657898, -0.771248996257782, 0.23526781797409058, 2.2442610263824463, 1.6044161319732666, -0.589564323425293, -0.15477633476257324, -0.9896008968353271, 1.3679685592651367, -0.25169479846954346, 0.4221169948577881, 1.9541130065917969, -0.4012003242969513, -1.2654733657836914, 1.2305699586868286, -2.408764362335205, 0.12041299045085907, 2.0778586864471436, 0.3374806046485901, 0.20859265327453613, -1.4915704727172852, -0.8163722157478333, -0.06448925286531448, -0.4962731599807739, -1.3156887292861938, 0.5797924399375916, -0.4375147521495819, -0.7570915818214417, -1.4582639932632446, 0.19489045441150665, -1.0231707096099854, -1.572389006614685, 0.3002965748310089, 1.8939076662063599, 1.9770265817642212, -0.8487805128097534, 1.5086170434951782, -0.08493809401988983, 0.18629001080989838, 1.2513442039489746, 1.0237501859664917, 2.9583349227905273, 1.961525797843933, -1.1064627170562744, 0.6847981214523315, -0.2071578949689865, -0.5298532843589783, 1.2370798587799072, -1.146698236465454, 1.2224247455596924, -0.048805732280015945, -1.041983962059021, -1.2146201133728027, 0.8466815948486328, 0.3961855173110962, 0.00033983029425144196, -0.43044978380203247, 1.389432430267334, 0.06748699396848679, 1.3491593599319458, 0.42989155650138855, -0.31073132157325745, 0.5934549570083618, -0.4387582540512085, -0.45553329586982727, 1.707170844078064, 0.23803289234638214, -1.4394654035568237, -2.2391700744628906, -0.3222939372062683, -0.7546882629394531, 0.013406445272266865, -0.5299944877624512, -0.8973667025566101, 1.7131599187850952, 0.48649662733078003, -1.1190011501312256, -0.21268817782402039, -0.42454925179481506, -0.6593958139419556, 2.711974859237671, -1.315463900566101, -0.346708744764328, -0.8139015436172485, -0.5636123418807983, 1.7374802827835083, -1.2417843341827393, -0.24900145828723907, -1.0082430839538574, -0.5440971255302429, -1.3903319835662842, -0.43439188599586487, 0.0525752529501915, -0.9771151542663574, 0.7298869490623474, 0.3784937858581543, -1.1518609523773193, -0.35271894931793213, -0.8873887062072754, 0.757911741733551, -0.034416574984788895, 0.3734547197818756, 1.9378902912139893, 0.37473130226135254, -0.3563864529132843, 0.7504564523696899, 1.208156704902649, 0.5561524629592896, -0.6967068910598755, 0.337156742811203, -0.6357821226119995, 0.28520864248275757, -1.2635972499847412, 0.24101592600345612, -2.998060464859009, 0.6666497588157654, 0.0025656986981630325, -0.03337986022233963, -0.07627714425325394, -1.3508176803588867, 1.1955941915512085, 2.5053348541259766, -1.1537456512451172, 0.5013504028320312, 0.2871549129486084, 1.4290729761123657, -1.4609943628311157, 0.3465452492237091, -0.5063577890396118, 2.058973789215088, 0.2967345416545868, 1.0520288944244385, -0.5372608304023743, -2.531747579574585, 0.49031510949134827, -1.204615592956543, -1.2864724397659302, 0.6615321040153503, -0.998134195804596, 0.05318160727620125, -1.4507521390914917, -0.16348673403263092, -1.0222101211547852, -1.113247036933899, 0.7926040291786194, 0.3703286647796631, 0.4492122530937195, -0.7103887796401978, 0.49906086921691895, -2.0978102684020996, -1.3575338125228882, -0.2735464870929718, -1.0091893672943115, 0.44060900807380676, -0.4369511008262634, 0.5891909599304199, -0.13075007498264313, 0.12719830870628357, 0.3592912256717682, 1.4987183809280396, 3.2469325065612793, 0.11073563247919083, 0.4108022153377533, -0.14797580242156982, -0.9475845098495483, 1.6087182760238647, 1.036239743232727, -0.10039898008108139, -0.6867178678512573, -1.0768542289733887, 1.2330814599990845, 1.7991029024124146, 0.9430943131446838, -0.02723143994808197, -0.6932839155197144, -0.4607158899307251, 0.07605631649494171, 0.06562627851963043, 0.4915754795074463, 0.8938233256340027, 0.09419945627450943, 0.0578249916434288, 1.4159536361694336, 1.1860584020614624, -0.5319052934646606, 0.2713533341884613, -0.8428114056587219, -0.47672557830810547, 0.44322100281715393, 0.3549521267414093, -0.008578460663557053, 0.32966217398643494, -0.7700154781341553, -0.16428662836551666, -0.17564484477043152, -1.003626823425293, -0.6090037822723389, -0.4383258819580078, -0.38754716515541077, 1.6436760425567627, 0.15644197165966034, -0.7525287866592407, -0.1268390715122223, -0.758834958076477, -0.010593337006866932, -1.026537299156189, 0.17868079245090485, -0.18921425938606262, -0.044875796884298325, -0.01777590811252594, 1.7530802488327026, -0.9372543096542358, -2.215857982635498, 0.10006094723939896, 0.2807154059410095, -0.2950228452682495, 0.17433089017868042, 1.495557188987732, 0.44949871301651, 1.393845796585083, 1.5213972330093384, 0.9251452684402466, -0.6480674147605896, -1.334963321685791, 0.7038829922676086, 0.7982867360115051, -1.3800090551376343, 0.8235543966293335, 0.020076896995306015, -0.4821673631668091, 0.6173028945922852, 1.2376939058303833, 0.47946837544441223, -1.903084397315979, 0.8130860924720764, -1.0419648885726929, 0.9901974201202393, 0.8029422163963318, 0.8001759052276611, 0.16898487508296967, 0.8939706087112427, -1.106339931488037, -1.2281495332717896, -0.7828014492988586, -0.7553823590278625, 1.9840035438537598, -0.3233315050601959, 0.5511504411697388, -0.21678344905376434, -1.001656413078308, -0.10994350165128708, 0.5861332416534424, 0.32630690932273865, -0.3571949303150177, 0.6850366592407227, -0.7104240655899048, -1.2302311658859253, -1.3886679410934448, -0.63129723072052, -1.1167770624160767, -1.01264226436615, 1.1025381088256836, 0.8074389100074768, 0.24569466710090637, 1.8690344095230103, 0.6478713750839233, 0.24458885192871094, -2.679074287414551, 0.8309366703033447, 0.23291318118572235, 0.008588560856878757, 0.7453892230987549, 0.34255507588386536, 0.9481304287910461, -0.07956818491220474, 0.5938106775283813, -2.3748362064361572, 2.4711339473724365, -0.39918994903564453, 0.675063967704773, 0.03603214770555496, 0.002469731494784355, 1.160333275794983, 0.58213210105896, 0.5819897651672363, -1.2224794626235962, 0.6924865245819092, -0.5484271049499512, 1.2503883838653564, 0.9189884662628174, -0.8890368342399597, 0.007026744075119495, 1.3475525379180908, 0.48955056071281433, -0.6276600956916809, -0.9038054943084717, -0.9401574730873108, 0.8849748373031616, 1.7364088296890259, -0.14147411286830902, 0.022271517664194107, 0.8200529217720032, 0.6004968285560608, -1.308588981628418, -0.0864274874329567, -0.7769545912742615, -0.6457907557487488, 1.664263129234314, 2.0920064449310303, -0.07669029384851456, -0.18986776471138, -0.5027099251747131, -1.2074352502822876, 0.7400274276733398, 0.09066958725452423, 0.1677941232919693, 0.5542394518852234, -0.7706550359725952, 1.1359277963638306, 0.7594209909439087, 0.7636529207229614, 0.12002091109752655, 0.3745588958263397, 0.43263229727745056, -0.2996295094490051, -1.1560750007629395, -0.1700235903263092, -1.084385871887207, -2.542581796646118, 0.19804993271827698, -0.19851931929588318, -1.468151330947876, 0.07829277962446213, -1.0303332805633545, 0.8855812549591064, -0.6023076176643372, -1.1321580410003662, -1.3998130559921265, 0.0062780603766441345, -0.11195473372936249, 0.7942579984664917, -1.8013380765914917, -0.12086135149002075, 1.24185311794281, 0.9293015599250793, -0.7712844014167786, 1.168158769607544, 0.32218948006629944, 1.0887291431427002, 0.7308692932128906, -0.446287602186203, 0.49309563636779785, -0.09226684272289276, -1.2585469484329224, 0.5795191526412964, 1.1080187559127808, 0.034200433641672134, 1.596099615097046, -0.5687543153762817, -0.08566994220018387, 0.34014296531677246, -0.6449344754219055, -0.5786471366882324, -0.4716135263442993, 0.638166069984436, 0.06864028424024582, -0.9006075263023376, 0.003931046463549137, -0.0022395113483071327, -0.1366104930639267, 0.1912776231765747, -1.5308619737625122, -0.2912173867225647, -0.45696401596069336, -0.4935508072376251, -1.3294405937194824, -0.02925650030374527, 1.4219462871551514, -0.6855204701423645, -0.02757875621318817, 0.479767769575119, 0.5057231783866882, 0.39899522066116333, 0.595719039440155, -0.7082774639129639, -0.3258824050426483, -0.2702587842941284, -0.340853750705719, 0.38030368089675903, 1.2442452907562256, -0.39246004819869995, -0.9244548082351685, 0.5778186321258545, -0.2337150126695633, 0.04289254918694496, 1.829585075378418, -0.030254356563091278, -0.8051109313964844, 0.26210924983024597, -0.8439030647277832, 2.0945537090301514, 1.6609487533569336, 1.4666239023208618, -0.17021587491035461, -0.8558714985847473, 0.559840738773346, -0.3299213647842407, -0.37784382700920105, 0.7020159363746643, 0.49725353717803955, -0.2753674387931824, -1.250189185142517, 0.6435093879699707, 1.185921549797058, -0.7778463959693909, -0.7693933248519897, 0.05574234575033188, -0.6229392886161804, 1.0134203433990479, 0.6965801119804382, 0.38993239402770996, 0.42532920837402344, 1.7855455875396729, 0.825332522392273, -0.38150554895401, 0.6510103940963745, 0.5488706231117249, -0.013182196766138077, -2.0270590782165527, -1.250584602355957, 0.35857197642326355, -0.6043553948402405, -1.564833641052246, 1.3696590662002563, -1.0082433223724365, -0.9750869870185852, 0.613681972026825, 0.13945764303207397, 1.5600016117095947, 0.5085920095443726, 1.4900859594345093, 1.9777464866638184, 0.9079854488372803, 0.38477542996406555, 1.3580726385116577, -0.08846152573823929, -0.46918201446533203, 1.9699825048446655, -0.40623101592063904, 0.2968843877315521, 1.1055141687393188, -0.25684213638305664, -0.9245936274528503, -0.8577274084091187, -1.2651638984680176, -0.7149631977081299, 1.0755598545074463, 0.13276797533035278, -1.319130778312683, 0.26800593733787537, 1.5536326169967651, 0.06043598800897598, -0.30586808919906616, 0.6453075408935547, 0.5128762722015381, -0.8002947568893433, -0.015430779196321964, -0.9906044006347656, 0.5189732313156128, -0.3630254566669464, -0.5506346225738525, 0.3615655303001404, 0.4808349907398224, 1.2126781940460205, -0.0813346728682518, 0.17570741474628448, 1.2578151226043701, -1.4878017902374268, 1.4005036354064941, -0.7524746060371399, 0.22959841787815094, -2.267664670944214, 1.3569910526275635, -0.6101284027099609, 1.9939157962799072, -2.8008153438568115, 0.5041662454605103, -0.6292918920516968, -0.4765062630176544, 0.37903106212615967, -0.44717374444007874, 0.05719901621341705, -0.09557156264781952, -1.1293706893920898, -0.00036943238228559494, -0.6876243352890015, 0.4988579750061035, 1.0731011629104614, 1.2104535102844238, -0.9925811290740967, -0.2919791638851166, -1.7441465854644775, -0.12001123279333115, -0.587909996509552, 0.42506834864616394, -2.1939077377319336, -0.30242806673049927, -1.9539767503738403, -2.1827244758605957, -1.2207237482070923, -0.8068355917930603, 1.174548864364624, -0.06645487993955612, -0.8964664340019226, 1.225189447402954, -0.2884579598903656, -1.807951807975769, 1.0935195684432983, -2.168363571166992 ]
https://github.com/huggingface/datasets/issues/3191
Dataset viewer issue for '*compguesswhat*'
```python >>> import datasets >>> dataset = datasets.load_dataset('compguesswhat', name='compguesswhat-original',split='train', streaming=True) >>> next(iter(dataset)) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 497, in __iter__ for key, example in self._iter(): File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 494, in _iter yield from ex_iterable File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 87, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/compguesswhat/4d08b9e0a8d1cf036c9626c93be4a759fdd9fcce050ea503ea14b075e830c799/compguesswhat.py", line 251, in _generate_examples with gzip.open(filepath) as in_file: File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/gzip.py", line 58, in open binary_file = GzipFile(filename, gz_mode, compresslevel) File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/gzip.py", line 173, in __init__ fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'zip://compguesswhat-original/0.2.0/compguesswhat.train.jsonl.gz::https://www.dropbox.com/s/l0nc13udml6vs0w/compguesswhat-original.zip?dl=1' ``` It's an issue with the streaming mode. Note that normal mode is used by the dataset viewer when streaming is failing, but only for the smallest datasets. This dataset is above the limit, hence the error. Same case as https://github.com/huggingface/datasets/issues/3186#issuecomment-1096549774.
## Dataset viewer issue for '*compguesswhat*' **Link:** https://huggingface.co/datasets/compguesswhat File not found Am I the one who added this dataset ? No
1,131
137
Dataset viewer issue for '*compguesswhat*' ## Dataset viewer issue for '*compguesswhat*' **Link:** https://huggingface.co/datasets/compguesswhat File not found Am I the one who added this dataset ? No ```python >>> import datasets >>> dataset = datasets.load_dataset('compguesswhat', name='compguesswhat-original',split='train', streaming=True) >>> next(iter(dataset)) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 497, in __iter__ for key, example in self._iter(): File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 494, in _iter yield from ex_iterable File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 87, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/compguesswhat/4d08b9e0a8d1cf036c9626c93be4a759fdd9fcce050ea503ea14b075e830c799/compguesswhat.py", line 251, in _generate_examples with gzip.open(filepath) as in_file: File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/gzip.py", line 58, in open binary_file = GzipFile(filename, gz_mode, compresslevel) File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/gzip.py", line 173, in __init__ fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'zip://compguesswhat-original/0.2.0/compguesswhat.train.jsonl.gz::https://www.dropbox.com/s/l0nc13udml6vs0w/compguesswhat-original.zip?dl=1' ``` It's an issue with the streaming mode. Note that normal mode is used by the dataset viewer when streaming is failing, but only for the smallest datasets. This dataset is above the limit, hence the error. Same case as https://github.com/huggingface/datasets/issues/3186#issuecomment-1096549774.
[ -1.1956356763839722, -0.9512522220611572, -0.7212889194488525, 1.3971904516220093, -0.15875674784183502, -1.2568542957305908, 0.10408779233694077, -1.0211855173110962, 1.591296911239624, -0.7029871344566345, 0.13899047672748566, -1.7139205932617188, -0.14498084783554077, -0.5125302076339722, -0.6750755906105042, -0.8902522921562195, -0.3395126760005951, -0.9370387196540833, 0.9842742085456848, 2.48225474357605, 1.2867833375930786, -1.3439832925796509, 2.8259165287017822, 0.6353520750999451, -0.25046253204345703, -1.0160781145095825, 0.5531647801399231, 0.050137393176555634, -1.2259082794189453, -0.45369261503219604, -0.9714831113815308, 0.04182622209191322, -0.5656116008758545, -0.4162246882915497, 0.17802436649799347, 0.4376983940601349, -0.26158496737480164, -0.1844600886106491, -0.5450997948646545, -0.7293461561203003, 0.507149875164032, -0.36014971137046814, 0.9593781232833862, -0.3141932189464569, 1.7651180028915405, -0.6059247851371765, 0.3249213993549347, 0.6865670084953308, 1.1974737644195557, 0.22545042634010315, 0.009494843892753124, 0.3076779544353485, 0.27130576968193054, -0.019702384248375893, 0.49319159984588623, 1.2911384105682373, 0.5686082243919373, 0.4840705692768097, 0.6039751172065735, -2.2660670280456543, 1.2852634191513062, -0.8834407925605774, 0.24798204004764557, 1.3747013807296753, -0.9034753441810608, 0.41623568534851074, -1.8986833095550537, -0.08458340913057327, 0.6362764239311218, -2.399873733520508, 0.2583884000778198, -1.2768747806549072, -0.6030319929122925, 0.9531534910202026, 0.28033962845802307, -1.2446191310882568, 0.17871373891830444, -0.5518015623092651, 1.1029479503631592, 0.44590339064598083, 1.1149653196334839, -1.7809780836105347, -0.07976238429546356, -0.12463941425085068, 0.13340476155281067, -1.3345659971237183, -1.6799242496490479, 0.6064295172691345, 0.5638846755027771, 0.727839469909668, -0.11565836519002914, 0.9884851574897766, -1.0549579858779907, 0.769501805305481, -0.973801851272583, -1.576397180557251, -1.35161292552948, -2.3348569869995117, -2.249844551086426, 0.8369095325469971, -0.5083277225494385, -0.5178853273391724, 1.9446309804916382, -1.0019557476043701, -1.7427085638046265, 1.1338646411895752, 0.34533900022506714, 0.0977175235748291, 2.4476590156555176, 0.2784115672111511, -0.7858679890632629, 0.44938021898269653, -0.6969715356826782, 0.8543419241905212, -0.2141319215297699, 1.3748018741607666, 0.5533762574195862, -0.9691812992095947, 1.6352530717849731, -0.48570728302001953, 0.5009859204292297, -0.6648799180984497, -0.543425440788269, -0.8008872270584106, 0.24768416583538055, 1.876774549484253, -0.33043065667152405, 1.604030966758728, -0.2716124653816223, -1.5871453285217285, -1.484119176864624, 0.8022305965423584, 0.534285843372345, -0.9574758410453796, -0.006417022552341223, -0.5120152235031128, 0.1876913160085678, -0.00013367924839258194, 1.0887809991836548, 1.155631422996521, 0.7259325385093689, -0.2893889844417572, -0.9048747420310974, 0.22923611104488373, -0.06669440865516663, -0.6118497252464294, -1.870937466621399, -0.29262304306030273, 0.2774290442466736, 0.6723783612251282, -1.2816784381866455, 1.6749212741851807, 0.869560956954956, 1.9831829071044922, 0.9417906403541565, -0.4199051260948181, 1.4919055700302124, -0.012830779887735844, 1.80060875415802, -0.5379656553268433, 0.6344085335731506, -0.2625299394130707, -1.1048659086227417, 0.8734501600265503, -0.3603235185146332, -1.9980812072753906, -0.8530200123786926, -0.8044089674949646, -0.1818816214799881, -0.7712697386741638, 0.8859055638313293, -0.32962343096733093, -1.481027603149414, 0.1569056510925293, -0.6606386303901672, 0.1942863017320633, -1.257568597793579, 0.19935566186904907, 0.707977831363678, -0.6727942228317261, -0.04173342511057854, -0.30552464723587036, -1.3184614181518555, -0.5062075853347778, 0.2967011034488678, 2.0252366065979004, -0.5679300427436829, 0.9777884483337402, 0.9915271997451782, -0.7429233193397522, 0.11695874482393265, 0.25275394320487976, -0.2962072789669037, 0.8298032879829407, -1.1915417909622192, -0.4249732196331024, 1.095866322517395, -0.19142398238182068, -0.6552532911300659, 1.4358361959457397, 0.7756635546684265, -1.103846788406372, -0.3667353391647339, -0.23076064884662628, -0.7687689661979675, -0.020497366786003113, -1.539068341255188, -0.21875104308128357, 0.3345268964767456, -1.4514987468719482, -0.4130518138408661, -0.23956742882728577, 1.3616489171981812, -0.20563676953315735, 1.3940043449401855, -0.317135751247406, -0.1856352984905243, -0.30736836791038513, -0.5376489162445068, 0.16666075587272644, -0.26550427079200745, -0.574724555015564, 0.2284422218799591, -0.9025579690933228, 0.24726904928684235, 1.5411326885223389, 0.44784560799598694, 0.008345342241227627, 0.47493696212768555, 1.1194629669189453, 0.4354913830757141, -0.10139879584312439, -0.8365938663482666, -1.5686633586883545, 1.9886343479156494, -1.5139877796173096, 1.8772609233856201, 0.7581509351730347, -0.09088023751974106, -1.7617497444152832, -1.8775330781936646, 1.245821237564087, 1.199433445930481, 2.4601123332977295, 0.5709325075149536, 0.41791173815727234, -0.7060901522636414, -0.7764445543289185, 0.33825406432151794, -0.984960675239563, -0.6787977814674377, 0.22604674100875854, 2.349362373352051, 1.7879782915115356, -0.571956217288971, -0.2497567981481552, -0.9203359484672546, 1.231994390487671, -0.2215907871723175, 0.23789532482624054, 2.051290273666382, -0.28328001499176025, -1.128272533416748, 1.2708109617233276, -2.3295159339904785, 0.22533193230628967, 2.0120890140533447, 0.29789865016937256, 0.15682511031627655, -1.405155897140503, -0.6560260653495789, -0.312550812959671, -0.41260039806365967, -1.2772563695907593, 0.5597701668739319, -0.2919486463069916, -0.874405562877655, -1.4933581352233887, 0.06277896463871002, -1.1409451961517334, -1.6920979022979736, 0.37134605646133423, 1.953271746635437, 2.1828091144561768, -0.8383715152740479, 1.3511340618133545, -0.30091747641563416, 0.026044297963380814, 1.2194520235061646, 1.3193960189819336, 3.066561698913574, 1.7760099172592163, -1.251584529876709, 0.7330567836761475, -0.21569833159446716, -0.4484880268573761, 1.1956406831741333, -1.1049447059631348, 1.018229603767395, -0.26984357833862305, -1.302298903465271, -1.168519139289856, 1.0169677734375, 0.4551423490047455, -0.05165928602218628, -0.538289487361908, 1.2373669147491455, 0.015153315849602222, 1.3456571102142334, 0.6068674921989441, -0.435820996761322, 0.5418676733970642, -0.4786277711391449, -0.5442273020744324, 1.6244914531707764, 0.12262647598981857, -1.5683832168579102, -2.3404693603515625, -0.21925218403339386, -0.8718565702438354, -0.0054793087765574455, -0.5935946702957153, -1.1146403551101685, 1.6516352891921997, 0.40168312191963196, -1.1972222328186035, -0.2784290611743927, -0.35823994874954224, -0.51543790102005, 2.54060697555542, -1.2749816179275513, -0.15799525380134583, -0.9056635499000549, -0.48093265295028687, 1.6635180711746216, -1.11873197555542, -0.21822737157344818, -0.9573948979377747, -0.6821687817573547, -1.3842564821243286, -0.4756404161453247, 0.04188377410173416, -0.8935289978981018, 0.7452415823936462, 0.14945362508296967, -1.0836894512176514, -0.21369501948356628, -0.8794843554496765, 0.9799795746803284, -0.1409205198287964, 0.22892402112483978, 1.8521122932434082, 0.32604262232780457, -0.38904404640197754, 0.7027495503425598, 1.2046685218811035, 0.5818711519241333, -0.6457129716873169, 0.04131843522191048, -0.7475186586380005, 0.34008413553237915, -1.41049063205719, 0.1521129161119461, -2.9953386783599854, 0.7495139837265015, -0.14197291433811188, -0.034929536283016205, -0.02964712679386139, -1.3067036867141724, 1.1623742580413818, 2.551091194152832, -1.191640019416809, 0.4966784715652466, 0.46331116557121277, 1.1801412105560303, -1.5961430072784424, 0.2702970802783966, -0.5092684030532837, 2.106605291366577, 0.18141010403633118, 1.3025870323181152, -0.5561122894287109, -2.177483320236206, 0.6927585005760193, -1.1768245697021484, -1.047574520111084, 0.7955689430236816, -0.9286454319953918, 0.274244487285614, -1.4929994344711304, -0.20205307006835938, -0.905495822429657, -1.2790549993515015, 0.8013299107551575, 0.034230317920446396, 0.38039925694465637, -0.5163829326629639, 0.42036694288253784, -2.150189161300659, -1.3928117752075195, -0.2869606614112854, -1.037418246269226, 0.5876421928405762, -0.353985458612442, 0.6370435357093811, -0.06924664974212646, 0.07197494804859161, 0.2996227443218231, 1.377881646156311, 3.4123458862304688, 0.19896140694618225, 0.1755296289920807, -0.08904057741165161, -1.0136473178863525, 1.4355374574661255, 0.9695743918418884, -0.08452913165092468, -0.582298755645752, -0.9865914583206177, 1.3625030517578125, 2.012033700942993, 1.1034941673278809, 0.1803511083126068, -0.872078537940979, -0.7016542553901672, 0.08511177450418472, 0.2067355215549469, 0.5119687914848328, 0.9303156733512878, -0.10549984872341156, 0.11008493602275848, 1.4305208921432495, 1.201379656791687, -0.3115725517272949, 0.4579755663871765, -0.9372342228889465, -0.42777061462402344, 0.459188848733902, 0.12125631421804428, 0.009627322666347027, 0.4927351474761963, -1.0463695526123047, -0.26142948865890503, -0.2799088954925537, -0.8963029980659485, -0.7199835181236267, -0.3804885447025299, -0.3647821545600891, 1.5881322622299194, 0.04824909195303917, -0.40771883726119995, 0.06715516746044159, -0.6952553987503052, -0.16521337628364563, -1.1162734031677246, 0.2292969971895218, -0.11786205321550369, -0.10721024870872498, -0.18881292641162872, 1.6669840812683105, -0.8814640045166016, -2.0915262699127197, 0.12587270140647888, 0.38933151960372925, -0.41619056463241577, 0.1322712004184723, 1.7751035690307617, 0.5319958329200745, 1.4210199117660522, 1.2953346967697144, 0.9889546036720276, -0.5483648777008057, -1.203463077545166, 0.6393691897392273, 0.9372267127037048, -1.3148990869522095, 0.9417632222175598, -0.21911942958831787, -0.5092467665672302, 0.6441778540611267, 1.39579176902771, 0.41957399249076843, -1.9827944040298462, 0.9366942048072815, -0.9473656415939331, 0.7134150266647339, 0.670556902885437, 0.9172581434249878, 0.21958929300308228, 0.9101700186729431, -1.3026916980743408, -1.1310824155807495, -0.7419971227645874, -0.5549946427345276, 1.8975610733032227, -0.1263085901737213, 0.4826420247554779, -0.18887975811958313, -1.1584692001342773, -0.04903875291347504, 0.7858020067214966, 0.38368988037109375, -0.3655356466770172, 0.9456191658973694, -0.6613225340843201, -0.9634003639221191, -1.2962448596954346, -0.41585463285446167, -0.9558447599411011, -0.8361154198646545, 1.0137488842010498, 0.7798373103141785, 0.4558578431606293, 1.9476816654205322, 0.6054115295410156, 0.32563456892967224, -2.638284921646118, 0.8865099549293518, 0.30870023369789124, -0.08442185074090958, 0.9530743360519409, 0.22296451032161713, 1.1782567501068115, 0.011400162242352962, 0.538720428943634, -2.26297664642334, 2.119903564453125, -0.17338426411151886, 0.7261793613433838, 0.047158900648355484, -0.19063502550125122, 1.127769112586975, 0.5391827821731567, 0.5927996039390564, -1.1206711530685425, 0.8257990479469299, -0.5556066632270813, 1.020115613937378, 0.9984183311462402, -0.8836386799812317, 0.08096639811992645, 1.3364293575286865, 0.4473629593849182, -0.43605029582977295, -0.9470956325531006, -0.7078673839569092, 0.9872666597366333, 1.7297638654708862, -0.07629184424877167, 0.03820044547319412, 0.8713728785514832, 0.5916462540626526, -1.1934115886688232, -0.03427644819021225, -0.6741015315055847, -0.6870409250259399, 1.7134639024734497, 1.9923374652862549, -0.11756979674100876, -0.2515440285205841, -0.6903616189956665, -1.26229989528656, 0.7617207765579224, -0.05243893712759018, 0.09643686562776566, 0.7302939891815186, -0.6727662086486816, 1.1784663200378418, 0.6231368184089661, 1.023787260055542, 0.015427161939442158, 0.3324361741542816, 0.4411681294441223, -0.3303419053554535, -1.1077758073806763, -0.37719595432281494, -1.137003779411316, -2.5429422855377197, 0.45080089569091797, -0.2899080216884613, -1.4184157848358154, 0.12468064576387405, -1.0122852325439453, 0.9529656171798706, -0.593869686126709, -1.1677441596984863, -1.4578726291656494, 0.34107884764671326, -0.2433474063873291, 0.9485129714012146, -1.6737045049667358, -0.22864443063735962, 1.2529394626617432, 0.9416982531547546, -0.5796654224395752, 0.950015664100647, 0.2856115400791168, 0.9937343597412109, 0.7652443647384644, -0.37326985597610474, 0.5734208822250366, 0.0832572728395462, -1.3446106910705566, 0.43113940954208374, 1.2600033283233643, 0.20985576510429382, 1.389262318611145, -0.40461984276771545, -0.0005455324426293373, 0.4837495982646942, -0.5900021195411682, -0.5549310445785522, -0.3992897570133209, 0.7073677182197571, 0.06845168769359589, -1.0575522184371948, -0.14168834686279297, -0.07658681273460388, -0.27209118008613586, 0.21724185347557068, -1.492649793624878, -0.34160667657852173, -0.43980512022972107, -0.36339467763900757, -1.3243356943130493, -0.033563461154699326, 1.311333417892456, -0.8423186540603638, -0.31272947788238525, 0.4920550584793091, 0.4489280581474304, 0.5533562302589417, 0.5411524772644043, -0.794037401676178, -0.29667067527770996, -0.3361285626888275, -0.32073503732681274, 0.18876110017299652, 1.1915932893753052, -0.06889241188764572, -1.0919647216796875, 0.6452620029449463, -0.30599772930145264, 0.09681442379951477, 1.9237945079803467, 0.0009128469973802567, -0.7095272541046143, 0.27645614743232727, -0.6951982378959656, 1.830358624458313, 1.6875466108322144, 1.3020881414413452, -0.12457801401615143, -0.8294298648834229, 0.5351607799530029, -0.24428702890872955, -0.3694952428340912, 0.8417828679084778, 0.47526121139526367, -0.16739264130592346, -1.5000733137130737, 0.6374623775482178, 1.254065990447998, -0.8990116119384766, -0.6810376048088074, 0.07603634893894196, -0.8952010273933411, 1.2242714166641235, 0.5877277255058289, 0.3307342231273651, 0.25923845171928406, 1.6395785808563232, 0.6752874255180359, -0.4718570113182068, 0.48259979486465454, 0.510904848575592, -0.19693507254123688, -2.1148877143859863, -1.0854988098144531, 0.29699933528900146, -0.3192382752895355, -1.4679011106491089, 1.3301630020141602, -1.0667927265167236, -0.9068203568458557, 0.5107389092445374, 0.1632642149925232, 1.3286454677581787, 0.34102901816368103, 1.7379026412963867, 2.1053383350372314, 0.8963990211486816, 0.2957879304885864, 1.291987657546997, -0.10985001176595688, -0.39894986152648926, 1.854299545288086, -0.4012143015861511, 0.533318281173706, 0.9691563248634338, -0.3515878915786743, -1.1380069255828857, -0.7532777190208435, -1.1988246440887451, -0.6616067886352539, 1.0934033393859863, 0.11812105029821396, -1.1065324544906616, 0.19758930802345276, 1.5790303945541382, 0.12753631174564362, -0.23795828223228455, 0.638954222202301, 0.4249487519264221, -0.7231213450431824, -0.09956380724906921, -0.9291032552719116, 0.4885269105434418, -0.11415094137191772, -0.2839699387550354, 0.14730431139469147, 0.5753613710403442, 1.312293529510498, -0.04133903607726097, 0.1351921409368515, 1.2134568691253662, -1.3451727628707886, 1.5092402696609497, -0.6550754308700562, 0.3079850673675537, -2.4999799728393555, 1.3250144720077515, -0.8075814843177795, 1.9265284538269043, -2.536367177963257, 0.44241008162498474, -0.5376083254814148, -0.41585537791252136, 0.24706168472766876, -0.401434987783432, 0.18620286881923676, -0.09253374487161636, -1.0063183307647705, -0.059680018573999405, -0.738297164440155, 0.5834444165229797, 1.1898579597473145, 1.3913075923919678, -1.137694001197815, -0.23446112871170044, -1.8060532808303833, -0.15882034599781036, -0.7686734199523926, 0.22946523129940033, -1.97383713722229, -0.16277951002120972, -1.94717276096344, -2.3723011016845703, -1.3989430665969849, -0.8419088125228882, 1.0887596607208252, 0.1966322362422943, -1.019142985343933, 1.2038437128067017, -0.36491990089416504, -1.81111478805542, 1.2181724309921265, -2.2231802940368652 ]
https://github.com/huggingface/datasets/issues/3191
Dataset viewer issue for '*compguesswhat*'
There is an issue with the URLs of their data files: https://www.dropbox.com/s/l0nc13udml6vs0w/compguesswhat-original.zip?dl=1 > Dropbox Error: That didn't work for some reason Error reported to their repo: - https://github.com/CompGuessWhat/compguesswhat.github.io/issues/1
## Dataset viewer issue for '*compguesswhat*' **Link:** https://huggingface.co/datasets/compguesswhat File not found Am I the one who added this dataset ? No
1,131
28
Dataset viewer issue for '*compguesswhat*' ## Dataset viewer issue for '*compguesswhat*' **Link:** https://huggingface.co/datasets/compguesswhat File not found Am I the one who added this dataset ? No There is an issue with the URLs of their data files: https://www.dropbox.com/s/l0nc13udml6vs0w/compguesswhat-original.zip?dl=1 > Dropbox Error: That didn't work for some reason Error reported to their repo: - https://github.com/CompGuessWhat/compguesswhat.github.io/issues/1
[ -1.2021222114562988, -1.0894232988357544, -0.8547630906105042, 1.4378511905670166, -0.18267469108104706, -1.2248207330703735, 0.11819412559270859, -0.9646920561790466, 1.5706435441970825, -0.5758435726165771, 0.24780148267745972, -1.6743496656417847, -0.0555340051651001, -0.6373129487037659, -0.6752582788467407, -0.9431266784667969, -0.38489142060279846, -0.7185567617416382, 1.0219693183898926, 2.468569755554199, 1.2108064889907837, -1.4461661577224731, 2.866351366043091, 0.7233116030693054, -0.21303169429302216, -1.1195000410079956, 0.5984382629394531, 0.15972819924354553, -1.194805383682251, -0.5251397490501404, -0.9194217324256897, 0.01858726143836975, -0.6044320464134216, -0.3711390197277069, 0.14239704608917236, 0.596866250038147, -0.14296625554561615, -0.16714629530906677, -0.479286789894104, -0.7496646642684937, 0.5035091638565063, -0.43058550357818604, 0.7589981555938721, -0.38990911841392517, 1.7773395776748657, -0.5754042267799377, 0.22065627574920654, 0.6117348670959473, 1.2604711055755615, 0.2122618705034256, -0.06139398738741875, 0.22930003702640533, 0.45056575536727905, -0.09400789439678192, 0.3390466272830963, 1.2278273105621338, 0.5783107280731201, 0.6069610714912415, 0.617132306098938, -2.1663966178894043, 1.3382385969161987, -0.9255310297012329, 0.3045680820941925, 1.4048124551773071, -1.0727449655532837, 0.4529908299446106, -1.903600811958313, -0.09799651056528091, 0.5611088871955872, -2.4206273555755615, 0.16402240097522736, -1.1897716522216797, -0.7074679136276245, 0.9803594350814819, 0.31121987104415894, -1.329992413520813, 0.14524495601654053, -0.5351674556732178, 1.163441777229309, 0.47062790393829346, 1.0932533740997314, -1.6860995292663574, -0.10057350248098373, -0.15980327129364014, -0.06290298700332642, -1.3968167304992676, -1.4366952180862427, 0.5569626688957214, 0.5853765606880188, 0.7053748369216919, -0.1410951167345047, 0.8077715039253235, -1.0325863361358643, 0.9060355424880981, -0.9995098114013672, -1.5277129411697388, -1.3856841325759888, -2.348897695541382, -2.2599611282348633, 0.9172835350036621, -0.43286368250846863, -0.47563880681991577, 1.833899736404419, -0.8402857184410095, -1.8355518579483032, 1.170353651046753, 0.32019755244255066, 0.11726272851228714, 2.3655245304107666, 0.3246440291404724, -0.7568739652633667, 0.3533182144165039, -0.7833700180053711, 0.975830078125, -0.35209423303604126, 1.5462828874588013, 0.539512038230896, -0.9117596745491028, 1.6792672872543335, -0.49993616342544556, 0.4688803255558014, -0.609348714351654, -0.6485443711280823, -0.7707716226577759, 0.2952668070793152, 1.9340596199035645, -0.3395225703716278, 1.6497423648834229, -0.4162972867488861, -1.532082200050354, -1.438178539276123, 0.7615453600883484, 0.5570914149284363, -0.9787981510162354, 0.03436632454395294, -0.3440440595149994, 0.08545363694429398, -0.03726066276431084, 1.0534753799438477, 1.1196693181991577, 0.8203884363174438, -0.42246127128601074, -0.8398507237434387, 0.26457449793815613, 0.10194617509841919, -0.6590068340301514, -1.8235571384429932, -0.3062495291233063, 0.3024861216545105, 0.6302522420883179, -1.4257397651672363, 1.5712982416152954, 0.8799353837966919, 2.046241521835327, 0.8489465117454529, -0.4383924901485443, 1.3794814348220825, -0.12002558261156082, 1.839009404182434, -0.7162595987319946, 0.6861382126808167, -0.1785588413476944, -0.9592284560203552, 0.8210408687591553, -0.34333938360214233, -2.0679264068603516, -0.9189844131469727, -0.9264069199562073, -0.21352238953113556, -0.7058010697364807, 0.9490138292312622, -0.3812367916107178, -1.3837053775787354, 0.10880615562200546, -0.7116506695747375, 0.22733598947525024, -1.298210620880127, 0.19706951081752777, 0.8225807547569275, -0.5928085446357727, 0.05363030359148979, -0.2676944434642792, -1.227549433708191, -0.5533112287521362, 0.2961725890636444, 1.9638792276382446, -0.6934682130813599, 1.0127414464950562, 0.8719744086265564, -0.689570426940918, 0.09631335735321045, 0.4135844111442566, -0.3494264483451843, 0.8859952688217163, -1.0759248733520508, -0.5767295956611633, 0.9571154713630676, -0.026400074362754822, -0.5893175005912781, 1.5207693576812744, 0.9301584362983704, -0.9414364695549011, -0.39409327507019043, -0.223293736577034, -0.7331154942512512, -0.04502258077263832, -1.5136200189590454, -0.3172587752342224, 0.15772278606891632, -1.4642081260681152, -0.6135427355766296, -0.32359975576400757, 1.3046481609344482, -0.2382442206144333, 1.2758703231811523, -0.2551358938217163, -0.33720335364341736, -0.4025057554244995, -0.46551913022994995, 0.1333041787147522, -0.3857244849205017, -0.6695541143417358, 0.25550028681755066, -0.9628599882125854, 0.3184575140476227, 1.5488771200180054, 0.458393931388855, -0.0015907371416687965, 0.5491111278533936, 1.036612868309021, 0.4218137860298157, -0.22161157429218292, -0.7958683967590332, -1.4275239706039429, 2.006138563156128, -1.4674869775772095, 1.86175537109375, 0.8121879696846008, -0.15951858460903168, -1.7258936166763306, -1.9291889667510986, 1.2861199378967285, 1.3048516511917114, 2.4310832023620605, 0.6737580895423889, 0.40982741117477417, -0.8995506167411804, -0.7659652233123779, 0.12191727012395859, -1.1417622566223145, -0.7482286691665649, 0.07456605136394501, 2.3447375297546387, 1.8718624114990234, -0.6507962942123413, -0.16058288514614105, -1.1649888753890991, 1.2744437456130981, -0.071068175137043, 0.11463004350662231, 2.0004870891571045, -0.26783114671707153, -1.2051160335540771, 1.0479966402053833, -2.232499599456787, 0.12796194851398468, 1.9399462938308716, 0.3414345979690552, 0.10586194694042206, -1.5039761066436768, -0.7062105536460876, -0.2388395220041275, -0.3813391625881195, -1.123397707939148, 0.5337806344032288, -0.20647430419921875, -0.9946786165237427, -1.5243613719940186, 0.054892655462026596, -1.12729012966156, -1.6982616186141968, 0.6159372329711914, 1.9487851858139038, 2.0329973697662354, -0.7546812891960144, 1.5263313055038452, -0.3303793966770172, -0.023985210806131363, 1.2698643207550049, 1.1496648788452148, 3.024618625640869, 1.8227726221084595, -1.1071058511734009, 0.7321568727493286, -0.17631895840168, -0.36344513297080994, 1.13870108127594, -0.9668651223182678, 1.0667988061904907, -0.24303732812404633, -1.1721101999282837, -1.2359700202941895, 0.894044816493988, 0.5042835474014282, -0.020121976733207703, -0.5019237399101257, 1.170465350151062, 0.12177474051713943, 1.3585965633392334, 0.45560240745544434, -0.35408440232276917, 0.5918897390365601, -0.4100213348865509, -0.40220898389816284, 1.5139095783233643, 0.06359731405973434, -1.5876778364181519, -2.2771692276000977, -0.15739716589450836, -0.8007088899612427, -0.0971846953034401, -0.6403498649597168, -1.2169743776321411, 1.759198784828186, 0.6471150517463684, -1.3601772785186768, -0.3101712763309479, -0.4147953391075134, -0.6559315919876099, 2.6252150535583496, -1.4055088758468628, -0.2894267439842224, -0.8915322422981262, -0.32017067074775696, 1.8274165391921997, -1.1173694133758545, -0.15603089332580566, -0.9187715649604797, -0.7781499028205872, -1.4161015748977661, -0.48882216215133667, -0.0409802608191967, -0.8173311352729797, 0.7950670719146729, -0.04868292436003685, -0.9689954519271851, -0.22421056032180786, -0.7342431545257568, 0.9149519801139832, -0.14276567101478577, 0.18446528911590576, 1.963308334350586, 0.4646896421909332, -0.3009202778339386, 0.7219522595405579, 1.2134746313095093, 0.5851933360099792, -0.6541103720664978, 0.16916601359844208, -0.6421074271202087, 0.31576815247535706, -1.3376253843307495, 0.1599845588207245, -2.988699436187744, 0.6952784657478333, -0.1215633749961853, -0.09455430507659912, -0.012932168319821358, -1.4137904644012451, 1.4119328260421753, 2.419321298599243, -1.2444305419921875, 0.408645361661911, 0.4387153387069702, 1.2126789093017578, -1.4511234760284424, 0.40202397108078003, -0.4287663996219635, 2.1537506580352783, 0.2622350752353668, 1.2747242450714111, -0.6572302579879761, -1.9727855920791626, 0.6861530542373657, -1.13392972946167, -1.0655068159103394, 0.6269006133079529, -0.8771923184394836, 0.12533456087112427, -1.501826286315918, -0.19833523035049438, -0.9547746181488037, -1.3738410472869873, 0.7964370846748352, 0.15011431276798248, 0.31423383951187134, -0.7190485596656799, 0.46046769618988037, -2.215546131134033, -1.3393309116363525, -0.2777218222618103, -0.9620975255966187, 0.47172966599464417, -0.3375207781791687, 0.641986072063446, -0.06851066648960114, 0.02385294809937477, 0.19844037294387817, 1.3642624616622925, 3.4485342502593994, 0.17817498743534088, 0.25201430916786194, -0.157382994890213, -0.9005573391914368, 1.5082350969314575, 1.0088226795196533, 0.07268311828374863, -0.5087317228317261, -0.9033690690994263, 1.4740077257156372, 1.9667435884475708, 1.130777359008789, 0.08524579554796219, -0.8041211366653442, -0.6064806580543518, 0.050598349422216415, 0.39907291531562805, 0.5083508491516113, 1.0086218118667603, -0.13125084340572357, 0.06697571277618408, 1.4400444030761719, 1.3129013776779175, -0.4443330466747284, 0.54900723695755, -0.9178986549377441, -0.3596910536289215, 0.40003514289855957, 0.19107158482074738, -0.06363578885793686, 0.3968329131603241, -1.1365787982940674, -0.35270509123802185, -0.21885815262794495, -1.034156084060669, -0.7465099692344666, -0.37054020166397095, -0.44145432114601135, 1.5386760234832764, 0.07982584089040756, -0.39358943700790405, 0.04372098296880722, -0.8710034489631653, -0.20233574509620667, -1.0986192226409912, 0.2817555069923401, -0.16956356167793274, 0.008438057266175747, -0.1154615581035614, 1.8428746461868286, -0.8896561861038208, -2.122945547103882, 0.27254390716552734, 0.3537469804286957, -0.6008833050727844, 0.18149800598621368, 1.6331003904342651, 0.5518865585327148, 1.3825465440750122, 1.2489097118377686, 0.9383032917976379, -0.525364875793457, -1.1983176469802856, 0.5569456219673157, 0.999028205871582, -1.387478232383728, 0.7807844877243042, -0.06709977239370346, -0.4042412340641022, 0.7516012787818909, 1.3724414110183716, 0.37735846638679504, -1.9871585369110107, 0.878499448299408, -0.7568901777267456, 0.7419764995574951, 0.6248888373374939, 0.839563250541687, 0.2142070084810257, 0.8813648223876953, -1.416553258895874, -1.0370378494262695, -0.8707827925682068, -0.544485330581665, 1.9169355630874634, -0.028382670134305954, 0.4938456416130066, -0.08036469668149948, -1.0732060670852661, -0.08669398725032806, 0.7109670042991638, 0.3374549150466919, -0.3376656472682953, 0.9935741424560547, -0.6472141742706299, -0.994981050491333, -1.3823156356811523, -0.4037014842033386, -0.7203415036201477, -0.8642098307609558, 1.0482890605926514, 0.9819465279579163, 0.5052331686019897, 2.0105860233306885, 0.523340106010437, 0.36480051279067993, -2.6488611698150635, 0.9449478983879089, 0.4071725904941559, 0.009846593253314495, 0.9426095485687256, 0.29871219396591187, 1.1582797765731812, 0.04243864864110947, 0.44357359409332275, -2.2593352794647217, 2.118074893951416, -0.18924161791801453, 0.6358869671821594, -0.03327830508351326, -0.1367420256137848, 1.3029733896255493, 0.6190624237060547, 0.5627005696296692, -1.1321256160736084, 0.7946105003356934, -0.5464498996734619, 1.1160883903503418, 1.0431902408599854, -0.7058477401733398, 0.05080682784318924, 1.2707492113113403, 0.5681189894676208, -0.40344905853271484, -0.8942705988883972, -0.5897759199142456, 0.9809688925743103, 1.748350739479065, -0.10219769179821014, -0.008909082040190697, 0.894680380821228, 0.5508815050125122, -1.2358814477920532, -0.10553815215826035, -0.8135102987289429, -0.49181410670280457, 1.7115848064422607, 1.9970424175262451, -0.08113639056682587, -0.32788118720054626, -0.693852424621582, -1.276972770690918, 0.6436951160430908, -0.11425810307264328, 0.20381730794906616, 0.7337933778762817, -0.6566943526268005, 1.1672582626342773, 0.7828077077865601, 1.0168105363845825, -0.13580775260925293, 0.425868421792984, 0.4032326638698578, -0.18993760645389557, -1.2438000440597534, -0.34118595719337463, -1.2730416059494019, -2.4689183235168457, 0.44241946935653687, -0.44213414192199707, -1.2712863683700562, 0.13586971163749695, -1.2204012870788574, 0.9579559564590454, -0.6875090003013611, -1.120929479598999, -1.4977712631225586, 0.2890052795410156, -0.18526890873908997, 0.9229586720466614, -1.5803728103637695, -0.0866585224866867, 1.3471438884735107, 0.8371504545211792, -0.5888895988464355, 0.9944634437561035, 0.40986257791519165, 1.1496694087982178, 0.6669193506240845, -0.33893728256225586, 0.46016180515289307, 0.011350939981639385, -1.34651517868042, 0.4696837365627289, 1.220164179801941, 0.2506285011768341, 1.4158085584640503, -0.5041717886924744, 0.08121439069509506, 0.5894383192062378, -0.561994194984436, -0.5632672309875488, -0.4279392957687378, 0.7180334329605103, 0.10777672380208969, -1.1166356801986694, 0.10172643512487411, -0.13707369565963745, -0.18160651624202728, 0.23428219556808472, -1.4745689630508423, -0.4819011092185974, -0.4175189435482025, -0.4585683047771454, -1.3055310249328613, 0.051203977316617966, 1.2322462797164917, -0.8430294990539551, -0.3350575864315033, 0.6017075181007385, 0.417186975479126, 0.5878759622573853, 0.6679528951644897, -0.7006198763847351, -0.4184494614601135, -0.24230895936489105, -0.1665641814470291, 0.15583451092243195, 1.19572114944458, -0.20388147234916687, -1.1453102827072144, 0.6064956784248352, -0.3666457235813141, 0.12789788842201233, 1.9129585027694702, -0.06526006013154984, -0.8691101670265198, 0.26663151383399963, -0.5988789200782776, 1.9525179862976074, 1.469191312789917, 1.4123899936676025, -0.11092785745859146, -0.7497660517692566, 0.4702082574367523, -0.0810839906334877, -0.458527535200119, 0.8063817620277405, 0.6545707583427429, -0.01867665722966194, -1.5204249620437622, 0.4965772032737732, 1.2662516832351685, -1.0825927257537842, -0.8290051221847534, 0.14432509243488312, -0.7986140251159668, 1.1470959186553955, 0.7664709091186523, 0.3943326771259308, 0.3224613666534424, 1.5496577024459839, 0.6598383188247681, -0.4409096837043762, 0.35010600090026855, 0.497894823551178, -0.16935323178768158, -2.1410348415374756, -1.0742260217666626, 0.362151563167572, -0.3647899031639099, -1.5048627853393555, 1.2490544319152832, -1.1126874685287476, -0.8177299499511719, 0.4937126636505127, 0.1603780835866928, 1.409168004989624, 0.2575817108154297, 1.7199972867965698, 1.9918913841247559, 0.8751073479652405, 0.19462819397449493, 1.4586875438690186, -0.17791636288166046, -0.4992451071739197, 1.8308026790618896, -0.4906767010688782, 0.6688869595527649, 1.088924527168274, -0.3623337745666504, -1.0891224145889282, -0.6415100693702698, -1.1573554277420044, -0.6458660364151001, 1.1810587644577026, 0.20221339166164398, -1.1639739274978638, 0.11885140091180801, 1.4409013986587524, 0.07258922606706619, -0.32252150774002075, 0.4600386321544647, 0.3847467601299286, -0.7838935256004333, -0.037987176328897476, -0.9661250114440918, 0.4548768401145935, -0.038250572979450226, -0.37013372778892517, 0.1912720650434494, 0.36223652958869934, 1.1644631624221802, -0.13844387233257294, 0.14923542737960815, 1.1351455450057983, -1.331859827041626, 1.5369160175323486, -0.5919157862663269, 0.27727460861206055, -2.5790398120880127, 1.3906170129776, -0.8352699279785156, 1.816980242729187, -2.6369516849517822, 0.4109913110733032, -0.5655295252799988, -0.31190255284309387, 0.29356664419174194, -0.4294357895851135, 0.1301693469285965, -0.1235622689127922, -1.0905708074569702, -0.022266175597906113, -0.8324220776557922, 0.5305802226066589, 1.2681411504745483, 1.3360475301742554, -1.1007784605026245, -0.1578703075647354, -1.835561752319336, -0.1316804736852646, -0.8012412786483765, 0.28383636474609375, -2.173293352127075, -0.07704605162143707, -1.8008918762207031, -2.21405291557312, -1.3035898208618164, -0.8964172601699829, 0.9385023713111877, 0.1771593689918518, -0.8881276845932007, 1.0993101596832275, -0.3781602382659912, -1.7172266244888306, 1.076308012008667, -2.1924965381622314 ]
https://github.com/huggingface/datasets/issues/3190
combination of shuffle and filter results in a bug
Hi ! There was a regression in `datasets` 1.12 that introduced this bug. It has been fixed in #3019 in 1.13 Can you try to update `datasets` and try again ?
## Describe the bug Hi, I would like to shuffle a dataset, then filter it based on each existing label. however, the combination of `filter`, `shuffle` seems to results in a bug. In the minimal example below, as you see in the filtered results, the filtered labels are not unique, meaning filter has not worked. Any suggestions as a temporary fix is appreciated @lhoestq. Thanks. Best regards Rabeeh ## Steps to reproduce the bug ```python import numpy as np import datasets datasets = datasets.load_dataset('super_glue', 'rte', script_version="master") shuffled_data = datasets["train"].shuffle(seed=42) for label in range(2): print("label ", label) data = shuffled_data.filter(lambda example: int(example['label']) == label) print("length ", len(data), np.unique(data['label'])) ``` ## Expected results Filtering per label, should only return the data with that specific label. ## Actual results As you can see, filtered data per label, has still two labels of [0, 1] ``` label 0 length 1249 [0 1] label 1 length 1241 [0 1] ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0
1,132
31
combination of shuffle and filter results in a bug ## Describe the bug Hi, I would like to shuffle a dataset, then filter it based on each existing label. however, the combination of `filter`, `shuffle` seems to results in a bug. In the minimal example below, as you see in the filtered results, the filtered labels are not unique, meaning filter has not worked. Any suggestions as a temporary fix is appreciated @lhoestq. Thanks. Best regards Rabeeh ## Steps to reproduce the bug ```python import numpy as np import datasets datasets = datasets.load_dataset('super_glue', 'rte', script_version="master") shuffled_data = datasets["train"].shuffle(seed=42) for label in range(2): print("label ", label) data = shuffled_data.filter(lambda example: int(example['label']) == label) print("length ", len(data), np.unique(data['label'])) ``` ## Expected results Filtering per label, should only return the data with that specific label. ## Actual results As you can see, filtered data per label, has still two labels of [0, 1] ``` label 0 length 1249 [0 1] label 1 length 1241 [0 1] ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0 Hi ! There was a regression in `datasets` 1.12 that introduced this bug. It has been fixed in #3019 in 1.13 Can you try to update `datasets` and try again ?
[ -1.1492472887039185, -0.8812903761863708, -0.7271469235420227, 1.4592254161834717, -0.15578298270702362, -1.1553094387054443, 0.17843475937843323, -1.1352170705795288, 1.7802836894989014, -0.8389032483100891, 0.24476273357868195, -1.7247135639190674, 0.05199643224477768, -0.6048413515090942, -0.7412495613098145, -0.8952183127403259, -0.3943519592285156, -0.6807547807693481, 0.9652518630027771, 2.4732518196105957, 1.1906538009643555, -1.4064619541168213, 2.6519339084625244, 0.7029116749763489, -0.20916175842285156, -0.915097177028656, 0.4717218577861786, -0.023257233202457428, -1.3220566511154175, -0.3197544813156128, -1.0127124786376953, -0.0636681541800499, -0.595171332359314, -0.6444916129112244, -0.007504642475396395, 0.3948732614517212, -0.39607253670692444, -0.4233856499195099, -0.4560694396495819, -0.7910807728767395, 0.43772822618484497, -0.3775453567504883, 0.9630396366119385, -0.3102405071258545, 1.8061718940734863, -0.5918775796890259, 0.4171088635921478, 0.7238937616348267, 1.2300337553024292, 0.163260355591774, 0.021038992330431938, 0.4053466320037842, 0.4029463529586792, -0.010600377805531025, 0.500673234462738, 1.230189323425293, 0.6401474475860596, 0.48886004090309143, 0.8209499716758728, -2.22271990776062, 1.2620567083358765, -1.0485934019088745, 0.3239862024784088, 1.2425012588500977, -0.9577081799507141, 0.38292476534843445, -1.6709541082382202, -0.15025466680526733, 0.5780349373817444, -2.2344813346862793, 0.2852439880371094, -1.305100679397583, -0.509369432926178, 0.9556809663772583, 0.36108890175819397, -1.2195546627044678, 0.1273234486579895, -0.39585867524147034, 0.9789273142814636, 0.41633933782577515, 1.1171605587005615, -1.755781650543213, 0.010191336274147034, -0.3514527678489685, 0.11053422838449478, -1.2451213598251343, -1.5354061126708984, 0.5386009812355042, 0.7231518030166626, 0.5760672092437744, -0.17908848822116852, 1.036147117614746, -1.0363266468048096, 0.6897637248039246, -1.0220465660095215, -1.8103865385055542, -1.3894765377044678, -2.2449607849121094, -2.2477283477783203, 0.6947215795516968, -0.4831795394420624, -0.5523428916931152, 2.121644973754883, -0.9402555823326111, -1.748442530632019, 1.155626893043518, 0.29634740948677063, -0.06591346114873886, 2.3874707221984863, 0.21490764617919922, -0.7586252689361572, 0.5982129573822021, -0.7484090924263, 0.7444859147071838, -0.40328818559646606, 1.214022159576416, 0.45602092146873474, -1.0446462631225586, 1.5587453842163086, -0.46426519751548767, 0.5891531705856323, -0.6808832883834839, -0.416567325592041, -0.7250000834465027, 0.2929045855998993, 1.8379226922988892, -0.2867501676082611, 1.4819180965423584, -0.24208280444145203, -1.610290288925171, -1.5561879873275757, 0.8698868155479431, 0.41428282856941223, -0.7362301349639893, 0.12988406419754028, -0.26737692952156067, 0.1376808136701584, -0.008943857625126839, 1.2408753633499146, 1.2736881971359253, 0.7225291132926941, -0.287624716758728, -0.9053429961204529, 0.21891072392463684, -0.07618987560272217, -0.7192059755325317, -1.748036503791809, -0.3585737645626068, 0.1118822917342186, 0.5819912552833557, -1.1690948009490967, 1.7206851243972778, 0.8913143277168274, 1.7994027137756348, 1.0232999324798584, -0.3029850423336029, 1.562484860420227, 0.11756423115730286, 1.8581645488739014, -0.41117608547210693, 0.6848626136779785, -0.4661594033241272, -1.2772432565689087, 0.8140741586685181, -0.3401281535625458, -2.0361008644104004, -0.7000616192817688, -0.855779230594635, -0.1507723331451416, -0.84445720911026, 0.9680459499359131, -0.3071556091308594, -1.4203344583511353, 0.3408779501914978, -0.7371141910552979, 0.07704406976699829, -1.2068912982940674, 0.3175846040248871, 0.7243987321853638, -0.609466552734375, 0.1153881847858429, -0.23168900609016418, -1.3160688877105713, -0.43436840176582336, 0.32937490940093994, 1.8961161375045776, -0.7955695986747742, 0.924413800239563, 1.0200841426849365, -0.72504723072052, -0.015204002149403095, 0.32837939262390137, -0.24941974878311157, 0.9060260057449341, -1.0515565872192383, -0.45555296540260315, 1.154024362564087, -0.10990872979164124, -0.6467509865760803, 1.4331166744232178, 0.6628857254981995, -0.9287839531898499, -0.172794371843338, -0.12349680811166763, -0.8169912099838257, 0.02536115236580372, -1.5843483209609985, -0.07461138814687729, 0.45413684844970703, -1.5350439548492432, -0.5439109802246094, -0.2026495635509491, 1.2663631439208984, -0.1645020842552185, 1.3398323059082031, -0.3136635720729828, -0.21891376376152039, -0.4277111291885376, -0.39528295397758484, 0.10805515944957733, -0.23928146064281464, -0.6318058371543884, 0.21392032504081726, -0.7583489418029785, 0.3431589603424072, 1.4411301612854004, 0.33885425329208374, 0.10417518019676208, 0.5679993033409119, 1.1267708539962769, 0.4030224084854126, -0.14419609308242798, -0.8833862543106079, -1.5131072998046875, 2.02204966545105, -1.4086538553237915, 1.9710383415222168, 0.7596253752708435, -0.030189547687768936, -1.8132412433624268, -1.9551855325698853, 1.4050055742263794, 1.1688179969787598, 2.392948865890503, 0.5487943291664124, 0.4767635464668274, -0.7996519804000854, -0.6600922346115112, 0.3129345774650574, -1.0212452411651611, -0.7668968439102173, 0.21097728610038757, 2.437464714050293, 1.7659077644348145, -0.38749757409095764, -0.19536909461021423, -1.0452667474746704, 1.423487663269043, -0.18722857534885406, 0.19493654370307922, 1.9736955165863037, -0.32748568058013916, -1.1245319843292236, 1.3225373029708862, -2.312457799911499, 0.04036516696214676, 2.0118303298950195, 0.2797392010688782, 0.045129112899303436, -1.313569188117981, -0.6346123814582825, -0.2580432593822479, -0.45540082454681396, -1.2558389902114868, 0.5469672083854675, -0.222763329744339, -0.7521049380302429, -1.4309026002883911, 0.23431821167469025, -1.1259710788726807, -1.6679095029830933, 0.10468790680170059, 1.8813602924346924, 2.0671732425689697, -0.8070780038833618, 1.654627799987793, -0.21903462707996368, 0.23681756854057312, 1.1818617582321167, 1.1780601739883423, 3.1699118614196777, 1.944222331047058, -1.2358752489089966, 0.635538637638092, -0.0850573182106018, -0.5204298496246338, 1.2516826391220093, -1.2093056440353394, 1.2962024211883545, -0.20147693157196045, -1.2705504894256592, -1.179407000541687, 0.952390730381012, 0.4495297074317932, -0.01733214594423771, -0.531514585018158, 1.1671806573867798, 0.017156444489955902, 1.2733701467514038, 0.5555654764175415, -0.27212250232696533, 0.6643652319908142, -0.45766061544418335, -0.4894402027130127, 1.5354799032211304, 0.22656525671482086, -1.357879638671875, -2.2847702503204346, -0.1930859237909317, -0.8657246232032776, 0.06187780201435089, -0.641124963760376, -0.9723660349845886, 1.6483559608459473, 0.36717861890792847, -1.244984745979309, -0.2761370837688446, -0.3608747720718384, -0.5975489020347595, 2.692279577255249, -1.4267204999923706, -0.2560374438762665, -1.0052448511123657, -0.6291795969009399, 1.638310194015503, -1.1501166820526123, -0.1735100895166397, -1.0409740209579468, -0.5148807168006897, -1.3541096448898315, -0.6021133661270142, 0.00117554422467947, -0.9889910221099854, 0.8704266548156738, 0.21493981778621674, -1.2462505102157593, -0.25930720567703247, -0.8997364640235901, 0.807532787322998, -0.15397273004055023, 0.1920015960931778, 1.9127718210220337, 0.38133278489112854, -0.4403877556324005, 0.6894294023513794, 1.1697008609771729, 0.6847679018974304, -0.659549355506897, 0.3231164216995239, -0.7606608271598816, 0.3167172968387604, -1.3201662302017212, 0.22847233712673187, -2.8602492809295654, 0.6018146872520447, -0.09204559028148651, -0.05748552083969116, 0.05550333857536316, -1.252490758895874, 0.9994794726371765, 2.5607166290283203, -1.15215003490448, 0.4609842300415039, 0.20000377297401428, 1.231614112854004, -1.5689893960952759, 0.18721340596675873, -0.46507710218429565, 2.095491647720337, 0.17974340915679932, 1.1840548515319824, -0.4082351624965668, -2.292307138442993, 0.607164740562439, -1.296605110168457, -1.2240556478500366, 0.8647075891494751, -0.7985601425170898, 0.07901740819215775, -1.3496243953704834, -0.22441783547401428, -0.7772610783576965, -1.1597890853881836, 0.6978724002838135, 0.09189412742853165, 0.5218479633331299, -0.581707239151001, 0.3083978295326233, -2.13423228263855, -1.338297963142395, -0.33060532808303833, -0.8890568614006042, 0.4236774146556854, -0.23047630488872528, 0.7225034832954407, -0.2594781517982483, -0.01839273050427437, 0.379111111164093, 1.3697082996368408, 3.352160692214966, 0.19889643788337708, 0.36555981636047363, -0.14323270320892334, -0.9524891376495361, 1.4034978151321411, 1.0001834630966187, -0.24603615701198578, -0.5232052803039551, -1.1386929750442505, 1.280877947807312, 1.8486499786376953, 0.9438886046409607, 0.049678027629852295, -0.7708519697189331, -0.7491090893745422, -0.03575590252876282, 0.11813126504421234, 0.484760046005249, 0.8223373293876648, 0.20799365639686584, 0.064991295337677, 1.4992318153381348, 1.1832653284072876, -0.32453206181526184, 0.3851318359375, -0.814143717288971, -0.4908871054649353, 0.5758954286575317, 0.35163700580596924, 0.013347318395972252, 0.22840151190757751, -1.0460504293441772, -0.3059459924697876, -0.4047378599643707, -0.888688862323761, -0.7438032031059265, -0.3853628635406494, -0.2877308130264282, 1.706700325012207, 0.06302667409181595, -0.5185648798942566, -0.05308409035205841, -0.7993309497833252, -0.047689132392406464, -1.0311214923858643, 0.37286219000816345, -0.14823320508003235, -0.0911792442202568, -0.07557325065135956, 1.773941159248352, -0.9117743372917175, -1.9935572147369385, 0.21682125329971313, 0.2288781851530075, -0.32896938920021057, 0.23780061304569244, 1.6093237400054932, 0.6531122326850891, 1.4824038743972778, 1.3664253950119019, 0.983924388885498, -0.5888935923576355, -1.2910103797912598, 0.6558574438095093, 0.9220398664474487, -1.4063342809677124, 0.7981556057929993, 0.019250061362981796, -0.5432058572769165, 0.5939632058143616, 1.1675926446914673, 0.4024990499019623, -1.9913619756698608, 0.7424701452255249, -0.9603918194770813, 0.7139682173728943, 0.7502826452255249, 0.7275234460830688, 0.18165479600429535, 0.7477697134017944, -1.2598310708999634, -1.1523540019989014, -0.7127469182014465, -0.6155811548233032, 2.009162425994873, -0.32963913679122925, 0.5802487134933472, -0.26199203729629517, -1.3660331964492798, -0.04913879930973053, 0.6566587090492249, 0.38665127754211426, -0.49178338050842285, 0.8303897380828857, -0.6480051279067993, -1.0680665969848633, -1.414467215538025, -0.45376792550086975, -1.0976531505584717, -0.9238676428794861, 0.9692451357841492, 0.7948154211044312, 0.31571778655052185, 1.838025689125061, 0.6660271286964417, 0.2514202296733856, -2.571704864501953, 0.8867678642272949, 0.28150737285614014, -0.15109725296497345, 0.7556129097938538, 0.3557581603527069, 0.965802013874054, -0.11033593863248825, 0.593970537185669, -2.4291164875030518, 2.3314881324768066, -0.14329999685287476, 0.7440255880355835, 0.06852729618549347, -0.12466033548116684, 1.0261293649673462, 0.5540477633476257, 0.6067746877670288, -0.996813952922821, 0.6832793354988098, -0.6358838081359863, 1.335660696029663, 0.9790636301040649, -0.8116292953491211, -0.06985863298177719, 1.3616689443588257, 0.47844231128692627, -0.4520641565322876, -0.9113584756851196, -1.0069340467453003, 0.9761750102043152, 1.8210673332214355, -0.035344768315553665, -0.0017446521669626236, 0.9148004651069641, 0.6857137084007263, -1.3391722440719604, 0.11334463953971863, -0.745418131351471, -0.7342766523361206, 1.6442811489105225, 2.068239688873291, -0.20792682468891144, -0.17851856350898743, -0.7449801564216614, -1.2717338800430298, 0.8391405940055847, 0.0717957392334938, 0.07177868485450745, 0.7528809309005737, -0.6710463762283325, 1.0793200731277466, 0.9374396204948425, 0.8641306161880493, 0.31811076402664185, 0.309946209192276, 0.3600511848926544, -0.3527257442474365, -1.1938848495483398, -0.1641935110092163, -0.9560199975967407, -2.515923500061035, 0.4151640832424164, -0.12876752018928528, -1.354162573814392, 0.05360713601112366, -1.0078423023223877, 0.9299601316452026, -0.4971540868282318, -1.191131353378296, -1.555727243423462, 0.15537653863430023, -0.0420459508895874, 0.9445937871932983, -1.5331923961639404, -0.03962826728820801, 1.2075601816177368, 1.0125149488449097, -0.7366872429847717, 0.9763253927230835, 0.186351478099823, 1.061646580696106, 0.9780426025390625, -0.3479825258255005, 0.5201280117034912, 0.08278714120388031, -1.3477551937103271, 0.3698744475841522, 1.1735762357711792, 0.1870032250881195, 1.4461969137191772, -0.6186324954032898, -0.09516377747058868, 0.39656496047973633, -0.4452543556690216, -0.4266560971736908, -0.6442108154296875, 0.6455287933349609, 0.057575926184654236, -0.8953673243522644, 0.027719048783183098, 0.030893711373209953, -0.2519264817237854, 0.24010752141475677, -1.4936108589172363, -0.06796688586473465, -0.3358968198299408, -0.6268399357795715, -1.219435691833496, -0.009709162637591362, 1.3855489492416382, -0.758337140083313, -0.21548712253570557, 0.4862367510795593, 0.26830583810806274, 0.49142590165138245, 0.5945751667022705, -0.6739572286605835, -0.36211562156677246, -0.2500509023666382, -0.38677147030830383, 0.3474780321121216, 1.4465371370315552, -0.11357568204402924, -0.9706022143363953, 0.6871447563171387, -0.41466888785362244, 0.049214161932468414, 1.9108340740203857, 0.04171581566333771, -0.8634852170944214, 0.2909024655818939, -0.7694829106330872, 1.9682502746582031, 1.7791143655776978, 1.2972239255905151, -0.1316138654947281, -1.0112249851226807, 0.6170831322669983, -0.4089099168777466, -0.39890730381011963, 0.9234508275985718, 0.3447023332118988, -0.2029065042734146, -1.385176658630371, 0.6913403868675232, 1.2863099575042725, -0.8539448976516724, -0.8487829566001892, 0.1396128088235855, -0.7866725325584412, 1.0549112558364868, 0.78976970911026, 0.42084428668022156, 0.18871471285820007, 1.6820380687713623, 0.8299760818481445, -0.46993058919906616, 0.5486229658126831, 0.5207840204238892, -0.0351439043879509, -2.0926308631896973, -1.2424037456512451, 0.3134906589984894, -0.5324626564979553, -1.620024561882019, 1.3994500637054443, -1.1323412656784058, -0.9583525657653809, 0.5710190534591675, 0.006569132208824158, 1.4086050987243652, 0.26125264167785645, 1.48528254032135, 2.018397092819214, 0.8509910106658936, 0.3803642988204956, 1.2596014738082886, -0.16969642043113708, -0.3537691831588745, 1.8021211624145508, -0.47301191091537476, 0.4813774824142456, 1.0746302604675293, -0.30968523025512695, -1.0750921964645386, -0.7052518725395203, -1.3083080053329468, -0.7337459921836853, 1.1287906169891357, 0.04430456459522247, -1.131994366645813, 0.27112650871276855, 1.6265466213226318, 0.03538539260625839, -0.33042415976524353, 0.6828479170799255, 0.3892154395580292, -0.7718645334243774, -0.003227734938263893, -0.9069958329200745, 0.5309593677520752, -0.15187153220176697, -0.319489985704422, 0.38054072856903076, 0.40349382162094116, 1.3463788032531738, 0.04983839392662048, 0.1632172018289566, 1.1671327352523804, -1.3700474500656128, 1.5007586479187012, -0.7760614156723022, 0.20424607396125793, -2.401970148086548, 1.4332122802734375, -0.8089281320571899, 1.9177324771881104, -2.704327344894409, 0.4510016143321991, -0.5160331726074219, -0.4601249694824219, 0.2678748667240143, -0.3395160138607025, 0.16782505810260773, -0.11773407459259033, -1.2068451642990112, -0.05289657413959503, -0.7138871550559998, 0.5614404082298279, 1.119277834892273, 1.385577917098999, -1.1908015012741089, -0.30547985434532166, -1.700938105583191, -0.06625542789697647, -0.6812064051628113, 0.25594526529312134, -1.9089505672454834, -0.2148587852716446, -1.8633710145950317, -2.510075330734253, -1.291527271270752, -0.8121655583381653, 1.1114264726638794, 0.03153324872255325, -0.9190676808357239, 1.2144789695739746, -0.4031471908092499, -1.8771021366119385, 1.1031184196472168, -2.2474122047424316 ]
https://github.com/huggingface/datasets/issues/3189
conll2003 incorrect label explanation
Hi @BramVanroy, since these fields are of type `ClassLabel` (you can check this with `dset.features`), you can inspect the possible values with: ```python dset.features[field_name].feature.names # .feature because it's a sequence of labels ``` and to find the mapping between names and integers, use: ```python dset.features[field_name].feature.int2str(value_or_values_list) # map integer value to string value # or dset.features[field_name].feature.str2int(value_or_values_list) # map string value to integer value ```
In the [conll2003](https://huggingface.co/datasets/conll2003#data-fields) README, the labels are described as follows > - `id`: a `string` feature. > - `tokens`: a `list` of `string` features. > - `pos_tags`: a `list` of classification labels, with possible values including `"` (0), `''` (1), `#` (2), `$` (3), `(` (4). > - `chunk_tags`: a `list` of classification labels, with possible values including `O` (0), `B-ADJP` (1), `I-ADJP` (2), `B-ADVP` (3), `I-ADVP` (4). > - `ner_tags`: a `list` of classification labels, with possible values including `O` (0), `B-PER` (1), `I-PER` (2), `B-ORG` (3), `I-ORG` (4) `B-LOC` (5), `I-LOC` (6) `B-MISC` (7), `I-MISC` (8). First of all, it would be great if we can get a list of ALL possible pos_tags. Second, the chunk tags labels cannot be correct. The description says the values go from 0 to 4 whereas the data shows values from at least 11 to 21 and 0. EDIT: not really a bug, sorry for mistagging.
1,133
63
conll2003 incorrect label explanation In the [conll2003](https://huggingface.co/datasets/conll2003#data-fields) README, the labels are described as follows > - `id`: a `string` feature. > - `tokens`: a `list` of `string` features. > - `pos_tags`: a `list` of classification labels, with possible values including `"` (0), `''` (1), `#` (2), `$` (3), `(` (4). > - `chunk_tags`: a `list` of classification labels, with possible values including `O` (0), `B-ADJP` (1), `I-ADJP` (2), `B-ADVP` (3), `I-ADVP` (4). > - `ner_tags`: a `list` of classification labels, with possible values including `O` (0), `B-PER` (1), `I-PER` (2), `B-ORG` (3), `I-ORG` (4) `B-LOC` (5), `I-LOC` (6) `B-MISC` (7), `I-MISC` (8). First of all, it would be great if we can get a list of ALL possible pos_tags. Second, the chunk tags labels cannot be correct. The description says the values go from 0 to 4 whereas the data shows values from at least 11 to 21 and 0. EDIT: not really a bug, sorry for mistagging. Hi @BramVanroy, since these fields are of type `ClassLabel` (you can check this with `dset.features`), you can inspect the possible values with: ```python dset.features[field_name].feature.names # .feature because it's a sequence of labels ``` and to find the mapping between names and integers, use: ```python dset.features[field_name].feature.int2str(value_or_values_list) # map integer value to string value # or dset.features[field_name].feature.str2int(value_or_values_list) # map string value to integer value ```
[ -1.0751079320907593, -0.7856404781341553, -0.7746471166610718, 1.5610393285751343, -0.15691281855106354, -1.3770769834518433, 0.29570773243904114, -1.082038402557373, 1.828553557395935, -0.8348392248153687, 0.44766634702682495, -1.7142179012298584, 0.10602924972772598, -0.7290433645248413, -0.8674466609954834, -0.7923599481582642, -0.42184439301490784, -0.7922487258911133, 1.0139182806015015, 2.47060489654541, 1.236979365348816, -1.3097004890441895, 2.5577728748321533, 0.7009011507034302, -0.2107078731060028, -0.93528151512146, 0.4059685468673706, -0.17258648574352264, -1.2882765531539917, -0.4256270229816437, -0.9574015140533447, -0.2026551216840744, -0.6544395685195923, -0.7512797117233276, -0.05764814838767052, 0.5285167694091797, -0.3066464066505432, -0.4956679344177246, -0.3610798716545105, -0.8799899816513062, 0.5194694995880127, -0.3480874001979828, 0.9243972301483154, -0.29197630286216736, 1.7549430131912231, -0.6096241474151611, 0.5173903703689575, 0.6645698547363281, 1.4427094459533691, 0.22756370902061462, -0.1682548075914383, 0.39127781987190247, 0.424253910779953, 0.07089948654174805, 0.6138662099838257, 1.2181140184402466, 0.7092406749725342, 0.5799797773361206, 0.8352669477462769, -2.332991361618042, 1.255562424659729, -1.1550651788711548, 0.36740463972091675, 1.1686885356903076, -0.9832943677902222, 0.16175875067710876, -1.7974748611450195, -0.09705713391304016, 0.49284401535987854, -2.1928441524505615, 0.27931419014930725, -1.3822029829025269, -0.40233781933784485, 1.097825527191162, 0.4196557104587555, -1.3715533018112183, 0.08778988569974899, -0.16850486397743225, 0.9457818269729614, 0.3584668040275574, 1.0256494283676147, -1.7649117708206177, -0.0017337808385491371, -0.44105660915374756, 0.2108672559261322, -1.0984299182891846, -1.5144113302230835, 0.5360254049301147, 0.7282613515853882, 0.46121925115585327, -0.26012998819351196, 1.0357872247695923, -0.919264554977417, 0.6843345165252686, -1.004593849182129, -1.8674615621566772, -1.4852644205093384, -2.0519001483917236, -2.2441797256469727, 0.6668959856033325, -0.524356484413147, -0.44377556443214417, 2.0679385662078857, -1.009169101715088, -1.7475215196609497, 1.0193355083465576, 0.32845503091812134, -0.1293421983718872, 2.219904899597168, 0.17666937410831451, -0.7247623205184937, 0.4565044939517975, -0.8081761598587036, 0.6795047521591187, -0.4208122193813324, 1.3867080211639404, 0.39863505959510803, -1.1447800397872925, 1.625757098197937, -0.3500455915927887, 0.5765209197998047, -0.7243781089782715, -0.3539143204689026, -0.6696981191635132, 0.35324913263320923, 1.8885798454284668, -0.3030431568622589, 1.35774827003479, -0.2251770794391632, -1.5228204727172852, -1.496267318725586, 0.8893462419509888, 0.4390566945075989, -0.6976251602172852, 0.21861499547958374, -0.3803367018699646, 0.13462574779987335, 0.07303927838802338, 1.2638647556304932, 1.280090570449829, 0.8221838474273682, -0.26943501830101013, -0.8141348361968994, 0.25639599561691284, 0.10502767562866211, -0.743411660194397, -1.6918635368347168, -0.3568948209285736, 0.09104906022548676, 0.6416339874267578, -0.9646950960159302, 1.9618929624557495, 0.7737329006195068, 1.8814893960952759, 1.0466591119766235, -0.29181209206581116, 1.5744355916976929, 0.03436199203133583, 1.9792604446411133, -0.42229682207107544, 0.641613245010376, -0.5128915309906006, -1.2124395370483398, 0.9378900527954102, -0.30658599734306335, -2.100632429122925, -0.5226119756698608, -0.8538891077041626, -0.12290376424789429, -0.8102716207504272, 1.009209156036377, -0.20410360395908356, -1.4266741275787354, 0.20133459568023682, -0.7785764932632446, 0.012940933927893639, -1.2812447547912598, 0.3720637857913971, 0.6916056871414185, -0.6830401420593262, 0.24871140718460083, -0.3399094045162201, -1.2549411058425903, -0.4941958785057068, 0.26010143756866455, 1.8252161741256714, -0.7572113275527954, 0.9304147958755493, 1.0553810596466064, -0.7109302282333374, -0.15044750273227692, 0.5004266500473022, -0.34958168864250183, 0.8823835849761963, -1.026695966720581, -0.4191303849220276, 1.2404918670654297, -0.06792088598012924, -0.5847492218017578, 1.39975106716156, 0.7114726305007935, -0.935250997543335, -0.04278021305799484, -0.17858296632766724, -0.8402340412139893, 0.17955853044986725, -1.64276921749115, 0.0033612381666898727, 0.633637547492981, -1.582179307937622, -0.5476092100143433, -0.09058202803134918, 1.3089876174926758, -0.10735316574573517, 1.3834599256515503, -0.2754947543144226, -0.14066612720489502, -0.3917188048362732, -0.3335546553134918, 0.07685371488332748, -0.187788724899292, -0.6821900606155396, 0.2446294128894806, -0.5976362228393555, 0.4020238518714905, 1.4229975938796997, 0.12046626210212708, 0.011427968740463257, 0.549325704574585, 1.1805245876312256, 0.32001280784606934, -0.018636636435985565, -0.9423493146896362, -1.5829540491104126, 2.068636417388916, -1.4087110757827759, 1.9923888444900513, 0.6801066398620605, 0.05876590311527252, -1.6963815689086914, -1.8874988555908203, 1.5270322561264038, 1.147172451019287, 2.3618111610412598, 0.6572510004043579, 0.4750881493091583, -0.7868808507919312, -0.47506871819496155, 0.4340500831604004, -1.0188226699829102, -0.8477621078491211, 0.17676877975463867, 2.4086360931396484, 1.7680741548538208, -0.43559566140174866, -0.2478155940771103, -1.1091111898422241, 1.4982800483703613, -0.23878465592861176, 0.14787274599075317, 1.912014365196228, -0.2931384742259979, -1.1453756093978882, 1.316788911819458, -2.2996318340301514, 0.17233017086982727, 2.046565055847168, 0.18846692144870758, 0.0829191654920578, -1.2989444732666016, -0.594853401184082, -0.15176573395729065, -0.49174341559410095, -1.3037489652633667, 0.43173184990882874, -0.1572180539369583, -0.7003904581069946, -1.367977261543274, 0.2972719371318817, -1.0264885425567627, -1.7110264301300049, 0.11092893034219742, 1.8561720848083496, 1.9490256309509277, -0.6811469793319702, 1.6764304637908936, -0.38662296533584595, 0.36879515647888184, 1.255876064300537, 1.21083402633667, 3.1573400497436523, 1.9321209192276, -1.285200595855713, 0.6830945014953613, -0.19330386817455292, -0.5496573448181152, 1.2740228176116943, -1.1716644763946533, 1.2359280586242676, -0.17274273931980133, -1.174677848815918, -1.1558960676193237, 0.7826999425888062, 0.460941344499588, 0.08428478986024857, -0.481819212436676, 1.0272529125213623, 0.11997243762016296, 1.154205083847046, 0.5989630222320557, -0.2619635760784149, 0.7066271305084229, -0.3249545395374298, -0.4260406196117401, 1.5364419221878052, 0.291923850774765, -1.1884597539901733, -2.3596270084381104, -0.04116130620241165, -0.9027688503265381, 0.07937312126159668, -0.6723413467407227, -0.8615046739578247, 1.6693040132522583, 0.391760915517807, -1.1549017429351807, -0.19518470764160156, -0.3373461663722992, -0.4965587258338928, 2.715406656265259, -1.3541854619979858, -0.323452353477478, -1.122377872467041, -0.6819088459014893, 1.642899513244629, -1.168108344078064, -0.2130403369665146, -0.9903082847595215, -0.4054701626300812, -1.2456446886062622, -0.5929794311523438, 0.015500381588935852, -0.8249437808990479, 0.8228855133056641, 0.1384873390197754, -1.4574450254440308, -0.38776448369026184, -0.9045364856719971, 0.7844380140304565, -0.26257967948913574, 0.16105593740940094, 1.892595887184143, 0.3695095181465149, -0.41282883286476135, 0.7151839733123779, 1.0433579683303833, 0.6052320003509521, -0.4100262224674225, 0.42425450682640076, -0.5970543622970581, 0.3613230288028717, -1.3174821138381958, 0.322090208530426, -2.770253896713257, 0.6241532564163208, -0.024657830595970154, -0.021824732422828674, -0.10285717248916626, -1.4558793306350708, 0.9296817779541016, 2.5523393154144287, -1.2054109573364258, 0.40806931257247925, 0.17229919135570526, 1.3273674249649048, -1.5990793704986572, 0.10402923822402954, -0.4300137460231781, 2.2228636741638184, 0.11227814853191376, 1.1737788915634155, -0.32132411003112793, -2.345212936401367, 0.547083854675293, -1.2792339324951172, -1.1508736610412598, 0.7713638544082642, -0.7342238426208496, -0.1230759248137474, -1.2347385883331299, -0.20405009388923645, -0.830355167388916, -1.045133113861084, 0.8609821796417236, 0.1086902990937233, 0.5078575611114502, -0.7377060651779175, 0.31026598811149597, -2.0223357677459717, -1.2875398397445679, -0.21196459233760834, -0.924805760383606, 0.35272225737571716, -0.24518872797489166, 0.6460906267166138, -0.23817919194698334, -0.10589403659105301, 0.4220418930053711, 1.56493079662323, 3.413607120513916, 0.1011451706290245, 0.3958434462547302, -0.3321836590766907, -0.8874962329864502, 1.4052895307540894, 0.8347166776657104, -0.20215432345867157, -0.5630694627761841, -1.0408726930618286, 1.2771140336990356, 1.9152076244354248, 0.9798089265823364, 0.09018100053071976, -0.8906919956207275, -0.8424341678619385, -0.06722527742385864, 0.16751855611801147, 0.40639010071754456, 0.8392661809921265, 0.23784823715686798, -0.0075820088386535645, 1.2625826597213745, 1.0476106405258179, -0.4269466698169708, 0.5164626836776733, -0.7845083475112915, -0.3489026129245758, 0.5408908128738403, 0.36028605699539185, 0.023801147937774658, 0.22446896135807037, -1.0061211585998535, -0.27372851967811584, -0.3558517396450043, -0.8495479822158813, -0.8562134504318237, -0.479905903339386, -0.32021597027778625, 1.7518550157546997, -0.059950001537799835, -0.5988208055496216, -0.07893571257591248, -0.7381155490875244, 0.005122695118188858, -0.907158613204956, 0.17829523980617523, -0.19042322039604187, -0.11199977993965149, -0.13071000576019287, 1.5882134437561035, -0.8714550733566284, -2.0462474822998047, 0.3084576427936554, 0.21312420070171356, -0.3995361328125, 0.27606144547462463, 1.6451512575149536, 0.6185088157653809, 1.4065372943878174, 1.466273546218872, 1.072788953781128, -0.6585170030593872, -1.3422075510025024, 0.7005879878997803, 0.9413419961929321, -1.425666332244873, 0.7972217798233032, 0.18621130287647247, -0.4198400378227234, 0.5372819900512695, 1.1744658946990967, 0.44857296347618103, -2.1259140968322754, 0.6451356410980225, -0.9417403936386108, 0.7403692007064819, 0.7019469738006592, 0.6832300424575806, 0.26292309165000916, 0.7976245880126953, -1.1853556632995605, -1.1602431535720825, -0.616234540939331, -0.7549178600311279, 1.9437687397003174, -0.16509748995304108, 0.58979332447052, -0.2190908044576645, -1.4754842519760132, -0.15025754272937775, 0.7444171905517578, 0.4019272029399872, -0.6858497858047485, 0.7191519737243652, -0.6384842395782471, -0.9943666458129883, -1.3276393413543701, -0.597873330116272, -1.1098721027374268, -0.9730991125106812, 0.8935449123382568, 0.7988771200180054, 0.3682540953159332, 1.8619537353515625, 0.7026320695877075, 0.12837012112140656, -2.5530457496643066, 0.8224940299987793, 0.3514193892478943, -0.18885207176208496, 0.7770333290100098, 0.46302756667137146, 0.9665535688400269, -0.1733018308877945, 0.635353684425354, -2.396292209625244, 2.428934335708618, -0.1662374585866928, 0.6148693561553955, 0.02916957065463066, -0.21743547916412354, 0.9949277639389038, 0.42851293087005615, 0.422608345746994, -1.0520074367523193, 0.550457239151001, -0.8155083656311035, 1.3668938875198364, 0.8141343593597412, -0.9043874740600586, -0.07436618953943253, 1.3585139513015747, 0.41302528977394104, -0.561582088470459, -0.9658997058868408, -1.0858243703842163, 0.9459050893783569, 1.6571195125579834, -0.06876803934574127, -0.02422531694173813, 0.8190724849700928, 0.7223448753356934, -1.2614811658859253, 0.09624004364013672, -0.7174444198608398, -0.8233217000961304, 1.6860606670379639, 2.0672194957733154, -0.35803067684173584, -0.19823616743087769, -0.9000102281570435, -1.2468488216400146, 0.8704328536987305, 0.059173889458179474, -0.10399828851222992, 0.6588208675384521, -0.6016761064529419, 1.187923550605774, 1.0533779859542847, 0.8529675006866455, 0.4107484519481659, 0.2927537262439728, 0.26963934302330017, -0.3990512788295746, -1.1697542667388916, -0.2424754500389099, -1.150202989578247, -2.6518819332122803, 0.49547305703163147, -0.13858141005039215, -1.3165372610092163, 0.05519832670688629, -0.9986408948898315, 0.7407287359237671, -0.5669339895248413, -1.11692476272583, -1.4146728515625, 0.26243171095848083, 0.02168210968375206, 0.8716534376144409, -1.6707366704940796, 0.06096259504556656, 1.209794282913208, 0.9386478662490845, -0.7742389440536499, 0.8307275772094727, 0.19983674585819244, 1.0704245567321777, 1.1286808252334595, -0.4176774024963379, 0.5385898351669312, 0.028821907937526703, -1.2902886867523193, 0.511831521987915, 1.2303448915481567, 0.12240685522556305, 1.4572076797485352, -0.5118637084960938, -0.031260449439287186, 0.3081398010253906, -0.42626121640205383, -0.5386329889297485, -0.7562606334686279, 0.6199527978897095, 0.02176062762737274, -0.8894065618515015, 0.2096228301525116, 0.09835328161716461, -0.14854072034358978, 0.2101522982120514, -1.5625978708267212, 0.03365687280893326, -0.16807924211025238, -0.619156002998352, -1.2197129726409912, -0.2761287987232208, 1.336346983909607, -0.6113148927688599, -0.17316760122776031, 0.605494499206543, 0.23917406797409058, 0.43800675868988037, 0.469717800617218, -0.6429638862609863, -0.44949498772621155, -0.19193348288536072, -0.4600280225276947, 0.37016820907592773, 1.4125498533248901, -0.02840733900666237, -0.8599346876144409, 0.6668432950973511, -0.37367182970046997, 0.008962556719779968, 1.7788972854614258, 0.10453324019908905, -0.918226957321167, 0.23222404718399048, -0.5744909048080444, 1.9425170421600342, 1.8642399311065674, 1.1678390502929688, -0.09063214808702469, -1.0713170766830444, 0.6732068061828613, -0.4597878158092499, -0.4289305806159973, 0.8525917530059814, 0.19947244226932526, -0.24147213995456696, -1.3890862464904785, 0.7758669853210449, 1.4153695106506348, -0.7791811227798462, -0.9877991676330566, 0.06451470404863358, -0.7856655120849609, 1.042900562286377, 0.7248786687850952, 0.33573639392852783, 0.27256831526756287, 1.6196688413619995, 0.8036876916885376, -0.2372119426727295, 0.6594390869140625, 0.4842368960380554, -0.06483686715364456, -2.1592729091644287, -1.3282437324523926, 0.3126457631587982, -0.5513070821762085, -1.6454570293426514, 1.3411420583724976, -1.2409805059432983, -0.9484692811965942, 0.5899118185043335, 0.13049238920211792, 1.5635517835617065, 0.3923964202404022, 1.4702109098434448, 2.008836507797241, 0.8162781000137329, 0.4688712954521179, 1.2515960931777954, -0.21045462787151337, -0.38445544242858887, 1.7407265901565552, -0.5210897922515869, 0.5113229751586914, 1.0866994857788086, -0.2563551068305969, -1.1669560670852661, -0.8734064102172852, -1.3774265050888062, -0.9050458669662476, 1.1123969554901123, 0.008721509948372841, -1.0947067737579346, 0.42830967903137207, 1.6188874244689941, -0.0408233180642128, -0.31643009185791016, 0.7323898077011108, 0.2772945463657379, -0.842889666557312, 0.008518921211361885, -0.8895719051361084, 0.5667992830276489, -0.267979234457016, -0.4278435707092285, 0.529304027557373, 0.4639405608177185, 1.2871664762496948, 0.058362945914268494, 0.0352473109960556, 1.0434333086013794, -1.4602704048156738, 1.4584312438964844, -0.804256796836853, 0.34648311138153076, -2.2645416259765625, 1.4539549350738525, -0.8479431867599487, 1.9083094596862793, -2.7019896507263184, 0.39936795830726624, -0.3742091655731201, -0.5375103950500488, 0.3060309588909149, -0.21302682161331177, 0.13332973420619965, -0.1120661124587059, -1.207559585571289, -0.13749495148658752, -0.675704836845398, 0.501609206199646, 1.0891584157943726, 1.4364796876907349, -1.0877124071121216, -0.3226163685321808, -1.8251961469650269, 0.017845062538981438, -0.4239189028739929, 0.2399960458278656, -1.9581769704818726, -0.2254728376865387, -1.9359415769577026, -2.39284348487854, -1.202214002609253, -0.804639458656311, 1.1381921768188477, 0.018598932772874832, -0.7175635099411011, 1.1938586235046387, -0.3804919719696045, -1.9246277809143066, 1.0002975463867188, -2.201183557510376 ]
https://github.com/huggingface/datasets/issues/3188
conll2002 issues
Hi ! Thanks for reporting :) This is related to https://github.com/huggingface/datasets/issues/2742, I'm working on it. It should fix the viewer for around 80 datasets.
**Link:** https://huggingface.co/datasets/conll2002 The dataset viewer throws a server error when trying to preview the dataset. ``` Message: Extraction protocol 'train' for file at 'https://raw.githubusercontent.com/teropa/nlp/master/resources/corpora/conll2002/esp.train' is not implemented yet ``` In addition, the "point of contact" has encoding issues and does not work when clicked. Am I the one who added this dataset ? No, @lhoestq did
1,134
24
conll2002 issues **Link:** https://huggingface.co/datasets/conll2002 The dataset viewer throws a server error when trying to preview the dataset. ``` Message: Extraction protocol 'train' for file at 'https://raw.githubusercontent.com/teropa/nlp/master/resources/corpora/conll2002/esp.train' is not implemented yet ``` In addition, the "point of contact" has encoding issues and does not work when clicked. Am I the one who added this dataset ? No, @lhoestq did Hi ! Thanks for reporting :) This is related to https://github.com/huggingface/datasets/issues/2742, I'm working on it. It should fix the viewer for around 80 datasets.
[ -1.1928236484527588, -0.9418654441833496, -0.8794344067573547, 1.5500458478927612, -0.178982675075531, -1.2934726476669312, 0.06981675326824188, -1.004502534866333, 1.6279656887054443, -0.6632462739944458, 0.28508618474006653, -1.6786152124404907, -0.04737503454089165, -0.5454598069190979, -0.7612099647521973, -0.9459193348884583, -0.3616153597831726, -0.8274902105331421, 0.9458186626434326, 2.5449163913726807, 1.1801152229309082, -1.3974322080612183, 2.751323699951172, 0.6739755868911743, -0.18166890740394592, -1.1598089933395386, 0.5501190423965454, 0.09074430912733078, -1.1544560194015503, -0.48916926980018616, -0.9598998427391052, -0.0010949578136205673, -0.5612481832504272, -0.5131317973136902, 0.03641539812088013, 0.44064271450042725, -0.18572980165481567, -0.3227909505367279, -0.49647077918052673, -0.7597687840461731, 0.46866437792778015, -0.3975895643234253, 0.9129810929298401, -0.4026868939399719, 1.7726609706878662, -0.5393086075782776, 0.2696817219257355, 0.6915766000747681, 1.389540433883667, 0.16842955350875854, 0.011878399178385735, 0.23601773381233215, 0.40726134181022644, -0.0438864603638649, 0.42830169200897217, 1.185972809791565, 0.5600394010543823, 0.5301904082298279, 0.7081437706947327, -2.211064338684082, 1.3354134559631348, -0.9983232021331787, 0.3048418164253235, 1.4312442541122437, -0.9673805832862854, 0.37000682950019836, -1.8819228410720825, -0.043133292347192764, 0.49174627661705017, -2.359652519226074, 0.1965808868408203, -1.2307820320129395, -0.5608367323875427, 0.972140371799469, 0.19170713424682617, -1.297764778137207, 0.15805485844612122, -0.38419944047927856, 0.9831847548484802, 0.5073405504226685, 1.2078466415405273, -1.6813429594039917, 0.043670713901519775, -0.2744007706642151, 0.06829594820737839, -1.3405659198760986, -1.554673433303833, 0.5609990358352661, 0.5608491897583008, 0.7542055249214172, -0.11427820473909378, 0.9017381072044373, -0.9375096559524536, 0.8536658883094788, -0.9220659732818604, -1.6120409965515137, -1.4243677854537964, -2.3206212520599365, -2.3720195293426514, 0.8629366159439087, -0.4453625977039337, -0.44130462408065796, 1.9004513025283813, -0.9516767263412476, -1.810021996498108, 1.0330429077148438, 0.3819379508495331, 0.15913039445877075, 2.383512258529663, 0.21826720237731934, -0.6938981413841248, 0.4287019670009613, -0.6702945232391357, 0.8488509058952332, -0.33145588636398315, 1.535566806793213, 0.6230771541595459, -0.9561270475387573, 1.7037192583084106, -0.4532688856124878, 0.5285096764564514, -0.7180359959602356, -0.5221925377845764, -0.9189879894256592, 0.34304332733154297, 1.8480416536331177, -0.37556079030036926, 1.5762519836425781, -0.41352739930152893, -1.5318137407302856, -1.5271979570388794, 0.827305018901825, 0.5255054831504822, -0.8229034543037415, 0.07328934222459793, -0.41376107931137085, 0.03765181452035904, -0.03883298486471176, 1.156016230583191, 1.0547544956207275, 0.6674109697341919, -0.31277063488960266, -0.9139725565910339, 0.26515376567840576, -0.06198429688811302, -0.7354026436805725, -1.852818250656128, -0.37881290912628174, 0.22608578205108643, 0.6466032862663269, -1.2146167755126953, 1.6601694822311401, 0.8650104403495789, 1.9532214403152466, 0.9600258469581604, -0.34310585260391235, 1.4554206132888794, -0.11225173622369766, 1.8998693227767944, -0.5897741913795471, 0.608961820602417, -0.26935359835624695, -1.0950275659561157, 0.7854731678962708, -0.34652239084243774, -2.012559652328491, -0.8746833801269531, -0.9323622584342957, -0.1590612232685089, -0.6939056515693665, 0.9480499029159546, -0.3622369170188904, -1.3661702871322632, 0.1452234387397766, -0.5985920429229736, 0.058250218629837036, -1.3265838623046875, 0.1808393895626068, 0.8192790746688843, -0.6637825965881348, -0.03171618655323982, -0.22621884942054749, -1.374389410018921, -0.5909355878829956, 0.29213041067123413, 1.9190093278884888, -0.693273663520813, 0.975110650062561, 0.911085844039917, -0.7848907709121704, 0.1015101820230484, 0.2929995059967041, -0.28513103723526, 0.8075743913650513, -1.087973713874817, -0.4676338732242584, 1.1257277727127075, -0.140619695186615, -0.7094141244888306, 1.4254921674728394, 0.8857194781303406, -1.0286879539489746, -0.18226784467697144, -0.2316264808177948, -0.7103695869445801, -0.01006454136222601, -1.5018272399902344, -0.23290297389030457, 0.16588866710662842, -1.3899407386779785, -0.5158790349960327, -0.28421175479888916, 1.2748104333877563, -0.28572526574134827, 1.3380998373031616, -0.29213619232177734, -0.36817666888237, -0.346647173166275, -0.3672741651535034, 0.14114001393318176, -0.20294645428657532, -0.7005012631416321, 0.2973572313785553, -0.8506666421890259, 0.3613913357257843, 1.458729863166809, 0.5038903951644897, 0.04578041285276413, 0.6525132060050964, 1.1019988059997559, 0.3551499545574188, -0.011148735880851746, -0.9514470100402832, -1.5771042108535767, 2.01511287689209, -1.3645224571228027, 1.8399053812026978, 0.7135871052742004, -0.14608946442604065, -1.7621897459030151, -1.7602518796920776, 1.4004381895065308, 1.279484748840332, 2.3891794681549072, 0.6417714953422546, 0.3868497610092163, -0.7907618284225464, -0.7089594006538391, 0.22511878609657288, -1.0736583471298218, -0.7865678668022156, 0.11787291616201401, 2.307006359100342, 1.8893892765045166, -0.6199153065681458, -0.27292847633361816, -0.9950439929962158, 1.2571951150894165, -0.18428534269332886, 0.2636542320251465, 1.992464542388916, -0.31201204657554626, -1.0638190507888794, 1.213728427886963, -2.263425350189209, 0.19749179482460022, 2.0632498264312744, 0.3297308087348938, 0.1007908508181572, -1.582148790359497, -0.7217980623245239, -0.22019222378730774, -0.5858922600746155, -1.2697486877441406, 0.6186521649360657, -0.2524282932281494, -0.8948448896408081, -1.4998890161514282, 0.12977385520935059, -1.1219793558120728, -1.6794718503952026, 0.39358314871788025, 1.816259503364563, 1.997875452041626, -0.7266640067100525, 1.4537395238876343, -0.18078690767288208, 0.18910866975784302, 1.317112684249878, 1.2577810287475586, 3.057385206222534, 1.922433853149414, -1.189835548400879, 0.8338199257850647, -0.16601121425628662, -0.503773033618927, 1.174870252609253, -1.0438545942306519, 1.167866587638855, -0.27328547835350037, -1.158347725868225, -1.2621980905532837, 0.933484673500061, 0.5112699866294861, 0.050579413771629333, -0.5036410689353943, 1.283262848854065, 0.045543160289525986, 1.2448207139968872, 0.5507650375366211, -0.3809785544872284, 0.551885724067688, -0.3902927041053772, -0.4791046679019928, 1.6478121280670166, 0.1420392096042633, -1.5088566541671753, -2.247039556503296, -0.20116809010505676, -0.8540575504302979, -0.18084532022476196, -0.46843376755714417, -0.9984436631202698, 1.6726555824279785, 0.49151846766471863, -1.2798484563827515, -0.31290897727012634, -0.3350452482700348, -0.6398534774780273, 2.5672683715820312, -1.3499035835266113, -0.19635307788848877, -0.961921751499176, -0.49419841170310974, 1.741472601890564, -1.1196829080581665, -0.12165123969316483, -1.03839111328125, -0.7058608531951904, -1.4632006883621216, -0.6134142875671387, 0.0639190599322319, -0.9033252000808716, 0.7991112470626831, 0.1039106473326683, -1.00908625125885, -0.2953132688999176, -0.8624199628829956, 0.8435025215148926, -0.045170750468969345, 0.24311134219169617, 2.004927396774292, 0.5296944379806519, -0.37329187989234924, 0.6695256233215332, 1.119686245918274, 0.5457782745361328, -0.6557394862174988, 0.20920363068580627, -0.665794312953949, 0.2736700177192688, -1.4324781894683838, 0.16344985365867615, -2.9649600982666016, 0.6925952434539795, -0.060341447591781616, -0.07446929067373276, -0.01005310658365488, -1.2479673624038696, 1.2542682886123657, 2.561293125152588, -1.2162573337554932, 0.4359912872314453, 0.39007073640823364, 1.085057020187378, -1.5772476196289062, 0.28489479422569275, -0.3628120422363281, 2.042858362197876, 0.17266201972961426, 1.2228046655654907, -0.533698320388794, -2.076063871383667, 0.6640589833259583, -1.1876901388168335, -1.0567234754562378, 0.7204487323760986, -0.8306214809417725, 0.1900242567062378, -1.5281052589416504, -0.1446641981601715, -0.9824824929237366, -1.3294295072555542, 1.0037518739700317, 0.16256383061408997, 0.398403525352478, -0.592460036277771, 0.40486156940460205, -2.049173355102539, -1.428065538406372, -0.1724998950958252, -0.9879728555679321, 0.47880882024765015, -0.2609145939350128, 0.6377339363098145, -0.08448110520839691, 0.07912960648536682, 0.28723642230033875, 1.4441394805908203, 3.4121475219726562, 0.17779073119163513, 0.3984260857105255, -0.023493601009249687, -0.9093691110610962, 1.5309702157974243, 1.0996308326721191, 0.018724221736192703, -0.5511444211006165, -1.020784854888916, 1.292012333869934, 2.0029025077819824, 1.0780285596847534, 0.15508198738098145, -0.9203263521194458, -0.6352238059043884, 0.02315668761730194, 0.18369832634925842, 0.5151028633117676, 0.9631426334381104, -0.020500343292951584, -0.01005280576646328, 1.4416682720184326, 1.2643227577209473, -0.4108577370643616, 0.432352751493454, -0.9160624146461487, -0.3784197270870209, 0.5049062371253967, 0.2486858367919922, 0.05734728276729584, 0.5713233947753906, -1.0419172048568726, -0.2773674428462982, -0.24858379364013672, -1.0885984897613525, -0.713051974773407, -0.5173273682594299, -0.3130967915058136, 1.5518776178359985, 0.10178732872009277, -0.5694679617881775, 0.04690494388341904, -0.8433424234390259, -0.13501694798469543, -1.010656476020813, 0.1792651116847992, -0.2014670968055725, -0.11772987991571426, -0.12793800234794617, 1.743540644645691, -0.9176830053329468, -2.1838293075561523, 0.2682955265045166, 0.37601056694984436, -0.4841397702693939, 0.26196151971817017, 1.5935657024383545, 0.5052345991134644, 1.3931044340133667, 1.2518097162246704, 0.9857965111732483, -0.6023547649383545, -1.269365668296814, 0.585731565952301, 0.9965194463729858, -1.3517510890960693, 0.836387038230896, -0.057839423418045044, -0.46401527523994446, 0.8130119442939758, 1.3264051675796509, 0.37639281153678894, -1.9059133529663086, 0.7188920974731445, -0.7533060312271118, 0.7825154066085815, 0.5550944805145264, 0.7826387286186218, 0.23208844661712646, 0.7762056589126587, -1.282549500465393, -1.0969613790512085, -0.855434238910675, -0.5782095789909363, 1.9048757553100586, -0.12315448373556137, 0.5649765729904175, -0.07400474697351456, -1.203609824180603, -0.11192232370376587, 0.7282636165618896, 0.4153845012187958, -0.34808874130249023, 0.8114132881164551, -0.6563405394554138, -1.0695383548736572, -1.363062858581543, -0.4638316333293915, -0.9062783122062683, -0.9105021357536316, 1.065434217453003, 0.8620683550834656, 0.35208845138549805, 1.9731526374816895, 0.6046100854873657, 0.17048069834709167, -2.698584794998169, 0.9249008893966675, 0.3049030601978302, 0.17903390526771545, 0.9281895160675049, 0.23531639575958252, 1.146378755569458, -0.05918820947408676, 0.5652415156364441, -2.2344930171966553, 2.1708059310913086, -0.16826516389846802, 0.5959978103637695, 0.03961840644478798, -0.31018972396850586, 1.1100894212722778, 0.5049372911453247, 0.6201313138008118, -1.2416633367538452, 0.6803790926933289, -0.5811191201210022, 1.196493148803711, 0.9323945045471191, -0.7967491745948792, 0.031811513006687164, 1.3653217554092407, 0.558559775352478, -0.3482239842414856, -0.9656065106391907, -0.8449823260307312, 1.0259491205215454, 1.635274887084961, -0.06080397963523865, -0.08081895112991333, 0.8902178406715393, 0.6451153755187988, -1.2910083532333374, 0.06288333237171173, -0.7910751700401306, -0.5396698117256165, 1.7315070629119873, 2.0532984733581543, -0.06010390818119049, -0.20647543668746948, -0.7499547004699707, -1.150766134262085, 0.6977019906044006, 0.045762475579977036, 0.12270180135965347, 0.7879620790481567, -0.7187312841415405, 1.2225953340530396, 0.7516987323760986, 0.839179277420044, 0.046271368861198425, 0.5476494431495667, 0.3263310492038727, -0.3380528390407562, -1.216517686843872, -0.36620354652404785, -1.1484156847000122, -2.5706119537353516, 0.47393926978111267, -0.2846126854419708, -1.3104548454284668, -0.02039402723312378, -1.1148818731307983, 0.9446123838424683, -0.6018352508544922, -1.086530327796936, -1.4089171886444092, 0.2379666268825531, -0.17286354303359985, 0.7947409749031067, -1.5747264623641968, -0.05433780327439308, 1.3848885297775269, 0.9061107635498047, -0.7046182751655579, 1.0160596370697021, 0.2516093850135803, 1.0271711349487305, 0.7425785660743713, -0.372904896736145, 0.4767751097679138, 0.03132212907075882, -1.4528776407241821, 0.4914189875125885, 1.011935830116272, 0.23593038320541382, 1.4730823040008545, -0.56254643201828, 0.1353219747543335, 0.5430042147636414, -0.6033025979995728, -0.5279684662818909, -0.5557708144187927, 0.7402680516242981, 0.026134908199310303, -1.0437262058258057, 0.13496482372283936, -0.10848116129636765, -0.18953675031661987, 0.2446858286857605, -1.4563318490982056, -0.2941012680530548, -0.3247450590133667, -0.49535149335861206, -1.2710886001586914, 0.039250027388334274, 1.2703355550765991, -0.7949360013008118, -0.25171878933906555, 0.48685845732688904, 0.34416303038597107, 0.4998765289783478, 0.5111662745475769, -0.7817659974098206, -0.36341556906700134, -0.2930350601673126, -0.3442864716053009, 0.2731395363807678, 1.2590314149856567, -0.24530485272407532, -1.1095560789108276, 0.7887807488441467, -0.42448368668556213, 0.08258780092000961, 1.9442111253738403, 0.04705243185162544, -0.8298303484916687, 0.31356081366539, -0.635651707649231, 1.8878041505813599, 1.6049449443817139, 1.314475178718567, -0.11852771043777466, -0.7880076169967651, 0.48099955916404724, -0.20274889469146729, -0.40141528844833374, 0.9379478096961975, 0.3969043493270874, -0.10134196281433105, -1.3632856607437134, 0.4399643540382385, 1.4185279607772827, -0.9341790676116943, -0.8065769672393799, 0.07118798792362213, -0.9164009690284729, 1.077255129814148, 0.7260921001434326, 0.4413166642189026, 0.270007848739624, 1.552916169166565, 0.6763551831245422, -0.4425916373729706, 0.4714909493923187, 0.4775735139846802, -0.16349080204963684, -2.0831947326660156, -1.0263748168945312, 0.2621600031852722, -0.43966737389564514, -1.5199722051620483, 1.2529205083847046, -1.1574316024780273, -0.8610107898712158, 0.5228220224380493, 0.20687368512153625, 1.5622029304504395, 0.33343958854675293, 1.6084823608398438, 2.026376962661743, 0.8523103594779968, 0.16369864344596863, 1.3757967948913574, -0.007256324868649244, -0.5300229787826538, 1.8992213010787964, -0.4163670539855957, 0.5474799275398254, 1.0564517974853516, -0.43962931632995605, -1.0833009481430054, -0.8334028720855713, -1.1624345779418945, -0.5703492760658264, 1.230733036994934, 0.19749245047569275, -1.2669508457183838, 0.12634456157684326, 1.4747345447540283, 0.1937670111656189, -0.30544665455818176, 0.6410000920295715, 0.42482897639274597, -0.8199948668479919, 0.03475559875369072, -0.8426313400268555, 0.5269731879234314, -0.14896851778030396, -0.37918534874916077, 0.2789693772792816, 0.47145524621009827, 1.2328970432281494, -0.15370526909828186, 0.14152491092681885, 1.2446703910827637, -1.2956849336624146, 1.5702160596847534, -0.5644227266311646, 0.21241959929466248, -2.4604439735412598, 1.3786448240280151, -0.8655184507369995, 1.9081913232803345, -2.621138572692871, 0.34960678219795227, -0.5524961948394775, -0.36874085664749146, 0.3376823365688324, -0.4823789894580841, 0.11030875891447067, -0.11795605719089508, -1.0201010704040527, -0.0005127228796482086, -0.7720813155174255, 0.5065280795097351, 1.2735902070999146, 1.3717625141143799, -1.1502439975738525, -0.3340270519256592, -1.8478124141693115, -0.17254206538200378, -0.7046019434928894, 0.5180615782737732, -2.1374928951263428, -0.11830075085163116, -1.9029388427734375, -2.3079071044921875, -1.438334345817566, -0.8443596959114075, 0.9716920256614685, 0.20609956979751587, -0.9283304214477539, 1.0822287797927856, -0.3183046281337738, -1.7123236656188965, 1.0439382791519165, -2.217461347579956 ]
https://github.com/huggingface/datasets/issues/3188
conll2002 issues
Ah, hadn't seen that sorry. The scrambled "point of contact" is a separate issue though, I think.
**Link:** https://huggingface.co/datasets/conll2002 The dataset viewer throws a server error when trying to preview the dataset. ``` Message: Extraction protocol 'train' for file at 'https://raw.githubusercontent.com/teropa/nlp/master/resources/corpora/conll2002/esp.train' is not implemented yet ``` In addition, the "point of contact" has encoding issues and does not work when clicked. Am I the one who added this dataset ? No, @lhoestq did
1,134
17
conll2002 issues **Link:** https://huggingface.co/datasets/conll2002 The dataset viewer throws a server error when trying to preview the dataset. ``` Message: Extraction protocol 'train' for file at 'https://raw.githubusercontent.com/teropa/nlp/master/resources/corpora/conll2002/esp.train' is not implemented yet ``` In addition, the "point of contact" has encoding issues and does not work when clicked. Am I the one who added this dataset ? No, @lhoestq did Ah, hadn't seen that sorry. The scrambled "point of contact" is a separate issue though, I think.
[ -1.185798168182373, -0.9098573923110962, -0.9363990426063538, 1.500529170036316, -0.21281874179840088, -1.273804783821106, 0.06552891433238983, -1.0319269895553589, 1.628920078277588, -0.6639599800109863, 0.25130024552345276, -1.6811925172805786, -0.09912671148777008, -0.5911166071891785, -0.738280177116394, -0.9519428610801697, -0.3769325613975525, -0.8649691939353943, 0.9789934158325195, 2.5317697525024414, 1.1505844593048096, -1.363433599472046, 2.7546277046203613, 0.7053239345550537, -0.18767894804477692, -1.1306257247924805, 0.5265161395072937, 0.07384644448757172, -1.0937113761901855, -0.5574877858161926, -0.9573560357093811, 0.028870802372694016, -0.6114609241485596, -0.5293464064598083, 0.003977722488343716, 0.48387467861175537, -0.19689582288265228, -0.35370486974716187, -0.4814388155937195, -0.7672608494758606, 0.5247853994369507, -0.39954087138175964, 0.9259399771690369, -0.42450815439224243, 1.8007451295852661, -0.553452730178833, 0.24456720054149628, 0.689950168132782, 1.4100055694580078, 0.2199677675962448, -0.03692499175667763, 0.23714186251163483, 0.47009748220443726, -0.09632641077041626, 0.42786329984664917, 1.1951879262924194, 0.4979405403137207, 0.5839822292327881, 0.7480217218399048, -2.222825527191162, 1.3245158195495605, -1.033408284187317, 0.34091535210609436, 1.3760857582092285, -1.0160328149795532, 0.37171927094459534, -1.8579506874084473, 0.0003225179389119148, 0.4964291453361511, -2.3877756595611572, 0.25111716985702515, -1.2599132061004639, -0.5924562215805054, 0.9224466681480408, 0.2792343497276306, -1.3240479230880737, 0.20559494197368622, -0.3136337697505951, 0.9660397171974182, 0.4886226952075958, 1.1626698970794678, -1.736614465713501, 0.023807745426893234, -0.2968915104866028, 0.026583682745695114, -1.3437244892120361, -1.4788960218429565, 0.5464783906936646, 0.556269645690918, 0.7027841210365295, -0.16447967290878296, 0.9798747301101685, -0.9453836679458618, 0.8054159283638, -0.9105427265167236, -1.6010910272598267, -1.410617470741272, -2.25146484375, -2.369210958480835, 0.8756667375564575, -0.473521888256073, -0.44458991289138794, 1.9214774370193481, -0.9262263774871826, -1.8015198707580566, 1.013742208480835, 0.377921998500824, 0.09513537585735321, 2.380643129348755, 0.2452271729707718, -0.7152904868125916, 0.4177565574645996, -0.7005863785743713, 0.8383768200874329, -0.396514892578125, 1.5236303806304932, 0.5750159621238708, -0.933384358882904, 1.7468949556350708, -0.45103633403778076, 0.5668203830718994, -0.689089834690094, -0.5237686634063721, -0.9268772006034851, 0.36409619450569153, 1.881146788597107, -0.364471971988678, 1.5575792789459229, -0.39762112498283386, -1.5618836879730225, -1.5819556713104248, 0.8712807297706604, 0.41914963722229004, -0.8588901162147522, 0.10019285976886749, -0.3849049508571625, 0.1011555939912796, -0.0442444384098053, 1.181746006011963, 1.1087290048599243, 0.7131949663162231, -0.2915283143520355, -0.8924553990364075, 0.28183746337890625, -0.049784593284130096, -0.7416924834251404, -1.8226139545440674, -0.4147876799106598, 0.20991834998130798, 0.6606160402297974, -1.1486543416976929, 1.6459206342697144, 0.9041666984558105, 1.9783461093902588, 0.9308944940567017, -0.3538281321525574, 1.441238284111023, -0.11639397591352463, 1.8860217332839966, -0.5730768442153931, 0.6114766597747803, -0.2794701159000397, -1.098892331123352, 0.8569368124008179, -0.31252750754356384, -1.985518217086792, -0.8690779209136963, -0.9659535884857178, -0.16298115253448486, -0.711028516292572, 0.9453545212745667, -0.3107454478740692, -1.3568367958068848, 0.11317045241594315, -0.6351658701896667, 0.041621871292591095, -1.3562710285186768, 0.1968502253293991, 0.7734430432319641, -0.6146283745765686, 0.00908659491688013, -0.18768903613090515, -1.3888051509857178, -0.5623011589050293, 0.24143941700458527, 1.9994499683380127, -0.7398231029510498, 0.9727275967597961, 0.9249004125595093, -0.7873374819755554, 0.06484553217887878, 0.35727712512016296, -0.25855401158332825, 0.7919417023658752, -1.0832887887954712, -0.4300476610660553, 1.1396381855010986, -0.15866239368915558, -0.6303572058677673, 1.4243512153625488, 0.8837154507637024, -0.9956656694412231, -0.09584154188632965, -0.3132070302963257, -0.7262029647827148, -0.004045724868774414, -1.488950490951538, -0.19286248087882996, 0.2058592438697815, -1.404270887374878, -0.5400072932243347, -0.24732813239097595, 1.3155620098114014, -0.21937794983386993, 1.3326419591903687, -0.3003784418106079, -0.37880954146385193, -0.35356947779655457, -0.36585211753845215, 0.19677934050559998, -0.22357994318008423, -0.6705324649810791, 0.2657519578933716, -0.821462094783783, 0.26307037472724915, 1.470720887184143, 0.4277397394180298, 0.027022674679756165, 0.6393576860427856, 1.082220435142517, 0.3608078360557556, 0.040153227746486664, -0.9685965776443481, -1.4945367574691772, 2.024402379989624, -1.3713442087173462, 1.8319510221481323, 0.6585180163383484, -0.11539216339588165, -1.7613530158996582, -1.796593427658081, 1.447209358215332, 1.3098746538162231, 2.3708386421203613, 0.6074687242507935, 0.38965949416160583, -0.8339837193489075, -0.671842634677887, 0.22412316501140594, -1.1436631679534912, -0.7189815044403076, 0.08226316422224045, 2.318385124206543, 1.8318359851837158, -0.7264736294746399, -0.25485512614250183, -0.9807981252670288, 1.2505677938461304, -0.1798662692308426, 0.24316196143627167, 1.9830639362335205, -0.35074490308761597, -1.0407480001449585, 1.1865043640136719, -2.2892017364501953, 0.13997025787830353, 2.061605215072632, 0.2870781421661377, 0.1193423867225647, -1.508478045463562, -0.7250015735626221, -0.1961575299501419, -0.5913426280021667, -1.2823039293289185, 0.6548633575439453, -0.24795761704444885, -0.869850218296051, -1.5171490907669067, 0.1430615484714508, -1.0746934413909912, -1.6675491333007812, 0.3530164062976837, 1.8591254949569702, 1.986088752746582, -0.726167619228363, 1.487169623374939, -0.14349135756492615, 0.17292360961437225, 1.292273759841919, 1.2533692121505737, 3.0518991947174072, 1.9327375888824463, -1.157271385192871, 0.7653766870498657, -0.18373827636241913, -0.4912942945957184, 1.1247385740280151, -1.121137261390686, 1.1682417392730713, -0.2973889112472534, -1.1124175786972046, -1.2582863569259644, 0.8529372215270996, 0.49313467741012573, 0.054332442581653595, -0.4426417052745819, 1.278863787651062, 0.051322534680366516, 1.2741159200668335, 0.5310290455818176, -0.4278348386287689, 0.6032760739326477, -0.3653482496738434, -0.4907342791557312, 1.6550270318984985, 0.23913130164146423, -1.4660855531692505, -2.2430062294006348, -0.16063149273395538, -0.9068867564201355, -0.1627962589263916, -0.4376046359539032, -0.9820512533187866, 1.6358400583267212, 0.48308995366096497, -1.2312129735946655, -0.3381323218345642, -0.3459858298301697, -0.6371628642082214, 2.6406779289245605, -1.398236870765686, -0.23462462425231934, -0.9695610404014587, -0.4775836765766144, 1.8011596202850342, -1.1784636974334717, -0.16307979822158813, -1.0691735744476318, -0.6146671772003174, -1.4035413265228271, -0.5631721615791321, 0.05788005143404007, -0.8713678121566772, 0.8592211008071899, 0.15576167404651642, -1.0784584283828735, -0.2977980077266693, -0.863978385925293, 0.8048176765441895, -0.059206921607255936, 0.24040670692920685, 1.9874186515808105, 0.41964802145957947, -0.36500829458236694, 0.6990055441856384, 1.1271134614944458, 0.5391294956207275, -0.5883951187133789, 0.23461557924747467, -0.6268559098243713, 0.29454052448272705, -1.3960620164871216, 0.14254824817180634, -2.966435194015503, 0.644032895565033, -0.07288204878568649, -0.060334462672472, -0.029423944652080536, -1.2858974933624268, 1.2461990118026733, 2.4910545349121094, -1.1874769926071167, 0.4409540295600891, 0.3058913052082062, 1.1817255020141602, -1.548368215560913, 0.2426367551088333, -0.3865334689617157, 2.0710155963897705, 0.19438426196575165, 1.1622278690338135, -0.453298419713974, -2.09911847114563, 0.6694198250770569, -1.2014598846435547, -1.0816435813903809, 0.6291107535362244, -0.8273496627807617, 0.1094118282198906, -1.5034775733947754, -0.11435346305370331, -1.013156533241272, -1.3203126192092896, 0.9771435260772705, 0.20513372123241425, 0.4159473180770874, -0.6042654514312744, 0.3540363013744354, -2.0492665767669678, -1.4062751531600952, -0.1971447467803955, -0.9454028606414795, 0.45891377329826355, -0.2815309762954712, 0.6530095338821411, -0.1880672127008438, 0.06218376010656357, 0.30400264263153076, 1.5007799863815308, 3.418715476989746, 0.11320444941520691, 0.40557435154914856, -0.08573576807975769, -0.8622340559959412, 1.5066746473312378, 1.1029735803604126, 0.017021600157022476, -0.5806728005409241, -1.0509597063064575, 1.315946102142334, 2.0261576175689697, 1.0555269718170166, 0.08756493031978607, -0.8936981558799744, -0.6201435923576355, 0.009853788651525974, 0.22645556926727295, 0.5228309631347656, 0.975179135799408, -0.0001155603677034378, -0.07123881578445435, 1.4353907108306885, 1.230880856513977, -0.39071089029312134, 0.41021251678466797, -0.9397250413894653, -0.321218341588974, 0.533650815486908, 0.28379690647125244, 0.05758999288082123, 0.5114341974258423, -1.0353479385375977, -0.2660489082336426, -0.22025810182094574, -1.0580370426177979, -0.7688860893249512, -0.5062279105186462, -0.3238203227519989, 1.6255333423614502, 0.11810238659381866, -0.5927509069442749, -0.007107355631887913, -0.8066537380218506, -0.07422251254320145, -1.033882975578308, 0.1933738887310028, -0.19891373813152313, -0.11759566515684128, -0.11405323445796967, 1.7456207275390625, -0.8843408823013306, -2.1647584438323975, 0.2985241711139679, 0.3892946243286133, -0.38761967420578003, 0.261389821767807, 1.5778571367263794, 0.5390651226043701, 1.4265270233154297, 1.285559058189392, 1.005831241607666, -0.6615861058235168, -1.265258550643921, 0.5683589577674866, 0.9623534679412842, -1.3614221811294556, 0.8465073704719543, 0.04253895580768585, -0.4451695680618286, 0.7299464344978333, 1.2781003713607788, 0.4015205502510071, -1.9929612874984741, 0.7465037703514099, -0.7983030080795288, 0.786220908164978, 0.5227878093719482, 0.7553331851959229, 0.286344975233078, 0.7542316913604736, -1.1989260911941528, -1.1183151006698608, -0.8133416175842285, -0.600267231464386, 1.9122353792190552, -0.12117814272642136, 0.5861414670944214, -0.1375996619462967, -1.1891793012619019, -0.11899594962596893, 0.7395421266555786, 0.4255959987640381, -0.3757799565792084, 0.7596733570098877, -0.6550741195678711, -1.1104204654693604, -1.409026861190796, -0.47103527188301086, -0.9711677432060242, -0.9708705544471741, 1.0697060823440552, 0.8398597240447998, 0.2959079444408417, 1.9646546840667725, 0.6159362196922302, 0.19256891310214996, -2.6436967849731445, 0.8907596468925476, 0.3522472679615021, 0.16431039571762085, 0.922428548336029, 0.2985205352306366, 1.1138254404067993, -0.05950707942247391, 0.5496076941490173, -2.3011858463287354, 2.2222282886505127, -0.1835075467824936, 0.603598952293396, 0.051450517028570175, -0.2690274715423584, 1.0625970363616943, 0.48443153500556946, 0.583530604839325, -1.2029725313186646, 0.6303509473800659, -0.597846269607544, 1.171523928642273, 0.960688591003418, -0.7424261569976807, 0.09854927659034729, 1.3508402109146118, 0.5926169157028198, -0.3942165672779083, -0.9989243149757385, -0.8834465742111206, 1.0241026878356934, 1.6547743082046509, -0.09292586892843246, -0.055557165294885635, 0.8187891244888306, 0.5792094469070435, -1.2687205076217651, 0.04568762704730034, -0.8055667877197266, -0.5671921968460083, 1.7009365558624268, 2.007460832595825, -0.08042922616004944, -0.15591226518154144, -0.7948623895645142, -1.177264928817749, 0.725050687789917, 0.06930366158485413, 0.07861809432506561, 0.8119729161262512, -0.6890552639961243, 1.229619026184082, 0.7603727579116821, 0.7991714477539062, 0.09987698495388031, 0.5406517386436462, 0.42521795630455017, -0.29841646552085876, -1.1735246181488037, -0.34049901366233826, -1.1570582389831543, -2.601752996444702, 0.48541828989982605, -0.28916457295417786, -1.3134593963623047, -0.07495896518230438, -1.1422290802001953, 0.9244899153709412, -0.5698516368865967, -1.0444836616516113, -1.4172375202178955, 0.1945289671421051, -0.10695970803499222, 0.7616021037101746, -1.5298476219177246, -0.07739344239234924, 1.3772889375686646, 0.9246567487716675, -0.8124712109565735, 0.999544084072113, 0.2697480320930481, 1.0621402263641357, 0.7442575693130493, -0.3585183918476105, 0.512143611907959, -0.01701859012246132, -1.4395523071289062, 0.5341528654098511, 1.119831919670105, 0.2227260172367096, 1.3965078592300415, -0.5781005620956421, 0.09974923729896545, 0.5381385684013367, -0.5912128686904907, -0.5582726001739502, -0.5562444925308228, 0.7315374612808228, 0.03412238135933876, -1.013582706451416, 0.1113661676645279, -0.0899648517370224, -0.18664969503879547, 0.2732696533203125, -1.4157167673110962, -0.3403259217739105, -0.3521279990673065, -0.4156758785247803, -1.2483693361282349, -0.02659217268228531, 1.2605897188186646, -0.6851740479469299, -0.2729608118534088, 0.5194265842437744, 0.3360983729362488, 0.5041106343269348, 0.4589904844760895, -0.7907282710075378, -0.37600812315940857, -0.2335561364889145, -0.3612614572048187, 0.2983176112174988, 1.3014928102493286, -0.24471594393253326, -1.0542412996292114, 0.7714657783508301, -0.3952656388282776, 0.030400700867176056, 1.9447628259658813, 0.07338107377290726, -0.8615682721138, 0.2742457985877991, -0.6198217272758484, 1.8805763721466064, 1.642898678779602, 1.248144268989563, -0.0908406674861908, -0.8048296570777893, 0.5027273297309875, -0.22954122722148895, -0.4019947350025177, 0.8728969693183899, 0.3591952919960022, -0.18110352754592896, -1.4607031345367432, 0.4667683243751526, 1.4018642902374268, -0.890538215637207, -0.8371751308441162, 0.03943026065826416, -0.916610836982727, 1.02196204662323, 0.7027347087860107, 0.48581233620643616, 0.24213643372058868, 1.605810284614563, 0.6777395606040955, -0.4338967800140381, 0.4338558316230774, 0.46917441487312317, -0.10828717052936554, -2.086272716522217, -1.1025407314300537, 0.25788792967796326, -0.48814892768859863, -1.5692286491394043, 1.3539814949035645, -1.1622554063796997, -0.8983166813850403, 0.5252965688705444, 0.23379094898700714, 1.5406194925308228, 0.3381973206996918, 1.5452077388763428, 2.0278170108795166, 0.9037598371505737, 0.22337612509727478, 1.4110733270645142, -0.04881836473941803, -0.5015878677368164, 1.9317964315414429, -0.3748067617416382, 0.5024623274803162, 1.057593822479248, -0.4120180010795593, -1.0530680418014526, -0.7825964093208313, -1.2209748029708862, -0.5990810990333557, 1.2240737676620483, 0.19824521243572235, -1.24640691280365, 0.15131957828998566, 1.4561234712600708, 0.1757844090461731, -0.36039063334465027, 0.6195859909057617, 0.435914009809494, -0.8085046410560608, 0.07271731644868851, -0.8715054988861084, 0.5341734290122986, -0.16747012734413147, -0.4333595037460327, 0.3682522475719452, 0.47297346591949463, 1.3053041696548462, -0.1135224923491478, 0.19415919482707977, 1.2182828187942505, -1.3387854099273682, 1.6282844543457031, -0.6014466285705566, 0.1720825731754303, -2.4292514324188232, 1.375805377960205, -0.8026258945465088, 1.920775055885315, -2.635737419128418, 0.380330890417099, -0.5576434135437012, -0.3859301507472992, 0.39648059010505676, -0.44154438376426697, 0.12039829790592194, -0.1162281408905983, -1.0789979696273804, 0.09013348072767258, -0.7314810156822205, 0.48674488067626953, 1.2125276327133179, 1.4114539623260498, -1.1101723909378052, -0.3623010814189911, -1.8394572734832764, -0.1601993888616562, -0.6846555471420288, 0.4575538635253906, -2.128970146179199, -0.12333701550960541, -1.889752745628357, -2.2684574127197266, -1.4321187734603882, -0.8648357391357422, 1.0518465042114258, 0.18254588544368744, -0.9359090924263, 1.1279840469360352, -0.3314978778362274, -1.7632989883422852, 1.052143931388855, -2.1616175174713135 ]
https://github.com/huggingface/datasets/issues/3186
Dataset viewer for nli_tr
It's an issue with the streaming mode: ```python >>> import datasets >>> dataset = datasets.load_dataset('nli_tr', name='snli_tr',split='test', streaming=True) >>> next(iter(dataset)) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 497, in __iter__ for key, example in self._iter(): File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 494, in _iter yield from ex_iterable File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 87, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/nli_tr/c2ddd0c0a70caddac6a81c2dae5ca7939f00060d517d08f1983927818dba6521/nli_tr.py", line 155, in _generate_examples with codecs.open(filepath, encoding="utf-8") as f: File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/codecs.py", line 905, in open file = builtins.open(filename, mode, buffering) FileNotFoundError: [Errno 2] No such file or directory: 'zip://snli_tr_1.0_test.jsonl::https://tabilab.cmpe.boun.edu.tr/datasets/nli_datasets/snli_tr_1.0.zip' ``` Note that normal mode is used by the dataset viewer when streaming is failing, but only for the smallest datasets. `nli_tr` is above the limit, hence the error.
## Dataset viewer issue for '*nli_tr*' **Link:** https://huggingface.co/datasets/nli_tr Hello, Thank you for the new dataset preview feature that will help the users to view the datasets online. We just noticed that the dataset viewer widget in the `nli_tr` dataset shows the error below. The error must be due to a temporary problem that may have blocked access to the dataset through the dataset viewer. But the dataset is currently accessible through the link in the error message. May we kindly ask if it would be possible to rerun the job so that it can access the dataset for the dataset viewer function? Thank you. Emrah ------------------------------------------ Server Error Status code: 404 Exception: FileNotFoundError Message: [Errno 2] No such file or directory: 'zip://snli_tr_1.0_train.jsonl::https://tabilab.cmpe.boun.edu.tr/datasets/nli_datasets/snli_tr_1.0.zip ------------------------------------------ Am I the one who added this dataset ? Yes
1,135
119
Dataset viewer for nli_tr ## Dataset viewer issue for '*nli_tr*' **Link:** https://huggingface.co/datasets/nli_tr Hello, Thank you for the new dataset preview feature that will help the users to view the datasets online. We just noticed that the dataset viewer widget in the `nli_tr` dataset shows the error below. The error must be due to a temporary problem that may have blocked access to the dataset through the dataset viewer. But the dataset is currently accessible through the link in the error message. May we kindly ask if it would be possible to rerun the job so that it can access the dataset for the dataset viewer function? Thank you. Emrah ------------------------------------------ Server Error Status code: 404 Exception: FileNotFoundError Message: [Errno 2] No such file or directory: 'zip://snli_tr_1.0_train.jsonl::https://tabilab.cmpe.boun.edu.tr/datasets/nli_datasets/snli_tr_1.0.zip ------------------------------------------ Am I the one who added this dataset ? Yes It's an issue with the streaming mode: ```python >>> import datasets >>> dataset = datasets.load_dataset('nli_tr', name='snli_tr',split='test', streaming=True) >>> next(iter(dataset)) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 497, in __iter__ for key, example in self._iter(): File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 494, in _iter yield from ex_iterable File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 87, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/nli_tr/c2ddd0c0a70caddac6a81c2dae5ca7939f00060d517d08f1983927818dba6521/nli_tr.py", line 155, in _generate_examples with codecs.open(filepath, encoding="utf-8") as f: File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/codecs.py", line 905, in open file = builtins.open(filename, mode, buffering) FileNotFoundError: [Errno 2] No such file or directory: 'zip://snli_tr_1.0_test.jsonl::https://tabilab.cmpe.boun.edu.tr/datasets/nli_datasets/snli_tr_1.0.zip' ``` Note that normal mode is used by the dataset viewer when streaming is failing, but only for the smallest datasets. `nli_tr` is above the limit, hence the error.
[ -1.2394853830337524, -0.7940859198570251, -0.6487321853637695, 1.3459410667419434, -0.00405103201046586, -1.388659119606018, 0.03606990724802017, -0.9163230657577515, 1.6537195444107056, -0.8394179344177246, 0.27051088213920593, -1.7367701530456543, -0.005572214722633362, -0.5404700636863708, -0.6721272468566895, -0.745221734046936, -0.35099896788597107, -0.8057911396026611, 1.0584690570831299, 2.430422782897949, 1.1717902421951294, -1.3513751029968262, 2.798149585723877, 0.6280949711799622, -0.18083904683589935, -0.8219785690307617, 0.4465698301792145, -0.03158598765730858, -1.457707405090332, -0.2502322196960449, -1.005824327468872, -0.039552051573991776, -0.6712226271629333, -0.5572474002838135, 0.16039705276489258, 0.4076847434043884, -0.20878101885318756, -0.2999354600906372, -0.4211009740829468, -0.7350170016288757, 0.5347082018852234, -0.3158452808856964, 0.887239396572113, -0.33166515827178955, 1.8207753896713257, -0.5866995453834534, 0.46620243787765503, 0.5421068668365479, 1.1484590768814087, 0.18685224652290344, -0.06437554955482483, 0.3530663549900055, 0.2453225553035736, 0.10319878160953522, 0.5357342958450317, 1.2187327146530151, 0.5841293334960938, 0.4880356788635254, 0.7100507616996765, -2.2534360885620117, 1.3419969081878662, -0.7478522062301636, 0.22660863399505615, 1.3795971870422363, -1.1416929960250854, 0.4760604500770569, -1.8842357397079468, -0.08023719489574432, 0.4326874613761902, -2.3173563480377197, 0.08203935623168945, -1.3162060976028442, -0.5665300488471985, 0.95610511302948, 0.26375076174736023, -1.164604902267456, 0.08188275247812271, -0.43865618109703064, 0.9490798711776733, 0.43923085927963257, 1.20612633228302, -1.6862878799438477, 0.06253638863563538, -0.19903111457824707, 0.3169376254081726, -1.2309050559997559, -1.6539454460144043, 0.6750600934028625, 0.7076539397239685, 0.6268126964569092, -0.16624301671981812, 0.8818963170051575, -1.1053463220596313, 0.7946681976318359, -0.96866774559021, -1.7695060968399048, -1.336608648300171, -2.4442059993743896, -2.3993961811065674, 0.7851677536964417, -0.47605666518211365, -0.324392169713974, 2.132007598876953, -1.1336005926132202, -1.7399040460586548, 1.051228642463684, 0.2904435992240906, -0.0595589317381382, 2.3728156089782715, 0.20464903116226196, -0.8862444758415222, 0.6447240710258484, -0.824654757976532, 0.697410523891449, -0.2813410758972168, 1.324378252029419, 0.4676031470298767, -1.0183502435684204, 1.5792979001998901, -0.5208392143249512, 0.5248446464538574, -0.6947747468948364, -0.3933897316455841, -0.6559603214263916, 0.18356700241565704, 1.94678795337677, -0.2332358956336975, 1.6104354858398438, -0.14270980656147003, -1.4644775390625, -1.3619377613067627, 0.7523897886276245, 0.4936319887638092, -0.9237028956413269, 0.14587165415287018, -0.40659967064857483, 0.12466279417276382, 0.08516684919595718, 1.1245405673980713, 1.2419975996017456, 0.8084746599197388, -0.20786961913108826, -0.9319718480110168, 0.08222179114818573, -0.09534429013729095, -0.538029134273529, -1.7564576864242554, -0.30589911341667175, 0.17658886313438416, 0.6563236117362976, -1.1834841966629028, 1.8516267538070679, 0.9070412516593933, 2.0199263095855713, 0.9984146356582642, -0.3691936433315277, 1.5240556001663208, 0.09271594882011414, 1.897154688835144, -0.3448755443096161, 0.6428399682044983, -0.515647828578949, -1.1974914073944092, 0.7021958231925964, -0.30123063921928406, -1.96259343624115, -0.41060328483581543, -0.9794813394546509, -0.15803612768650055, -0.8209097981452942, 1.033812165260315, -0.16811206936836243, -1.3688286542892456, 0.18332567811012268, -0.6200883388519287, 0.1020415723323822, -1.3815635442733765, 0.23602727055549622, 0.7510390877723694, -0.7156723141670227, -0.026663005352020264, -0.490732878446579, -1.465079665184021, -0.6444405913352966, 0.46094727516174316, 1.7164283990859985, -0.6315418481826782, 1.0301514863967896, 1.0001444816589355, -0.6433165669441223, -0.06315039098262787, 0.40919896960258484, -0.3268812596797943, 0.8687659502029419, -0.9989674687385559, -0.4390682876110077, 1.048721194267273, -0.320748895406723, -0.5558307766914368, 1.3004565238952637, 0.6759181022644043, -0.9969044327735901, -0.32307544350624084, -0.13190898299217224, -0.8276758790016174, 0.047949302941560745, -1.6077525615692139, -0.1652723252773285, 0.23096255958080292, -1.5133001804351807, -0.5367329120635986, -0.1093592718243599, 1.29440176486969, -0.016691938042640686, 1.292874813079834, -0.2532396614551544, -0.13976670801639557, -0.5913011431694031, -0.5475587248802185, 0.21871216595172882, -0.13060957193374634, -0.5940819978713989, 0.31727665662765503, -0.8610971570014954, 0.12976068258285522, 1.4509832859039307, 0.3160010874271393, 0.06515022367238998, 0.5686293244361877, 1.1813899278640747, 0.3311609625816345, -0.18513160943984985, -0.8592761158943176, -1.6876343488693237, 2.0671305656433105, -1.589905858039856, 1.9166598320007324, 0.7292786836624146, -0.02445877529680729, -1.9213504791259766, -1.8760515451431274, 1.413367748260498, 1.078393816947937, 2.506465435028076, 0.5693581104278564, 0.4292234778404236, -0.7910728454589844, -0.6923958659172058, 0.5224137902259827, -0.7373363375663757, -0.8877637982368469, 0.1666746288537979, 2.3102378845214844, 1.698766827583313, -0.4592573940753937, -0.16132628917694092, -0.8528802394866943, 1.316773772239685, -0.25764599442481995, 0.3582580089569092, 1.870994210243225, -0.43603944778442383, -1.0075687170028687, 1.2798551321029663, -2.3798134326934814, 0.3176088333129883, 2.01737380027771, 0.3150794208049774, 0.06330645829439163, -1.1891390085220337, -0.7497298121452332, -0.1453133225440979, -0.4671871066093445, -1.2689241170883179, 0.41687828302383423, -0.3270666301250458, -0.8371958136558533, -1.4588680267333984, -0.01993957720696926, -1.178381323814392, -1.7312380075454712, 0.2692657709121704, 1.8598487377166748, 2.2156386375427246, -0.708106279373169, 1.2987234592437744, -0.32620468735694885, 0.22877460718154907, 1.177534580230713, 1.230076789855957, 3.243492364883423, 1.9609054327011108, -1.2161306142807007, 0.7007472515106201, -0.14236755669116974, -0.5143567323684692, 1.1970847845077515, -0.9706465005874634, 1.107175350189209, -0.3413517475128174, -1.3977752923965454, -1.1977628469467163, 1.00803804397583, 0.45282262563705444, -0.07731987535953522, -0.5039664506912231, 1.1648310422897339, 0.10419850051403046, 1.3467862606048584, 0.6395798325538635, -0.35894471406936646, 0.508111298084259, -0.4062826931476593, -0.598342776298523, 1.5994806289672852, 0.06228558346629143, -1.5488044023513794, -2.3432464599609375, -0.25792327523231506, -1.0095945596694946, -0.058320146054029465, -0.8055197596549988, -0.9990285038948059, 1.497651219367981, 0.5073724985122681, -0.9875791072845459, -0.11778257042169571, -0.44286438822746277, -0.6294541358947754, 2.5616629123687744, -1.3697381019592285, -0.19267435371875763, -0.9115433096885681, -0.5882153511047363, 1.5440038442611694, -1.1577423810958862, -0.28205814957618713, -1.0550894737243652, -0.5167077779769897, -1.279759407043457, -0.45086097717285156, -0.10493502020835876, -0.7840983867645264, 0.7851973176002502, -0.05711580067873001, -1.1736220121383667, -0.23871281743049622, -1.0736881494522095, 0.8616747260093689, -0.192988321185112, 0.05341348424553871, 1.7882070541381836, 0.24656349420547485, -0.41106295585632324, 0.7306841015815735, 1.2101353406906128, 0.6514949798583984, -0.5870591402053833, 0.1772201657295227, -0.6157864928245544, 0.44622212648391724, -1.2134382724761963, 0.31928104162216187, -3.016963243484497, 0.64053875207901, -0.005002390593290329, 0.02482270449399948, -0.10219547152519226, -1.4624340534210205, 0.9296940565109253, 2.4206910133361816, -1.2023745775222778, 0.6197066903114319, 0.33488672971725464, 1.1750962734222412, -1.6873159408569336, 0.03127201274037361, -0.6789345145225525, 2.1017415523529053, 0.03196648508310318, 1.0389084815979004, -0.56045001745224, -2.2997758388519287, 0.5278719067573547, -1.1501679420471191, -0.9947456121444702, 0.80230712890625, -0.8715749979019165, 0.23584851622581482, -1.2545044422149658, -0.04987640306353569, -0.9086435437202454, -1.20480215549469, 0.5845876932144165, 0.030837930738925934, 0.6426529884338379, -0.6194326281547546, 0.27911844849586487, -2.278609275817871, -1.3528997898101807, -0.18845410645008087, -0.902793288230896, 0.4929235875606537, -0.3865966200828552, 0.7753896713256836, -0.05889695882797241, 0.06181718036532402, 0.2527002990245819, 1.3683335781097412, 3.203080177307129, -0.021539771929383278, 0.305970698595047, -0.20955340564250946, -1.0516682863235474, 1.4878567457199097, 0.9595548510551453, -0.2176852822303772, -0.5379202365875244, -0.9516116380691528, 1.3228923082351685, 1.8996989727020264, 1.0194977521896362, 0.11769745498895645, -0.9003841280937195, -0.698030948638916, 0.19736425578594208, 0.13086646795272827, 0.5200852155685425, 0.9462323784828186, 0.08609849214553833, 0.2378261238336563, 1.3821320533752441, 1.064239263534546, -0.18406260013580322, 0.5296988487243652, -0.796678900718689, -0.46580731868743896, 0.5700478553771973, 0.36865487694740295, 0.002042029984295368, 0.3189830482006073, -1.0512384176254272, -0.22338120639324188, -0.21938496828079224, -0.9052566289901733, -0.6523277163505554, -0.3958302140235901, -0.44828808307647705, 1.7406588792800903, -0.07482731342315674, -0.49641573429107666, -0.02341407723724842, -0.7975137829780579, -0.08327032625675201, -1.0858227014541626, 0.3467791974544525, -0.1984032541513443, 0.05410124734044075, -0.1547304391860962, 1.5935710668563843, -0.9337114095687866, -2.2210021018981934, 0.14575350284576416, 0.28245553374290466, -0.40250930190086365, -0.10818436741828918, 1.8189221620559692, 0.5549702048301697, 1.3960208892822266, 1.5604267120361328, 1.1135300397872925, -0.6094938516616821, -1.3269941806793213, 0.665745198726654, 0.8966313600540161, -1.337359070777893, 0.9821361899375916, -0.20610736310482025, -0.6624241471290588, 0.5723224878311157, 1.2986783981323242, 0.37978285551071167, -1.9981513023376465, 0.955235481262207, -1.1045973300933838, 0.8923969864845276, 0.778980553150177, 0.9408221244812012, 0.10241146385669708, 0.9102579355239868, -1.230794906616211, -1.0470256805419922, -0.6081068515777588, -0.6322420835494995, 1.837912678718567, -0.17518161237239838, 0.30652645230293274, -0.33048346638679504, -1.2496135234832764, 0.1880730837583542, 0.6456602811813354, 0.3678067624568939, -0.2410403937101364, 0.7679933309555054, -0.753271758556366, -1.1559364795684814, -1.3262165784835815, -0.43090853095054626, -0.9616850018501282, -0.8107131719589233, 1.0489073991775513, 0.7431710362434387, 0.5611493587493896, 1.94513738155365, 0.6576357483863831, 0.19825959205627441, -2.668696880340576, 0.8563892841339111, 0.3064500093460083, -0.06289205700159073, 0.8667874932289124, 0.2662542462348938, 1.2566196918487549, -0.16171368956565857, 0.5387454032897949, -2.3119375705718994, 2.1809561252593994, -0.3184078335762024, 0.7659260630607605, 0.09041161090135574, 0.06063050404191017, 1.0070207118988037, 0.5696464776992798, 0.6088326573371887, -1.1169620752334595, 1.0021611452102661, -0.5587907433509827, 1.0896321535110474, 0.9962021112442017, -0.9029620289802551, 0.2048482745885849, 1.1862841844558716, 0.40507417917251587, -0.5490565299987793, -1.0119954347610474, -0.784572958946228, 0.8955954909324646, 1.8088558912277222, 0.06374720484018326, 0.11046936362981796, 0.8336713314056396, 0.7407397627830505, -1.2426226139068604, 0.10606178641319275, -0.593774139881134, -0.6131144762039185, 1.7502250671386719, 1.9885265827178955, 0.06266093254089355, 0.024693790823221207, -0.6514894366264343, -1.4815315008163452, 0.7831096053123474, 0.1842244416475296, -0.06762766093015671, 0.7869781851768494, -0.6156860589981079, 1.1870434284210205, 0.74364173412323, 0.9084738492965698, 0.15130653977394104, 0.07878412306308746, 0.2937213182449341, -0.20114466547966003, -1.1481761932373047, -0.3223894238471985, -0.9150872826576233, -2.526512384414673, 0.4570496082305908, -0.2629377543926239, -1.508325457572937, 0.09065297245979309, -0.8823102116584778, 0.8232113718986511, -0.49046170711517334, -1.180794358253479, -1.370250940322876, 0.2832126021385193, -0.15752293169498444, 0.7888482809066772, -1.6380364894866943, -0.15535147488117218, 1.1740766763687134, 0.9420316815376282, -0.6837872266769409, 0.9627861380577087, 0.3324984610080719, 0.9363582134246826, 0.8963393568992615, -0.4509908854961395, 0.41019871830940247, 0.2933977544307709, -1.3745781183242798, 0.35546159744262695, 1.3258460760116577, 0.09475616365671158, 1.2869150638580322, -0.4657962918281555, -0.0705929547548294, 0.46292543411254883, -0.29941627383232117, -0.49619048833847046, -0.6846664547920227, 0.7286399602890015, -0.13655398786067963, -0.9029531478881836, -0.09407217055559158, 0.04141044616699219, -0.1144697442650795, 0.29758432507514954, -1.4493660926818848, -0.12042250484228134, -0.46255630254745483, -0.5350836515426636, -1.4273579120635986, -0.059584178030490875, 1.3411340713500977, -0.8711010217666626, -0.1210828348994255, 0.5489985346794128, 0.220339834690094, 0.5664732456207275, 0.6643611788749695, -0.7436211705207825, -0.17428116500377655, -0.18371200561523438, -0.4326847493648529, 0.23422002792358398, 1.2914807796478271, -0.13629473745822906, -0.9997223019599915, 0.5123822093009949, -0.21900877356529236, 0.12709718942642212, 1.9378684759140015, 0.07934790849685669, -0.835515022277832, 0.3300907611846924, -0.763917863368988, 1.7836600542068481, 1.6442468166351318, 1.3766417503356934, -0.14292705059051514, -0.9149566888809204, 0.5743076801300049, -0.29110288619995117, -0.3794485330581665, 0.8272613883018494, 0.4537748098373413, -0.2556077241897583, -1.4157558679580688, 0.7148004770278931, 1.216819405555725, -0.8571516871452332, -0.7269455194473267, 0.15769581496715546, -0.7760294675827026, 1.228635549545288, 0.7085985541343689, 0.40106406807899475, 0.2715429961681366, 1.7255864143371582, 0.6555815935134888, -0.6268675923347473, 0.49897441267967224, 0.48495152592658997, -0.1616067886352539, -1.9746694564819336, -1.1335724592208862, 0.3244900703430176, -0.38955315947532654, -1.4585528373718262, 1.4372940063476562, -1.2328225374221802, -0.9397208094596863, 0.5130969882011414, 0.16221654415130615, 1.3550752401351929, 0.3524850308895111, 1.812766432762146, 2.0777370929718018, 0.9252382516860962, 0.5089711546897888, 1.2222853899002075, -0.16060185432434082, -0.2519012689590454, 1.6737303733825684, -0.45474931597709656, 0.6835752725601196, 1.0837258100509644, -0.5045221447944641, -1.1956082582473755, -0.8019663691520691, -1.1597295999526978, -0.6501777172088623, 0.9799669981002808, 0.17084036767482758, -1.1324387788772583, 0.34619343280792236, 1.6300241947174072, 0.0038031553849577904, -0.1067918911576271, 0.6869078278541565, 0.4064192473888397, -0.6484902501106262, -0.12042807042598724, -1.0927025079727173, 0.5623354911804199, -0.3907763361930847, -0.38149750232696533, 0.1799999475479126, 0.5516088604927063, 1.2555087804794312, 0.20126886665821075, 0.09650510549545288, 1.4108939170837402, -1.3061044216156006, 1.2088249921798706, -0.9502585530281067, 0.31742918491363525, -2.313204050064087, 1.4853030443191528, -0.8879014253616333, 1.9826043844223022, -2.668128252029419, 0.4239639639854431, -0.49408504366874695, -0.560194194316864, 0.20222285389900208, -0.2119044065475464, 0.08702348917722702, -0.05352247506380081, -1.0650919675827026, -0.05713016539812088, -0.8867307901382446, 0.5073161125183105, 1.2843482494354248, 1.3783701658248901, -0.9859403371810913, -0.3072863519191742, -1.6475608348846436, -0.18504713475704193, -0.5549997687339783, 0.19401319324970245, -1.737937569618225, -0.17865227162837982, -2.04532790184021, -2.5452322959899902, -1.3533294200897217, -1.0600895881652832, 1.2996854782104492, 0.162983238697052, -0.9243673086166382, 1.1249916553497314, -0.3481524586677551, -1.786663293838501, 1.2751145362854004, -2.1693897247314453 ]
https://github.com/huggingface/datasets/issues/3186
Dataset viewer for nli_tr
Apparently there is an issue with the data source URLs: Server Not Found - https://tabilab.cmpe.boun.edu.tr/datasets/nli_datasets/snli_tr_1.0.zip We are contacting the authors to ask them: @e-budur you are one of the authors: are you aware of the issue with the URLs of your data ?
## Dataset viewer issue for '*nli_tr*' **Link:** https://huggingface.co/datasets/nli_tr Hello, Thank you for the new dataset preview feature that will help the users to view the datasets online. We just noticed that the dataset viewer widget in the `nli_tr` dataset shows the error below. The error must be due to a temporary problem that may have blocked access to the dataset through the dataset viewer. But the dataset is currently accessible through the link in the error message. May we kindly ask if it would be possible to rerun the job so that it can access the dataset for the dataset viewer function? Thank you. Emrah ------------------------------------------ Server Error Status code: 404 Exception: FileNotFoundError Message: [Errno 2] No such file or directory: 'zip://snli_tr_1.0_train.jsonl::https://tabilab.cmpe.boun.edu.tr/datasets/nli_datasets/snli_tr_1.0.zip ------------------------------------------ Am I the one who added this dataset ? Yes
1,135
43
Dataset viewer for nli_tr ## Dataset viewer issue for '*nli_tr*' **Link:** https://huggingface.co/datasets/nli_tr Hello, Thank you for the new dataset preview feature that will help the users to view the datasets online. We just noticed that the dataset viewer widget in the `nli_tr` dataset shows the error below. The error must be due to a temporary problem that may have blocked access to the dataset through the dataset viewer. But the dataset is currently accessible through the link in the error message. May we kindly ask if it would be possible to rerun the job so that it can access the dataset for the dataset viewer function? Thank you. Emrah ------------------------------------------ Server Error Status code: 404 Exception: FileNotFoundError Message: [Errno 2] No such file or directory: 'zip://snli_tr_1.0_train.jsonl::https://tabilab.cmpe.boun.edu.tr/datasets/nli_datasets/snli_tr_1.0.zip ------------------------------------------ Am I the one who added this dataset ? Yes Apparently there is an issue with the data source URLs: Server Not Found - https://tabilab.cmpe.boun.edu.tr/datasets/nli_datasets/snli_tr_1.0.zip We are contacting the authors to ask them: @e-budur you are one of the authors: are you aware of the issue with the URLs of your data ?
[ -1.215806484222412, -0.7645496129989624, -0.6968789100646973, 1.3220577239990234, 0.018467221409082413, -1.4032725095748901, 0.04846670851111412, -0.9023398160934448, 1.6639496088027954, -0.8551952838897705, 0.32544252276420593, -1.7192356586456299, 0.07369410991668701, -0.5765167474746704, -0.6538352966308594, -0.7335787415504456, -0.3599226176738739, -0.7380557656288147, 1.0494381189346313, 2.4411044120788574, 1.1347073316574097, -1.341435194015503, 2.7727532386779785, 0.6191076636314392, -0.19128133356571198, -0.785415768623352, 0.39576348662376404, -0.02955455891788006, -1.475615382194519, -0.2403099536895752, -0.9811177849769592, -0.06220649182796478, -0.6766222715377808, -0.6064038276672363, 0.14652803540229797, 0.4277782440185547, -0.1981096714735031, -0.29262861609458923, -0.37770000100135803, -0.7718756198883057, 0.5687488317489624, -0.279516339302063, 0.8565957546234131, -0.37872374057769775, 1.8948489427566528, -0.5827467441558838, 0.4733794629573822, 0.52245032787323, 1.142512559890747, 0.16135115921497345, -0.08538809418678284, 0.3286195695400238, 0.24474073946475983, 0.11242422461509705, 0.49480846524238586, 1.2076627016067505, 0.5808865427970886, 0.4986162483692169, 0.6890315413475037, -2.2177212238311768, 1.382843017578125, -0.7359863519668579, 0.21612848341464996, 1.418236255645752, -1.187375545501709, 0.46165576577186584, -1.8559986352920532, -0.12947086989879608, 0.3713819980621338, -2.3163554668426514, 0.02349027246236801, -1.2868962287902832, -0.599073052406311, 0.9986393451690674, 0.25880002975463867, -1.169329285621643, 0.08055058121681213, -0.415088027715683, 0.9319813251495361, 0.46074068546295166, 1.225379467010498, -1.6251150369644165, 0.05632222816348076, -0.17840810120105743, 0.2824518084526062, -1.2616684436798096, -1.636494517326355, 0.6459468603134155, 0.7427207231521606, 0.554633378982544, -0.1613490730524063, 0.8315490484237671, -1.1256059408187866, 0.8971307277679443, -0.9842569231987, -1.8034203052520752, -1.338287591934204, -2.4947712421417236, -2.448416233062744, 0.8266744017601013, -0.4192775785923004, -0.30845627188682556, 2.14190936088562, -1.1583958864212036, -1.6955935955047607, 1.0586872100830078, 0.2720603346824646, -0.07389028370380402, 2.3357582092285156, 0.1884717345237732, -0.8919665217399597, 0.6252657175064087, -0.8456407785415649, 0.6829503774642944, -0.29083654284477234, 1.3136014938354492, 0.48371943831443787, -1.0479542016983032, 1.558672547340393, -0.5348818302154541, 0.4780813157558441, -0.7006762027740479, -0.4056752026081085, -0.6278426647186279, 0.22275564074516296, 1.9167494773864746, -0.24980245530605316, 1.6372921466827393, -0.149430051445961, -1.4298344850540161, -1.3194347620010376, 0.7105963826179504, 0.4958193600177765, -0.900103747844696, 0.14559099078178406, -0.34137922525405884, 0.054459091275930405, 0.09361530840396881, 1.125941276550293, 1.2188643217086792, 0.8045734763145447, -0.2723279893398285, -0.9276041388511658, 0.10956057906150818, -0.10110203921794891, -0.5292549729347229, -1.704375982284546, -0.3154647648334503, 0.18698450922966003, 0.6446365714073181, -1.2094624042510986, 1.854972243309021, 0.898800790309906, 2.0421488285064697, 0.9961376190185547, -0.3897700309753418, 1.5190645456314087, 0.07832814753055573, 1.9178928136825562, -0.31641632318496704, 0.6643810868263245, -0.5158064961433411, -1.2115299701690674, 0.6775566935539246, -0.29000717401504517, -2.0207087993621826, -0.3899034261703491, -1.0124417543411255, -0.13512352108955383, -0.823401927947998, 1.0703312158584595, -0.12062132358551025, -1.3339792490005493, 0.16949515044689178, -0.597640335559845, 0.0596061609685421, -1.408838152885437, 0.2508787214756012, 0.7967231869697571, -0.7265151739120483, 0.002155027352273464, -0.47437605261802673, -1.4729276895523071, -0.6522454023361206, 0.5029931664466858, 1.6452363729476929, -0.6363618969917297, 1.0612916946411133, 1.003709077835083, -0.6048790812492371, -0.047929082065820694, 0.44000598788261414, -0.3904244601726532, 0.9049498438835144, -0.9266533255577087, -0.44288161396980286, 0.9893577098846436, -0.325383722782135, -0.5229025483131409, 1.2907788753509521, 0.684647262096405, -0.9610323309898376, -0.32400888204574585, -0.12178023159503937, -0.838974118232727, 0.07576227188110352, -1.6117160320281982, -0.19475793838500977, 0.18817882239818573, -1.5112812519073486, -0.5282125473022461, -0.08306202292442322, 1.2956660985946655, -0.021141301840543747, 1.3054909706115723, -0.254406213760376, -0.19852186739444733, -0.6832044124603271, -0.5371561050415039, 0.2151346504688263, -0.0964905321598053, -0.600267231464386, 0.38157957792282104, -0.8506214618682861, 0.11345888674259186, 1.3847297430038452, 0.3193608820438385, 0.0968700647354126, 0.5517730712890625, 1.1928871870040894, 0.3025379180908203, -0.22415365278720856, -0.8539305925369263, -1.6896451711654663, 2.0772016048431396, -1.536750316619873, 1.9289979934692383, 0.7794376015663147, -0.00966104306280613, -1.940792202949524, -1.880597710609436, 1.4263883829116821, 1.0757646560668945, 2.49104905128479, 0.5278420448303223, 0.4328758716583252, -0.8102274537086487, -0.7003605961799622, 0.6028963327407837, -0.729584276676178, -0.8810654282569885, 0.10531075298786163, 2.3105740547180176, 1.6839120388031006, -0.4045220911502838, -0.16143769025802612, -0.9047597050666809, 1.3201128244400024, -0.2146957814693451, 0.34199807047843933, 1.8630295991897583, -0.46290209889411926, -1.0019704103469849, 1.2657781839370728, -2.3765292167663574, 0.3336099684238434, 2.023036479949951, 0.34581032395362854, -0.021199196577072144, -1.1791990995407104, -0.7395597696304321, -0.14566558599472046, -0.46950817108154297, -1.194711685180664, 0.3869556784629822, -0.311477392911911, -0.9047052264213562, -1.470585584640503, -0.06761151552200317, -1.2333954572677612, -1.7615559101104736, 0.33892059326171875, 1.8162826299667358, 2.163914442062378, -0.657248318195343, 1.2980129718780518, -0.2576698958873749, 0.2364879995584488, 1.1864782571792603, 1.2242987155914307, 3.2790815830230713, 1.9799426794052124, -1.2338552474975586, 0.6935365796089172, -0.0847972184419632, -0.5015237331390381, 1.1449648141860962, -0.9410527348518372, 1.173664927482605, -0.33896753191947937, -1.4052003622055054, -1.2194138765335083, 1.0419813394546509, 0.46953824162483215, -0.05528554692864418, -0.4917277693748474, 1.1266825199127197, 0.17301960289478302, 1.3282281160354614, 0.6462597250938416, -0.3407265543937683, 0.5261896252632141, -0.4172494411468506, -0.598682701587677, 1.5658644437789917, 0.0389406681060791, -1.5477124452590942, -2.335416078567505, -0.2796871066093445, -0.9870162606239319, -0.12182720005512238, -0.8450101613998413, -0.9951111674308777, 1.4870179891586304, 0.5894249677658081, -1.025835633277893, -0.1349637359380722, -0.5070933699607849, -0.6981125473976135, 2.5459952354431152, -1.4183210134506226, -0.16246242821216583, -0.9235779643058777, -0.5819071531295776, 1.5016624927520752, -1.1655371189117432, -0.2711719274520874, -1.061589002609253, -0.5459083914756775, -1.2358500957489014, -0.4599834084510803, -0.12227904796600342, -0.7453441023826599, 0.7870453596115112, -0.16250497102737427, -1.1191762685775757, -0.2544765770435333, -1.0675939321517944, 0.8199405670166016, -0.20206286013126373, 0.019969506189227104, 1.7587119340896606, 0.2511267364025116, -0.4045904278755188, 0.7243232131004333, 1.204076886177063, 0.6741769313812256, -0.5731664896011353, 0.22857898473739624, -0.5998253226280212, 0.4116835594177246, -1.1447726488113403, 0.38987791538238525, -2.993607521057129, 0.6005445718765259, -0.021452277898788452, -0.021898968145251274, -0.13725745677947998, -1.4861634969711304, 0.9474844336509705, 2.378528594970703, -1.193280577659607, 0.6321837306022644, 0.30478277802467346, 1.1134001016616821, -1.7040228843688965, 0.028303980827331543, -0.7050172686576843, 2.0671448707580566, 0.028833672404289246, 1.021679162979126, -0.6068512797355652, -2.1979386806488037, 0.5386568903923035, -1.1117990016937256, -0.9704949855804443, 0.8259538412094116, -0.8530665040016174, 0.24360837042331696, -1.1901862621307373, -0.06043384596705437, -0.8999720215797424, -1.2411209344863892, 0.48800626397132874, 0.07626931369304657, 0.7167482972145081, -0.6507884860038757, 0.22903525829315186, -2.311168670654297, -1.3341282606124878, -0.18272708356380463, -0.8923138976097107, 0.45070624351501465, -0.37525683641433716, 0.7782071828842163, -0.03080957569181919, 0.06925071775913239, 0.2211291790008545, 1.3554695844650269, 3.196920871734619, -0.018638085573911667, 0.3393552005290985, -0.2176302671432495, -1.063028335571289, 1.4952845573425293, 0.9960706233978271, -0.15067017078399658, -0.5425096154212952, -0.9164701700210571, 1.3025459051132202, 1.9110451936721802, 1.0750311613082886, 0.10643640160560608, -0.8682584166526794, -0.7552988529205322, 0.19726306200027466, 0.1669374704360962, 0.5198458433151245, 0.9808440804481506, 0.10040225088596344, 0.26889222860336304, 1.4283382892608643, 1.0872713327407837, -0.21331830322742462, 0.5124068856239319, -0.7795040607452393, -0.4729467034339905, 0.511287271976471, 0.4354344606399536, 0.007544012740254402, 0.3199799060821533, -1.0717859268188477, -0.2303410917520523, -0.2516932785511017, -0.9386118650436401, -0.6567267775535583, -0.3906148672103882, -0.5140259861946106, 1.7616108655929565, -0.07361216843128204, -0.4835323095321655, -0.04800666496157646, -0.8209259510040283, -0.0946103185415268, -1.0894451141357422, 0.40245527029037476, -0.1817312091588974, 0.08940768241882324, -0.19197724759578705, 1.6340044736862183, -0.9695879817008972, -2.2611353397369385, 0.1992371678352356, 0.2014264017343521, -0.4155687093734741, -0.1433236449956894, 1.7928814888000488, 0.5469436645507812, 1.4024392366409302, 1.5862280130386353, 1.1090900897979736, -0.6356447339057922, -1.3641451597213745, 0.68935227394104, 0.9083595275878906, -1.3832306861877441, 0.9112169146537781, -0.18506208062171936, -0.6307872533798218, 0.6179125308990479, 1.283039927482605, 0.33337050676345825, -2.0163307189941406, 0.9506219029426575, -1.0916165113449097, 0.8832176923751831, 0.7581869959831238, 0.8788353800773621, 0.060532670468091965, 0.886070966720581, -1.2539620399475098, -1.0347917079925537, -0.5594407916069031, -0.6163306832313538, 1.850881814956665, -0.18908244371414185, 0.32254424691200256, -0.3364380896091461, -1.2477797269821167, 0.22916235029697418, 0.639616847038269, 0.36492687463760376, -0.2199038416147232, 0.7930707335472107, -0.7501567602157593, -1.154125452041626, -1.3685036897659302, -0.4079757630825043, -0.9514303803443909, -0.786613941192627, 1.0388743877410889, 0.7544806599617004, 0.5736888647079468, 1.9747042655944824, 0.6437981128692627, 0.23842686414718628, -2.677990436553955, 0.8588070869445801, 0.3282035291194916, -0.04201764240860939, 0.898985743522644, 0.24100713431835175, 1.2842497825622559, -0.17074744403362274, 0.4959852397441864, -2.321455478668213, 2.217941999435425, -0.31760141253471375, 0.7884330153465271, 0.08607591688632965, 0.09384386241436005, 1.037987470626831, 0.6176530718803406, 0.6281680464744568, -1.1523301601409912, 1.0445131063461304, -0.5791409611701965, 1.0950316190719604, 0.9948635101318359, -0.8688549399375916, 0.18848012387752533, 1.1623237133026123, 0.4457232654094696, -0.5159029364585876, -0.9864738583564758, -0.826666533946991, 0.851862907409668, 1.807810664176941, 0.10306303203105927, 0.1481563001871109, 0.8693252801895142, 0.7596912384033203, -1.2540279626846313, 0.14216069877147675, -0.6196042895317078, -0.6197698712348938, 1.71000075340271, 1.9951238632202148, 0.10670223832130432, 0.03838680312037468, -0.6655694842338562, -1.4771504402160645, 0.7615532279014587, 0.18153870105743408, -0.055204108357429504, 0.7812270522117615, -0.6429259777069092, 1.20592200756073, 0.8231701254844666, 0.8659744262695312, 0.13723154366016388, 0.02257733792066574, 0.22803103923797607, -0.17258422076702118, -1.1727092266082764, -0.3096662163734436, -0.8515176773071289, -2.5162079334259033, 0.46906062960624695, -0.29088863730430603, -1.569120168685913, 0.08124390244483948, -0.9032033085823059, 0.7798923850059509, -0.48608729243278503, -1.1825224161148071, -1.407270073890686, 0.3162638545036316, -0.163631871342659, 0.7849173545837402, -1.6027281284332275, -0.13926592469215393, 1.1691588163375854, 0.8843597769737244, -0.6494168639183044, 0.9496949911117554, 0.3099983036518097, 0.922011137008667, 0.8930866718292236, -0.41512158513069153, 0.3199141323566437, 0.3900700509548187, -1.4266396760940552, 0.32207629084587097, 1.3408058881759644, 0.058614831417798996, 1.3188742399215698, -0.48189982771873474, 0.013378407806158066, 0.4715784192085266, -0.23041793704032898, -0.511189877986908, -0.7350364923477173, 0.7783126831054688, -0.16028422117233276, -0.8686086535453796, -0.029528861865401268, 0.023889891803264618, -0.1104331910610199, 0.2942536473274231, -1.4334652423858643, -0.13012400269508362, -0.4573923945426941, -0.5970081686973572, -1.449828028678894, -0.02531556412577629, 1.321723222732544, -0.8750388622283936, -0.06874054670333862, 0.5624819993972778, 0.21616578102111816, 0.5776423215866089, 0.7139529585838318, -0.6512519717216492, -0.1815793514251709, -0.1518145650625229, -0.37898415327072144, 0.2414056807756424, 1.2728749513626099, -0.14692041277885437, -1.0005247592926025, 0.5428237318992615, -0.23601709306240082, 0.13719363510608673, 1.9954001903533936, 0.11465534567832947, -0.8654332756996155, 0.3731450140476227, -0.7612410187721252, 1.789727807044983, 1.6198899745941162, 1.3872487545013428, -0.10156354308128357, -0.9730800986289978, 0.5588201284408569, -0.2855525612831116, -0.34157559275627136, 0.9065783619880676, 0.4271659255027771, -0.2695077657699585, -1.3741074800491333, 0.6465111970901489, 1.2311049699783325, -0.9173412919044495, -0.7396490573883057, 0.23370584845542908, -0.7661552429199219, 1.2332278490066528, 0.701553225517273, 0.4144761562347412, 0.27109265327453613, 1.6919233798980713, 0.637208878993988, -0.6117228865623474, 0.5023050308227539, 0.47257810831069946, -0.16875319182872772, -1.9424397945404053, -1.1149648427963257, 0.33843258023262024, -0.4219605028629303, -1.480145812034607, 1.4402414560317993, -1.2732608318328857, -0.964277982711792, 0.5004379153251648, 0.11224737763404846, 1.3346664905548096, 0.32191455364227295, 1.8443434238433838, 2.072883367538452, 0.9411617517471313, 0.5468525290489197, 1.2739307880401611, -0.13533921539783478, -0.21805298328399658, 1.644554853439331, -0.49201861023902893, 0.7220147252082825, 1.1221636533737183, -0.5194353461265564, -1.1885899305343628, -0.7863337993621826, -1.089038372039795, -0.6312831044197083, 0.9785416126251221, 0.20650313794612885, -1.1017776727676392, 0.3635736107826233, 1.610111117362976, -0.019401870667934418, -0.08990359306335449, 0.601371169090271, 0.4070501923561096, -0.6009843349456787, -0.09146280586719513, -1.1337401866912842, 0.5536377429962158, -0.4372732937335968, -0.4054706394672394, 0.2200441062450409, 0.5360833406448364, 1.217597484588623, 0.1550556868314743, 0.09188519418239594, 1.4541265964508057, -1.3537992238998413, 1.1943291425704956, -0.9619843363761902, 0.3229728937149048, -2.274083137512207, 1.4938632249832153, -0.8914465308189392, 1.9455140829086304, -2.680765390396118, 0.39823874831199646, -0.4971478283405304, -0.5895179510116577, 0.2321980744600296, -0.17624516785144806, 0.06848682463169098, -0.07911193370819092, -1.0683223009109497, -0.11182869970798492, -0.95755934715271, 0.46980372071266174, 1.3349744081497192, 1.3525140285491943, -0.9430209398269653, -0.3508017361164093, -1.5773698091506958, -0.1792268007993698, -0.509677529335022, 0.21948377788066864, -1.7386373281478882, -0.14568109810352325, -2.0567708015441895, -2.5688509941101074, -1.3720964193344116, -1.0957987308502197, 1.2839654684066772, 0.1570657193660736, -0.9019831418991089, 1.0464462041854858, -0.36406150460243225, -1.7850604057312012, 1.2277581691741943, -2.1640162467956543 ]
https://github.com/huggingface/datasets/issues/3185
7z dataset preview not implemented?
It's a bug in the dataset viewer: the dataset cannot be downloaded in streaming mode, but since the dataset is relatively small, the dataset viewer should have fallback to normal mode. Working on a fix.
## Dataset viewer issue for dataset 'samsum' **Link:** https://huggingface.co/datasets/samsum Server Error Status code: 400 Exception: NotImplementedError Message: Extraction protocol '7z' for file at 'https://arxiv.org/src/1911.12237v2/anc/corpus.7z' is not implemented yet
1,136
35
7z dataset preview not implemented? ## Dataset viewer issue for dataset 'samsum' **Link:** https://huggingface.co/datasets/samsum Server Error Status code: 400 Exception: NotImplementedError Message: Extraction protocol '7z' for file at 'https://arxiv.org/src/1911.12237v2/anc/corpus.7z' is not implemented yet It's a bug in the dataset viewer: the dataset cannot be downloaded in streaming mode, but since the dataset is relatively small, the dataset viewer should have fallback to normal mode. Working on a fix.
[ -1.2074687480926514, -0.9131606221199036, -0.8425233960151672, 1.3861175775527954, -0.22318238019943237, -1.1567606925964355, 0.05182310938835144, -0.9353853464126587, 1.632861614227295, -0.5305943489074707, 0.22784851491451263, -1.729848861694336, -0.18259796500205994, -0.46678227186203003, -0.6915751695632935, -1.0147134065628052, -0.46500325202941895, -0.8786443471908569, 1.0488505363464355, 2.5413308143615723, 1.1649363040924072, -1.4851490259170532, 2.71640682220459, 0.657669723033905, -0.1904289275407791, -1.0710341930389404, 0.5404848456382751, 0.10406935214996338, -1.155206322669983, -0.40836960077285767, -0.9772292375564575, -0.04195389896631241, -0.5386101603507996, -0.4368220865726471, -0.0009949756786227226, 0.4830159842967987, -0.09835835546255112, -0.31630221009254456, -0.45471513271331787, -0.741834282875061, 0.4034794867038727, -0.43309488892555237, 0.8830082416534424, -0.4994308650493622, 1.7856881618499756, -0.4579760730266571, 0.24282942712306976, 0.7013643383979797, 1.428780198097229, 0.0982038751244545, -0.053241632878780365, 0.3020018935203552, 0.39204221963882446, -0.013664323836565018, 0.4616711139678955, 1.176971435546875, 0.4626811742782593, 0.5331856608390808, 0.6033596396446228, -2.3004567623138428, 1.304524540901184, -0.9986474514007568, 0.3485223650932312, 1.4682230949401855, -1.0059762001037598, 0.4561867117881775, -1.813646912574768, -0.00858390424400568, 0.5556147694587708, -2.2852401733398438, 0.2099711000919342, -1.2097121477127075, -0.5070872902870178, 0.9206216931343079, 0.35043227672576904, -1.2505276203155518, 0.18088768422603607, -0.4544749855995178, 1.0273841619491577, 0.41103291511535645, 1.2403541803359985, -1.6732910871505737, 0.07753144204616547, -0.2867754399776459, -0.08425935357809067, -1.4599928855895996, -1.5634390115737915, 0.5318906307220459, 0.6195973753929138, 0.7003162503242493, -0.1514354646205902, 0.8197044134140015, -0.9330297112464905, 0.7122395634651184, -0.9637787938117981, -1.6390714645385742, -1.4046766757965088, -2.3176515102386475, -2.298959493637085, 0.9233521819114685, -0.4233466386795044, -0.5074625015258789, 1.9530766010284424, -0.7662702798843384, -1.8655542135238647, 1.2202792167663574, 0.38615500926971436, 0.1043785959482193, 2.4090356826782227, 0.2721967399120331, -0.615546464920044, 0.37975043058395386, -0.8034316897392273, 0.9076952338218689, -0.36582687497138977, 1.5398210287094116, 0.540860116481781, -0.8116840720176697, 1.6916744709014893, -0.5062990784645081, 0.5849198698997498, -0.5893993377685547, -0.6313395500183105, -0.9561185836791992, 0.32814547419548035, 1.9046497344970703, -0.3620547950267792, 1.5265014171600342, -0.4353521764278412, -1.6182445287704468, -1.6197645664215088, 0.8361764550209045, 0.5380517840385437, -0.90521240234375, 0.0712861716747284, -0.36087867617607117, 0.09165146201848984, -0.0764608383178711, 1.116834044456482, 1.077772617340088, 0.6711660027503967, -0.34623458981513977, -1.0273188352584839, 0.28995785117149353, -0.06734626740217209, -0.7211229205131531, -1.8818470239639282, -0.32992008328437805, 0.17040526866912842, 0.5980374217033386, -1.2173964977264404, 1.5714281797409058, 0.9580219984054565, 2.0525267124176025, 0.8892966508865356, -0.4793560206890106, 1.400376796722412, -0.011078834533691406, 1.859754204750061, -0.6136488318443298, 0.6491710543632507, -0.22142218053340912, -1.1449612379074097, 0.8415819406509399, -0.3262115716934204, -2.0497756004333496, -0.9280012249946594, -1.0090423822402954, -0.235735684633255, -0.6825112104415894, 1.002092957496643, -0.28662756085395813, -1.38516366481781, 0.13290885090827942, -0.709649384021759, 0.1805582195520401, -1.2891952991485596, 0.09362699836492538, 0.7087820768356323, -0.5068293809890747, -0.0974414050579071, -0.19561323523521423, -1.3848803043365479, -0.5339251160621643, 0.31016024947166443, 1.832289218902588, -0.7547968029975891, 0.9337995648384094, 0.9019566774368286, -0.7314057946205139, 0.08573979139328003, 0.15169182419776917, -0.14326034486293793, 0.8335613012313843, -1.0494298934936523, -0.47413936257362366, 1.1446353197097778, -0.13605466485023499, -0.7381689548492432, 1.505131721496582, 0.8402162790298462, -1.0467242002487183, -0.18473616242408752, -0.324748158454895, -0.7550336718559265, -0.17557592689990997, -1.704439640045166, -0.2072639763355255, 0.18035762012004852, -1.518174648284912, -0.5082501769065857, -0.2719418704509735, 1.3003268241882324, -0.11480815708637238, 1.2896277904510498, -0.27672600746154785, -0.18231377005577087, -0.4737946391105652, -0.4196470379829407, 0.2604633569717407, -0.27831292152404785, -0.5422351956367493, 0.2000681608915329, -1.0399407148361206, 0.2905035614967346, 1.510682463645935, 0.5035327672958374, 0.10542336851358414, 0.6872380375862122, 0.9653759598731995, 0.4183558523654938, -0.047513946890830994, -0.8099995255470276, -1.4978985786437988, 1.9492628574371338, -1.4461079835891724, 1.7582333087921143, 0.7611459493637085, -0.04676813632249832, -1.8048442602157593, -1.8721693754196167, 1.296182632446289, 1.1656595468521118, 2.259608268737793, 0.6652753949165344, 0.48807260394096375, -0.9172568917274475, -0.7541720271110535, 0.16735103726387024, -1.0986766815185547, -0.6935297846794128, 0.1118302270770073, 2.2874884605407715, 1.8838756084442139, -0.684394121170044, -0.08309841901063919, -0.9277280569076538, 1.2749433517456055, -0.1470630168914795, 0.29143646359443665, 2.043172836303711, -0.2445208728313446, -1.063630223274231, 1.2826935052871704, -2.317654609680176, 0.23546911776065826, 1.9485191106796265, 0.29867982864379883, 0.20295560359954834, -1.541137456893921, -0.7467514276504517, -0.14662788808345795, -0.4666295647621155, -1.1708523035049438, 0.6250914931297302, -0.3732006251811981, -0.9087636470794678, -1.510382890701294, 0.15923281013965607, -1.0390515327453613, -1.6506110429763794, 0.38395074009895325, 1.8352588415145874, 2.0147550106048584, -0.772567868232727, 1.4733967781066895, -0.16968007385730743, 0.10570299625396729, 1.3863037824630737, 1.1000202894210815, 2.9002437591552734, 1.9706287384033203, -1.1540961265563965, 0.7572289109230042, -0.08514481037855148, -0.4924771189689636, 1.1770517826080322, -1.0951128005981445, 1.1814264059066772, -0.26100102066993713, -1.1153753995895386, -1.2552706003189087, 0.9756761789321899, 0.4753659963607788, 0.0906987413764, -0.4996977746486664, 1.3116481304168701, 0.0010541761294007301, 1.3511420488357544, 0.610787570476532, -0.4083630442619324, 0.4705057740211487, -0.3852849006652832, -0.48039957880973816, 1.6826496124267578, 0.15788526833057404, -1.5453280210494995, -2.225520610809326, -0.30140048265457153, -0.7996917366981506, -0.07555527985095978, -0.5045806765556335, -1.0533950328826904, 1.520068883895874, 0.5307673215866089, -1.2348287105560303, -0.3180961012840271, -0.36361539363861084, -0.5816220045089722, 2.643681287765503, -1.4110990762710571, -0.12666381895542145, -0.856850802898407, -0.4075493812561035, 1.7503092288970947, -1.1472132205963135, -0.12462718039751053, -1.0922552347183228, -0.6907030344009399, -1.3768844604492188, -0.4914238452911377, -0.06425567716360092, -0.8778126239776611, 0.8007242679595947, 0.08728356659412384, -1.0258513689041138, -0.1981959491968155, -0.8088260293006897, 0.9570735692977905, -0.11303290724754333, 0.27941203117370605, 1.9700947999954224, 0.41740691661834717, -0.39981433749198914, 0.6724640727043152, 1.1273012161254883, 0.603700578212738, -0.6649571657180786, 0.10333427041769028, -0.6865736842155457, 0.31956741213798523, -1.49773371219635, 0.10963089764118195, -3.0170655250549316, 0.7120210528373718, -0.09664064645767212, 0.018202802166342735, -0.01844099909067154, -1.2899023294448853, 1.1888625621795654, 2.502779483795166, -1.3028239011764526, 0.426546186208725, 0.39506691694259644, 1.1830670833587646, -1.6007156372070312, 0.32165929675102234, -0.42655566334724426, 2.1821701526641846, 0.13528604805469513, 1.2258585691452026, -0.4895811378955841, -2.099302291870117, 0.6890411972999573, -1.2458840608596802, -1.0603667497634888, 0.6026598215103149, -0.8118131756782532, 0.16080999374389648, -1.6596133708953857, -0.1314534693956375, -0.9471198916435242, -1.368943452835083, 0.861174464225769, 0.17435558140277863, 0.2684056758880615, -0.5493735074996948, 0.42832857370376587, -2.1307973861694336, -1.4472143650054932, -0.21836696565151215, -0.8358530402183533, 0.5359845161437988, -0.30441054701805115, 0.749449610710144, -0.05085798352956772, -0.013967707753181458, 0.2449093610048294, 1.2245045900344849, 3.4329583644866943, 0.13201995193958282, 0.3189290463924408, -0.04691185802221298, -0.9484016299247742, 1.4085561037063599, 1.1556824445724487, 0.026969963684678078, -0.48671817779541016, -1.04344642162323, 1.3293768167495728, 2.097947120666504, 1.0112953186035156, 0.11339223384857178, -0.8334859609603882, -0.529509425163269, -0.043505750596523285, 0.2359042763710022, 0.6985414624214172, 0.8996700644493103, -0.07425732910633087, 0.08739708364009857, 1.4727137088775635, 1.2502750158309937, -0.3505544662475586, 0.4666300117969513, -0.9667432904243469, -0.4765115976333618, 0.49198848009109497, 0.2634694576263428, -0.0131401177495718, 0.5430929064750671, -1.0572843551635742, -0.24603816866874695, -0.12972189486026764, -1.0049898624420166, -0.6812426447868347, -0.3469947278499603, -0.4256002604961395, 1.559119701385498, 0.19675306975841522, -0.5851923227310181, -0.06622466444969177, -0.7307886481285095, -0.16929113864898682, -1.1297703981399536, 0.3302035629749298, -0.22213128209114075, 0.03456965833902359, -0.22520039975643158, 1.7705577611923218, -0.9491083025932312, -2.1211366653442383, 0.20301614701747894, 0.5331575870513916, -0.5464000701904297, 0.21484878659248352, 1.6422432661056519, 0.5315195322036743, 1.4191874265670776, 1.2619141340255737, 0.957356333732605, -0.6458989977836609, -1.3586580753326416, 0.502633810043335, 1.0600169897079468, -1.3927925825119019, 0.7751895785331726, -0.020101558417081833, -0.5319724082946777, 0.7549381852149963, 1.3662998676300049, 0.41432902216911316, -1.9856715202331543, 0.8588513731956482, -0.8897683024406433, 0.8784864544868469, 0.5634709000587463, 0.8625968098640442, 0.2767358422279358, 0.7831839919090271, -1.3487625122070312, -1.103330135345459, -0.9125810861587524, -0.5727151036262512, 1.920517921447754, -0.16464564204216003, 0.547667920589447, -0.06680326163768768, -1.2340198755264282, -0.09539340436458588, 0.7515050768852234, 0.3278741240501404, -0.3691152036190033, 0.8158954977989197, -0.5228529572486877, -1.116300344467163, -1.3260443210601807, -0.3572098910808563, -0.8545851111412048, -0.885596513748169, 1.0353870391845703, 0.7543201446533203, 0.3761307895183563, 1.8702025413513184, 0.5435431599617004, 0.15563127398490906, -2.674835443496704, 0.8659880757331848, 0.3377031683921814, 0.1733735352754593, 0.9163442254066467, 0.2771381735801697, 1.0514037609100342, -0.07981260865926743, 0.5102438926696777, -2.1904656887054443, 2.0997893810272217, -0.22396306693553925, 0.5728994011878967, 0.04562470316886902, -0.11794702708721161, 1.0737032890319824, 0.6161012053489685, 0.6491256952285767, -1.132304072380066, 0.7852839827537537, -0.6474826335906982, 1.1989829540252686, 1.0090245008468628, -0.7139868140220642, -0.0467580109834671, 1.363651990890503, 0.5972170829772949, -0.38351067900657654, -0.9267024397850037, -0.6731390357017517, 1.0343042612075806, 1.6701048612594604, -0.16461099684238434, -0.04376090317964554, 0.8277908563613892, 0.5143424868583679, -1.3414053916931152, -0.02219409868121147, -0.7128131985664368, -0.5533475279808044, 1.6835176944732666, 2.021268844604492, -0.11780355125665665, -0.18416374921798706, -0.7242016792297363, -1.2142527103424072, 0.6125796437263489, -0.02062084898352623, 0.13945846259593964, 0.8276964426040649, -0.6290863752365112, 1.1591054201126099, 0.5866560339927673, 0.8090258836746216, -0.012674153782427311, 0.4349059462547302, 0.34399521350860596, -0.1758018434047699, -1.1663638353347778, -0.3256920278072357, -1.1160482168197632, -2.5112009048461914, 0.4326580762863159, -0.28333374857902527, -1.4190740585327148, -0.052200086414813995, -1.1490076780319214, 1.080012559890747, -0.40482011437416077, -1.0879812240600586, -1.5361168384552002, 0.2568018436431885, -0.03872005268931389, 0.8742546439170837, -1.488625407218933, 0.0008659744635224342, 1.358138084411621, 0.8499476909637451, -0.7376699447631836, 1.1237152814865112, 0.34879714250564575, 1.1876887083053589, 0.6763375997543335, -0.35393810272216797, 0.4826798141002655, 0.09866078943014145, -1.2566721439361572, 0.6105178594589233, 1.1430332660675049, 0.07510767132043839, 1.4278581142425537, -0.5951098203659058, 0.01352003961801529, 0.5115607976913452, -0.5658130049705505, -0.4455556571483612, -0.3782687485218048, 0.7759751081466675, 0.08195813745260239, -1.0485153198242188, 0.05526784062385559, -0.175090491771698, -0.11087587475776672, 0.2449095994234085, -1.42898690700531, -0.3951815962791443, -0.40572816133499146, -0.3940560519695282, -1.2925151586532593, -0.011131394654512405, 1.4183999300003052, -0.7124962210655212, -0.2743813097476959, 0.5765545964241028, 0.31656208634376526, 0.5816501379013062, 0.5747517347335815, -0.6732309460639954, -0.33470240235328674, -0.24027949571609497, -0.29807496070861816, 0.2550783157348633, 1.2860842943191528, -0.15301086008548737, -1.1081726551055908, 0.8888370394706726, -0.33598777651786804, 0.022112706676125526, 2.002101421356201, 0.09750621765851974, -0.8532748222351074, 0.28619295358657837, -0.7986152172088623, 1.8760441541671753, 1.575582504272461, 1.2934576272964478, -0.09700186550617218, -0.8063449859619141, 0.4592868685722351, -0.1822933852672577, -0.3429676294326782, 0.8496579527854919, 0.5696324110031128, -0.2191639393568039, -1.394248127937317, 0.42679911851882935, 1.2495954036712646, -0.8765798211097717, -0.7963158488273621, 0.1422804594039917, -0.7948747277259827, 1.1541894674301147, 0.7091368436813354, 0.5491347312927246, 0.2697627544403076, 1.5318777561187744, 0.6276190876960754, -0.5491778254508972, 0.5320751070976257, 0.4999358057975769, -0.09137440472841263, -2.1032800674438477, -1.0900284051895142, 0.23083241283893585, -0.46414950489997864, -1.4679772853851318, 1.2732511758804321, -1.1529686450958252, -0.8702362179756165, 0.5555030107498169, 0.1597069948911667, 1.4785757064819336, 0.2744785249233246, 1.6991009712219238, 1.961715817451477, 1.000008463859558, 0.19411002099514008, 1.5141880512237549, -0.05129168927669525, -0.5647625923156738, 1.8423330783843994, -0.4029574990272522, 0.5368912816047668, 1.1121569871902466, -0.4812948703765869, -0.9971182346343994, -0.7297042608261108, -1.207260251045227, -0.5608041882514954, 1.0908613204956055, 0.217243954539299, -1.2602969408035278, 0.12378305941820145, 1.517022728919983, 0.2206161916255951, -0.34254324436187744, 0.5615097284317017, 0.4260120391845703, -0.9267386794090271, -0.006939495448023081, -0.9501851797103882, 0.32807019352912903, -0.14802232384681702, -0.2983718514442444, 0.2760898470878601, 0.47298258543014526, 1.2587997913360596, -0.02299315109848976, 0.26040270924568176, 1.1546902656555176, -1.3227949142456055, 1.5376036167144775, -0.5978351831436157, 0.1343923807144165, -2.5061817169189453, 1.4105298519134521, -0.7528793811798096, 1.9374176263809204, -2.695253372192383, 0.46225816011428833, -0.6666052341461182, -0.3875071108341217, 0.2941534221172333, -0.4642428159713745, 0.04513686150312424, -0.04539048671722412, -1.1267169713974, 0.030552657321095467, -0.7238495349884033, 0.522688627243042, 1.2273471355438232, 1.391184687614441, -1.1209381818771362, -0.35203903913497925, -1.8142242431640625, -0.24402058124542236, -0.8622329831123352, 0.41816893219947815, -2.0993871688842773, -0.17788392305374146, -1.8601322174072266, -2.292908191680908, -1.4438765048980713, -0.8459590077400208, 1.0254132747650146, 0.18981990218162537, -0.9846689701080322, 1.015440821647644, -0.33098676800727844, -1.7532438039779663, 1.0830992460250854, -2.120026111602783 ]
https://github.com/huggingface/datasets/issues/3181
`None` converted to `"None"` when loading a dataset
Hi @eladsegal, thanks for reporting. @mariosasko I saw you are already working on this, but maybe my comment will be useful to you. All values are casted to their corresponding feature type (including `None` values). For example if the feature type is `Value("bool")`, `None` is casted to `False`. It is true that strings were an exception, but this was recently fixed by @lhoestq (see #3158).
## Describe the bug When loading a dataset `None` values of the type `NoneType` are converted to `'None'` of the type `str`. ## Steps to reproduce the bug ```python from datasets import load_dataset qasper = load_dataset("qasper", split="train", download_mode="reuse_cache_if_exists") print(qasper[60]["full_text"]["section_name"]) ``` When installing version 1.1.40, the output is `[None, 'Introduction', 'Benchmark Datasets', ...]` When installing from the master branch, the output is `['None', 'Introduction', 'Benchmark Datasets', ...]` Notice how the first element was changed from `NoneType` to `str`. ## Expected results `None` should stay as is. ## Actual results `None` is converted to a string. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: master - Platform: Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 4.0.1
1,137
65
`None` converted to `"None"` when loading a dataset ## Describe the bug When loading a dataset `None` values of the type `NoneType` are converted to `'None'` of the type `str`. ## Steps to reproduce the bug ```python from datasets import load_dataset qasper = load_dataset("qasper", split="train", download_mode="reuse_cache_if_exists") print(qasper[60]["full_text"]["section_name"]) ``` When installing version 1.1.40, the output is `[None, 'Introduction', 'Benchmark Datasets', ...]` When installing from the master branch, the output is `['None', 'Introduction', 'Benchmark Datasets', ...]` Notice how the first element was changed from `NoneType` to `str`. ## Expected results `None` should stay as is. ## Actual results `None` is converted to a string. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: master - Platform: Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 4.0.1 Hi @eladsegal, thanks for reporting. @mariosasko I saw you are already working on this, but maybe my comment will be useful to you. All values are casted to their corresponding feature type (including `None` values). For example if the feature type is `Value("bool")`, `None` is casted to `False`. It is true that strings were an exception, but this was recently fixed by @lhoestq (see #3158).
[ -1.0999916791915894, -0.8553860187530518, -0.7405563592910767, 1.594931960105896, -0.11760137230157852, -1.2051451206207275, 0.15265530347824097, -1.0315252542495728, 1.8005903959274292, -0.8054513931274414, 0.3664199113845825, -1.6940126419067383, 0.05141976475715637, -0.62486332654953, -0.7964997291564941, -0.7793599963188171, -0.4025125503540039, -0.7060555815696716, 1.0481927394866943, 2.4353315830230713, 1.171818494796753, -1.3083306550979614, 2.6041555404663086, 0.6426695585250854, -0.14344768226146698, -0.9821888208389282, 0.514001727104187, -0.08031877875328064, -1.2836130857467651, -0.38230133056640625, -0.8787364959716797, -0.13758903741836548, -0.6252370476722717, -0.6866828799247742, 0.013412460684776306, 0.4951173663139343, -0.3401520848274231, -0.5152324438095093, -0.5525035858154297, -0.8264153003692627, 0.447407066822052, -0.40129005908966064, 0.9359803795814514, -0.32686883211135864, 1.8660905361175537, -0.5965486168861389, 0.513750433921814, 0.6864166259765625, 1.3484293222427368, 0.2696956396102905, 0.04268132522702217, 0.38744205236434937, 0.46135491132736206, -0.000876033678650856, 0.5230891704559326, 1.1075870990753174, 0.6462095975875854, 0.5026422739028931, 0.8662479519844055, -2.317964792251587, 1.2753944396972656, -1.0876286029815674, 0.2903951406478882, 1.2976384162902832, -0.8845461010932922, 0.31103307008743286, -1.7927005290985107, 0.036021169275045395, 0.5332988500595093, -2.1696572303771973, 0.22849318385124207, -1.3165526390075684, -0.4742583632469177, 1.0200849771499634, 0.3663333058357239, -1.2878133058547974, 0.06428997218608856, -0.34166061878204346, 0.9213215112686157, 0.38867712020874023, 1.0927212238311768, -1.7601262331008911, -0.08953376859426498, -0.38437044620513916, 0.20112048089504242, -1.2187179327011108, -1.5304627418518066, 0.5377867221832275, 0.7128780484199524, 0.5250275731086731, -0.21770800650119781, 1.0399852991104126, -0.9841777086257935, 0.7235952019691467, -1.0894695520401, -1.893511414527893, -1.342751383781433, -2.1950485706329346, -2.292693853378296, 0.7090625166893005, -0.478671133518219, -0.44400179386138916, 2.1050639152526855, -0.953607976436615, -1.7513805627822876, 1.1029565334320068, 0.3524931073188782, -0.02631772682070732, 2.402636766433716, 0.17610348761081696, -0.6978076696395874, 0.5030559301376343, -0.7857739329338074, 0.6828035116195679, -0.40770334005355835, 1.350990891456604, 0.3880695104598999, -1.0525500774383545, 1.6506487131118774, -0.318747341632843, 0.6309976577758789, -0.7496116757392883, -0.4043717384338379, -0.7033637762069702, 0.2947477698326111, 1.8694581985473633, -0.2701740860939026, 1.4655990600585938, -0.3556281328201294, -1.529105305671692, -1.5948466062545776, 0.8504166007041931, 0.4264800548553467, -0.6793538928031921, 0.15058855712413788, -0.2740481495857239, 0.17622010409832, -0.07932154834270477, 1.2342661619186401, 1.2916940450668335, 0.8147553205490112, -0.2701954245567322, -0.8766807317733765, 0.16726821660995483, -0.0494110994040966, -0.8002969622612, -1.7316678762435913, -0.3497169017791748, 0.14672493934631348, 0.6926259994506836, -1.148828387260437, 1.8184380531311035, 0.8812022805213928, 1.9204119443893433, 1.0354177951812744, -0.35475653409957886, 1.4410895109176636, 0.09866424649953842, 1.937786340713501, -0.4655454158782959, 0.6318723559379578, -0.495674729347229, -1.1340276002883911, 0.8283080458641052, -0.27252626419067383, -1.965497374534607, -0.7347332239151001, -0.9044681191444397, -0.19024939835071564, -0.7264502644538879, 0.9110843539237976, -0.26469123363494873, -1.3737775087356567, 0.2265283316373825, -0.7755818367004395, 0.049463000148534775, -1.2091923952102661, 0.33595532178878784, 0.6994335055351257, -0.6309767365455627, 0.2317323088645935, -0.2799510955810547, -1.3502318859100342, -0.5439185500144958, 0.3432368040084839, 1.8667110204696655, -0.8328832983970642, 0.9473876953125, 1.0549911260604858, -0.7676088809967041, -0.0833551362156868, 0.3740350008010864, -0.3245028257369995, 0.8297349810600281, -1.0571789741516113, -0.4752950072288513, 1.1997811794281006, -0.13584232330322266, -0.6451153755187988, 1.4193568229675293, 0.6766704320907593, -0.9877849221229553, -0.16013705730438232, -0.12790733575820923, -0.7684420347213745, 0.0928768664598465, -1.5974388122558594, -0.06365637481212616, 0.4586314558982849, -1.5929447412490845, -0.5044917464256287, -0.17661282420158386, 1.2747875452041626, -0.13564829528331757, 1.3335274457931519, -0.24643296003341675, -0.24948403239250183, -0.3959692120552063, -0.34059035778045654, 0.07503940165042877, -0.20596982538700104, -0.724226176738739, 0.23637507855892181, -0.6929473280906677, 0.4375948905944824, 1.4143348932266235, 0.26363879442214966, -0.001125238835811615, 0.5690170526504517, 1.2101383209228516, 0.3800659775733948, 0.08217554539442062, -0.91279536485672, -1.5607612133026123, 1.9663736820220947, -1.5205776691436768, 2.012082099914551, 0.645317792892456, -0.03797455132007599, -1.7527918815612793, -1.908751130104065, 1.551274299621582, 1.1344789266586304, 2.352118730545044, 0.6463821530342102, 0.43601810932159424, -0.8161997199058533, -0.5665923357009888, 0.28340864181518555, -0.9868615865707397, -0.7363272905349731, 0.20318152010440826, 2.4402077198028564, 1.6744892597198486, -0.5115143060684204, -0.16835856437683105, -1.021880865097046, 1.4804633855819702, -0.1300194263458252, 0.20778194069862366, 2.0083577632904053, -0.28885602951049805, -1.0680723190307617, 1.2647024393081665, -2.3166558742523193, 0.1589028686285019, 2.00189208984375, 0.17916610836982727, 0.09824001789093018, -1.2932932376861572, -0.6840458512306213, -0.26240503787994385, -0.4249352812767029, -1.255518913269043, 0.4899309277534485, -0.12975499033927917, -0.7022413611412048, -1.477356195449829, 0.2016599476337433, -1.100411295890808, -1.613084316253662, 0.1384214162826538, 1.9408822059631348, 1.939402461051941, -0.7263472080230713, 1.6071897745132446, -0.238283172249794, 0.2709852457046509, 1.280290961265564, 1.2166463136672974, 3.087867021560669, 1.929731845855713, -1.2307926416397095, 0.6551868915557861, -0.12965929508209229, -0.4885181784629822, 1.1838494539260864, -1.1758745908737183, 1.2724449634552002, -0.14633722603321075, -1.1195693016052246, -1.235642910003662, 0.8554849028587341, 0.4809672236442566, -0.039724573493003845, -0.4384499192237854, 1.1334056854248047, 0.12068267166614532, 1.277190089225769, 0.5961594581604004, -0.23970089852809906, 0.7484042644500732, -0.4116712212562561, -0.503680408000946, 1.5485169887542725, 0.22214815020561218, -1.3782577514648438, -2.282923698425293, -0.16876564919948578, -0.9021974802017212, 0.06348706781864166, -0.6205629110336304, -0.947782576084137, 1.6692233085632324, 0.38051921129226685, -1.206315040588379, -0.1989346593618393, -0.30238091945648193, -0.674960732460022, 2.7943551540374756, -1.3859726190567017, -0.28076642751693726, -1.031844139099121, -0.7135822772979736, 1.6561650037765503, -1.1988012790679932, -0.210959792137146, -1.0718214511871338, -0.43275755643844604, -1.3231070041656494, -0.5882351398468018, 0.03740650415420532, -0.8516049981117249, 0.8661898374557495, 0.24583788216114044, -1.3149139881134033, -0.4294821619987488, -0.8977142572402954, 0.8010642528533936, -0.14540159702301025, 0.1553935706615448, 1.8966344594955444, 0.5426944494247437, -0.343106746673584, 0.6496729254722595, 1.1472320556640625, 0.6880816221237183, -0.5503162145614624, 0.3939357399940491, -0.6139861941337585, 0.30522602796554565, -1.295057773590088, 0.23546725511550903, -2.7836925983428955, 0.5868213772773743, -0.04185492917895317, -0.1146933063864708, -0.004485216923058033, -1.3465056419372559, 1.0573724508285522, 2.523594379425049, -1.1992210149765015, 0.4653319716453552, 0.19493409991264343, 1.2696236371994019, -1.6014374494552612, 0.2055073231458664, -0.45693129301071167, 2.154829502105713, 0.1253613829612732, 1.088593602180481, -0.44758927822113037, -2.304842472076416, 0.5500527024269104, -1.270513653755188, -1.237559199333191, 0.7692258358001709, -0.8492738604545593, 0.08636245876550674, -1.329201579093933, -0.20359309017658234, -0.8575745820999146, -1.1761441230773926, 0.761049747467041, 0.06204696744680405, 0.44702786207199097, -0.6381272673606873, 0.4116777181625366, -2.1485486030578613, -1.4269828796386719, -0.29493677616119385, -0.9178404808044434, 0.4557510018348694, -0.31290602684020996, 0.7620700001716614, -0.22737303376197815, -0.028333278372883797, 0.3691292405128479, 1.4459463357925415, 3.3679893016815186, 0.1736842542886734, 0.473929226398468, -0.2786012291908264, -0.9963987469673157, 1.4648730754852295, 0.9393768310546875, -0.16454748809337616, -0.4852537512779236, -1.132786750793457, 1.2111495733261108, 1.9686347246170044, 1.0099154710769653, -0.021778147667646408, -0.6936324834823608, -0.7830263376235962, 0.05177251249551773, 0.18366779386997223, 0.4101782441139221, 0.8057500123977661, 0.19215936958789825, 0.08007729053497314, 1.343660593032837, 1.1101680994033813, -0.4509503245353699, 0.3458441495895386, -0.7739612460136414, -0.4576760530471802, 0.562605082988739, 0.34509724378585815, 0.004691249690949917, 0.2494008094072342, -1.0247318744659424, -0.2752683162689209, -0.33611583709716797, -0.8970869779586792, -0.7391912937164307, -0.4953976273536682, -0.3353894352912903, 1.6727294921875, 0.01582547463476658, -0.5504531860351562, -0.0472627691924572, -0.7856113910675049, 0.045220110565423965, -1.0218693017959595, 0.27512550354003906, -0.14939388632774353, -0.16845263540744781, -0.05609547346830368, 1.7932205200195312, -0.9881455302238464, -2.0077972412109375, 0.25250279903411865, 0.2524363398551941, -0.3458373546600342, 0.24854345619678497, 1.6254009008407593, 0.5867409706115723, 1.4744337797164917, 1.4486576318740845, 1.008436918258667, -0.7389422655105591, -1.3604494333267212, 0.5860200524330139, 0.9395082592964172, -1.362627625465393, 0.7653343677520752, 0.05413304269313812, -0.4556712508201599, 0.49585777521133423, 1.3055648803710938, 0.44702160358428955, -1.9716039896011353, 0.6875479817390442, -0.8837565779685974, 0.7874000072479248, 0.7728355526924133, 0.7730756402015686, 0.18166755139827728, 0.730503499507904, -1.1748210191726685, -1.1689608097076416, -0.6776195764541626, -0.7369614839553833, 1.9159711599349976, -0.23962073028087616, 0.5957862138748169, -0.13354229927062988, -1.4033098220825195, -0.05903563275933266, 0.6643004417419434, 0.4015209674835205, -0.5840974450111389, 0.6878433227539062, -0.6088847517967224, -1.1197277307510376, -1.3702443838119507, -0.5224403142929077, -1.136912226676941, -1.004953384399414, 1.0417602062225342, 0.8536502122879028, 0.2861611247062683, 1.8860607147216797, 0.6813847422599792, 0.20689186453819275, -2.5829498767852783, 0.8626469373703003, 0.40059149265289307, -0.0757550522685051, 0.7535792589187622, 0.5041561722755432, 0.9815991520881653, -0.16104845702648163, 0.6358689665794373, -2.401535987854004, 2.3643198013305664, -0.21594808995723724, 0.6994141340255737, -0.018910860642790794, -0.19459877908229828, 1.0069078207015991, 0.5469528436660767, 0.5057314038276672, -1.0046119689941406, 0.5954791903495789, -0.6654902100563049, 1.3361161947250366, 0.8221142888069153, -0.7869881987571716, -0.024459168314933777, 1.330517292022705, 0.5195369124412537, -0.5739763379096985, -0.9473426938056946, -1.0426527261734009, 0.922272801399231, 1.7240471839904785, -0.11855916678905487, -0.02216465398669243, 0.9044959545135498, 0.6543927192687988, -1.337144374847412, 0.059106722474098206, -0.7648680806159973, -0.7317876219749451, 1.693068027496338, 2.102274179458618, -0.22261758148670197, -0.22052639722824097, -0.8322644233703613, -1.2339779138565063, 0.7832168936729431, 0.10801369696855545, 0.035557642579078674, 0.6669912934303284, -0.6300957798957825, 1.1454954147338867, 0.8890298008918762, 0.9190200567245483, 0.2753239870071411, 0.3328658938407898, 0.3225082755088806, -0.394314706325531, -1.1758999824523926, -0.17790661752223969, -1.0714735984802246, -2.5555713176727295, 0.47691071033477783, -0.22076688706874847, -1.3705408573150635, -0.004180376883596182, -1.0216442346572876, 0.8453436493873596, -0.4747793674468994, -1.161233901977539, -1.4220421314239502, 0.10612812638282776, -0.050498832017183304, 0.8739609718322754, -1.6413718461990356, -0.05045462027192116, 1.1995428800582886, 0.9981865882873535, -0.8486209511756897, 0.9388298988342285, 0.2288568615913391, 1.096014142036438, 0.9534450769424438, -0.3270246982574463, 0.48637574911117554, -0.029003813862800598, -1.3376117944717407, 0.4407883882522583, 1.1606216430664062, 0.17166008055210114, 1.4382792711257935, -0.5770239233970642, -0.005590084008872509, 0.3622007369995117, -0.4264812469482422, -0.45515626668930054, -0.6819424629211426, 0.6005197763442993, 0.06470710039138794, -0.8371096849441528, 0.13048769533634186, 0.036957480013370514, -0.1818711757659912, 0.16637495160102844, -1.5064291954040527, -0.08230892568826675, -0.35003048181533813, -0.6943588852882385, -1.140662431716919, -0.14602884650230408, 1.3237131834030151, -0.6848251223564148, -0.1589466780424118, 0.504633903503418, 0.21909072995185852, 0.45893746614456177, 0.5802971720695496, -0.6540282964706421, -0.40170979499816895, -0.17619556188583374, -0.4493902325630188, 0.3740966320037842, 1.4752603769302368, -0.07802478224039078, -0.9708698391914368, 0.6695095896720886, -0.3597422242164612, 0.05152744799852371, 1.8936944007873535, 0.03739030286669731, -0.8532344102859497, 0.22845694422721863, -0.6954147815704346, 1.9463180303573608, 1.7923961877822876, 1.324947476387024, -0.09235779196023941, -1.0320531129837036, 0.6609247326850891, -0.38704413175582886, -0.5026207566261292, 0.9346001744270325, 0.3227004408836365, -0.26571470499038696, -1.336104393005371, 0.7215844988822937, 1.3501096963882446, -0.8018905520439148, -0.8782094120979309, 0.1770261973142624, -0.8027445077896118, 1.089889407157898, 0.7367132306098938, 0.386160671710968, 0.28201019763946533, 1.6452257633209229, 0.7957716584205627, -0.4192658066749573, 0.617519736289978, 0.49504733085632324, -0.16827726364135742, -2.045123815536499, -1.2415618896484375, 0.29770803451538086, -0.5698162317276001, -1.6623691320419312, 1.4302781820297241, -1.2180519104003906, -0.9737611413002014, 0.5707616806030273, 0.11211615800857544, 1.4729357957839966, 0.39121997356414795, 1.4921168088912964, 2.0217254161834717, 0.8105306625366211, 0.4537469744682312, 1.261401891708374, -0.2164337933063507, -0.5225880742073059, 1.7433784008026123, -0.5262266397476196, 0.46658700704574585, 1.090504765510559, -0.21179580688476562, -1.1599247455596924, -0.7891348004341125, -1.2884705066680908, -0.7684321999549866, 1.1453018188476562, 0.054743871092796326, -1.1793835163116455, 0.35222113132476807, 1.6457303762435913, 0.013739943504333496, -0.39523792266845703, 0.6801481246948242, 0.3382711410522461, -0.8138028383255005, -0.08670562505722046, -0.9620568752288818, 0.5992392897605896, -0.23696886003017426, -0.3074091672897339, 0.396185040473938, 0.4750629663467407, 1.3766145706176758, 0.05381987243890762, 0.14141613245010376, 1.108243465423584, -1.3791414499282837, 1.4917974472045898, -0.6841405630111694, 0.3226196765899658, -2.307873487472534, 1.4216471910476685, -0.7689170241355896, 1.8825827836990356, -2.6822805404663086, 0.3712124228477478, -0.5383008718490601, -0.5322434902191162, 0.27257615327835083, -0.2947003245353699, 0.1700771450996399, -0.18167822062969208, -1.2148267030715942, -0.08094345033168793, -0.738364040851593, 0.5039624571800232, 1.0830585956573486, 1.3502804040908813, -1.037923812866211, -0.3500867486000061, -1.733916163444519, -0.10548872500658035, -0.6042479872703552, 0.32337069511413574, -1.9386744499206543, -0.3068278431892395, -1.8921152353286743, -2.349217653274536, -1.2535239458084106, -0.811689019203186, 1.110224723815918, 0.03855976462364197, -0.8360961079597473, 1.1787182092666626, -0.3988008499145508, -1.8999115228652954, 1.0628665685653687, -2.168626070022583 ]
https://github.com/huggingface/datasets/issues/3181
`None` converted to `"None"` when loading a dataset
Thanks for reporting. This is actually a breaking change that I think can cause issues when users preprocess their data. String columns used to be nullable. Maybe we can correct https://github.com/huggingface/datasets/pull/3158 to keep the None values and avoid this breaking change ? EDIT: the other types (bool, int, etc) can also become nullable IMO
## Describe the bug When loading a dataset `None` values of the type `NoneType` are converted to `'None'` of the type `str`. ## Steps to reproduce the bug ```python from datasets import load_dataset qasper = load_dataset("qasper", split="train", download_mode="reuse_cache_if_exists") print(qasper[60]["full_text"]["section_name"]) ``` When installing version 1.1.40, the output is `[None, 'Introduction', 'Benchmark Datasets', ...]` When installing from the master branch, the output is `['None', 'Introduction', 'Benchmark Datasets', ...]` Notice how the first element was changed from `NoneType` to `str`. ## Expected results `None` should stay as is. ## Actual results `None` is converted to a string. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: master - Platform: Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 4.0.1
1,137
54
`None` converted to `"None"` when loading a dataset ## Describe the bug When loading a dataset `None` values of the type `NoneType` are converted to `'None'` of the type `str`. ## Steps to reproduce the bug ```python from datasets import load_dataset qasper = load_dataset("qasper", split="train", download_mode="reuse_cache_if_exists") print(qasper[60]["full_text"]["section_name"]) ``` When installing version 1.1.40, the output is `[None, 'Introduction', 'Benchmark Datasets', ...]` When installing from the master branch, the output is `['None', 'Introduction', 'Benchmark Datasets', ...]` Notice how the first element was changed from `NoneType` to `str`. ## Expected results `None` should stay as is. ## Actual results `None` is converted to a string. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: master - Platform: Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 4.0.1 Thanks for reporting. This is actually a breaking change that I think can cause issues when users preprocess their data. String columns used to be nullable. Maybe we can correct https://github.com/huggingface/datasets/pull/3158 to keep the None values and avoid this breaking change ? EDIT: the other types (bool, int, etc) can also become nullable IMO
[ -1.0911318063735962, -0.882531464099884, -0.7324954867362976, 1.550197958946228, -0.0904211550951004, -1.2375785112380981, 0.11741011589765549, -1.0219576358795166, 1.7756493091583252, -0.7770442962646484, 0.35934382677078247, -1.679020643234253, 0.03219295293092728, -0.5986884236335754, -0.7833253741264343, -0.8043530583381653, -0.37582528591156006, -0.7271472811698914, 1.0493395328521729, 2.3937313556671143, 1.161172866821289, -1.3227983713150024, 2.632176160812378, 0.6426084041595459, -0.12481633573770523, -0.9935699105262756, 0.5302017331123352, -0.03779129683971405, -1.30856454372406, -0.35791656374931335, -0.8524294495582581, -0.10066206008195877, -0.639535129070282, -0.6330582499504089, -0.002164611592888832, 0.48900288343429565, -0.3403954803943634, -0.5174511075019836, -0.5613001585006714, -0.8098906874656677, 0.4010714888572693, -0.40561336278915405, 0.9089711308479309, -0.3351782560348511, 1.8461074829101562, -0.5747876167297363, 0.47286882996559143, 0.7035751938819885, 1.3052988052368164, 0.24825559556484222, 0.0628562867641449, 0.35910531878471375, 0.4292285442352295, 0.0003473535180091858, 0.5374179482460022, 1.122146725654602, 0.613553524017334, 0.5152904987335205, 0.8389484882354736, -2.308938980102539, 1.2869166135787964, -1.0421169996261597, 0.2939893901348114, 1.2905490398406982, -0.8740020990371704, 0.35057392716407776, -1.78932785987854, 0.01512918435037136, 0.5532001852989197, -2.1925017833709717, 0.2373330444097519, -1.3553680181503296, -0.49727872014045715, 0.9896285533905029, 0.3808021545410156, -1.265188455581665, 0.05979194492101669, -0.38642871379852295, 0.9328992962837219, 0.40938830375671387, 1.1051111221313477, -1.7323459386825562, -0.08769884705543518, -0.3311498165130615, 0.18226145207881927, -1.2721902132034302, -1.5362865924835205, 0.5390615463256836, 0.7210204005241394, 0.5696073174476624, -0.22681941092014313, 1.0329976081848145, -1.0139801502227783, 0.725850522518158, -1.0515373945236206, -1.8826621770858765, -1.341537356376648, -2.224487781524658, -2.2782816886901855, 0.7357046604156494, -0.48475274443626404, -0.4616073966026306, 2.0918538570404053, -0.9736506342887878, -1.791636347770691, 1.0983209609985352, 0.3538714349269867, -0.008983130566775799, 2.4006235599517822, 0.18370339274406433, -0.6928257942199707, 0.5007652640342712, -0.780366063117981, 0.6946108937263489, -0.3909216821193695, 1.3201524019241333, 0.43484488129615784, -1.0264933109283447, 1.6131283044815063, -0.3746809959411621, 0.6242761611938477, -0.7650045156478882, -0.39907240867614746, -0.7244559526443481, 0.2856042683124542, 1.872271180152893, -0.24233084917068481, 1.4956371784210205, -0.3561033606529236, -1.539359450340271, -1.5644710063934326, 0.8128023743629456, 0.42895886301994324, -0.7146599292755127, 0.11857915669679642, -0.2907467186450958, 0.18101473152637482, -0.06018606573343277, 1.234729528427124, 1.2795665264129639, 0.8294346928596497, -0.26871293783187866, -0.8619519472122192, 0.17491701245307922, -0.06842056661844254, -0.7852974534034729, -1.7654043436050415, -0.31193313002586365, 0.20120136439800262, 0.6532710790634155, -1.1858413219451904, 1.7854225635528564, 0.8891559839248657, 1.95863676071167, 1.0192264318466187, -0.3890360891819, 1.4341760873794556, 0.0832807794213295, 1.9222184419631958, -0.4427974820137024, 0.6369465589523315, -0.44568246603012085, -1.1410959959030151, 0.8392758369445801, -0.2879238724708557, -1.9681994915008545, -0.7441724538803101, -0.8926066160202026, -0.15999269485473633, -0.6923738718032837, 0.9121816754341125, -0.25888094305992126, -1.3705933094024658, 0.21152032911777496, -0.7614755630493164, 0.06131638586521149, -1.1953580379486084, 0.27869555354118347, 0.719058632850647, -0.6190657019615173, 0.1530316025018692, -0.2804795205593109, -1.336598515510559, -0.5280059576034546, 0.3833428621292114, 1.8556406497955322, -0.8342779278755188, 0.9482566714286804, 1.067970871925354, -0.7542117238044739, -0.06176026165485382, 0.3449898958206177, -0.34146419167518616, 0.8543551564216614, -1.0718445777893066, -0.46944934129714966, 1.1665982007980347, -0.1392805427312851, -0.6666490435600281, 1.4339797496795654, 0.7129430770874023, -0.9882805347442627, -0.17680975794792175, -0.12606020271778107, -0.779571533203125, 0.06528125703334808, -1.6209404468536377, -0.07159894704818726, 0.416351318359375, -1.544226884841919, -0.505933940410614, -0.199216827750206, 1.2760493755340576, -0.12898670136928558, 1.3182215690612793, -0.24517710506916046, -0.22827129065990448, -0.4350886046886444, -0.36255180835723877, 0.0847761332988739, -0.24462473392486572, -0.7149319648742676, 0.23804406821727753, -0.6992652416229248, 0.4075368046760559, 1.4323869943618774, 0.2907034456729889, 0.04348330944776535, 0.5486932396888733, 1.2074005603790283, 0.38965561985969543, 0.04980958253145218, -0.9006866812705994, -1.5920649766921997, 1.9867832660675049, -1.54460871219635, 2.0122616291046143, 0.6315953135490417, -0.022962704300880432, -1.8125371932983398, -1.916787028312683, 1.5223251581192017, 1.1064972877502441, 2.3353984355926514, 0.6117827892303467, 0.4225176274776459, -0.810192883014679, -0.6018943190574646, 0.26221951842308044, -0.9566013216972351, -0.7415958642959595, 0.1907956749200821, 2.39017391204834, 1.7167128324508667, -0.5264923572540283, -0.18205027282238007, -1.000767707824707, 1.4527852535247803, -0.15094077587127686, 0.1863485723733902, 2.0510447025299072, -0.23073555529117584, -1.0577365159988403, 1.2850844860076904, -2.3331522941589355, 0.16683310270309448, 1.9941606521606445, 0.2164643108844757, 0.07124654948711395, -1.3163516521453857, -0.6963905096054077, -0.29853594303131104, -0.4439834654331207, -1.253880500793457, 0.5078826546669006, -0.18703104555606842, -0.7504371404647827, -1.4760199785232544, 0.17446620762348175, -1.1083945035934448, -1.6280806064605713, 0.16158106923103333, 1.9436404705047607, 1.9532791376113892, -0.7419461011886597, 1.5681369304656982, -0.2277272790670395, 0.19734413921833038, 1.301213264465332, 1.1990617513656616, 3.12034010887146, 1.9069244861602783, -1.2564501762390137, 0.6656790971755981, -0.11712954193353653, -0.48953983187675476, 1.1956833600997925, -1.1559351682662964, 1.2816234827041626, -0.1861143708229065, -1.1507798433303833, -1.2052497863769531, 0.8909178972244263, 0.4886009395122528, -0.0019483109936118126, -0.4604282081127167, 1.1637444496154785, 0.11339226365089417, 1.2990258932113647, 0.5931533575057983, -0.24968770146369934, 0.7128298878669739, -0.4205583333969116, -0.5248118042945862, 1.5565296411514282, 0.18562279641628265, -1.4113380908966064, -2.315892219543457, -0.1856129914522171, -0.8883956074714661, 0.060135453939437866, -0.635731041431427, -0.954761266708374, 1.6523813009262085, 0.4041265845298767, -1.2046555280685425, -0.22421839833259583, -0.3184981048107147, -0.6876670718193054, 2.768249988555908, -1.3745832443237305, -0.24048815667629242, -1.064253568649292, -0.6380253434181213, 1.6480605602264404, -1.2083628177642822, -0.22088906168937683, -1.0831475257873535, -0.45629414916038513, -1.301820158958435, -0.5837724208831787, 0.00870811752974987, -0.8542209267616272, 0.8596397638320923, 0.219411239027977, -1.2718476057052612, -0.40081754326820374, -0.9104591012001038, 0.8308647871017456, -0.1459316909313202, 0.1927110105752945, 1.9084116220474243, 0.5291903614997864, -0.3406620919704437, 0.6774978637695312, 1.1433676481246948, 0.6978691220283508, -0.5866548418998718, 0.37179094552993774, -0.6183471083641052, 0.2956191599369049, -1.3112192153930664, 0.23828718066215515, -2.815715789794922, 0.6149908304214478, -0.03500533849000931, -0.08920707553625107, 0.0011930698528885841, -1.3182692527770996, 1.0660425424575806, 2.5344293117523193, -1.2062690258026123, 0.5067296624183655, 0.1942674219608307, 1.2271623611450195, -1.6303404569625854, 0.23717474937438965, -0.42806220054626465, 2.1602931022644043, 0.10908736288547516, 1.089465856552124, -0.44303974509239197, -2.256730318069458, 0.5736967921257019, -1.2598133087158203, -1.1976567506790161, 0.7945428490638733, -0.8460999727249146, 0.10699430108070374, -1.3583908081054688, -0.18486805260181427, -0.8700923323631287, -1.1707658767700195, 0.7452540993690491, 0.050251685082912445, 0.43362197279930115, -0.5880538821220398, 0.40971601009368896, -2.1749274730682373, -1.4293749332427979, -0.27990442514419556, -0.9656633138656616, 0.4897821843624115, -0.28922611474990845, 0.7422435879707336, -0.17975139617919922, -0.0015586083754897118, 0.3284846246242523, 1.3977248668670654, 3.3752329349517822, 0.18081550300121307, 0.47565212845802307, -0.21477481722831726, -1.0077565908432007, 1.4590719938278198, 0.9345486164093018, -0.16699561476707458, -0.5127663612365723, -1.1161967515945435, 1.2235236167907715, 1.9900577068328857, 1.0461498498916626, 0.0000912155956029892, -0.7152584791183472, -0.7986357808113098, 0.06395739316940308, 0.19527986645698547, 0.4586070477962494, 0.8348127603530884, 0.14620506763458252, 0.08047370612621307, 1.3845962285995483, 1.136633276939392, -0.405631422996521, 0.3738817274570465, -0.8222576975822449, -0.44028398394584656, 0.552203357219696, 0.3265429437160492, 0.005717279389500618, 0.30862027406692505, -1.0689698457717896, -0.2613513171672821, -0.35129648447036743, -0.8787571787834167, -0.7067086696624756, -0.4688304662704468, -0.35697752237319946, 1.65889310836792, 0.012782525271177292, -0.532744288444519, -0.03174148499965668, -0.759044885635376, 0.05216857045888901, -1.0328727960586548, 0.28965485095977783, -0.1362786442041397, -0.13847364485263824, -0.056121788918972015, 1.7848905324935913, -0.9808399081230164, -2.008892297744751, 0.23643754422664642, 0.2643962800502777, -0.36243849992752075, 0.2304651439189911, 1.6682024002075195, 0.5633630752563477, 1.453866958618164, 1.3908703327178955, 1.0091404914855957, -0.7025641202926636, -1.3672618865966797, 0.5882459878921509, 0.9592196941375732, -1.368677020072937, 0.7959645986557007, 0.03406769037246704, -0.4633142054080963, 0.5749894380569458, 1.361190915107727, 0.4052037298679352, -2.002265691757202, 0.7213038206100464, -0.8825762867927551, 0.7950038313865662, 0.7577146291732788, 0.7619522213935852, 0.16218721866607666, 0.7531469464302063, -1.21963369846344, -1.1722241640090942, -0.7176582217216492, -0.7297893762588501, 1.876950979232788, -0.2167469710111618, 0.5663300156593323, -0.1613641083240509, -1.3711401224136353, -0.056719571352005005, 0.6385319232940674, 0.4161410629749298, -0.5252518653869629, 0.7194733619689941, -0.6240078210830688, -1.136375904083252, -1.355711817741394, -0.4564760625362396, -1.0883947610855103, -0.9951260685920715, 1.0234429836273193, 0.8638995885848999, 0.2769227921962738, 1.8670319318771362, 0.6851300597190857, 0.20380105078220367, -2.604595422744751, 0.8921990394592285, 0.39173099398612976, -0.061037302017211914, 0.7764431238174438, 0.45210182666778564, 1.019513487815857, -0.15725921094417572, 0.6101511120796204, -2.3979649543762207, 2.344188928604126, -0.24942751228809357, 0.6636631488800049, -0.003915075678378344, -0.2040792852640152, 1.0144966840744019, 0.5546373724937439, 0.5441213846206665, -1.030800223350525, 0.6434977650642395, -0.6473336815834045, 1.2968435287475586, 0.8289769887924194, -0.7857741713523865, -0.020397234708070755, 1.3179527521133423, 0.5253555178642273, -0.5849882960319519, -0.9287716746330261, -1.061179280281067, 0.9128530025482178, 1.731127381324768, -0.092071034014225, -0.044246383011341095, 0.9017349481582642, 0.6505724191665649, -1.3747495412826538, 0.07026775926351547, -0.7294765114784241, -0.7070091366767883, 1.7092008590698242, 2.1015126705169678, -0.17725980281829834, -0.21020682156085968, -0.8331805467605591, -1.2355855703353882, 0.7311908602714539, 0.09387367218732834, 0.05677761882543564, 0.6782233715057373, -0.6248601675033569, 1.1494454145431519, 0.8617711067199707, 0.9315780401229858, 0.23048143088817596, 0.31979048252105713, 0.32816797494888306, -0.37704503536224365, -1.210093379020691, -0.22810550034046173, -1.0587605237960815, -2.483654499053955, 0.4636514484882355, -0.2555692195892334, -1.4250961542129517, -0.0016811825335025787, -1.0123354196548462, 0.8532708287239075, -0.49430492520332336, -1.1252549886703491, -1.408974289894104, 0.14204739034175873, -0.06934822350740433, 0.8501943349838257, -1.6291913986206055, -0.07996547967195511, 1.2307013273239136, 0.9810539484024048, -0.8248268961906433, 0.945335328578949, 0.24667005240917206, 1.092700481414795, 0.9231935143470764, -0.35322877764701843, 0.46794259548187256, 0.0034541916102170944, -1.3256192207336426, 0.4169679582118988, 1.1839042901992798, 0.160134419798851, 1.4155234098434448, -0.5569581389427185, 0.015876872465014458, 0.3698064982891083, -0.44105133414268494, -0.4704148471355438, -0.6663013100624084, 0.6437697410583496, 0.06549293547868729, -0.8543803095817566, 0.12811897695064545, 0.00018742866814136505, -0.1976361870765686, 0.23232506215572357, -1.5145941972732544, -0.12946917116641998, -0.3630712032318115, -0.6597389578819275, -1.1387425661087036, -0.11177726089954376, 1.3285255432128906, -0.7314705848693848, -0.16276247799396515, 0.5000510215759277, 0.23395183682441711, 0.4834088385105133, 0.5991688370704651, -0.6351537704467773, -0.35842952132225037, -0.20683862268924713, -0.4212858974933624, 0.3293195366859436, 1.4418342113494873, -0.07858992367982864, -0.9857563972473145, 0.670052170753479, -0.3809387981891632, 0.06879866123199463, 1.9467477798461914, 0.02443590573966503, -0.8632048964500427, 0.2733929455280304, -0.7363653182983398, 1.9023048877716064, 1.7732857465744019, 1.3208088874816895, -0.08525615930557251, -1.0007340908050537, 0.6340258121490479, -0.34014108777046204, -0.4744766354560852, 0.9339964985847473, 0.4019996225833893, -0.2728758752346039, -1.334544062614441, 0.7011049389839172, 1.359956979751587, -0.8260852098464966, -0.8765553832054138, 0.1494670808315277, -0.8069823980331421, 1.0977792739868164, 0.7911089062690735, 0.3974928855895996, 0.33032938838005066, 1.6012086868286133, 0.7839252352714539, -0.4436573088169098, 0.6018661856651306, 0.47793129086494446, -0.19590696692466736, -2.0308609008789062, -1.1639071702957153, 0.28603702783584595, -0.5257711410522461, -1.6774145364761353, 1.4343074560165405, -1.2226649522781372, -0.9749033451080322, 0.560589075088501, 0.08524494618177414, 1.4471052885055542, 0.3881596624851227, 1.5128817558288574, 2.0346291065216064, 0.8253490924835205, 0.4069036543369293, 1.2574976682662964, -0.2036401927471161, -0.5455105900764465, 1.7664103507995605, -0.531148374080658, 0.4969433844089508, 1.0536080598831177, -0.25001418590545654, -1.1299103498458862, -0.79886394739151, -1.2470051050186157, -0.7354723215103149, 1.2069092988967896, 0.07431947439908981, -1.1662505865097046, 0.3279244899749756, 1.6134003400802612, 0.02635246329009533, -0.3691332936286926, 0.6954705119132996, 0.35794544219970703, -0.8228580355644226, -0.1296321004629135, -0.957850992679596, 0.5705495476722717, -0.17750076949596405, -0.2653360366821289, 0.384013831615448, 0.47420695424079895, 1.3687796592712402, 0.09030676633119583, 0.14083389937877655, 1.133465051651001, -1.3385906219482422, 1.4851114749908447, -0.662010669708252, 0.3142071068286896, -2.345885753631592, 1.4522287845611572, -0.7843101024627686, 1.90382719039917, -2.6740403175354004, 0.3854671120643616, -0.5780746340751648, -0.5106127262115479, 0.27797597646713257, -0.33129048347473145, 0.15930506587028503, -0.19648538529872894, -1.1896570920944214, -0.08452252298593521, -0.7881253361701965, 0.5139536261558533, 1.1186127662658691, 1.3666505813598633, -1.017142415046692, -0.3447517454624176, -1.726102590560913, -0.15988650918006897, -0.6811313629150391, 0.35819536447525024, -1.908247947692871, -0.26070883870124817, -1.916383981704712, -2.354386806488037, -1.272296667098999, -0.8464896082878113, 1.1153794527053833, 0.07858298718929291, -0.8588457107543945, 1.1489002704620361, -0.4136572778224945, -1.8844525814056396, 1.0635161399841309, -2.148444890975952 ]
https://github.com/huggingface/datasets/issues/3181
`None` converted to `"None"` when loading a dataset
So what would be the best way to handle a feature that can have a null value in some of the instances? So far I used `None`. Using the empty string won't be a good option, as it can be an actual value in the data and is not the same as not having a value at all.
## Describe the bug When loading a dataset `None` values of the type `NoneType` are converted to `'None'` of the type `str`. ## Steps to reproduce the bug ```python from datasets import load_dataset qasper = load_dataset("qasper", split="train", download_mode="reuse_cache_if_exists") print(qasper[60]["full_text"]["section_name"]) ``` When installing version 1.1.40, the output is `[None, 'Introduction', 'Benchmark Datasets', ...]` When installing from the master branch, the output is `['None', 'Introduction', 'Benchmark Datasets', ...]` Notice how the first element was changed from `NoneType` to `str`. ## Expected results `None` should stay as is. ## Actual results `None` is converted to a string. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: master - Platform: Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 4.0.1
1,137
58
`None` converted to `"None"` when loading a dataset ## Describe the bug When loading a dataset `None` values of the type `NoneType` are converted to `'None'` of the type `str`. ## Steps to reproduce the bug ```python from datasets import load_dataset qasper = load_dataset("qasper", split="train", download_mode="reuse_cache_if_exists") print(qasper[60]["full_text"]["section_name"]) ``` When installing version 1.1.40, the output is `[None, 'Introduction', 'Benchmark Datasets', ...]` When installing from the master branch, the output is `['None', 'Introduction', 'Benchmark Datasets', ...]` Notice how the first element was changed from `NoneType` to `str`. ## Expected results `None` should stay as is. ## Actual results `None` is converted to a string. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: master - Platform: Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 4.0.1 So what would be the best way to handle a feature that can have a null value in some of the instances? So far I used `None`. Using the empty string won't be a good option, as it can be an actual value in the data and is not the same as not having a value at all.
[ -1.059288740158081, -0.8610916137695312, -0.7823936939239502, 1.555702567100525, -0.11233387142419815, -1.2522691488265991, 0.1433178037405014, -0.9937381148338318, 1.7844302654266357, -0.8291566371917725, 0.36793792247772217, -1.6656520366668701, 0.0578678622841835, -0.6378370523452759, -0.7634570598602295, -0.8272506594657898, -0.3794078528881073, -0.7387038469314575, 1.0640053749084473, 2.3887856006622314, 1.1391459703445435, -1.3267041444778442, 2.6101133823394775, 0.6513856649398804, -0.08467379957437515, -0.9744011163711548, 0.49098047614097595, -0.039211444556713104, -1.287959337234497, -0.3813532292842865, -0.847725510597229, -0.09725254029035568, -0.6339862942695618, -0.6543363332748413, 0.019822902977466583, 0.46439608931541443, -0.3669857680797577, -0.546319305896759, -0.5280502438545227, -0.8462600708007812, 0.3745226562023163, -0.4076898992061615, 0.9334195256233215, -0.36615651845932007, 1.8821054697036743, -0.5544145703315735, 0.43214932084083557, 0.6964074969291687, 1.3038944005966187, 0.2706281542778015, 0.04125664383172989, 0.35446539521217346, 0.42435145378112793, -0.024437163025140762, 0.5481148362159729, 1.1442309617996216, 0.5842233896255493, 0.5348781943321228, 0.8569101691246033, -2.30920672416687, 1.305876612663269, -1.0821568965911865, 0.2887403964996338, 1.2912685871124268, -0.8878390789031982, 0.34246453642845154, -1.7648266553878784, 0.0289054773747921, 0.5214318037033081, -2.230691432952881, 0.25135311484336853, -1.3383965492248535, -0.4861920177936554, 1.009533166885376, 0.36501750349998474, -1.2594729661941528, 0.0788700059056282, -0.34854206442832947, 0.9276220798492432, 0.39622941613197327, 1.1062818765640259, -1.7597416639328003, -0.07758880406618118, -0.33211517333984375, 0.20968815684318542, -1.284894347190857, -1.5378179550170898, 0.5473837852478027, 0.7512984871864319, 0.5360681414604187, -0.23559561371803284, 1.0580426454544067, -1.0002509355545044, 0.7086828351020813, -1.0606671571731567, -1.8571590185165405, -1.3330998420715332, -2.188978672027588, -2.286188840866089, 0.7629271149635315, -0.48931175470352173, -0.4622246026992798, 2.1134510040283203, -0.9462005496025085, -1.767560601234436, 1.1335246562957764, 0.35689452290534973, -0.018085960298776627, 2.403151035308838, 0.2070191502571106, -0.7002492547035217, 0.4746967852115631, -0.7908077836036682, 0.6981252431869507, -0.442552387714386, 1.3127529621124268, 0.41969162225723267, -1.0269445180892944, 1.6068650484085083, -0.3597422242164612, 0.6377877593040466, -0.7728955745697021, -0.3949947953224182, -0.7283291220664978, 0.303971529006958, 1.8914963006973267, -0.23222589492797852, 1.4711769819259644, -0.3133643865585327, -1.542059302330017, -1.5711565017700195, 0.84894198179245, 0.3910500109195709, -0.7097107768058777, 0.12579627335071564, -0.23569610714912415, 0.25677376985549927, -0.0744863972067833, 1.265562653541565, 1.2878196239471436, 0.7998549938201904, -0.25941434502601624, -0.8606905341148376, 0.18461695313453674, -0.08218952268362045, -0.7825616002082825, -1.730313777923584, -0.3229528069496155, 0.175554558634758, 0.6201131939888, -1.1731598377227783, 1.7771382331848145, 0.8942829966545105, 1.9508548974990845, 1.0154087543487549, -0.3435681462287903, 1.4522764682769775, 0.12636378407478333, 1.9301987886428833, -0.4343354105949402, 0.6296844482421875, -0.45690542459487915, -1.1328874826431274, 0.8460313081741333, -0.2875145673751831, -1.9342796802520752, -0.7334163784980774, -0.9230698347091675, -0.16739422082901, -0.6902982592582703, 0.9220829606056213, -0.24651992321014404, -1.3738036155700684, 0.21812711656093597, -0.7691778540611267, 0.03427648916840553, -1.2070729732513428, 0.28611087799072266, 0.7282310128211975, -0.6496061086654663, 0.1629665493965149, -0.2860774099826813, -1.3778934478759766, -0.5386219620704651, 0.368619441986084, 1.8696985244750977, -0.8304668664932251, 0.9051851034164429, 1.0421884059906006, -0.757071316242218, -0.07431704550981522, 0.3503679633140564, -0.33097580075263977, 0.8385224342346191, -1.090006947517395, -0.4495263993740082, 1.1811503171920776, -0.14842413365840912, -0.6620394587516785, 1.4007651805877686, 0.6926982402801514, -0.9803467392921448, -0.12854328751564026, -0.17167800664901733, -0.8022717833518982, 0.06664648652076721, -1.6187312602996826, -0.06853001564741135, 0.4213200509548187, -1.5570125579833984, -0.4954577088356018, -0.18744151294231415, 1.2682490348815918, -0.1596209704875946, 1.327358365058899, -0.25857487320899963, -0.2308618426322937, -0.4345073401927948, -0.35263222455978394, 0.09315068274736404, -0.24047210812568665, -0.7322109937667847, 0.23028264939785004, -0.6878659129142761, 0.3853532373905182, 1.3935240507125854, 0.27620911598205566, 0.033392973244190216, 0.5834739208221436, 1.2178914546966553, 0.366293728351593, 0.08185790479183197, -0.8947734236717224, -1.5371801853179932, 1.9798990488052368, -1.5217148065567017, 2.01951003074646, 0.5873174071311951, 0.015168230049312115, -1.7772220373153687, -1.9272340536117554, 1.51015043258667, 1.1083588600158691, 2.310100793838501, 0.6065754294395447, 0.4405635595321655, -0.8094707727432251, -0.597493588924408, 0.2604723870754242, -0.9835256338119507, -0.7309103608131409, 0.1988360434770584, 2.36982798576355, 1.685531735420227, -0.53329998254776, -0.18224114179611206, -0.9780887961387634, 1.5132733583450317, -0.16437193751335144, 0.1673949658870697, 2.0484235286712646, -0.2340313047170639, -1.0484046936035156, 1.252380609512329, -2.3452444076538086, 0.12846803665161133, 1.9915281534194946, 0.18239758908748627, 0.07850795984268188, -1.303292989730835, -0.7372006177902222, -0.2541969418525696, -0.43065792322158813, -1.279174566268921, 0.4932498037815094, -0.20325815677642822, -0.6977665424346924, -1.4947172403335571, 0.21502003073692322, -1.0675361156463623, -1.6245414018630981, 0.13123877346515656, 1.9516984224319458, 1.9290337562561035, -0.7098369598388672, 1.591546893119812, -0.2205466479063034, 0.22485676407814026, 1.2884793281555176, 1.1795791387557983, 3.1195228099823, 1.9392107725143433, -1.210794448852539, 0.6253780126571655, -0.11543229222297668, -0.46780186891555786, 1.1926301717758179, -1.1552003622055054, 1.269355058670044, -0.136030375957489, -1.1377661228179932, -1.2147670984268188, 0.8564546704292297, 0.5107343792915344, 0.009125332348048687, -0.45155051350593567, 1.1717437505722046, 0.08171556144952774, 1.3271805047988892, 0.6010866165161133, -0.2662520110607147, 0.7065216898918152, -0.4267628788948059, -0.5487878322601318, 1.5905921459197998, 0.17845788598060608, -1.3563363552093506, -2.305824041366577, -0.194745734333992, -0.8858853578567505, 0.07190151512622833, -0.6111863851547241, -0.9490818381309509, 1.663529872894287, 0.396244078874588, -1.205052375793457, -0.20708520710468292, -0.3187384009361267, -0.6903607845306396, 2.808032751083374, -1.424848198890686, -0.27642980217933655, -1.0348056554794312, -0.6395165920257568, 1.6464155912399292, -1.2126890420913696, -0.23488368093967438, -1.0999583005905151, -0.38907119631767273, -1.307154893875122, -0.6045970320701599, 0.00030126050114631653, -0.8187540173530579, 0.881085216999054, 0.2245023101568222, -1.3287467956542969, -0.4330432713031769, -0.9497905969619751, 0.77193284034729, -0.11135662347078323, 0.1753622591495514, 1.9008756875991821, 0.5151340961456299, -0.3693409264087677, 0.6715439558029175, 1.1301137208938599, 0.6643361449241638, -0.5293760895729065, 0.41360801458358765, -0.5969752669334412, 0.2896076440811157, -1.2993420362472534, 0.2579880654811859, -2.8317337036132812, 0.5951755046844482, -0.034078724682331085, -0.07802245020866394, -0.009691211394965649, -1.3438329696655273, 1.0476864576339722, 2.534745931625366, -1.202001690864563, 0.48786625266075134, 0.1647953987121582, 1.2685679197311401, -1.6663508415222168, 0.23166713118553162, -0.41852113604545593, 2.1447486877441406, 0.08514481782913208, 1.0683460235595703, -0.4151383936405182, -2.3069512844085693, 0.5167374610900879, -1.2715331315994263, -1.2076201438903809, 0.8206833004951477, -0.8299142122268677, 0.07337377220392227, -1.3272676467895508, -0.2004258930683136, -0.8321532607078552, -1.1625107526779175, 0.7695968747138977, 0.056482963263988495, 0.4663735628128052, -0.6163071393966675, 0.4000350534915924, -2.1660635471343994, -1.4219993352890015, -0.29576072096824646, -0.92221599817276, 0.4582323133945465, -0.3025153875350952, 0.7488685250282288, -0.21592800319194794, 0.019938815385103226, 0.33222633600234985, 1.4263955354690552, 3.3839125633239746, 0.1797696202993393, 0.5165934562683105, -0.24601754546165466, -0.9705118536949158, 1.435704231262207, 0.9303973913192749, -0.1571110635995865, -0.4891893267631531, -1.151625394821167, 1.2315845489501953, 1.9821226596832275, 1.0101244449615479, -0.027977991849184036, -0.6866174936294556, -0.7485496997833252, 0.020682498812675476, 0.17636050283908844, 0.45790842175483704, 0.8163259625434875, 0.1886853724718094, 0.057132117450237274, 1.3567438125610352, 1.0923616886138916, -0.41416898369789124, 0.37950947880744934, -0.805461585521698, -0.4388991594314575, 0.5615073442459106, 0.37309542298316956, -0.009903371334075928, 0.2687866985797882, -0.9952258467674255, -0.25859534740448, -0.3671686053276062, -0.8994565010070801, -0.695722758769989, -0.494437038898468, -0.33862707018852234, 1.6935089826583862, 0.017789512872695923, -0.5565222501754761, -0.07954103499650955, -0.7504839301109314, 0.07071301341056824, -1.042779803276062, 0.2751463055610657, -0.14585880935192108, -0.14982853829860687, -0.03843493014574051, 1.7943669557571411, -0.9583134651184082, -1.9989525079727173, 0.22075214982032776, 0.2678969204425812, -0.3303264379501343, 0.2312377691268921, 1.6827571392059326, 0.5141206979751587, 1.4397424459457397, 1.4269770383834839, 1.0145341157913208, -0.7223438620567322, -1.3994717597961426, 0.5718602538108826, 0.9259908199310303, -1.399476408958435, 0.7670841217041016, 0.09573699533939362, -0.45574697852134705, 0.5449028015136719, 1.3330363035202026, 0.4310598373413086, -1.9966120719909668, 0.6971510052680969, -0.9182605147361755, 0.786446213722229, 0.7868819236755371, 0.7196868658065796, 0.1748548448085785, 0.7667319774627686, -1.17213773727417, -1.198199987411499, -0.7067245244979858, -0.7121198177337646, 1.8731330633163452, -0.26336216926574707, 0.554089367389679, -0.13591477274894714, -1.4245657920837402, -0.03951484337449074, 0.6406366229057312, 0.4430304169654846, -0.5119941234588623, 0.6932101845741272, -0.6572036743164062, -1.1325149536132812, -1.391563057899475, -0.4681047797203064, -1.1263099908828735, -1.0162137746810913, 1.054632306098938, 0.8871626257896423, 0.21372249722480774, 1.8390172719955444, 0.7258691787719727, 0.20174939930438995, -2.5683858394622803, 0.8679742217063904, 0.41020458936691284, -0.05285125970840454, 0.7408062219619751, 0.471686989068985, 1.0309083461761475, -0.1544884443283081, 0.5735060572624207, -2.408247709274292, 2.3541972637176514, -0.25179192423820496, 0.6990925073623657, -0.013785328716039658, -0.20927020907402039, 0.9926116466522217, 0.55000239610672, 0.5474028587341309, -1.0324218273162842, 0.6093117594718933, -0.6456366777420044, 1.2951847314834595, 0.8786522150039673, -0.7818009257316589, -0.037798188626766205, 1.32968270778656, 0.5113139152526855, -0.6132662296295166, -0.9329292178153992, -1.07749342918396, 0.9220694899559021, 1.7256391048431396, -0.07530602812767029, -0.062196455895900726, 0.9151894450187683, 0.6684273481369019, -1.3492991924285889, 0.09557073563337326, -0.7479731440544128, -0.7666991949081421, 1.7054606676101685, 2.0866265296936035, -0.18641698360443115, -0.19464288651943207, -0.831115186214447, -1.2472279071807861, 0.7208204865455627, 0.1251235008239746, 0.017982911318540573, 0.6844945549964905, -0.6263449192047119, 1.1230802536010742, 0.8699260354042053, 0.9064816236495972, 0.27543750405311584, 0.3051471412181854, 0.34648793935775757, -0.4048619270324707, -1.2273924350738525, -0.21202808618545532, -1.06216299533844, -2.5001981258392334, 0.48607078194618225, -0.25152134895324707, -1.401719570159912, -0.019490689039230347, -0.9972249269485474, 0.8672128915786743, -0.4566494822502136, -1.1596730947494507, -1.3940823078155518, 0.12356650084257126, -0.026767391711473465, 0.8269179463386536, -1.5960643291473389, -0.08674624562263489, 1.2402851581573486, 1.0115420818328857, -0.8642432689666748, 0.930979311466217, 0.20341546833515167, 1.110935091972351, 0.9429060220718384, -0.3492111563682556, 0.4494200646877289, -0.004968389868736267, -1.3462038040161133, 0.4612015187740326, 1.1577070951461792, 0.14076530933380127, 1.4177967309951782, -0.5735722780227661, 0.006067424081265926, 0.344940721988678, -0.41826388239860535, -0.44760191440582275, -0.6919108033180237, 0.637934148311615, 0.0554288774728775, -0.8148697018623352, 0.14549119770526886, 0.04125719144940376, -0.2071540504693985, 0.210042342543602, -1.5172916650772095, -0.08677096664905548, -0.329457551240921, -0.6775692105293274, -1.1433943510055542, -0.13825033605098724, 1.3379735946655273, -0.7080407738685608, -0.18343767523765564, 0.5228073000907898, 0.25558850169181824, 0.5121933817863464, 0.5634240508079529, -0.6347991824150085, -0.34370243549346924, -0.1748216599225998, -0.42986539006233215, 0.3474613428115845, 1.4770307540893555, -0.07346278429031372, -0.9509505033493042, 0.6836357116699219, -0.3532733619213104, 0.0349273681640625, 1.9535366296768188, 0.051628656685352325, -0.8857765197753906, 0.2559410631656647, -0.7338677644729614, 1.9231547117233276, 1.8172647953033447, 1.2889416217803955, -0.06471554934978485, -1.0095840692520142, 0.6758896708488464, -0.39596647024154663, -0.522654116153717, 0.9297450184822083, 0.390908807516098, -0.2804129421710968, -1.3388386964797974, 0.7097431421279907, 1.3070460557937622, -0.7633824348449707, -0.925672173500061, 0.13840551674365997, -0.8021117448806763, 1.0552140474319458, 0.7869764566421509, 0.43376314640045166, 0.2973651587963104, 1.6365551948547363, 0.8117466568946838, -0.4602525532245636, 0.5949563384056091, 0.5134933590888977, -0.1726735532283783, -2.040895700454712, -1.2157132625579834, 0.2917693555355072, -0.5221226215362549, -1.6552979946136475, 1.4595755338668823, -1.200293779373169, -0.9675419330596924, 0.5743423700332642, 0.07213644683361053, 1.440400242805481, 0.3614467680454254, 1.497162103652954, 2.015450954437256, 0.8070269823074341, 0.42186877131462097, 1.274003028869629, -0.2094481736421585, -0.5595243573188782, 1.7930043935775757, -0.5164408683776855, 0.4858189821243286, 1.0888957977294922, -0.23964923620224, -1.1365495920181274, -0.777685284614563, -1.2603036165237427, -0.7501847147941589, 1.1495795249938965, 0.0682530403137207, -1.156968593597412, 0.3330008089542389, 1.632978916168213, 0.02110612764954567, -0.36040541529655457, 0.7189871072769165, 0.35414329171180725, -0.8214930891990662, -0.09908260405063629, -0.9834635257720947, 0.5763834118843079, -0.20823387801647186, -0.2837124168872833, 0.41351091861724854, 0.4564407169818878, 1.3834351301193237, 0.11873304098844528, 0.15433825552463531, 1.132415771484375, -1.3486024141311646, 1.4481980800628662, -0.6774047613143921, 0.3232992887496948, -2.3390469551086426, 1.4532729387283325, -0.7908169031143188, 1.906609296798706, -2.677170991897583, 0.38690561056137085, -0.584800660610199, -0.517646074295044, 0.29128941893577576, -0.32770708203315735, 0.14961719512939453, -0.15156880021095276, -1.216794490814209, -0.04360818490386009, -0.7675788402557373, 0.526369571685791, 1.09480619430542, 1.3668633699417114, -1.0255519151687622, -0.38915398716926575, -1.7120373249053955, -0.125966876745224, -0.6565316319465637, 0.3691551089286804, -1.9074954986572266, -0.30412757396698, -1.9090474843978882, -2.3691515922546387, -1.2669413089752197, -0.8507333397865295, 1.1150308847427368, 0.08476891368627548, -0.8522076606750488, 1.152283787727356, -0.38379305601119995, -1.89894700050354, 1.0948166847229004, -2.0895960330963135 ]
https://github.com/huggingface/datasets/issues/3181
`None` converted to `"None"` when loading a dataset
Hi @eladsegal, Use `None`. As @albertvillanova correctly pointed out, this change in conversion was introduced (by mistake) in #3158. To avoid it, install the earlier revision with: ``` pip install git+https://github.com/huggingface/datasets.git@8107844ec0e7add005db0585c772ee20adc01a5e ``` I'm making all the feature types nullable as we speak, and the fix will be merged probably early next week.
## Describe the bug When loading a dataset `None` values of the type `NoneType` are converted to `'None'` of the type `str`. ## Steps to reproduce the bug ```python from datasets import load_dataset qasper = load_dataset("qasper", split="train", download_mode="reuse_cache_if_exists") print(qasper[60]["full_text"]["section_name"]) ``` When installing version 1.1.40, the output is `[None, 'Introduction', 'Benchmark Datasets', ...]` When installing from the master branch, the output is `['None', 'Introduction', 'Benchmark Datasets', ...]` Notice how the first element was changed from `NoneType` to `str`. ## Expected results `None` should stay as is. ## Actual results `None` is converted to a string. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: master - Platform: Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 4.0.1
1,137
52
`None` converted to `"None"` when loading a dataset ## Describe the bug When loading a dataset `None` values of the type `NoneType` are converted to `'None'` of the type `str`. ## Steps to reproduce the bug ```python from datasets import load_dataset qasper = load_dataset("qasper", split="train", download_mode="reuse_cache_if_exists") print(qasper[60]["full_text"]["section_name"]) ``` When installing version 1.1.40, the output is `[None, 'Introduction', 'Benchmark Datasets', ...]` When installing from the master branch, the output is `['None', 'Introduction', 'Benchmark Datasets', ...]` Notice how the first element was changed from `NoneType` to `str`. ## Expected results `None` should stay as is. ## Actual results `None` is converted to a string. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: master - Platform: Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 4.0.1 Hi @eladsegal, Use `None`. As @albertvillanova correctly pointed out, this change in conversion was introduced (by mistake) in #3158. To avoid it, install the earlier revision with: ``` pip install git+https://github.com/huggingface/datasets.git@8107844ec0e7add005db0585c772ee20adc01a5e ``` I'm making all the feature types nullable as we speak, and the fix will be merged probably early next week.
[ -1.1104297637939453, -0.8794372081756592, -0.7295841574668884, 1.5458197593688965, -0.11839979141950607, -1.2499629259109497, 0.1818075180053711, -1.0077917575836182, 1.8026396036148071, -0.7718185186386108, 0.35351356863975525, -1.6729868650436401, 0.03571954742074013, -0.6544751524925232, -0.7748857140541077, -0.8011904358863831, -0.3895419239997864, -0.7376421093940735, 1.055450677871704, 2.365792751312256, 1.1630496978759766, -1.3278889656066895, 2.6473424434661865, 0.6300206780433655, -0.13659510016441345, -0.9686366319656372, 0.4867035746574402, -0.07027049362659454, -1.3057327270507812, -0.37325388193130493, -0.8759250640869141, -0.10605312138795853, -0.5792255401611328, -0.654107391834259, 0.05607012286782265, 0.47494766116142273, -0.33576175570487976, -0.5488166809082031, -0.5196325778961182, -0.8259833455085754, 0.38778015971183777, -0.39776623249053955, 0.9415763020515442, -0.3356277346611023, 1.8128055334091187, -0.5955747961997986, 0.4797728657722473, 0.6923391819000244, 1.3370773792266846, 0.23574595153331757, 0.03457231447100639, 0.38381877541542053, 0.4131557047367096, 0.022717971354722977, 0.5567130446434021, 1.1592289209365845, 0.6244343519210815, 0.49618032574653625, 0.8701996803283691, -2.3057053089141846, 1.2650117874145508, -1.0424171686172485, 0.28824397921562195, 1.2995282411575317, -0.8781643509864807, 0.3256864845752716, -1.7935625314712524, 0.01610768958926201, 0.5109263062477112, -2.189587116241455, 0.2647196650505066, -1.349981665611267, -0.46373218297958374, 1.0067079067230225, 0.355989009141922, -1.2538400888442993, 0.09921267628669739, -0.35171303153038025, 0.9311387538909912, 0.4008065164089203, 1.1248083114624023, -1.7562423944473267, -0.09708724170923233, -0.35117411613464355, 0.19348818063735962, -1.217528223991394, -1.5406874418258667, 0.5497729182243347, 0.698173999786377, 0.5429951548576355, -0.23560233414173126, 1.0416635274887085, -0.96718430519104, 0.7447778582572937, -1.05889093875885, -1.8776376247406006, -1.3078808784484863, -2.169370412826538, -2.2767536640167236, 0.7326479554176331, -0.49337178468704224, -0.44739705324172974, 2.1121180057525635, -0.967003345489502, -1.7859266996383667, 1.0983771085739136, 0.33972159028053284, -0.020780060440301895, 2.3660788536071777, 0.20755812525749207, -0.6997042298316956, 0.4947453439235687, -0.7658119201660156, 0.6823792457580566, -0.4345317780971527, 1.3378993272781372, 0.39455485343933105, -1.0245516300201416, 1.5939536094665527, -0.35004475712776184, 0.6420445442199707, -0.7712236642837524, -0.4153689444065094, -0.6928951740264893, 0.31324952840805054, 1.8968673944473267, -0.2591383457183838, 1.4724252223968506, -0.33955010771751404, -1.553404688835144, -1.5495299100875854, 0.8470481038093567, 0.4372662603855133, -0.6810055375099182, 0.09935697168111801, -0.2707139849662781, 0.19059553742408752, -0.05857177823781967, 1.204665184020996, 1.3059073686599731, 0.8001063466072083, -0.2603573799133301, -0.8560131788253784, 0.18674427270889282, -0.04493536055088043, -0.7818322777748108, -1.7350261211395264, -0.3126010000705719, 0.1998312771320343, 0.6448613405227661, -1.1781375408172607, 1.765146017074585, 0.8764734864234924, 1.948443055152893, 1.012143611907959, -0.3526899814605713, 1.4867225885391235, 0.12930777668952942, 1.9311820268630981, -0.45684319734573364, 0.5951425433158875, -0.4555279016494751, -1.119276762008667, 0.855377197265625, -0.27653563022613525, -1.9737390279769897, -0.7086204886436462, -0.9050964713096619, -0.17518194019794464, -0.6893384456634521, 0.9253197908401489, -0.27434849739074707, -1.397080659866333, 0.22044257819652557, -0.7817310690879822, 0.07253770530223846, -1.2030504941940308, 0.28288981318473816, 0.7057977318763733, -0.6285766959190369, 0.15180760622024536, -0.27558502554893494, -1.3463369607925415, -0.5249883532524109, 0.36931854486465454, 1.8346377611160278, -0.8112505674362183, 0.935446560382843, 1.1011288166046143, -0.7684133648872375, -0.06594708561897278, 0.3685520887374878, -0.32939600944519043, 0.8253843784332275, -1.0855289697647095, -0.4368770122528076, 1.1499329805374146, -0.10213082283735275, -0.6409503221511841, 1.43210768699646, 0.7010568380355835, -1.020358681678772, -0.1539975106716156, -0.0968073382973671, -0.7927220463752747, 0.05853010341525078, -1.6211298704147339, -0.07583179324865341, 0.4326304793357849, -1.528579831123352, -0.4968191981315613, -0.2335757315158844, 1.2657520771026611, -0.11170502752065659, 1.3474034070968628, -0.258111834526062, -0.21560102701187134, -0.4240405857563019, -0.390011727809906, 0.08652003854513168, -0.23730961978435516, -0.7361388206481934, 0.21960841119289398, -0.6673135161399841, 0.4099467098712921, 1.4270482063293457, 0.27138596773147583, -0.002794410567730665, 0.5613725185394287, 1.2167047262191772, 0.38660287857055664, 0.04686477780342102, -0.8918327689170837, -1.5512511730194092, 1.993267297744751, -1.5530714988708496, 1.9978435039520264, 0.6149840354919434, -0.01037521380931139, -1.754477620124817, -1.961814522743225, 1.5548466444015503, 1.0897914171218872, 2.3633925914764404, 0.6103642582893372, 0.4483851492404938, -0.8058041334152222, -0.5926896929740906, 0.24983100593090057, -0.949536919593811, -0.7432834506034851, 0.19529858231544495, 2.412152051925659, 1.7006142139434814, -0.5238573551177979, -0.215441033244133, -0.9927148818969727, 1.4454164505004883, -0.1669783741235733, 0.20136843621730804, 2.0534284114837646, -0.20995087921619415, -1.0628323554992676, 1.2704222202301025, -2.304931879043579, 0.15044920146465302, 2.0121607780456543, 0.18597109615802765, 0.108796626329422, -1.2953763008117676, -0.7006521821022034, -0.26303088665008545, -0.46513834595680237, -1.2641774415969849, 0.5082196593284607, -0.1894572675228119, -0.7161572575569153, -1.4702988862991333, 0.22581331431865692, -1.1184452772140503, -1.6219029426574707, 0.14105650782585144, 1.9665884971618652, 1.9196418523788452, -0.7523845434188843, 1.584111213684082, -0.2797655761241913, 0.22806569933891296, 1.291581392288208, 1.1882531642913818, 3.114304780960083, 1.917837142944336, -1.2478938102722168, 0.6613339781761169, -0.12647627294063568, -0.4804946780204773, 1.2025580406188965, -1.1496894359588623, 1.2503892183303833, -0.16654957830905914, -1.1507149934768677, -1.1883699893951416, 0.8670886754989624, 0.49706801772117615, 0.011947589926421642, -0.4397275745868683, 1.157065749168396, 0.07508324086666107, 1.2946527004241943, 0.5699712634086609, -0.26768773794174194, 0.7376835942268372, -0.40461885929107666, -0.5163213610649109, 1.5309239625930786, 0.1820661574602127, -1.3971320390701294, -2.3107948303222656, -0.19672396779060364, -0.8935260772705078, 0.07565739005804062, -0.6268514394760132, -0.9509300589561462, 1.672603726387024, 0.3729018270969391, -1.187875747680664, -0.23699690401554108, -0.293279230594635, -0.5999387502670288, 2.7539734840393066, -1.3803832530975342, -0.2642422616481781, -1.0268205404281616, -0.6439445614814758, 1.6548887491226196, -1.1730190515518188, -0.23258990049362183, -1.0495563745498657, -0.40619567036628723, -1.3046923875808716, -0.5934767127037048, 0.0146271837875247, -0.8672929406166077, 0.8683872222900391, 0.22396765649318695, -1.3205231428146362, -0.38401520252227783, -0.9364223480224609, 0.8364842534065247, -0.12521757185459137, 0.15771587193012238, 1.8922796249389648, 0.529067873954773, -0.3677133619785309, 0.6861204504966736, 1.1049025058746338, 0.6498739719390869, -0.5711946487426758, 0.360364705324173, -0.6406139731407166, 0.29466119408607483, -1.3420733213424683, 0.2634797990322113, -2.8094918727874756, 0.5972822904586792, -0.037786971777677536, -0.07697717100381851, -0.020940296351909637, -1.3477592468261719, 1.070087194442749, 2.559326410293579, -1.194850206375122, 0.48475897312164307, 0.23528581857681274, 1.2969931364059448, -1.625939965248108, 0.23073218762874603, -0.4405348598957062, 2.1541945934295654, 0.08976900577545166, 1.114269733428955, -0.43868952989578247, -2.289238929748535, 0.5166653990745544, -1.27785325050354, -1.2083218097686768, 0.7816306948661804, -0.8301998376846313, 0.07245967537164688, -1.3424766063690186, -0.19080717861652374, -0.8333739042282104, -1.15583074092865, 0.7459516525268555, 0.07532443106174469, 0.42571765184402466, -0.6443994641304016, 0.41152647137641907, -2.1464691162109375, -1.4022897481918335, -0.28695470094680786, -0.9313401579856873, 0.4666867256164551, -0.2832592725753784, 0.7278637886047363, -0.20515850186347961, -0.011034530587494373, 0.33443284034729004, 1.4073927402496338, 3.3594114780426025, 0.1614767462015152, 0.4628974497318268, -0.25665542483329773, -0.9708285331726074, 1.4582902193069458, 0.9504539370536804, -0.1624630242586136, -0.5005244016647339, -1.119922161102295, 1.2460156679153442, 2.0112357139587402, 1.0298761129379272, 0.0002475753426551819, -0.7532745003700256, -0.8164553046226501, 0.05184623971581459, 0.17712844908237457, 0.4585058093070984, 0.862643301486969, 0.21073761582374573, 0.02494601160287857, 1.3568034172058105, 1.0907421112060547, -0.43407100439071655, 0.3817633092403412, -0.810366690158844, -0.4386732876300812, 0.5697587728500366, 0.3228592574596405, 0.028150618076324463, 0.271304190158844, -1.0372264385223389, -0.2832789719104767, -0.3501564562320709, -0.8999047875404358, -0.7431074976921082, -0.485901802778244, -0.3278670012950897, 1.685251235961914, 0.0067721521481871605, -0.5266444683074951, -0.015817809849977493, -0.7123863101005554, 0.044379543513059616, -1.035109519958496, 0.28562983870506287, -0.17151471972465515, -0.1322447806596756, -0.03631773963570595, 1.7533199787139893, -0.9769351482391357, -2.0107944011688232, 0.22453008592128754, 0.2561943829059601, -0.34624147415161133, 0.24366138875484467, 1.6532233953475952, 0.5896168947219849, 1.459317922592163, 1.4076730012893677, 1.0304192304611206, -0.701654851436615, -1.3575538396835327, 0.6106849908828735, 0.9426100850105286, -1.3752334117889404, 0.7486194372177124, 0.05443030968308449, -0.4704054892063141, 0.5558258891105652, 1.3478277921676636, 0.4212031662464142, -2.0483295917510986, 0.7221705317497253, -0.8900182843208313, 0.7713709473609924, 0.7522526383399963, 0.7709057927131653, 0.2090839147567749, 0.7818141579627991, -1.2021085023880005, -1.1780147552490234, -0.6895962357521057, -0.7356514930725098, 1.858354091644287, -0.1971648931503296, 0.5619933605194092, -0.15678974986076355, -1.404173493385315, -0.06618546694517136, 0.6601161360740662, 0.42909523844718933, -0.549058198928833, 0.6918288469314575, -0.6705479621887207, -1.106513500213623, -1.363624930381775, -0.5072911381721497, -1.0985523462295532, -1.0046374797821045, 1.0042462348937988, 0.878981351852417, 0.28564271330833435, 1.8604345321655273, 0.6947828531265259, 0.2086838334798813, -2.55975341796875, 0.9094627499580383, 0.4002481997013092, -0.08594556897878647, 0.7672433853149414, 0.46354392170906067, 1.0493067502975464, -0.13435694575309753, 0.6215638518333435, -2.40221905708313, 2.3497416973114014, -0.24357318878173828, 0.6817518472671509, -0.016519220545887947, -0.22506585717201233, 1.0035476684570312, 0.5199720859527588, 0.5247628688812256, -1.0363211631774902, 0.620191216468811, -0.6809230446815491, 1.2931281328201294, 0.8248733878135681, -0.789044976234436, -0.007969856262207031, 1.3105851411819458, 0.49747326970100403, -0.5851853489875793, -0.923484206199646, -1.0402436256408691, 0.9273450374603271, 1.7102173566818237, -0.12926210463047028, -0.02214062586426735, 0.9185848832130432, 0.6894693970680237, -1.3662238121032715, 0.06621628254652023, -0.7024827003479004, -0.735443651676178, 1.7247800827026367, 2.0890064239501953, -0.21151840686798096, -0.23178547620773315, -0.8721745610237122, -1.2247934341430664, 0.7406222224235535, 0.11655791103839874, 0.018916483968496323, 0.6612027287483215, -0.6170779466629028, 1.1770039796829224, 0.8438884019851685, 0.9326606392860413, 0.23980610072612762, 0.35001078248023987, 0.35259735584259033, -0.3956552743911743, -1.184643030166626, -0.21608860790729523, -1.063246488571167, -2.5438294410705566, 0.4995868504047394, -0.23663607239723206, -1.3976699113845825, 0.03883008658885956, -1.0077342987060547, 0.8682931661605835, -0.49150747060775757, -1.170196533203125, -1.3988611698150635, 0.14083562791347504, -0.0755273699760437, 0.8595731258392334, -1.6384766101837158, -0.07277914136648178, 1.2331715822219849, 1.0057393312454224, -0.828176736831665, 0.9169319272041321, 0.23123407363891602, 1.0842050313949585, 0.9650315046310425, -0.34986865520477295, 0.46943196654319763, 0.0050705233588814735, -1.341336727142334, 0.4317386746406555, 1.2060387134552002, 0.20654818415641785, 1.4197959899902344, -0.5778288841247559, -0.00011088047176599503, 0.38888606429100037, -0.45290452241897583, -0.4425906240940094, -0.7221187949180603, 0.6119478344917297, 0.022714368999004364, -0.8987594842910767, 0.11991065740585327, 0.021556492894887924, -0.21326833963394165, 0.22071315348148346, -1.530592441558838, -0.11543333530426025, -0.3414773941040039, -0.6836615204811096, -1.129141092300415, -0.10320112854242325, 1.3051942586898804, -0.6896552443504333, -0.1835404485464096, 0.5127030611038208, 0.2465042918920517, 0.46387454867362976, 0.5707173347473145, -0.6531630158424377, -0.3894678056240082, -0.20296674966812134, -0.47023752331733704, 0.33967283368110657, 1.465954303741455, -0.060861580073833466, -1.0028035640716553, 0.6645117402076721, -0.4113845229148865, 0.03678897023200989, 1.907069206237793, 0.02428947389125824, -0.862691342830658, 0.25000521540641785, -0.7068448662757874, 1.9230719804763794, 1.8118984699249268, 1.3069539070129395, -0.12110374122858047, -0.9942752122879028, 0.6463142037391663, -0.3872150182723999, -0.4945291578769684, 0.9274787306785583, 0.3625955879688263, -0.2523096203804016, -1.3458654880523682, 0.6887173056602478, 1.3405718803405762, -0.8102949261665344, -0.8972297310829163, 0.1164671778678894, -0.8128374814987183, 1.0775530338287354, 0.7983797788619995, 0.37844401597976685, 0.27367591857910156, 1.60390305519104, 0.7922057509422302, -0.4411378800868988, 0.6104689836502075, 0.4967072904109955, -0.16777630150318146, -2.0728342533111572, -1.2144079208374023, 0.30051863193511963, -0.5073253512382507, -1.6739131212234497, 1.4352428913116455, -1.2062973976135254, -0.9795325994491577, 0.5425202250480652, 0.105671726167202, 1.4568474292755127, 0.38747361302375793, 1.4968341588974, 2.0547494888305664, 0.8158008456230164, 0.4318694770336151, 1.2623302936553955, -0.22194050252437592, -0.5294194221496582, 1.7972882986068726, -0.5298308730125427, 0.526925265789032, 1.0482261180877686, -0.24396957457065582, -1.1460191011428833, -0.8121806383132935, -1.2805087566375732, -0.7412182092666626, 1.173183798789978, 0.058457259088754654, -1.184988260269165, 0.3570278584957123, 1.6473649740219116, 0.03108687326312065, -0.4149642288684845, 0.7286105751991272, 0.3499745726585388, -0.7990192174911499, -0.1167229637503624, -0.961314857006073, 0.560372531414032, -0.18733397126197815, -0.27799099683761597, 0.3982637822628021, 0.49634209275245667, 1.354277491569519, 0.09231731295585632, 0.150201678276062, 1.1464626789093018, -1.3334404230117798, 1.4585809707641602, -0.6989867687225342, 0.331598162651062, -2.3578526973724365, 1.414930820465088, -0.8021527528762817, 1.8799303770065308, -2.662940740585327, 0.38905030488967896, -0.5430342555046082, -0.49654921889305115, 0.2760443389415741, -0.3101319968700409, 0.14337624609470367, -0.16879820823669434, -1.2024474143981934, -0.08639777451753616, -0.7609056830406189, 0.5429978966712952, 1.0848352909088135, 1.377022385597229, -1.0037157535552979, -0.3356078565120697, -1.7461483478546143, -0.12446517497301102, -0.6414885520935059, 0.33734115958213806, -1.9411475658416748, -0.26885807514190674, -1.938970685005188, -2.364412546157837, -1.2893249988555908, -0.8281516432762146, 1.1429163217544556, 0.11990796029567719, -0.8449051380157471, 1.1639258861541748, -0.40467369556427, -1.877932071685791, 1.0628539323806763, -2.1479403972625732 ]
https://github.com/huggingface/datasets/issues/3181
`None` converted to `"None"` when loading a dataset
https://github.com/huggingface/datasets/pull/3195 fixed it, we'll do a new release soon :) For now feel free to install `datasets` from the master branch
## Describe the bug When loading a dataset `None` values of the type `NoneType` are converted to `'None'` of the type `str`. ## Steps to reproduce the bug ```python from datasets import load_dataset qasper = load_dataset("qasper", split="train", download_mode="reuse_cache_if_exists") print(qasper[60]["full_text"]["section_name"]) ``` When installing version 1.1.40, the output is `[None, 'Introduction', 'Benchmark Datasets', ...]` When installing from the master branch, the output is `['None', 'Introduction', 'Benchmark Datasets', ...]` Notice how the first element was changed from `NoneType` to `str`. ## Expected results `None` should stay as is. ## Actual results `None` is converted to a string. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: master - Platform: Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 4.0.1
1,137
21
`None` converted to `"None"` when loading a dataset ## Describe the bug When loading a dataset `None` values of the type `NoneType` are converted to `'None'` of the type `str`. ## Steps to reproduce the bug ```python from datasets import load_dataset qasper = load_dataset("qasper", split="train", download_mode="reuse_cache_if_exists") print(qasper[60]["full_text"]["section_name"]) ``` When installing version 1.1.40, the output is `[None, 'Introduction', 'Benchmark Datasets', ...]` When installing from the master branch, the output is `['None', 'Introduction', 'Benchmark Datasets', ...]` Notice how the first element was changed from `NoneType` to `str`. ## Expected results `None` should stay as is. ## Actual results `None` is converted to a string. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: master - Platform: Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 4.0.1 https://github.com/huggingface/datasets/pull/3195 fixed it, we'll do a new release soon :) For now feel free to install `datasets` from the master branch
[ -1.0740617513656616, -0.8484784960746765, -0.7379323244094849, 1.5833247900009155, -0.06813623011112213, -1.2702780961990356, 0.12588250637054443, -0.9717298746109009, 1.7830504179000854, -0.7928630709648132, 0.3547161817550659, -1.7074229717254639, 0.028199702501296997, -0.6244760751724243, -0.7678322792053223, -0.829608678817749, -0.3876296579837799, -0.6882439255714417, 1.0577560663223267, 2.3654088973999023, 1.1513335704803467, -1.3287400007247925, 2.622406005859375, 0.6387708783149719, -0.09896036982536316, -0.977246105670929, 0.5146210193634033, -0.027936585247516632, -1.2597695589065552, -0.3581336438655853, -0.8538675308227539, -0.1161709576845169, -0.615257203578949, -0.6604936122894287, 0.030764959752559662, 0.49548715353012085, -0.3722570836544037, -0.530612587928772, -0.5359103083610535, -0.8341932892799377, 0.36774730682373047, -0.39448636770248413, 0.9163995981216431, -0.3647076189517975, 1.8673123121261597, -0.5541641116142273, 0.4850170910358429, 0.673407793045044, 1.3275946378707886, 0.25212886929512024, 0.0877917930483818, 0.3546246886253357, 0.4258764684200287, 0.007701466791331768, 0.5471976399421692, 1.132357120513916, 0.6104207634925842, 0.5158140659332275, 0.8578731417655945, -2.319200038909912, 1.2625571489334106, -1.0568355321884155, 0.28624117374420166, 1.3426295518875122, -0.8596727252006531, 0.3473566770553589, -1.7721962928771973, 0.04807252064347267, 0.5241101980209351, -2.2007927894592285, 0.2545362710952759, -1.3242084980010986, -0.4791160225868225, 1.041288137435913, 0.3765449523925781, -1.2428914308547974, 0.06952957808971405, -0.3523702025413513, 0.9537818431854248, 0.4144670069217682, 1.121337652206421, -1.7527354955673218, -0.05567481741309166, -0.3284437358379364, 0.1719442456960678, -1.2417547702789307, -1.5371578931808472, 0.5315724015235901, 0.737133800983429, 0.5686360001564026, -0.23345951735973358, 1.0242866277694702, -1.0006935596466064, 0.6854763627052307, -1.0744121074676514, -1.8742892742156982, -1.3223861455917358, -2.2202680110931396, -2.315086841583252, 0.7430880665779114, -0.4668215215206146, -0.45316341519355774, 2.0748932361602783, -0.9350445866584778, -1.7745633125305176, 1.100627064704895, 0.3973812162876129, -0.021329883486032486, 2.393159866333008, 0.1972609907388687, -0.7178564667701721, 0.4978998899459839, -0.8004076480865479, 0.6363766193389893, -0.4352954626083374, 1.3284568786621094, 0.4452483654022217, -1.0574519634246826, 1.6070634126663208, -0.3725089132785797, 0.6530793309211731, -0.792297899723053, -0.37604638934135437, -0.6918297410011292, 0.275300532579422, 1.9122909307479858, -0.24437542259693146, 1.4803967475891113, -0.3001536428928375, -1.5088375806808472, -1.5532982349395752, 0.8232766389846802, 0.373686283826828, -0.6813589930534363, 0.12581604719161987, -0.2525402307510376, 0.22311097383499146, -0.08710310608148575, 1.2136015892028809, 1.2342758178710938, 0.7872591018676758, -0.2641843557357788, -0.867170512676239, 0.17090411484241486, -0.04087395966053009, -0.7658997178077698, -1.73486328125, -0.3134956657886505, 0.19841359555721283, 0.6372912526130676, -1.1853121519088745, 1.7970718145370483, 0.8639340996742249, 1.958022117614746, 1.00235915184021, -0.38284552097320557, 1.4458962678909302, 0.10062272101640701, 1.9575103521347046, -0.46054258942604065, 0.6324881315231323, -0.3933286964893341, -1.128267526626587, 0.8263541460037231, -0.27928194403648376, -1.958303689956665, -0.74384605884552, -0.9328085780143738, -0.13798561692237854, -0.7021669745445251, 0.9276994466781616, -0.26121485233306885, -1.3956156969070435, 0.2023637890815735, -0.7743110656738281, 0.07870964705944061, -1.2321362495422363, 0.2687612771987915, 0.7339017987251282, -0.623924195766449, 0.14178141951560974, -0.29630690813064575, -1.3768559694290161, -0.5324258804321289, 0.4118572175502777, 1.8721916675567627, -0.802015483379364, 0.9417183995246887, 1.0671234130859375, -0.7803777456283569, -0.056551165878772736, 0.3484393358230591, -0.32691285014152527, 0.8644515872001648, -1.08974289894104, -0.49811840057373047, 1.2185946702957153, -0.14839597046375275, -0.6886467337608337, 1.4416935443878174, 0.7271475791931152, -1.001768708229065, -0.1276080161333084, -0.15525665879249573, -0.7615473866462708, 0.08032450824975967, -1.583162784576416, -0.05404634028673172, 0.42455801367759705, -1.5240918397903442, -0.49725064635276794, -0.19830092787742615, 1.2738784551620483, -0.16326582431793213, 1.311838984489441, -0.24076373875141144, -0.24005454778671265, -0.4428226351737976, -0.383963406085968, 0.08011279255151749, -0.2513369023799896, -0.7334184646606445, 0.2297075241804123, -0.6833611726760864, 0.4394513666629791, 1.3880788087844849, 0.28042659163475037, 0.029781676828861237, 0.5926814675331116, 1.21956467628479, 0.35667842626571655, 0.04742230474948883, -0.9090027213096619, -1.5881080627441406, 1.977895736694336, -1.513063669204712, 2.006030559539795, 0.5746473670005798, -0.03957528620958328, -1.7539256811141968, -1.9244509935379028, 1.5337530374526978, 1.1240442991256714, 2.34378719329834, 0.6026426553726196, 0.4627606272697449, -0.8084630370140076, -0.6282460689544678, 0.2339329570531845, -0.9516293406486511, -0.7141907811164856, 0.22549991309642792, 2.3901185989379883, 1.7092876434326172, -0.5111135840415955, -0.178911492228508, -1.0118104219436646, 1.4751479625701904, -0.19826382398605347, 0.18339110910892487, 2.053156614303589, -0.263605535030365, -1.0510413646697998, 1.289162278175354, -2.342440128326416, 0.14672069251537323, 2.0193355083465576, 0.19745858013629913, 0.09230054914951324, -1.311217188835144, -0.7250276207923889, -0.2888292074203491, -0.4141176640987396, -1.2866542339324951, 0.4822760820388794, -0.16736318171024323, -0.7029003500938416, -1.4540632963180542, 0.2151889204978943, -1.0782543420791626, -1.6232742071151733, 0.14568239450454712, 1.9187970161437988, 1.90914785861969, -0.7496736645698547, 1.5764873027801514, -0.19745919108390808, 0.24280449748039246, 1.3010528087615967, 1.1917895078659058, 3.0998971462249756, 1.9248923063278198, -1.2265353202819824, 0.6798305511474609, -0.12190369516611099, -0.49877163767814636, 1.2258734703063965, -1.1743918657302856, 1.2683073282241821, -0.1561623066663742, -1.1569392681121826, -1.2436364889144897, 0.8864167332649231, 0.5105516910552979, 0.008477755822241306, -0.48683664202690125, 1.1650559902191162, 0.07502030581235886, 1.3027395009994507, 0.5856039524078369, -0.2807542681694031, 0.7026486992835999, -0.42197051644325256, -0.5253562927246094, 1.555814266204834, 0.20040620863437653, -1.3913874626159668, -2.3158962726593018, -0.20393013954162598, -0.9027133584022522, 0.02079503983259201, -0.6674521565437317, -0.951789379119873, 1.6754016876220703, 0.4288015365600586, -1.2006365060806274, -0.2127894014120102, -0.3019828200340271, -0.6799626350402832, 2.814998149871826, -1.3868552446365356, -0.2614574432373047, -1.0482860803604126, -0.6503306031227112, 1.636717677116394, -1.2032243013381958, -0.2149512618780136, -1.0968449115753174, -0.4448542594909668, -1.3194576501846313, -0.5822561383247375, 0.038941655308008194, -0.8373284935951233, 0.8677276372909546, 0.22367265820503235, -1.324168086051941, -0.428335040807724, -0.9590800404548645, 0.8143483996391296, -0.1467655748128891, 0.1639697253704071, 1.858349323272705, 0.5549036264419556, -0.346703439950943, 0.6644986271858215, 1.1393882036209106, 0.6992838382720947, -0.5890302062034607, 0.38525092601776123, -0.6380051970481873, 0.286469429731369, -1.3303797245025635, 0.24072250723838806, -2.8160531520843506, 0.5845584273338318, -0.05944810062646866, -0.07682216167449951, -0.013438992202281952, -1.3103266954421997, 1.0750815868377686, 2.5314416885375977, -1.2257654666900635, 0.4912216067314148, 0.19237802922725677, 1.267975926399231, -1.6273078918457031, 0.19929297268390656, -0.4548945128917694, 2.1373095512390137, 0.06911259889602661, 1.0643426179885864, -0.45842909812927246, -2.2814736366271973, 0.5304771661758423, -1.2714452743530273, -1.1895095109939575, 0.8104896545410156, -0.8245653510093689, 0.12866489589214325, -1.3159846067428589, -0.1837281584739685, -0.8441750407218933, -1.1837347745895386, 0.7612504959106445, 0.021821189671754837, 0.4474742114543915, -0.6138926148414612, 0.4039655327796936, -2.1714558601379395, -1.43185555934906, -0.29621416330337524, -0.9426775574684143, 0.4895468056201935, -0.29885104298591614, 0.741060197353363, -0.18700829148292542, 0.002001372165977955, 0.3136225640773773, 1.4246586561203003, 3.3828868865966797, 0.18176016211509705, 0.49762123823165894, -0.19403783977031708, -1.0103853940963745, 1.4648112058639526, 0.9131733179092407, -0.14972876012325287, -0.459374338388443, -1.0978773832321167, 1.2431809902191162, 1.9749845266342163, 1.0643178224563599, -0.015426341444253922, -0.7304493188858032, -0.7892065048217773, 0.0654095709323883, 0.16727696359157562, 0.4335844814777374, 0.7877880930900574, 0.1590844839811325, 0.059160053730010986, 1.3600174188613892, 1.1159411668777466, -0.3981764614582062, 0.3585819602012634, -0.8166622519493103, -0.4385070204734802, 0.6114357113838196, 0.3325729966163635, 0.02179781347513199, 0.2952795922756195, -1.0483886003494263, -0.26093247532844543, -0.34020915627479553, -0.8710950016975403, -0.7123668789863586, -0.513116717338562, -0.3376366198062897, 1.677607774734497, -0.01375640369951725, -0.563964307308197, -0.01676718145608902, -0.7699038982391357, 0.0652727261185646, -1.0374234914779663, 0.28416502475738525, -0.16254638135433197, -0.1242138147354126, -0.06296935677528381, 1.7516357898712158, -1.0155590772628784, -2.021404266357422, 0.2083936184644699, 0.289499968290329, -0.35108327865600586, 0.2036391794681549, 1.6719529628753662, 0.5546509623527527, 1.4498765468597412, 1.4005156755447388, 1.0401939153671265, -0.7274737358093262, -1.370522379875183, 0.5875001549720764, 0.9597401022911072, -1.3537293672561646, 0.7932543754577637, 0.06722339242696762, -0.4742163121700287, 0.5402940511703491, 1.341870665550232, 0.40311622619628906, -1.9546949863433838, 0.6813629865646362, -0.8993284106254578, 0.7937312126159668, 0.7790600657463074, 0.7693192958831787, 0.15174271166324615, 0.7516999840736389, -1.2027734518051147, -1.1762115955352783, -0.6988716125488281, -0.7197272777557373, 1.841723918914795, -0.22078971564769745, 0.5610138773918152, -0.16831178963184357, -1.400063157081604, -0.03578208014369011, 0.6569938063621521, 0.45654812455177307, -0.5464997291564941, 0.7109436392784119, -0.6316133141517639, -1.0840916633605957, -1.3601257801055908, -0.4806361794471741, -1.1158324480056763, -1.0028061866760254, 1.0512782335281372, 0.8600743412971497, 0.26106011867523193, 1.8283429145812988, 0.7187382578849792, 0.20272500813007355, -2.5745484828948975, 0.8690927028656006, 0.38714903593063354, -0.05953345447778702, 0.7121004462242126, 0.4848911166191101, 1.034040927886963, -0.16507768630981445, 0.6258285045623779, -2.3669722080230713, 2.325615644454956, -0.2245689034461975, 0.6440286040306091, -0.03633294254541397, -0.18425366282463074, 0.9916841983795166, 0.5356276631355286, 0.520750880241394, -1.0568212270736694, 0.6246551871299744, -0.6625009179115295, 1.2858741283416748, 0.8336953520774841, -0.8135610222816467, -0.0052185035310685635, 1.3292357921600342, 0.5285011529922485, -0.578400194644928, -0.9483010768890381, -1.0301522016525269, 0.9512114524841309, 1.6879425048828125, -0.07300801575183868, -0.06536530703306198, 0.9429535269737244, 0.6820619702339172, -1.3585107326507568, 0.06297779083251953, -0.704961359500885, -0.6789683103561401, 1.746443271636963, 2.0880839824676514, -0.18716809153556824, -0.21684764325618744, -0.8562144637107849, -1.225751519203186, 0.7038873434066772, 0.11397739499807358, -0.007910169661045074, 0.7084614038467407, -0.6289944052696228, 1.1548267602920532, 0.8462535738945007, 0.9042669534683228, 0.2439538538455963, 0.31268876791000366, 0.3288264870643616, -0.41340523958206177, -1.242238163948059, -0.19869540631771088, -1.0529166460037231, -2.5386064052581787, 0.45406925678253174, -0.25648126006126404, -1.3814399242401123, -0.012658483348786831, -1.024925947189331, 0.8993149399757385, -0.46776866912841797, -1.1457595825195312, -1.3793811798095703, 0.12174034118652344, -0.03941115364432335, 0.8302160501480103, -1.6237850189208984, -0.06478902697563171, 1.248389482498169, 1.0008647441864014, -0.8408129215240479, 0.9107832908630371, 0.21476304531097412, 1.1076409816741943, 0.9253861308097839, -0.32526588439941406, 0.4696197509765625, 0.011716636829078197, -1.3577262163162231, 0.44034263491630554, 1.1593698263168335, 0.19786027073860168, 1.3753706216812134, -0.5679060220718384, 0.020479924976825714, 0.3588661849498749, -0.4224306344985962, -0.48382264375686646, -0.6956319808959961, 0.6055489182472229, 0.041095245629549026, -0.8539308309555054, 0.1518629491329193, 0.034462474286556244, -0.18736159801483154, 0.22745396196842194, -1.5292551517486572, -0.11807378381490707, -0.3129924237728119, -0.6646023392677307, -1.1412529945373535, -0.11617615073919296, 1.319839596748352, -0.7286450266838074, -0.16589228808879852, 0.5230022668838501, 0.20488502085208893, 0.4915153980255127, 0.577491044998169, -0.6111720204353333, -0.3418564796447754, -0.21204808354377747, -0.43671277165412903, 0.3121291697025299, 1.4391226768493652, -0.10566318035125732, -0.9912010431289673, 0.678360641002655, -0.40121155977249146, 0.07220790535211563, 1.9260300397872925, 0.03459428250789642, -0.8890352845191956, 0.26340651512145996, -0.7348766922950745, 1.9066063165664673, 1.8103525638580322, 1.3326431512832642, -0.10992071032524109, -0.9852840304374695, 0.6573803424835205, -0.37095218896865845, -0.5160661935806274, 0.929328441619873, 0.36401376128196716, -0.2800757586956024, -1.3343461751937866, 0.7030261158943176, 1.3398754596710205, -0.7920008301734924, -0.9192548394203186, 0.18293185532093048, -0.8386831283569336, 1.1011863946914673, 0.7916338443756104, 0.40102073550224304, 0.3320980966091156, 1.6291265487670898, 0.7799028754234314, -0.44640475511550903, 0.5935781598091125, 0.5154238343238831, -0.19687040150165558, -1.9938712120056152, -1.1856937408447266, 0.26801732182502747, -0.5692048072814941, -1.6575558185577393, 1.4335383176803589, -1.2058837413787842, -0.9648587703704834, 0.5675128698348999, 0.15058106184005737, 1.4744281768798828, 0.370201975107193, 1.5157496929168701, 2.000523090362549, 0.799336850643158, 0.41687044501304626, 1.2398921251296997, -0.21413815021514893, -0.5128059387207031, 1.767019510269165, -0.507250189781189, 0.5151427388191223, 1.0681419372558594, -0.24622663855552673, -1.16205632686615, -0.7990768551826477, -1.2644582986831665, -0.7337550520896912, 1.1762193441390991, 0.08266319334506989, -1.184373378753662, 0.3087928891181946, 1.6426161527633667, 0.021109703928232193, -0.3561340570449829, 0.7319623231887817, 0.3424585461616516, -0.8255745768547058, -0.09223505854606628, -0.9916954636573792, 0.5984484553337097, -0.17653366923332214, -0.25334155559539795, 0.3635784685611725, 0.5011771321296692, 1.3844069242477417, 0.12451218068599701, 0.17824779450893402, 1.146310567855835, -1.3159339427947998, 1.463261365890503, -0.7128021717071533, 0.33644139766693115, -2.3545382022857666, 1.4204670190811157, -0.7892463207244873, 1.864230990409851, -2.659468173980713, 0.38399460911750793, -0.5515959858894348, -0.5321113467216492, 0.29070815443992615, -0.38138696551322937, 0.13030333817005157, -0.15658429265022278, -1.2048790454864502, -0.06805098801851273, -0.7729470133781433, 0.5250241160392761, 1.1354551315307617, 1.402425765991211, -1.0237295627593994, -0.3801044821739197, -1.7530938386917114, -0.11985807865858078, -0.6700926423072815, 0.4022824466228485, -1.8997297286987305, -0.2999720871448517, -1.8893017768859863, -2.3831703662872314, -1.2607457637786865, -0.8653041124343872, 1.1191351413726807, 0.07928089797496796, -0.8797321915626526, 1.1717804670333862, -0.4114476442337036, -1.8894320726394653, 1.0820802450180054, -2.1639463901519775 ]
https://github.com/huggingface/datasets/issues/3181
`None` converted to `"None"` when loading a dataset
Thanks, but unfortunately looks like it isn't fixed yet 😒 [notebook for 1.14.0](https://colab.research.google.com/drive/1SV3sFXPJMWSQgbm4pr9Y1Q8OJ4JYKcDo?usp=sharing) [notebook for master](https://colab.research.google.com/drive/145wDpuO74MmsuI0SVLcI1IswG6aHpyhi?usp=sharing)
## Describe the bug When loading a dataset `None` values of the type `NoneType` are converted to `'None'` of the type `str`. ## Steps to reproduce the bug ```python from datasets import load_dataset qasper = load_dataset("qasper", split="train", download_mode="reuse_cache_if_exists") print(qasper[60]["full_text"]["section_name"]) ``` When installing version 1.1.40, the output is `[None, 'Introduction', 'Benchmark Datasets', ...]` When installing from the master branch, the output is `['None', 'Introduction', 'Benchmark Datasets', ...]` Notice how the first element was changed from `NoneType` to `str`. ## Expected results `None` should stay as is. ## Actual results `None` is converted to a string. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: master - Platform: Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 4.0.1
1,137
16
`None` converted to `"None"` when loading a dataset ## Describe the bug When loading a dataset `None` values of the type `NoneType` are converted to `'None'` of the type `str`. ## Steps to reproduce the bug ```python from datasets import load_dataset qasper = load_dataset("qasper", split="train", download_mode="reuse_cache_if_exists") print(qasper[60]["full_text"]["section_name"]) ``` When installing version 1.1.40, the output is `[None, 'Introduction', 'Benchmark Datasets', ...]` When installing from the master branch, the output is `['None', 'Introduction', 'Benchmark Datasets', ...]` Notice how the first element was changed from `NoneType` to `str`. ## Expected results `None` should stay as is. ## Actual results `None` is converted to a string. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: master - Platform: Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 4.0.1 Thanks, but unfortunately looks like it isn't fixed yet 😒 [notebook for 1.14.0](https://colab.research.google.com/drive/1SV3sFXPJMWSQgbm4pr9Y1Q8OJ4JYKcDo?usp=sharing) [notebook for master](https://colab.research.google.com/drive/145wDpuO74MmsuI0SVLcI1IswG6aHpyhi?usp=sharing)
[ -1.117220401763916, -0.8870999813079834, -0.7563175559043884, 1.5397804975509644, -0.10925611853599548, -1.27373206615448, 0.13632306456565857, -0.9916651248931885, 1.7711703777313232, -0.8115760684013367, 0.348585844039917, -1.676233172416687, 0.06569804251194, -0.5813008546829224, -0.753912091255188, -0.8259698748588562, -0.3541852533817291, -0.7247121930122375, 1.0852851867675781, 2.431201219558716, 1.14137601852417, -1.3355072736740112, 2.6236467361450195, 0.6504073739051819, -0.15812146663665771, -1.0072879791259766, 0.5012200474739075, -0.03931158781051636, -1.314988136291504, -0.3353351056575775, -0.8776606321334839, -0.10292980819940567, -0.6510522365570068, -0.6525828242301941, 0.03619108349084854, 0.4075956642627716, -0.32534483075141907, -0.48813456296920776, -0.5343992114067078, -0.7869589328765869, 0.3828640878200531, -0.4074283242225647, 0.922198474407196, -0.3007810115814209, 1.8307833671569824, -0.611415684223175, 0.4569947123527527, 0.6986902356147766, 1.3177274465560913, 0.25392699241638184, 0.0523139089345932, 0.354351282119751, 0.441028892993927, 0.006135635077953339, 0.5212771892547607, 1.1860268115997314, 0.6314312815666199, 0.4761285185813904, 0.8189891576766968, -2.333937406539917, 1.2763854265213013, -1.0321018695831299, 0.2954370379447937, 1.3072606325149536, -0.8897802829742432, 0.35403069853782654, -1.8046801090240479, -0.026311151683330536, 0.5146144032478333, -2.222224712371826, 0.2696968913078308, -1.3578166961669922, -0.4999150335788727, 0.9717560410499573, 0.37842094898223877, -1.2489862442016602, 0.08001702278852463, -0.41065502166748047, 0.9407883286476135, 0.4019790291786194, 1.1142724752426147, -1.7587472200393677, -0.10984911024570465, -0.3562470078468323, 0.1943328082561493, -1.2219268083572388, -1.5577195882797241, 0.5911034345626831, 0.7408621907234192, 0.5475180149078369, -0.1900014877319336, 1.0148310661315918, -1.0402761697769165, 0.7489424347877502, -1.065045714378357, -1.874362826347351, -1.3369624614715576, -2.2261178493499756, -2.256044626235962, 0.7496973872184753, -0.4312623143196106, -0.4449470639228821, 2.0763773918151855, -0.9891982078552246, -1.755858302116394, 1.1031460762023926, 0.3012467324733734, -0.07212740927934647, 2.390122890472412, 0.20161154866218567, -0.7363255620002747, 0.4845801591873169, -0.7960221767425537, 0.6812216639518738, -0.380539208650589, 1.3117784261703491, 0.4414360821247101, -1.0182464122772217, 1.5988678932189941, -0.33836156129837036, 0.6100007891654968, -0.761063277721405, -0.3858262002468109, -0.7129276394844055, 0.26535677909851074, 1.9253309965133667, -0.26939231157302856, 1.501097321510315, -0.31754979491233826, -1.5160948038101196, -1.523516297340393, 0.806488573551178, 0.4450748562812805, -0.7249690294265747, 0.09809043258428574, -0.28977760672569275, 0.20623445510864258, -0.03929506242275238, 1.2295094728469849, 1.2809374332427979, 0.7754409909248352, -0.31078311800956726, -0.8673866391181946, 0.14056816697120667, -0.06199058145284653, -0.7623103260993958, -1.7702387571334839, -0.34471452236175537, 0.1508704274892807, 0.6800382137298584, -1.2188011407852173, 1.776901364326477, 0.8736920356750488, 1.9436979293823242, 1.0254336595535278, -0.36376309394836426, 1.4479694366455078, 0.08940678834915161, 1.9416042566299438, -0.4433234930038452, 0.6825018525123596, -0.43622446060180664, -1.159210443496704, 0.8539077043533325, -0.26132896542549133, -1.9761848449707031, -0.7135827541351318, -0.9170358180999756, -0.1487017124891281, -0.7082800269126892, 0.9075599312782288, -0.263227641582489, -1.4294968843460083, 0.2115435153245926, -0.7910342216491699, 0.02918204851448536, -1.2188951969146729, 0.2583262026309967, 0.6882182359695435, -0.6096371412277222, 0.14820019900798798, -0.29063746333122253, -1.3443840742111206, -0.5338869690895081, 0.3408737778663635, 1.8662604093551636, -0.807110607624054, 0.9557682275772095, 1.077653169631958, -0.7406755685806274, -0.010029593482613564, 0.3642660081386566, -0.32393333315849304, 0.8576013445854187, -1.1063605546951294, -0.4400656223297119, 1.1307284832000732, -0.09523376822471619, -0.6380311846733093, 1.4368195533752441, 0.7268444299697876, -0.9898889660835266, -0.17750763893127441, -0.12661652266979218, -0.7715367674827576, 0.05706635117530823, -1.6315311193466187, -0.12918275594711304, 0.40222322940826416, -1.5405910015106201, -0.49552127718925476, -0.25271615386009216, 1.3151408433914185, -0.0988100990653038, 1.3252809047698975, -0.24036778509616852, -0.24606141448020935, -0.43567001819610596, -0.3633559048175812, 0.10409844666719437, -0.22467286884784698, -0.6816008687019348, 0.2774946689605713, -0.7162347435951233, 0.3754180073738098, 1.4560154676437378, 0.2706396281719208, 0.03849472105503082, 0.5662026405334473, 1.1621333360671997, 0.3514433205127716, 0.041343800723552704, -0.9002529978752136, -1.5827527046203613, 1.984656810760498, -1.5114045143127441, 2.0347793102264404, 0.6613661646842957, -0.026312004774808884, -1.7955586910247803, -1.9323883056640625, 1.4789912700653076, 1.1130903959274292, 2.339371681213379, 0.6183647513389587, 0.4755132794380188, -0.7816804647445679, -0.6063291430473328, 0.2807939350605011, -1.0002200603485107, -0.7401440143585205, 0.2051798552274704, 2.3963325023651123, 1.6778223514556885, -0.5056887269020081, -0.16498400270938873, -1.0052231550216675, 1.4152281284332275, -0.15357762575149536, 0.21692562103271484, 2.040090560913086, -0.2619021534919739, -1.073617696762085, 1.2893234491348267, -2.3133091926574707, 0.16105201840400696, 2.028545379638672, 0.18315549194812775, 0.06566860526800156, -1.3268647193908691, -0.7091834545135498, -0.2880590856075287, -0.44516411423683167, -1.2596036195755005, 0.49208158254623413, -0.1990722268819809, -0.7990419864654541, -1.4987475872039795, 0.18876737356185913, -1.106289029121399, -1.6594957113265991, 0.17792071402072906, 1.9370061159133911, 1.939679741859436, -0.753181517124176, 1.5580134391784668, -0.2601485550403595, 0.2107551395893097, 1.2538787126541138, 1.2030856609344482, 3.0998291969299316, 1.9443540573120117, -1.236496925354004, 0.7039698958396912, -0.14085230231285095, -0.4489207863807678, 1.1325795650482178, -1.1704803705215454, 1.2604048252105713, -0.18714967370033264, -1.1487878561019897, -1.2120896577835083, 0.9297040104866028, 0.4745333790779114, -0.026309994980692863, -0.4535541236400604, 1.215505599975586, 0.09391732513904572, 1.3039926290512085, 0.5684648752212524, -0.2623171806335449, 0.6933999061584473, -0.4174764156341553, -0.5212294459342957, 1.5717496871948242, 0.19754558801651, -1.3947169780731201, -2.3718454837799072, -0.20279626548290253, -0.9096832275390625, 0.042244285345077515, -0.6334074139595032, -0.9605239033699036, 1.668506383895874, 0.41230547428131104, -1.185329556465149, -0.21204589307308197, -0.3213304281234741, -0.6323968172073364, 2.7625484466552734, -1.4059326648712158, -0.26538923382759094, -1.0198473930358887, -0.6465133428573608, 1.6324405670166016, -1.2019318342208862, -0.21930894255638123, -1.0427930355072021, -0.4382665157318115, -1.315793514251709, -0.5404899716377258, 0.04368533939123154, -0.8530600666999817, 0.8463900089263916, 0.1912412792444229, -1.2737754583358765, -0.3963540494441986, -0.914993405342102, 0.8016127347946167, -0.09808047115802765, 0.17991787195205688, 1.9021648168563843, 0.4797123670578003, -0.37601640820503235, 0.6812608242034912, 1.143676996231079, 0.6907263398170471, -0.5890862941741943, 0.34429025650024414, -0.5936827659606934, 0.2718096077442169, -1.2983670234680176, 0.28433290123939514, -2.80552077293396, 0.6100804805755615, -0.05486832559108734, -0.054404325783252716, -0.004910635761916637, -1.3106905221939087, 1.091274380683899, 2.494565486907959, -1.1956952810287476, 0.5045217871665955, 0.17758230865001678, 1.2397677898406982, -1.560903787612915, 0.21893668174743652, -0.41820845007896423, 2.119828224182129, 0.14302827417850494, 1.1292258501052856, -0.4273141026496887, -2.262359142303467, 0.581421971321106, -1.249617576599121, -1.1599833965301514, 0.8149518370628357, -0.8179792761802673, 0.12068880349397659, -1.364600658416748, -0.20327158272266388, -0.860403835773468, -1.164732813835144, 0.7222476005554199, 0.05843222886323929, 0.45690223574638367, -0.6550615429878235, 0.3801162838935852, -2.1355550289154053, -1.4328138828277588, -0.24151398241519928, -0.9601255655288696, 0.4853762984275818, -0.2935428321361542, 0.7334777116775513, -0.20968061685562134, 0.015500390902161598, 0.29765966534614563, 1.4181718826293945, 3.390465497970581, 0.1383938044309616, 0.4526579976081848, -0.22170980274677277, -0.9962199926376343, 1.4225374460220337, 0.9709703922271729, -0.13649077713489532, -0.4897346496582031, -1.1146149635314941, 1.2392992973327637, 1.9714680910110474, 1.0469311475753784, 0.001946798525750637, -0.7293990850448608, -0.7880080342292786, 0.05260658264160156, 0.23907645046710968, 0.4545220732688904, 0.8484542965888977, 0.17745104432106018, 0.07389464974403381, 1.408658742904663, 1.126778244972229, -0.4732983410358429, 0.36824214458465576, -0.8679282665252686, -0.441676527261734, 0.5451931953430176, 0.33805638551712036, 0.042265117168426514, 0.3153199851512909, -1.11143958568573, -0.28019049763679504, -0.31444141268730164, -0.9129263162612915, -0.7425939440727234, -0.45443496108055115, -0.34219542145729065, 1.6636791229248047, 0.020173199474811554, -0.49580246210098267, -0.028434837237000465, -0.7353640198707581, 0.0294474046677351, -1.0441073179244995, 0.26698312163352966, -0.14533032476902008, -0.11161455512046814, -0.05417705327272415, 1.766419768333435, -0.9507280588150024, -1.9768638610839844, 0.245162233710289, 0.23437288403511047, -0.3595517873764038, 0.2371918261051178, 1.7011969089508057, 0.5854831337928772, 1.4507421255111694, 1.377539873123169, 1.0026804208755493, -0.6894140243530273, -1.351595401763916, 0.5755038261413574, 0.9509924054145813, -1.3984932899475098, 0.7630642652511597, 0.02686028741300106, -0.4973798394203186, 0.5710225701332092, 1.3378311395645142, 0.4215239882469177, -2.027188301086426, 0.7008770704269409, -0.9059962034225464, 0.7718454003334045, 0.7524685859680176, 0.7786957621574402, 0.19334037601947784, 0.7289477586746216, -1.2229633331298828, -1.1454929113388062, -0.7228890061378479, -0.704193651676178, 1.872618556022644, -0.22267140448093414, 0.5419096350669861, -0.18180207908153534, -1.3345650434494019, -0.07975787669420242, 0.626504123210907, 0.46624693274497986, -0.5224959254264832, 0.6948469877243042, -0.6406934857368469, -1.1111384630203247, -1.3342852592468262, -0.48969873785972595, -1.070643424987793, -0.9603475332260132, 1.014662265777588, 0.84388267993927, 0.32788944244384766, 1.8977853059768677, 0.6996683478355408, 0.19734878838062286, -2.5983357429504395, 0.9154471755027771, 0.3647368848323822, -0.049934566020965576, 0.8115872144699097, 0.40775245428085327, 1.0442085266113281, -0.13186882436275482, 0.5926368236541748, -2.401449680328369, 2.318052053451538, -0.22139377892017365, 0.6810653209686279, -0.013723121955990791, -0.15085789561271667, 1.010706901550293, 0.5517171025276184, 0.5667452216148376, -1.0360102653503418, 0.6445888876914978, -0.6807577610015869, 1.3163809776306152, 0.8670470118522644, -0.8040244579315186, -0.02874479815363884, 1.2944974899291992, 0.5084483027458191, -0.5755634903907776, -0.8848496079444885, -1.0749213695526123, 0.8977193832397461, 1.7546809911727905, -0.09078920632600784, -0.01633615978062153, 0.8810012936592102, 0.6343246698379517, -1.3435097932815552, 0.027423391118645668, -0.728472113609314, -0.6968727707862854, 1.715008020401001, 2.0941386222839355, -0.19826015830039978, -0.19288544356822968, -0.7847436666488647, -1.2513123750686646, 0.7702668905258179, 0.0606616735458374, 0.025030197575688362, 0.716497004032135, -0.6268428564071655, 1.1875582933425903, 0.8122206926345825, 0.9344930648803711, 0.262370765209198, 0.3159591257572174, 0.3317469656467438, -0.3759712874889374, -1.2084758281707764, -0.23455573618412018, -1.0423543453216553, -2.526618480682373, 0.47420182824134827, -0.2360103279352188, -1.3901993036270142, -0.01844160258769989, -1.0224360227584839, 0.8549367189407349, -0.5009543299674988, -1.1108249425888062, -1.3899648189544678, 0.15311138331890106, -0.05673397332429886, 0.8685779571533203, -1.655124545097351, -0.04636091738939285, 1.2265523672103882, 1.0289480686187744, -0.7584337592124939, 0.9535210728645325, 0.2517545223236084, 1.0857621431350708, 0.9005768299102783, -0.3249550759792328, 0.47228553891181946, 0.034470126032829285, -1.2986797094345093, 0.45268842577934265, 1.1787376403808594, 0.20188869535923004, 1.3971962928771973, -0.5706159472465515, 0.0016656937077641487, 0.39961424469947815, -0.4308941662311554, -0.4592541754245758, -0.6977484226226807, 0.6495917439460754, 0.05527368187904358, -0.8565256595611572, 0.08631003648042679, -0.02382240816950798, -0.16942650079727173, 0.22665371000766754, -1.497578740119934, -0.11179061979055405, -0.3439476788043976, -0.6928216814994812, -1.1698591709136963, -0.09857555478811264, 1.3108552694320679, -0.7493141889572144, -0.1653100699186325, 0.5108039975166321, 0.2703217566013336, 0.5077241063117981, 0.5860339999198914, -0.6278838515281677, -0.42381957173347473, -0.18729938566684723, -0.41884854435920715, 0.33237966895103455, 1.4480037689208984, -0.09208443015813828, -1.0228657722473145, 0.6903117299079895, -0.43063199520111084, 0.0731312707066536, 1.9042783975601196, 0.01965634524822235, -0.869370698928833, 0.24839751422405243, -0.6826951503753662, 1.9519058465957642, 1.7685887813568115, 1.2872130870819092, -0.15525414049625397, -0.9436835050582886, 0.6520544290542603, -0.3389394283294678, -0.4712699055671692, 0.9197698831558228, 0.3827213644981384, -0.2600347697734833, -1.3321343660354614, 0.6522573232650757, 1.353764295578003, -0.844577968120575, -0.8614584803581238, 0.14358097314834595, -0.8020772933959961, 1.0954214334487915, 0.7983242869377136, 0.41387689113616943, 0.29983776807785034, 1.6387217044830322, 0.7874761819839478, -0.4530814290046692, 0.5677968263626099, 0.4955873489379883, -0.16688761115074158, -2.0660054683685303, -1.1399978399276733, 0.26694434881210327, -0.5027939677238464, -1.6567630767822266, 1.4284794330596924, -1.1943953037261963, -0.9863559007644653, 0.5674199461936951, 0.1025402843952179, 1.4116448163986206, 0.3437890112400055, 1.5496751070022583, 2.0298943519592285, 0.8392102122306824, 0.4188813865184784, 1.2705128192901611, -0.2293802946805954, -0.5339761972427368, 1.7747431993484497, -0.49696195125579834, 0.5162676572799683, 1.058517575263977, -0.2688126266002655, -1.110481858253479, -0.777845561504364, -1.2687749862670898, -0.7237929701805115, 1.174824595451355, 0.07757987827062607, -1.1763273477554321, 0.31769752502441406, 1.6148792505264282, 0.049000538885593414, -0.37501972913742065, 0.6987302899360657, 0.364082932472229, -0.7754652500152588, -0.09709390252828598, -0.982331395149231, 0.5790295004844666, -0.1994013786315918, -0.3050960898399353, 0.35905927419662476, 0.45245644450187683, 1.3802584409713745, 0.06682305783033371, 0.12292974442243576, 1.2060859203338623, -1.36098051071167, 1.5145097970962524, -0.6623427271842957, 0.3234533369541168, -2.380289077758789, 1.397411584854126, -0.7925746440887451, 1.9099594354629517, -2.664764642715454, 0.3687695562839508, -0.5339547991752625, -0.5376536250114441, 0.2799816131591797, -0.33242765069007874, 0.13092251121997833, -0.17014041543006897, -1.1905254125595093, -0.0863543301820755, -0.770987331867218, 0.4922329783439636, 1.1265898942947388, 1.3686312437057495, -1.0540605783462524, -0.31208983063697815, -1.7430678606033325, -0.1209409311413765, -0.6623780131340027, 0.3510533273220062, -1.9402409791946411, -0.2581407427787781, -1.903368592262268, -2.3785812854766846, -1.2891274690628052, -0.8832845687866211, 1.1001267433166504, 0.08157164603471756, -0.8661875128746033, 1.1126110553741455, -0.3778095543384552, -1.8883912563323975, 1.098423719406128, -2.1675124168395996 ]
https://github.com/huggingface/datasets/issues/3181
`None` converted to `"None"` when loading a dataset
Oh, sorry. I deleted the fix by accident when I was resolving a merge conflict. Let me fix this real quick.
## Describe the bug When loading a dataset `None` values of the type `NoneType` are converted to `'None'` of the type `str`. ## Steps to reproduce the bug ```python from datasets import load_dataset qasper = load_dataset("qasper", split="train", download_mode="reuse_cache_if_exists") print(qasper[60]["full_text"]["section_name"]) ``` When installing version 1.1.40, the output is `[None, 'Introduction', 'Benchmark Datasets', ...]` When installing from the master branch, the output is `['None', 'Introduction', 'Benchmark Datasets', ...]` Notice how the first element was changed from `NoneType` to `str`. ## Expected results `None` should stay as is. ## Actual results `None` is converted to a string. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: master - Platform: Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 4.0.1
1,137
21
`None` converted to `"None"` when loading a dataset ## Describe the bug When loading a dataset `None` values of the type `NoneType` are converted to `'None'` of the type `str`. ## Steps to reproduce the bug ```python from datasets import load_dataset qasper = load_dataset("qasper", split="train", download_mode="reuse_cache_if_exists") print(qasper[60]["full_text"]["section_name"]) ``` When installing version 1.1.40, the output is `[None, 'Introduction', 'Benchmark Datasets', ...]` When installing from the master branch, the output is `['None', 'Introduction', 'Benchmark Datasets', ...]` Notice how the first element was changed from `NoneType` to `str`. ## Expected results `None` should stay as is. ## Actual results `None` is converted to a string. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: master - Platform: Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 4.0.1 Oh, sorry. I deleted the fix by accident when I was resolving a merge conflict. Let me fix this real quick.
[ -1.0886856317520142, -0.8367547988891602, -0.7209291458129883, 1.547113060951233, -0.11470504850149155, -1.234330177307129, 0.16596844792366028, -1.0085505247116089, 1.7746423482894897, -0.8325297832489014, 0.35446053743362427, -1.6905018091201782, 0.04861191660165787, -0.6268988251686096, -0.7501787543296814, -0.8423770666122437, -0.3963383734226227, -0.6842007040977478, 1.0712368488311768, 2.3705179691314697, 1.1114473342895508, -1.3272759914398193, 2.6000900268554688, 0.6359965205192566, -0.07058914005756378, -1.0080482959747314, 0.5270856618881226, -0.023610306903719902, -1.2809178829193115, -0.33676576614379883, -0.8536174893379211, -0.16855067014694214, -0.6317577958106995, -0.6634836792945862, 0.015637464821338654, 0.4715416729450226, -0.3477552533149719, -0.5439780950546265, -0.5021352171897888, -0.843813955783844, 0.37324610352516174, -0.4201945960521698, 0.8941176533699036, -0.382002055644989, 1.8586344718933105, -0.5852618217468262, 0.5144860744476318, 0.7019733190536499, 1.3190702199935913, 0.2564581632614136, 0.07871884852647781, 0.3716559410095215, 0.431831032037735, 0.023090599104762077, 0.5264813303947449, 1.1016931533813477, 0.5986548662185669, 0.5042692422866821, 0.8457332253456116, -2.322357654571533, 1.2531578540802002, -1.0676403045654297, 0.28778156638145447, 1.3291922807693481, -0.8694761395454407, 0.3384421467781067, -1.7909839153289795, 0.052524082362651825, 0.5319100022315979, -2.1865479946136475, 0.22735595703125, -1.3415989875793457, -0.4929868280887604, 1.0188883543014526, 0.38927608728408813, -1.26637601852417, 0.03204602748155594, -0.36319828033447266, 0.9292702078819275, 0.42308348417282104, 1.0948594808578491, -1.7442532777786255, -0.07050854712724686, -0.35525044798851013, 0.2140173614025116, -1.2446260452270508, -1.506003737449646, 0.544292688369751, 0.7605776190757751, 0.5233436822891235, -0.23053230345249176, 1.0206183195114136, -0.9837831258773804, 0.6995867490768433, -1.0836784839630127, -1.9086674451828003, -1.3226113319396973, -2.2066917419433594, -2.2952940464019775, 0.7480086088180542, -0.47416752576828003, -0.4464145600795746, 2.1000263690948486, -0.952183723449707, -1.7522274255752563, 1.1159943342208862, 0.3495214283466339, -0.029741939157247543, 2.4096877574920654, 0.1880464404821396, -0.7261866927146912, 0.48658350110054016, -0.8184632062911987, 0.640096127986908, -0.4493848383426666, 1.3182804584503174, 0.4174227714538574, -1.0251868963241577, 1.6276792287826538, -0.3445766866207123, 0.6442294120788574, -0.7817972302436829, -0.37017667293548584, -0.7066653370857239, 0.29724109172821045, 1.9052515029907227, -0.20520588755607605, 1.474098801612854, -0.30422183871269226, -1.5167138576507568, -1.5482877492904663, 0.8271021246910095, 0.39468246698379517, -0.6909440159797668, 0.14100277423858643, -0.2319640815258026, 0.21982719004154205, -0.05581332743167877, 1.2153816223144531, 1.2962400913238525, 0.8262948393821716, -0.2481221854686737, -0.872367262840271, 0.17256273329257965, -0.07390164583921432, -0.7921431064605713, -1.7524381875991821, -0.3278825581073761, 0.142818421125412, 0.674361526966095, -1.1772997379302979, 1.8171919584274292, 0.8626417517662048, 1.9356690645217896, 1.0136526823043823, -0.357136607170105, 1.4668102264404297, 0.11473538726568222, 1.9450734853744507, -0.42548829317092896, 0.6620245575904846, -0.4342785179615021, -1.1016310453414917, 0.8210617899894714, -0.2616179287433624, -1.9570696353912354, -0.7566583752632141, -0.9416210651397705, -0.13849800825119019, -0.6837126612663269, 0.9252765774726868, -0.25925570726394653, -1.3855136632919312, 0.2271992713212967, -0.7740902304649353, 0.044416844844818115, -1.2476444244384766, 0.27950093150138855, 0.7240727543830872, -0.6071465015411377, 0.1583738476037979, -0.31778737902641296, -1.3728159666061401, -0.5412235260009766, 0.3737785518169403, 1.8540887832641602, -0.8319411277770996, 0.9231227040290833, 1.0575529336929321, -0.7785109281539917, -0.10703528672456741, 0.3608464300632477, -0.32045432925224304, 0.8411449790000916, -1.0770403146743774, -0.48608726263046265, 1.1956971883773804, -0.13793182373046875, -0.6703442931175232, 1.4289629459381104, 0.7180711627006531, -0.9693377614021301, -0.12450630217790604, -0.17390377819538116, -0.7670612335205078, 0.06610984355211258, -1.6321407556533813, -0.04151982069015503, 0.4159279465675354, -1.544034481048584, -0.4752771556377411, -0.16084794700145721, 1.2674105167388916, -0.12361142039299011, 1.3305585384368896, -0.2668027877807617, -0.26063016057014465, -0.44930997490882874, -0.3653443455696106, 0.10116356611251831, -0.26744234561920166, -0.7425891757011414, 0.22084029018878937, -0.6679617762565613, 0.4147234857082367, 1.391210913658142, 0.26216015219688416, 0.02698306180536747, 0.6279665231704712, 1.2071988582611084, 0.32601821422576904, 0.08063992857933044, -0.9041244983673096, -1.553969144821167, 1.9808804988861084, -1.5182946920394897, 2.0341837406158447, 0.5738013982772827, -0.05696830898523331, -1.7715245485305786, -1.9181013107299805, 1.5577125549316406, 1.1347172260284424, 2.298628568649292, 0.6193512678146362, 0.47006461024284363, -0.8185989260673523, -0.6205447912216187, 0.2138081192970276, -0.9615351557731628, -0.7273598313331604, 0.21146288514137268, 2.393634080886841, 1.6792969703674316, -0.5400140881538391, -0.15479350090026855, -0.9886350631713867, 1.5004223585128784, -0.18756654858589172, 0.19848334789276123, 2.0486984252929688, -0.2655365467071533, -1.0707707405090332, 1.2481496334075928, -2.3320248126983643, 0.150447279214859, 2.013427257537842, 0.18879656493663788, 0.09751398116350174, -1.2911747694015503, -0.7389527559280396, -0.27424654364585876, -0.41161638498306274, -1.2626081705093384, 0.48796346783638, -0.16378653049468994, -0.6996171474456787, -1.4623100757598877, 0.2191017121076584, -1.0750666856765747, -1.628012776374817, 0.14049284160137177, 1.9192700386047363, 1.9040672779083252, -0.6973711252212524, 1.576067328453064, -0.21142524480819702, 0.261152446269989, 1.2986780405044556, 1.1689609289169312, 3.075031042098999, 1.9471708536148071, -1.2023236751556396, 0.6599602699279785, -0.11571947485208511, -0.47290077805519104, 1.1821081638336182, -1.1568119525909424, 1.2809147834777832, -0.14341087639331818, -1.1165064573287964, -1.2087558507919312, 0.856238603591919, 0.470655620098114, -0.005715925246477127, -0.45639023184776306, 1.1834030151367188, 0.08921192586421967, 1.3336925506591797, 0.5842126607894897, -0.26383426785469055, 0.703865647315979, -0.4287929832935333, -0.5407620668411255, 1.6085094213485718, 0.20967049896717072, -1.4040956497192383, -2.3140504360198975, -0.2085098773241043, -0.9018846750259399, 0.07382708787918091, -0.6380462646484375, -0.950588047504425, 1.6995869874954224, 0.4318857192993164, -1.1630780696868896, -0.20850788056850433, -0.3095276653766632, -0.7137808799743652, 2.8415215015411377, -1.396248459815979, -0.2967583239078522, -1.035701870918274, -0.6862670183181763, 1.6486098766326904, -1.2154295444488525, -0.18133406341075897, -1.0639288425445557, -0.41437527537345886, -1.316598653793335, -0.5523980855941772, 0.008556803688406944, -0.8789159655570984, 0.9165540933609009, 0.23452620208263397, -1.3460839986801147, -0.442537397146225, -0.9383971691131592, 0.7837724089622498, -0.11706169694662094, 0.18534643948078156, 1.861226201057434, 0.5461222529411316, -0.3299844264984131, 0.6917778849601746, 1.146931767463684, 0.6996737718582153, -0.5825735330581665, 0.3956432640552521, -0.5898460745811462, 0.3184226155281067, -1.2982991933822632, 0.229462668299675, -2.825562000274658, 0.5999966263771057, -0.05148785561323166, -0.08224423229694366, -0.03091615065932274, -1.3216416835784912, 1.0638870000839233, 2.5304973125457764, -1.2175501585006714, 0.4824393689632416, 0.17965316772460938, 1.2708333730697632, -1.5924198627471924, 0.21626903116703033, -0.45541125535964966, 2.1393251419067383, 0.08283434808254242, 1.0480166673660278, -0.43854036927223206, -2.3023829460144043, 0.5482439994812012, -1.278612494468689, -1.212794542312622, 0.7804656624794006, -0.8161197304725647, 0.1006927415728569, -1.3062443733215332, -0.1851843297481537, -0.8476239442825317, -1.1619889736175537, 0.7481828331947327, 0.07035670429468155, 0.4487850069999695, -0.61814284324646, 0.4067505896091461, -2.193371295928955, -1.470727801322937, -0.3060672879219055, -0.9304371476173401, 0.4685436189174652, -0.30354470014572144, 0.7633897066116333, -0.19857269525527954, 0.017843574285507202, 0.33042532205581665, 1.441319227218628, 3.3616983890533447, 0.1397656500339508, 0.5009729862213135, -0.2299298495054245, -1.0079784393310547, 1.4661738872528076, 0.9013382792472839, -0.14943018555641174, -0.47202926874160767, -1.1133352518081665, 1.2276315689086914, 1.9794164896011353, 1.0293995141983032, -0.02128608338534832, -0.6910369396209717, -0.7451863884925842, 0.0516890212893486, 0.172710120677948, 0.45892512798309326, 0.8241910338401794, 0.17062392830848694, 0.07372450083494186, 1.367802619934082, 1.0998589992523193, -0.4090626537799835, 0.36568930745124817, -0.8077279925346375, -0.4465632438659668, 0.6298080682754517, 0.36399292945861816, 0.015447806566953659, 0.2798207402229309, -1.0599390268325806, -0.23730653524398804, -0.3076959550380707, -0.8828600645065308, -0.7206355929374695, -0.5113503336906433, -0.3608744144439697, 1.677688479423523, 0.00029404833912849426, -0.5530275702476501, -0.02781262807548046, -0.7557571530342102, 0.08528414368629456, -1.0305079221725464, 0.2777877748012543, -0.16501249372959137, -0.14256234467029572, -0.04155194014310837, 1.8147740364074707, -1.0027711391448975, -2.000126600265503, 0.22743292152881622, 0.26977109909057617, -0.31942495703697205, 0.21539324522018433, 1.6573959589004517, 0.5629802346229553, 1.47028386592865, 1.4178874492645264, 1.0315160751342773, -0.7321001887321472, -1.3902928829193115, 0.5796446204185486, 0.9525647759437561, -1.3568775653839111, 0.7477416396141052, 0.08984874933958054, -0.48413392901420593, 0.5171336531639099, 1.329314947128296, 0.4223654866218567, -1.9769089221954346, 0.6798664331436157, -0.9221132397651672, 0.8154099583625793, 0.7915874719619751, 0.754239022731781, 0.17300675809383392, 0.7815814018249512, -1.1842563152313232, -1.1640000343322754, -0.7283294796943665, -0.7184577584266663, 1.859084129333496, -0.23397167026996613, 0.5549668669700623, -0.14302749931812286, -1.3933793306350708, -0.02180413529276848, 0.6382097601890564, 0.45625269412994385, -0.5221785306930542, 0.682985246181488, -0.6314432621002197, -1.1361602544784546, -1.3745824098587036, -0.4838066101074219, -1.119460940361023, -1.0320358276367188, 1.0563406944274902, 0.8692411780357361, 0.2569892704486847, 1.8267470598220825, 0.7289760112762451, 0.1644803285598755, -2.598409414291382, 0.8662158846855164, 0.37228015065193176, -0.05779460817575455, 0.7003663182258606, 0.4784776270389557, 1.0173006057739258, -0.17225374281406403, 0.6314839720726013, -2.400434732437134, 2.3566911220550537, -0.279772013425827, 0.6839636564254761, -0.02093973010778427, -0.15466763079166412, 0.9723803997039795, 0.5699607133865356, 0.5362702012062073, -1.0263699293136597, 0.615006685256958, -0.6520201563835144, 1.344200611114502, 0.8358397483825684, -0.7621252536773682, -0.00603389460593462, 1.3252378702163696, 0.5378247499465942, -0.6174209117889404, -0.9471977353096008, -1.0599828958511353, 0.931973934173584, 1.726238489151001, -0.13006751239299774, -0.061185598373413086, 0.888221025466919, 0.656744658946991, -1.354303002357483, 0.02947870083153248, -0.7400891780853271, -0.712553858757019, 1.7452242374420166, 2.1364102363586426, -0.19596292078495026, -0.1895642876625061, -0.8607023358345032, -1.258339524269104, 0.7328418493270874, 0.11468855291604996, -0.013880360871553421, 0.7143170833587646, -0.5962690114974976, 1.11135733127594, 0.8262156844139099, 0.9122633337974548, 0.2991125285625458, 0.31508123874664307, 0.3041987717151642, -0.3876109719276428, -1.2311105728149414, -0.1925353705883026, -1.050499677658081, -2.5467112064361572, 0.45030659437179565, -0.28420642018318176, -1.3905588388442993, -0.01805589348077774, -1.011789321899414, 0.8461143970489502, -0.45765480399131775, -1.1264784336090088, -1.3538175821304321, 0.1284399926662445, -0.018544267863035202, 0.8154739737510681, -1.632121205329895, -0.05399122089147568, 1.2623200416564941, 1.0183184146881104, -0.8467728495597839, 0.916657567024231, 0.2384735494852066, 1.1183000802993774, 0.9417957663536072, -0.32741761207580566, 0.473989874124527, -0.03363616019487381, -1.3291420936584473, 0.4605182707309723, 1.151293396949768, 0.17452707886695862, 1.3969578742980957, -0.5784986615180969, -0.010244013741612434, 0.3347017467021942, -0.39439234137535095, -0.4617167115211487, -0.7418103218078613, 0.608025074005127, 0.04088237136602402, -0.8463391065597534, 0.13473086059093475, 0.02668999694287777, -0.18497544527053833, 0.23931528627872467, -1.5134117603302002, -0.08627291768789291, -0.3391294479370117, -0.6857966780662537, -1.1376080513000488, -0.12675729393959045, 1.3250417709350586, -0.7121788859367371, -0.11193979531526566, 0.5038732290267944, 0.2281537801027298, 0.5212507247924805, 0.572494626045227, -0.639581561088562, -0.38941168785095215, -0.19389578700065613, -0.4221866726875305, 0.33331891894340515, 1.4510701894760132, -0.10497693717479706, -0.9855816960334778, 0.6768160462379456, -0.35627686977386475, 0.0554661750793457, 1.9384773969650269, 0.05566082149744034, -0.8721421957015991, 0.2657013535499573, -0.7484152317047119, 1.9201805591583252, 1.793382167816162, 1.2953115701675415, -0.10395077615976334, -1.0040520429611206, 0.6278420686721802, -0.37771809101104736, -0.5152163505554199, 0.8726122379302979, 0.3969632387161255, -0.27498486638069153, -1.3051966428756714, 0.7386820912361145, 1.3310415744781494, -0.7634834051132202, -0.9420729279518127, 0.16076472401618958, -0.8072695136070251, 1.0813727378845215, 0.7806259989738464, 0.4298248887062073, 0.3133690357208252, 1.6611045598983765, 0.8018620014190674, -0.48568299412727356, 0.5739086866378784, 0.49341294169425964, -0.18053987622261047, -1.992087721824646, -1.228298544883728, 0.28659382462501526, -0.5778385996818542, -1.698319435119629, 1.439069151878357, -1.2016481161117554, -0.9739041328430176, 0.5732817649841309, 0.13467362523078918, 1.4519540071487427, 0.38152241706848145, 1.4874941110610962, 1.9820936918258667, 0.8156942129135132, 0.46703779697418213, 1.2668894529342651, -0.23193566501140594, -0.5543940663337708, 1.761351466178894, -0.4848282039165497, 0.47766876220703125, 1.0914223194122314, -0.23627370595932007, -1.131689190864563, -0.8253991007804871, -1.251010537147522, -0.7282878160476685, 1.1458048820495605, 0.0885513424873352, -1.208923578262329, 0.3114616572856903, 1.629440426826477, 0.033473290503025055, -0.3936573565006256, 0.7247467041015625, 0.335945188999176, -0.8176964521408081, -0.09278025478124619, -1.017581582069397, 0.563803493976593, -0.19982464611530304, -0.28892868757247925, 0.39334264397621155, 0.5090358257293701, 1.3980916738510132, 0.09699203819036484, 0.1755678504705429, 1.1512399911880493, -1.3184539079666138, 1.4244389533996582, -0.6695820689201355, 0.3535363972187042, -2.321237087249756, 1.4023360013961792, -0.7765426635742188, 1.8685506582260132, -2.68528151512146, 0.36602500081062317, -0.5733771324157715, -0.5123881101608276, 0.26271045207977295, -0.3304862082004547, 0.1472925990819931, -0.1526680737733841, -1.2353923320770264, -0.08660733699798584, -0.7903003096580505, 0.48644670844078064, 1.0637303590774536, 1.3947011232376099, -1.0090194940567017, -0.36070239543914795, -1.7249797582626343, -0.11252757161855698, -0.6503205299377441, 0.39581289887428284, -1.9262025356292725, -0.2909100353717804, -1.910330057144165, -2.357961893081665, -1.26176118850708, -0.8634448647499084, 1.1389172077178955, 0.03522210568189621, -0.8515787720680237, 1.1589701175689697, -0.3816138505935669, -1.8976714611053467, 1.0943057537078857, -2.1398963928222656 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
After some digging, I found that this is caused by `dill` and using `recurse=True)` when trying to dump the object. The problem also occurs without multiprocessing. I can only find [the following information](https://dill.readthedocs.io/en/latest/dill.html#dill._dill.dumps) about this: > If recurse=True, then objects referred to in the global dictionary are recursively traced and pickled, instead of the default behavior of attempting to store the entire global dictionary. This is needed for functions defined via exec(). In the utils, this is explicitly enabled https://github.com/huggingface/datasets/blob/df63614223bf1dd1feb267d39d741bada613352c/src/datasets/utils/py_utils.py#L327-L330 Is this really necessary? Is there a way around it? Also pinging the spaCy team in case this is easy to solve on their end. (I hope so.)
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
108
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 After some digging, I found that this is caused by `dill` and using `recurse=True)` when trying to dump the object. The problem also occurs without multiprocessing. I can only find [the following information](https://dill.readthedocs.io/en/latest/dill.html#dill._dill.dumps) about this: > If recurse=True, then objects referred to in the global dictionary are recursively traced and pickled, instead of the default behavior of attempting to store the entire global dictionary. This is needed for functions defined via exec(). In the utils, this is explicitly enabled https://github.com/huggingface/datasets/blob/df63614223bf1dd1feb267d39d741bada613352c/src/datasets/utils/py_utils.py#L327-L330 Is this really necessary? Is there a way around it? Also pinging the spaCy team in case this is easy to solve on their end. (I hope so.)
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
Hi ! Thanks for reporting Yes `recurse=True` is necessary to be able to hash all the objects that are passed to the `map` function EDIT: hopefully this object can be serializable soon, but otherwise we can consider adding more control to the user on how to hash objects that are not serializable (as mentioned in https://github.com/huggingface/datasets/issues/3044#issuecomment-948818210)
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
56
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 Hi ! Thanks for reporting Yes `recurse=True` is necessary to be able to hash all the objects that are passed to the `map` function EDIT: hopefully this object can be serializable soon, but otherwise we can consider adding more control to the user on how to hash objects that are not serializable (as mentioned in https://github.com/huggingface/datasets/issues/3044#issuecomment-948818210)
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
I submitted a PR to spacy that should fix this issue (linked above). I'll leave this open until that PR is merged.
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
22
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 I submitted a PR to spacy that should fix this issue (linked above). I'll leave this open until that PR is merged.
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
@lhoestq After some testing I find that even with the updated spaCy, no cache files are used. I do not get any warnings though, but I can see that map is run every time I run the code. Do you have thoughts about why? If you want to try the tests below, make sure to install spaCy from [here](https://github.com/BramVanroy/spaCy) and installing the base model with `python -m spacy download en_core_web_sm`. ```python from functools import partial from pathlib import Path import spacy from datasets import Dataset import datasets datasets.logging.set_verbosity_debug() def tokenize(nlp, l): return {"tok": [t.text for t in nlp(l["text"])]} def main(): fin = r"some/file/with/many/lines" lines = Path(fin).read_text(encoding="utf-8").splitlines() nlp = spacy.load("en_core_web_sm") ds = Dataset.from_dict({"text": lines, "text_id": list(range(len(lines)))}) tok = partial(tokenize, nlp) ds = ds.map(tok, load_from_cache_file=True) print(ds[0:2]) if __name__ == '__main__': main() ``` ... or with load_dataset (here I get the message that `load_dataset` can reuse the dataset, but still I see all samples being processed via the tqdm progressbar): ```python from functools import partial import spacy from datasets import load_dataset import datasets datasets.logging.set_verbosity_debug() def tokenize(nlp, sample): return {"tok": [t.text for t in nlp(sample["text"])]} def main(): fin = r"some/file/with/many/lines" nlp = spacy.load("en_core_web_sm") tok_func = partial(tokenize, nlp) ds = load_dataset('text', data_files=fin) ds = ds["train"].map(tok_func) print(ds[0:2]) if __name__ == '__main__': main() ```
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
207
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 @lhoestq After some testing I find that even with the updated spaCy, no cache files are used. I do not get any warnings though, but I can see that map is run every time I run the code. Do you have thoughts about why? If you want to try the tests below, make sure to install spaCy from [here](https://github.com/BramVanroy/spaCy) and installing the base model with `python -m spacy download en_core_web_sm`. ```python from functools import partial from pathlib import Path import spacy from datasets import Dataset import datasets datasets.logging.set_verbosity_debug() def tokenize(nlp, l): return {"tok": [t.text for t in nlp(l["text"])]} def main(): fin = r"some/file/with/many/lines" lines = Path(fin).read_text(encoding="utf-8").splitlines() nlp = spacy.load("en_core_web_sm") ds = Dataset.from_dict({"text": lines, "text_id": list(range(len(lines)))}) tok = partial(tokenize, nlp) ds = ds.map(tok, load_from_cache_file=True) print(ds[0:2]) if __name__ == '__main__': main() ``` ... or with load_dataset (here I get the message that `load_dataset` can reuse the dataset, but still I see all samples being processed via the tqdm progressbar): ```python from functools import partial import spacy from datasets import load_dataset import datasets datasets.logging.set_verbosity_debug() def tokenize(nlp, sample): return {"tok": [t.text for t in nlp(sample["text"])]} def main(): fin = r"some/file/with/many/lines" nlp = spacy.load("en_core_web_sm") tok_func = partial(tokenize, nlp) ds = load_dataset('text', data_files=fin) ds = ds["train"].map(tok_func) print(ds[0:2]) if __name__ == '__main__': main() ```
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
It looks like every time you load `en_core_web_sm` you get a different python object: ```python import spacy from datasets.fingerprint import Hasher nlp1 = spacy.load("en_core_web_sm") nlp2 = spacy.load("en_core_web_sm") Hasher.hash(nlp1), Hasher.hash(nlp2) # ('f6196a33882fea3b', 'a4c676a071f266ff') ``` Here is a list of attributes that have different hashes for `nlp1` and `nlp2`: - tagger - parser - entity - pipeline (it's the list of the three attributes above) I just took a look at the tagger for example and I found subtle differences (there may be other differences though): ```python nlp1.tagger.model.tok2vec.embed.id, nlp2.tagger.model.tok2vec.embed.id # (1721, 2243) ``` We can try to find all the differences and find the best way to hash those objects properly
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
109
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 It looks like every time you load `en_core_web_sm` you get a different python object: ```python import spacy from datasets.fingerprint import Hasher nlp1 = spacy.load("en_core_web_sm") nlp2 = spacy.load("en_core_web_sm") Hasher.hash(nlp1), Hasher.hash(nlp2) # ('f6196a33882fea3b', 'a4c676a071f266ff') ``` Here is a list of attributes that have different hashes for `nlp1` and `nlp2`: - tagger - parser - entity - pipeline (it's the list of the three attributes above) I just took a look at the tagger for example and I found subtle differences (there may be other differences though): ```python nlp1.tagger.model.tok2vec.embed.id, nlp2.tagger.model.tok2vec.embed.id # (1721, 2243) ``` We can try to find all the differences and find the best way to hash those objects properly
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
Thanks for searching! I went looking, and found that this is an implementation detail of thinc https://github.com/explosion/thinc/blob/68691e303ae68cae4bc803299016f1fc064328bf/thinc/model.py#L96-L98 Presumably (?) exactly to distinguish between different parts in memory when multiple models are loaded. Do not think that this can be changed on their end - but I will ask what exactly it is for (I'm curious). Do you think it is overkill to write something into the hasher explicitly to deal with spaCy models? It seems like something that is beneficial to many, but I do not know if you are open to adding third-party-specific ways to deal with this. If you are, I can have a look for this specific case how we can ignore `thinc.Model.id` from the hasher.
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
119
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 Thanks for searching! I went looking, and found that this is an implementation detail of thinc https://github.com/explosion/thinc/blob/68691e303ae68cae4bc803299016f1fc064328bf/thinc/model.py#L96-L98 Presumably (?) exactly to distinguish between different parts in memory when multiple models are loaded. Do not think that this can be changed on their end - but I will ask what exactly it is for (I'm curious). Do you think it is overkill to write something into the hasher explicitly to deal with spaCy models? It seems like something that is beneficial to many, but I do not know if you are open to adding third-party-specific ways to deal with this. If you are, I can have a look for this specific case how we can ignore `thinc.Model.id` from the hasher.
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
It can be even simpler to hash the bytes of the pipeline instead ```python nlp1.to_bytes() == nlp2.to_bytes() # True ``` IMO we should integrate the custom hashing for spacy models into `datasets` (we use a custom Pickler for that). What could be done on Spacy's side instead (if they think it's nice to have) is to implement a custom pickling for these classes using `to_bytes`/`from_bytes` to have deterministic pickle dumps. Finally I think it would be nice in the future to add an API to let `datasets` users control this kind of things. Something like being able to define your own hashing if you use complex objects. ```python @datasets.register_hash(spacy.language.Language) def hash_spacy_language(nlp): return Hasher.hash(nlp.to_bytes()) ```
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
114
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 It can be even simpler to hash the bytes of the pipeline instead ```python nlp1.to_bytes() == nlp2.to_bytes() # True ``` IMO we should integrate the custom hashing for spacy models into `datasets` (we use a custom Pickler for that). What could be done on Spacy's side instead (if they think it's nice to have) is to implement a custom pickling for these classes using `to_bytes`/`from_bytes` to have deterministic pickle dumps. Finally I think it would be nice in the future to add an API to let `datasets` users control this kind of things. Something like being able to define your own hashing if you use complex objects. ```python @datasets.register_hash(spacy.language.Language) def hash_spacy_language(nlp): return Hasher.hash(nlp.to_bytes()) ```
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
I do not quite understand what you mean. as far as I can tell, using `to_bytes` does a pickle dump behind the scene (with `srsly`), recursively using `to_bytes` on the required objects. Therefore, the result of `to_bytes` is a deterministic pickle dump AFAICT. Or do you mean that you wish that using your own pickler and running `dumps(nlp)` should also be deterministic? I guess that would require `__setstate__` and `__getstate__` methods on all the objects that have to/from_bytes. I'll have a listen over at spaCy what they think, and if that would solve the issue. I'll try this locally first, if I find the time. I agree that having the option to use a custom hasher would be useful. I like your suggestion! EDIT: after trying some things and reading through their API, it seems that they explicitly do not want this. https://spacy.io/usage/saving-loading#pipeline > When serializing the pipeline, keep in mind that this will only save out the binary data for the individual components to allow spaCy to restore them – not the entire objects. This is a good thing, because it makes serialization safe. But it also means that you have to take care of storing the config, which contains the pipeline configuration and all the relevant settings. Best way forward therefore seems to implement the ability to specify a hasher depending on the objects that are pickled, as you suggested. I can work on this if that is useful. I could use some pointers as to how you would like to implement the `register_hash` functionality though. I assume using `catalogue` over at Explosion might be a good starting point.
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
271
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 I do not quite understand what you mean. as far as I can tell, using `to_bytes` does a pickle dump behind the scene (with `srsly`), recursively using `to_bytes` on the required objects. Therefore, the result of `to_bytes` is a deterministic pickle dump AFAICT. Or do you mean that you wish that using your own pickler and running `dumps(nlp)` should also be deterministic? I guess that would require `__setstate__` and `__getstate__` methods on all the objects that have to/from_bytes. I'll have a listen over at spaCy what they think, and if that would solve the issue. I'll try this locally first, if I find the time. I agree that having the option to use a custom hasher would be useful. I like your suggestion! EDIT: after trying some things and reading through their API, it seems that they explicitly do not want this. https://spacy.io/usage/saving-loading#pipeline > When serializing the pipeline, keep in mind that this will only save out the binary data for the individual components to allow spaCy to restore them – not the entire objects. This is a good thing, because it makes serialization safe. But it also means that you have to take care of storing the config, which contains the pipeline configuration and all the relevant settings. Best way forward therefore seems to implement the ability to specify a hasher depending on the objects that are pickled, as you suggested. I can work on this if that is useful. I could use some pointers as to how you would like to implement the `register_hash` functionality though. I assume using `catalogue` over at Explosion might be a good starting point.
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
Interestingly, my PR does not solve the issue discussed above. The `tokenize` function hash is different on every run, because for some reason `nlp.__call__` has a different hash every time. The issue therefore seems to run much deeper than I thought. If you have any ideas, I'm all ears. ```shell git clone https://github.com/explosion/spaCy.git cd spaCy/ git checkout cab9209c3dfcd1b75dfe5657f10e52c4d847a3cf cd .. git clone https://github.com/BramVanroy/datasets.git cd datasets git checkout registry pip install -e . pip install ../spaCy spacy download en_core_web_sm ``` ```python import spacy from datasets import load_dataset from datasets.fingerprint import Hasher from datasets.utils.registry import hashers @hashers.register(spacy.Language) def hash_spacy_language(nlp): return Hasher.hash(nlp.to_bytes()) def main(): fin = r"your/large/file" nlp = spacy.load("en_core_web_sm") # This is now always the same yay! print(Hasher.hash(nlp)) def tokenize(l): return {"tok": [t.text for t in nlp(l["text"])]} ds = load_dataset("text", data_files=fin) # But this is not... print(Hasher.hash(tokenize)) # ... because of this print(Hasher.hash(nlp.__call__)) ds = ds["train"].map(tokenize) print(ds[0:2]) if __name__ == '__main__': main() ```
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
151
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 Interestingly, my PR does not solve the issue discussed above. The `tokenize` function hash is different on every run, because for some reason `nlp.__call__` has a different hash every time. The issue therefore seems to run much deeper than I thought. If you have any ideas, I'm all ears. ```shell git clone https://github.com/explosion/spaCy.git cd spaCy/ git checkout cab9209c3dfcd1b75dfe5657f10e52c4d847a3cf cd .. git clone https://github.com/BramVanroy/datasets.git cd datasets git checkout registry pip install -e . pip install ../spaCy spacy download en_core_web_sm ``` ```python import spacy from datasets import load_dataset from datasets.fingerprint import Hasher from datasets.utils.registry import hashers @hashers.register(spacy.Language) def hash_spacy_language(nlp): return Hasher.hash(nlp.to_bytes()) def main(): fin = r"your/large/file" nlp = spacy.load("en_core_web_sm") # This is now always the same yay! print(Hasher.hash(nlp)) def tokenize(l): return {"tok": [t.text for t in nlp(l["text"])]} ds = load_dataset("text", data_files=fin) # But this is not... print(Hasher.hash(tokenize)) # ... because of this print(Hasher.hash(nlp.__call__)) ds = ds["train"].map(tokenize) print(ds[0:2]) if __name__ == '__main__': main() ```
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
Hi ! I just answered in your PR :) In order for your custom hashing to be used for nested objects, you must integrate it into our recursive pickler that we use for hashing.
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
34
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 Hi ! I just answered in your PR :) In order for your custom hashing to be used for nested objects, you must integrate it into our recursive pickler that we use for hashing.
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
I don't quite understand the design constraints of `datasets` or the script that you're running, but my usual advice is to avoid using pickle unless you _absolutely_ have to. So for instance instead of doing your `partial` over the `nlp` object itself, can you just pass the string `en_core_web_sm` in? This will mean calling `spacy.load()` inside the work function, but this is no worse than having to call `pickle.load()` on the contents of the NLP object anyway -- in fact you'll generally find `spacy.load()` faster, apart from the disk read. If you need to pass in the bytes data and don't want to read from disk, you could do something like this: ``` msg = (nlp.lang, nlp.to_bytes()) def unpack(lang, bytes_data): return spacy.blank(lang).from_bytes(bytes_data) ``` I think that should probably work: the Thinc `model.to_dict()` method (which is used by the `model.to_bytes()` method) doesn't pack the model's ID into the message, so the `nlp.to_bytes()` that you get shouldn't be affected by the global IDs. So you should get a clean message from `nlp.to_bytes()` that doesn't depend on the global state.
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
177
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 I don't quite understand the design constraints of `datasets` or the script that you're running, but my usual advice is to avoid using pickle unless you _absolutely_ have to. So for instance instead of doing your `partial` over the `nlp` object itself, can you just pass the string `en_core_web_sm` in? This will mean calling `spacy.load()` inside the work function, but this is no worse than having to call `pickle.load()` on the contents of the NLP object anyway -- in fact you'll generally find `spacy.load()` faster, apart from the disk read. If you need to pass in the bytes data and don't want to read from disk, you could do something like this: ``` msg = (nlp.lang, nlp.to_bytes()) def unpack(lang, bytes_data): return spacy.blank(lang).from_bytes(bytes_data) ``` I think that should probably work: the Thinc `model.to_dict()` method (which is used by the `model.to_bytes()` method) doesn't pack the model's ID into the message, so the `nlp.to_bytes()` that you get shouldn't be affected by the global IDs. So you should get a clean message from `nlp.to_bytes()` that doesn't depend on the global state.
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
Hi Matthew, thanks for chiming in! We are currently implementing exactly what you suggest: `to_bytes()` as a default before pickling - but we may prefer `to_dict` to avoid double dumping. `datasets` uses pickle dumps (actually dill) to get unique representations of processing steps (a "fingerprint" or hash). So it never needs to re-load that dump - it just needs its value to create a hash. If a fingerprint is identical to a cached fingerprint, then the result can be retrieved from the on-disk cache. (@lhoestq or @mariosasko can correct me if I'm wrong.) I was experiencing the issue that parsing with spaCy gave me a different fingerprint on every run of the script and thus it could never load the processed dataset from cache. At first I thought the reason was that spaCy Language objects were not picklable with recursive dill, but even after [adjusting for that](https://github.com/explosion/spaCy/pull/9593) the issue persisted. @lhoestq found that this is due to the changing `id`, which you discussed [here](https://github.com/explosion/spaCy/discussions/9609#discussioncomment-1661081). So yes, you are right. On the surface there simply seems to be an incompatibility between `datasets` default caching functionality as it is currently implemented and `spacy.Language`. The [linked PR](https://github.com/huggingface/datasets/pull/3224) aims to remedy that, though. Up to now I have put some effort into making it easier to define your own "pickling" function for a given type (and optionally any of its subclasses). That allows us to tell `datasets` that instead of doing `dill.save(nlp)` (non-deterministic), to use `dill.save(nlp.to_bytes())` (deterministic). When I find some more time, the PR [will be expanded](https://github.com/huggingface/datasets/pull/3224#issuecomment-968958528) to improve the user-experience a bit and add a built-in function to pickle `spacy.Language` as one of the defaults (using `to_bytes()`).
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
275
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 Hi Matthew, thanks for chiming in! We are currently implementing exactly what you suggest: `to_bytes()` as a default before pickling - but we may prefer `to_dict` to avoid double dumping. `datasets` uses pickle dumps (actually dill) to get unique representations of processing steps (a "fingerprint" or hash). So it never needs to re-load that dump - it just needs its value to create a hash. If a fingerprint is identical to a cached fingerprint, then the result can be retrieved from the on-disk cache. (@lhoestq or @mariosasko can correct me if I'm wrong.) I was experiencing the issue that parsing with spaCy gave me a different fingerprint on every run of the script and thus it could never load the processed dataset from cache. At first I thought the reason was that spaCy Language objects were not picklable with recursive dill, but even after [adjusting for that](https://github.com/explosion/spaCy/pull/9593) the issue persisted. @lhoestq found that this is due to the changing `id`, which you discussed [here](https://github.com/explosion/spaCy/discussions/9609#discussioncomment-1661081). So yes, you are right. On the surface there simply seems to be an incompatibility between `datasets` default caching functionality as it is currently implemented and `spacy.Language`. The [linked PR](https://github.com/huggingface/datasets/pull/3224) aims to remedy that, though. Up to now I have put some effort into making it easier to define your own "pickling" function for a given type (and optionally any of its subclasses). That allows us to tell `datasets` that instead of doing `dill.save(nlp)` (non-deterministic), to use `dill.save(nlp.to_bytes())` (deterministic). When I find some more time, the PR [will be expanded](https://github.com/huggingface/datasets/pull/3224#issuecomment-968958528) to improve the user-experience a bit and add a built-in function to pickle `spacy.Language` as one of the defaults (using `to_bytes()`).
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
Is there a workaround for this? maybe by explicitly requesting datasets to cache the result of `.map()`?
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
17
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 Is there a workaround for this? maybe by explicitly requesting datasets to cache the result of `.map()`?
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
Hi ! If your function is not picklable, then the fingerprint of the resulting dataset can't be computed. The fingerprint is a hash that is used by the cache to reload previously computed datasets: the dataset file is named `cache-<fingerprint>.arrow` in your dataset's cache directory. As a workaround you can set the fingerprint that is going to be used by the cache: ```python result = my_dataset.map(func, new_fingerprint=new_fingerprint) ``` Any future call to `map` with the same `new_fingerprint` will reload the result from the cache. **Be careful using this though: if you change your `func`, be sure to change the `new_fingerprint` as well.**
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
102
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 Hi ! If your function is not picklable, then the fingerprint of the resulting dataset can't be computed. The fingerprint is a hash that is used by the cache to reload previously computed datasets: the dataset file is named `cache-<fingerprint>.arrow` in your dataset's cache directory. As a workaround you can set the fingerprint that is going to be used by the cache: ```python result = my_dataset.map(func, new_fingerprint=new_fingerprint) ``` Any future call to `map` with the same `new_fingerprint` will reload the result from the cache. **Be careful using this though: if you change your `func`, be sure to change the `new_fingerprint` as well.**
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
I've been having an issue that might be related to this when trying to pre-tokenize a corpus and caching it for using it later in the pre-training of a RoBERTa model. I always get the following warning: ``` Dataset text downloaded and prepared to /gpfswork/rech/project/user/.cache/hf-datasets/text/default-1850886023af0077/0.0.0/acc32f2f2ef863c93c2f30c52f7df6cc9053a1c2230b8d7da0d210404683ca08. Subsequent calls will reuse this data. Parameter 'function'=<function encode_dataset.<locals>.<lambda> at 0x14a92157b280> of the transform [email protected] couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. ``` And when I launch the pre-training the pre-tokenized corpus is not found and it is tokenized again, which makes me waste precious GPU hours. For me, the workaround was downgrading `dill` and `multiprocess` to the following versions: ``` dill 0.3.4 multiprocess 0.70.12.2 ```
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
167
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 I've been having an issue that might be related to this when trying to pre-tokenize a corpus and caching it for using it later in the pre-training of a RoBERTa model. I always get the following warning: ``` Dataset text downloaded and prepared to /gpfswork/rech/project/user/.cache/hf-datasets/text/default-1850886023af0077/0.0.0/acc32f2f2ef863c93c2f30c52f7df6cc9053a1c2230b8d7da0d210404683ca08. Subsequent calls will reuse this data. Parameter 'function'=<function encode_dataset.<locals>.<lambda> at 0x14a92157b280> of the transform [email protected] couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. ``` And when I launch the pre-training the pre-tokenized corpus is not found and it is tokenized again, which makes me waste precious GPU hours. For me, the workaround was downgrading `dill` and `multiprocess` to the following versions: ``` dill 0.3.4 multiprocess 0.70.12.2 ```
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
> Hi ! If your function is not picklable, then the fingerprint of the resulting dataset can't be computed. The fingerprint is a hash that is used by the cache to reload previously computed datasets: the dataset file is named `cache-<fingerprint>.arrow` in your dataset's cache directory. > > As a workaround you can set the fingerprint that is going to be used by the cache: > > ```python > result = my_dataset.map(func, new_fingerprint=new_fingerprint) > ``` > > Any future call to `map` with the same `new_fingerprint` will reload the result from the cache. > > **Be careful using this though: if you change your `func`, be sure to change the `new_fingerprint` as well.** Is the argument `new_fingerprint` available for datasetDict ? I can only use it on arrow datasets but might be useful to generalize it to DatasetDict's map as well ? @lhoestq
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
143
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 > Hi ! If your function is not picklable, then the fingerprint of the resulting dataset can't be computed. The fingerprint is a hash that is used by the cache to reload previously computed datasets: the dataset file is named `cache-<fingerprint>.arrow` in your dataset's cache directory. > > As a workaround you can set the fingerprint that is going to be used by the cache: > > ```python > result = my_dataset.map(func, new_fingerprint=new_fingerprint) > ``` > > Any future call to `map` with the same `new_fingerprint` will reload the result from the cache. > > **Be careful using this though: if you change your `func`, be sure to change the `new_fingerprint` as well.** Is the argument `new_fingerprint` available for datasetDict ? I can only use it on arrow datasets but might be useful to generalize it to DatasetDict's map as well ? @lhoestq
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
> I've been having an issue that might be related to this when trying to pre-tokenize a corpus and caching it for using it later in the pre-training of a RoBERTa model. I always get the following warning: > > ``` > Dataset text downloaded and prepared to /gpfswork/rech/project/user/.cache/hf-datasets/text/default-1850886023af0077/0.0.0/acc32f2f2ef863c93c2f30c52f7df6cc9053a1c2230b8d7da0d210404683ca08. Subsequent calls will reuse this data. > Parameter 'function'=<function encode_dataset.<locals>.<lambda> at 0x14a92157b280> of the transform [email protected] couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. > ``` > > And when I launch the pre-training the pre-tokenized corpus is not found and it is tokenized again, which makes me waste precious GPU hours. > > For me, the workaround was downgrading `dill` and `multiprocess` to the following versions: > > ``` > dill 0.3.4 > multiprocess 0.70.12.2 > ``` This worked for me - thanks!
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
188
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 > I've been having an issue that might be related to this when trying to pre-tokenize a corpus and caching it for using it later in the pre-training of a RoBERTa model. I always get the following warning: > > ``` > Dataset text downloaded and prepared to /gpfswork/rech/project/user/.cache/hf-datasets/text/default-1850886023af0077/0.0.0/acc32f2f2ef863c93c2f30c52f7df6cc9053a1c2230b8d7da0d210404683ca08. Subsequent calls will reuse this data. > Parameter 'function'=<function encode_dataset.<locals>.<lambda> at 0x14a92157b280> of the transform [email protected] couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. > ``` > > And when I launch the pre-training the pre-tokenized corpus is not found and it is tokenized again, which makes me waste precious GPU hours. > > For me, the workaround was downgrading `dill` and `multiprocess` to the following versions: > > ``` > dill 0.3.4 > multiprocess 0.70.12.2 > ``` This worked for me - thanks!
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
I see this has just been closed - it seems quite relevant to another tokenizer I have been trying to use, the `vinai/phobert` family of tokenizers https://huggingface.co/vinai/phobert-base https://huggingface.co/vinai/phobert-large I ran into an issue where a large dataset took several hours to tokenize, the process hung, and I was unable to use the cached version of the tokenized data: https://discuss.huggingface.co/t/cache-parallelize-long-tokenization-step/25791/3 I don't see any way to specify the hash of the tokenizer or the fingerprint of the tokenized data to use, so is the tokenized dataset basically lost at this point? Is there a good way to avoid this happening again if I retokenize the data?
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
105
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 I see this has just been closed - it seems quite relevant to another tokenizer I have been trying to use, the `vinai/phobert` family of tokenizers https://huggingface.co/vinai/phobert-base https://huggingface.co/vinai/phobert-large I ran into an issue where a large dataset took several hours to tokenize, the process hung, and I was unable to use the cached version of the tokenized data: https://discuss.huggingface.co/t/cache-parallelize-long-tokenization-step/25791/3 I don't see any way to specify the hash of the tokenizer or the fingerprint of the tokenized data to use, so is the tokenized dataset basically lost at this point? Is there a good way to avoid this happening again if I retokenize the data?
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
In your case it looks like the job failed before caching the data - maybe one of the processes crashed
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
20
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 In your case it looks like the job failed before caching the data - maybe one of the processes crashed
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
Interesting. Thanks for the observation. Any suggestions on how to start tracking that down? Perhaps run it singlethreaded and see if it crashes?
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
23
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 Interesting. Thanks for the observation. Any suggestions on how to start tracking that down? Perhaps run it singlethreaded and see if it crashes?
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
You can monitor your RAM and disk space in case a process dies from OOM or disk full, and when it hangs you can check how many processes are running. IIRC there are other start methods for multiprocessing in python that may show an error message if a process dies. Running on a single process can also help debugging this indeed
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
61
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 You can monitor your RAM and disk space in case a process dies from OOM or disk full, and when it hangs you can check how many processes are running. IIRC there are other start methods for multiprocessing in python that may show an error message if a process dies. Running on a single process can also help debugging this indeed
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3178
"Property couldn't be hashed properly" even though fully picklable
Hi @tung-msol could you open a new issue and share the error you got and the map function you used ?
## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0
1,139
21
"Property couldn't be hashed properly" even though fully picklable ## Describe the bug I am trying to tokenize a dataset with spaCy. I found that no matter what I do, the spaCy language object (`nlp`) prevents `datasets` from pickling correctly - or so the warning says - even though manually pickling is no issue. It should not be an issue either, since spaCy objects are picklable. ## Steps to reproduce the bug Here is a [colab](https://colab.research.google.com/drive/1gt75LCBIzsmBMvvipEOvWulvyZseBiA7?usp=sharing) but for some reason I cannot reproduce it there. That may have to do with logging/tqdm on Colab, or with running things in notebooks. I tried below code on Windows and Ubuntu as a Python script and getting the same issue (warning below). ```python import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10%]") ds = ds.map(self.parse, batched=True, num_proc=6) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled!") pr.process() ``` --- Here is a small change that includes `Hasher.hash` that shows that the hasher cannot seem to successfully pickle parts form the NLP object. ```python from datasets.fingerprint import Hasher import pickle from datasets import load_dataset import spacy class Processor: def __init__(self): self.nlp = spacy.load("en_core_web_sm", disable=["tagger", "parser", "ner", "lemmatizer"]) @staticmethod def collate(batch): return [d["en"] for d in batch] def parse(self, batch): batch = batch["translation"] return {"translation_tok": [{"en_tok": " ".join([t.text for t in doc])} for doc in self.nlp.pipe(self.collate(batch))]} def process(self): ds = load_dataset("wmt16", "de-en", split="train[:10]") return ds.map(self.parse, batched=True) if __name__ == '__main__': pr = Processor() # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr, f) print("Successfully pickled class instance!") # succeeds with open("temp.pkl", "wb") as f: pickle.dump(pr.nlp, f) print("Successfully pickled nlp!") # fails print(Hasher.hash(pr.nlp)) pr.process() ``` ## Expected results This to be picklable, working (fingerprinted), and no warning. ## Actual results In the first snippet, I get this warning Parameter 'function'=<function Processor.parse at 0x7f44982247a0> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. In the second, I get this traceback which directs to the `Hasher.hash` line. ``` Traceback (most recent call last): File " \Python\Python36\lib\pickle.py", line 918, in save_global obj2, parent = _getattribute(module, name) File " \Python\Python36\lib\pickle.py", line 266, in _getattribute .format(name, obj)) AttributeError: Can't get local attribute 'add_codes.<locals>.ErrorsWithCodes' on <function add_codes at 0x00000296FF606EA0> During handling of the above exception, another exception occurred: Traceback (most recent call last): File " scratch_4.py", line 40, in <module> print(Hasher.hash(pr.nlp)) File " \lib\site-packages\datasets\fingerprint.py", line 191, in hash return cls.hash_default(value) File " \lib\site-packages\datasets\fingerprint.py", line 184, in hash_default return cls.hash_bytes(dumps(value)) File " \lib\site-packages\datasets\utils\py_utils.py", line 345, in dumps dump(obj, file) File " \lib\site-packages\datasets\utils\py_utils.py", line 320, in dump Pickler(file, recurse=True).dump(obj) File " \lib\site-packages\dill\_dill.py", line 498, in dump StockPickler.dump(self, obj) File " \Python\Python36\lib\pickle.py", line 409, in dump self.save(obj) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 781, in save_list self._batch_appends(obj) File " \Python\Python36\lib\pickle.py", line 805, in _batch_appends save(x) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 634, in save_reduce save(state) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1176, in save_instancemethod0 pickler.save_reduce(MethodType, (obj.__func__, obj.__self__), obj=obj) File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 736, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\datasets\utils\py_utils.py", line 523, in save_function obj=obj, File " \Python\Python36\lib\pickle.py", line 610, in save_reduce save(args) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \Python\Python36\lib\pickle.py", line 751, in save_tuple save(element) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 990, in save_module_dict StockPickler.save_dict(pickler, obj) File " \Python\Python36\lib\pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File " \Python\Python36\lib\pickle.py", line 847, in _batch_setitems save(v) File " \Python\Python36\lib\pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File " \Python\Python36\lib\pickle.py", line 605, in save_reduce save(cls) File " \Python\Python36\lib\pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File " \lib\site-packages\dill\_dill.py", line 1439, in save_type StockPickler.save_global(pickler, obj, name=name) File " \Python\Python36\lib\pickle.py", line 922, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle <class 'spacy.errors.add_codes.<locals>.ErrorsWithCodes'>: it's not found as spacy.errors.add_codes.<locals>.ErrorsWithCodes ``` ## Environment info Tried on both Linux and Windows - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 + Python 3.7.9; Linux-5.11.0-38-generic-x86_64-with-Ubuntu-20.04-focal + Python 3.7.12 - PyArrow version: 6.0.0 Hi @tung-msol could you open a new issue and share the error you got and the map function you used ?
[ -1.2768163681030273, -0.8986586928367615, -0.6862420439720154, 1.4672660827636719, -0.18224464356899261, -1.15681791305542, 0.19105981290340424, -1.0926718711853027, 1.6184024810791016, -0.8082042932510376, 0.4367443025112152, -1.5654189586639404, 0.07511787861585617, -0.5814680457115173, -0.7544398903846741, -0.9084214568138123, -0.4240635335445404, -0.7323852181434631, 1.0536561012268066, 2.4893252849578857, 1.2658815383911133, -1.421830415725708, 2.7908849716186523, 0.7402070164680481, -0.1497429609298706, -1.0114681720733643, 0.5354604125022888, 0.02149990387260914, -1.2638001441955566, -0.4449525475502014, -1.0471563339233398, -0.1063540130853653, -0.4785178005695343, -0.503739595413208, -0.025927042588591576, 0.36568158864974976, -0.2725931704044342, -0.49404388666152954, -0.6467801332473755, -0.8036969304084778, 0.5004584193229675, -0.39664918184280396, 0.9788075685501099, -0.33817628026008606, 1.8326332569122314, -0.5966452360153198, 0.5673855543136597, 0.6823098063468933, 1.361269474029541, 0.28119489550590515, -0.02675873599946499, 0.3522951900959015, 0.371433824300766, -0.027881493791937828, 0.6014809608459473, 1.1869282722473145, 0.6935304403305054, 0.4937739968299866, 0.734585165977478, -2.1194703578948975, 1.2496974468231201, -1.127089023590088, 0.23531946539878845, 1.310173749923706, -0.8907775282859802, 0.42424190044403076, -1.7167909145355225, -0.11728629469871521, 0.6500244736671448, -2.279611110687256, 0.2794731855392456, -1.2999279499053955, -0.5502897500991821, 1.0468037128448486, 0.38285279273986816, -1.2226648330688477, 0.15193180739879608, -0.4485589861869812, 1.010160207748413, 0.35608378052711487, 1.1532924175262451, -1.6450653076171875, -0.04261580854654312, -0.298868328332901, 0.09912747889757156, -1.2419703006744385, -1.521068811416626, 0.6082137823104858, 0.5814330577850342, 0.5250831246376038, -0.12237592041492462, 1.1025454998016357, -1.1646065711975098, 0.8589751720428467, -1.0359551906585693, -1.6065504550933838, -1.4866890907287598, -2.271266222000122, -2.240741491317749, 0.786910891532898, -0.45898523926734924, -0.5480863451957703, 2.061669111251831, -0.952454149723053, -1.6438562870025635, 1.142646074295044, 0.23612059652805328, 0.02701450139284134, 2.433429479598999, 0.18241539597511292, -0.7238973379135132, 0.5129780769348145, -0.7619516849517822, 0.7976685166358948, -0.3911752998828888, 1.3682153224945068, 0.40595459938049316, -0.9538934230804443, 1.5629725456237793, -0.3518926799297333, 0.5614811182022095, -0.5470170378684998, -0.5593792200088501, -0.7276945114135742, 0.3007615804672241, 1.9202206134796143, -0.3458206057548523, 1.5527241230010986, -0.29488399624824524, -1.5364093780517578, -1.6119985580444336, 0.8658679127693176, 0.49594491720199585, -0.780883252620697, 0.0647016391158104, -0.43382853269577026, 0.10880022495985031, -0.10169859230518341, 1.2371175289154053, 1.3002619743347168, 0.7273461818695068, -0.3243962228298187, -0.8661295175552368, 0.12138612568378448, -0.06253615766763687, -0.7976527810096741, -1.7341797351837158, -0.3572910726070404, 0.10867574065923691, 0.5851188898086548, -1.2375025749206543, 1.714143991470337, 0.9363659024238586, 1.8489153385162354, 1.0833561420440674, -0.30362585186958313, 1.5329351425170898, 0.10376798361539841, 1.735924243927002, -0.5100308060646057, 0.6473668813705444, -0.3701433837413788, -1.1680285930633545, 0.7929856181144714, -0.34577676653862, -2.0656092166900635, -0.8173826932907104, -0.6895194053649902, -0.18381181359291077, -0.7796205282211304, 0.9397900700569153, -0.2960140109062195, -1.44927978515625, 0.2748950719833374, -0.7966025471687317, 0.0531083308160305, -1.1392581462860107, 0.3227432072162628, 0.6756881475448608, -0.6194687485694885, 0.11592099070549011, -0.19067327678203583, -1.2268660068511963, -0.38119637966156006, 0.21252693235874176, 1.956498622894287, -0.7755514979362488, 0.828827977180481, 1.0687675476074219, -0.7349124550819397, -0.024355396628379822, 0.3085091710090637, -0.37926894426345825, 0.8267635703086853, -1.1009352207183838, -0.5086346864700317, 1.1858241558074951, -0.154836967587471, -0.5465938448905945, 1.4405226707458496, 0.6593230366706848, -0.9490061402320862, -0.2886643707752228, -0.09709013998508453, -0.8656316995620728, 0.06148000806570053, -1.572159767150879, -0.2011307030916214, 0.44598203897476196, -1.5522935390472412, -0.4660099446773529, -0.19809812307357788, 1.3073937892913818, -0.2249564677476883, 1.4809799194335938, -0.3765188753604889, -0.15409010648727417, -0.33155548572540283, -0.37897127866744995, 0.16046108305454254, -0.20718780159950256, -0.6055083870887756, 0.18107926845550537, -0.7761996388435364, 0.3712655305862427, 1.4144542217254639, 0.3248186409473419, 0.011679233983159065, 0.45075732469558716, 1.002244472503662, 0.42923033237457275, -0.05625945329666138, -0.8584045767784119, -1.5255224704742432, 1.9989039897918701, -1.4463307857513428, 2.0071403980255127, 0.7849085927009583, -0.03187403455376625, -1.8219285011291504, -1.9214997291564941, 1.2482776641845703, 1.2011334896087646, 2.3481693267822266, 0.4697016179561615, 0.36706167459487915, -0.7577298879623413, -0.6652198433876038, 0.4106411635875702, -1.0591089725494385, -0.666778564453125, 0.19373157620429993, 2.3285903930664062, 1.8066318035125732, -0.4577350616455078, -0.200892835855484, -0.9228468537330627, 1.3598682880401611, -0.1834983229637146, 0.18319186568260193, 1.9679977893829346, -0.19909682869911194, -1.126431941986084, 1.3605525493621826, -2.3095016479492188, 0.1360865831375122, 2.0198912620544434, 0.35786131024360657, 0.007880309596657753, -1.405400037765503, -0.5781089067459106, -0.33216214179992676, -0.4162801504135132, -1.2622013092041016, 0.5064702033996582, -0.2559899687767029, -0.9018442630767822, -1.4092764854431152, 0.13890650868415833, -1.17875075340271, -1.6360831260681152, 0.28484928607940674, 1.8853724002838135, 2.038461923599243, -0.7932008504867554, 1.5540878772735596, -0.3591616153717041, 0.11245206743478775, 1.1942613124847412, 1.2290568351745605, 3.1004114151000977, 1.9142553806304932, -1.2690062522888184, 0.5656781792640686, -0.1813148707151413, -0.4727261960506439, 1.09633207321167, -1.290550947189331, 1.3299214839935303, 0.01887325756251812, -1.1315560340881348, -1.1621465682983398, 0.9660219550132751, 0.4182402491569519, 0.02140031009912491, -0.4410109519958496, 1.181882381439209, 0.10966826230287552, 1.3348522186279297, 0.569404661655426, -0.24150347709655762, 0.6036568284034729, -0.4122677743434906, -0.4539167881011963, 1.4998514652252197, 0.15656329691410065, -1.4741551876068115, -2.236203908920288, -0.18955157697200775, -0.892046332359314, 0.09929502755403519, -0.6000832915306091, -1.0098543167114258, 1.7259259223937988, 0.3039315640926361, -1.2635900974273682, -0.2788577675819397, -0.3541128635406494, -0.5205196738243103, 2.7693305015563965, -1.3198366165161133, -0.2128836065530777, -1.0293796062469482, -0.6596768498420715, 1.6703999042510986, -1.2016401290893555, -0.2459055483341217, -0.9739291071891785, -0.5160101056098938, -1.2944300174713135, -0.5634227395057678, 0.0716114267706871, -0.9543378353118896, 0.7698443531990051, 0.19899044930934906, -1.1110563278198242, -0.3953751027584076, -0.809895932674408, 0.8644155859947205, -0.07766398787498474, 0.1747732162475586, 1.9736008644104004, 0.24023549258708954, -0.3810884356498718, 0.7478007674217224, 1.2098422050476074, 0.6213178038597107, -0.6052822470664978, 0.14476154744625092, -0.6353456377983093, 0.3238227069377899, -1.3490054607391357, 0.285367488861084, -2.827517032623291, 0.674004852771759, -0.08699128776788712, -0.0737484022974968, -0.011559128761291504, -1.310258150100708, 1.1289846897125244, 2.6402041912078857, -1.1298365592956543, 0.4594356417655945, 0.34921079874038696, 1.1654398441314697, -1.6043157577514648, 0.35307562351226807, -0.44521859288215637, 2.066889524459839, 0.23493695259094238, 1.1375977993011475, -0.4568047821521759, -2.323561906814575, 0.7149645686149597, -1.2464213371276855, -1.2428619861602783, 0.7093831896781921, -0.9555029273033142, 0.12978357076644897, -1.4461870193481445, -0.25171971321105957, -0.8518521189689636, -1.1249325275421143, 0.55108642578125, 0.09509769827127457, 0.3520141541957855, -0.540924072265625, 0.33852869272232056, -2.227161169052124, -1.3530948162078857, -0.16351443529129028, -0.9845340847969055, 0.48520275950431824, -0.43280765414237976, 0.733442485332489, -0.15314728021621704, 0.006053597666323185, 0.38480135798454285, 1.4694738388061523, 3.394353151321411, 0.24167600274085999, 0.3100403845310211, -0.25910788774490356, -0.9834550023078918, 1.4165751934051514, 0.8680642247200012, -0.12006665766239166, -0.6044526100158691, -1.0553803443908691, 1.2533140182495117, 1.975266695022583, 0.9672611355781555, -0.0012843925505876541, -0.8050251007080078, -0.7012787461280823, -0.06532445549964905, 0.17841172218322754, 0.4131857454776764, 0.9989871382713318, 0.07184439152479172, 0.05406583100557327, 1.531099557876587, 1.1706559658050537, -0.40867549180984497, 0.24131914973258972, -0.8578896522521973, -0.44412073493003845, 0.5139443874359131, 0.22835829854011536, -0.0028183255344629288, 0.3883371651172638, -0.9495766162872314, -0.31802743673324585, -0.43472611904144287, -0.908382773399353, -0.6702454686164856, -0.3546406626701355, -0.29660966992378235, 1.657440185546875, 0.13908572494983673, -0.5129361748695374, -0.028294770047068596, -0.7945250868797302, -0.14589542150497437, -1.1013789176940918, 0.19770610332489014, -0.05073288455605507, -0.13399794697761536, -0.10454161465167999, 1.730828046798706, -0.8071932792663574, -2.032456874847412, 0.12913598120212555, 0.18377695977687836, -0.17918024957180023, 0.17449158430099487, 1.679689884185791, 0.57468581199646, 1.4158360958099365, 1.229588270187378, 0.8754671216011047, -0.5674735903739929, -1.319087028503418, 0.7051633596420288, 1.025745153427124, -1.3776719570159912, 0.8205060362815857, -0.06316351145505905, -0.4462861120700836, 0.5419319868087769, 1.2315497398376465, 0.5088807940483093, -1.9182932376861572, 0.8406022191047668, -1.0109035968780518, 0.7734224796295166, 0.6694339513778687, 0.6079322099685669, 0.2083217054605484, 0.8811731338500977, -1.1814360618591309, -1.0943024158477783, -0.768315315246582, -0.6595681309700012, 1.9919252395629883, -0.39686569571495056, 0.6354912519454956, -0.2637158930301666, -1.295647144317627, -0.11253024637699127, 0.6376322507858276, 0.30605021119117737, -0.4818365275859833, 0.859143078327179, -0.6912412047386169, -1.0947506427764893, -1.4075443744659424, -0.38006436824798584, -1.032721996307373, -0.9443078637123108, 1.1098294258117676, 0.7533319592475891, 0.2968321144580841, 1.9308924674987793, 0.7451034784317017, 0.2884649634361267, -2.617727756500244, 0.8942909836769104, 0.2737899720668793, -0.11592920869588852, 0.9549918174743652, 0.32916051149368286, 1.0154714584350586, -0.06760150194168091, 0.4672740697860718, -2.4218437671661377, 2.312391519546509, -0.1936510056257248, 0.7819553017616272, 0.051519908010959625, -0.1608147770166397, 1.0848276615142822, 0.6228524446487427, 0.5878007411956787, -1.055971622467041, 0.5281742215156555, -0.48384425044059753, 1.2449798583984375, 0.9025775194168091, -0.7342866659164429, -0.015635840594768524, 1.3709452152252197, 0.4933098554611206, -0.4941558539867401, -0.9208598732948303, -0.9474519491195679, 0.9452945590019226, 1.7393980026245117, -0.03299421817064285, -0.02288307622075081, 0.8993099331855774, 0.6282721757888794, -1.3061137199401855, -0.032856326550245285, -0.7752706408500671, -0.793831467628479, 1.6957929134368896, 2.1616389751434326, -0.1542821079492569, -0.22766755521297455, -0.637610137462616, -1.3570747375488281, 0.7928763031959534, -0.13704311847686768, 0.22713468968868256, 0.5827153325080872, -0.6375396251678467, 1.0215437412261963, 0.8936697244644165, 0.9376011490821838, 0.25678759813308716, 0.24717995524406433, 0.43067583441734314, -0.3351030647754669, -1.1558427810668945, -0.23486563563346863, -1.0231435298919678, -2.5866801738739014, 0.4078817665576935, -0.2135564535856247, -1.4394848346710205, 0.11126212775707245, -1.0079119205474854, 0.9213947057723999, -0.5651426315307617, -0.9975053071975708, -1.546159267425537, 0.2437361180782318, 0.06706107407808304, 1.0184738636016846, -1.5686728954315186, -0.2275247424840927, 1.2122130393981934, 0.9161694049835205, -0.6472948789596558, 0.9314181804656982, 0.24316513538360596, 1.1264824867248535, 0.768833339214325, -0.4223383963108063, 0.5179507732391357, 0.060304053127765656, -1.3277430534362793, 0.4963955283164978, 1.1868739128112793, 0.14186057448387146, 1.4723548889160156, -0.5062916874885559, 0.07824292778968811, 0.3750426173210144, -0.6960409283638, -0.4410995841026306, -0.49339282512664795, 0.6469894051551819, 0.025207743048667908, -0.9663827419281006, -0.1819070279598236, -0.06438592076301575, -0.2933458387851715, 0.06798577308654785, -1.5025889873504639, -0.1348901093006134, -0.3637228012084961, -0.6681710481643677, -1.1901159286499023, -0.10075598955154419, 1.401637077331543, -0.8533585667610168, -0.20011408627033234, 0.398894727230072, 0.4097084105014801, 0.5793567299842834, 0.6256943941116333, -0.7370347380638123, -0.33870309591293335, -0.19439253211021423, -0.35391131043434143, 0.29642724990844727, 1.4435250759124756, -0.107606440782547, -0.9668664336204529, 0.6513380408287048, -0.3213774263858795, 0.10515999794006348, 1.9198894500732422, 0.05741668492555618, -0.7164567708969116, 0.277121901512146, -0.7218637466430664, 1.9613075256347656, 1.6990573406219482, 1.2942218780517578, -0.18218407034873962, -0.8319435119628906, 0.6665744185447693, -0.4061869978904724, -0.3514651358127594, 0.7771739363670349, 0.3589566648006439, -0.18535812199115753, -1.4559965133666992, 0.7195678353309631, 1.2367980480194092, -0.914313018321991, -0.7855640649795532, 0.1066088005900383, -0.8037310242652893, 1.1273856163024902, 0.5984830856323242, 0.3486204445362091, 0.3635367751121521, 1.7091412544250488, 0.8787214756011963, -0.45375150442123413, 0.49864286184310913, 0.642043948173523, -0.10810098797082901, -2.202077865600586, -1.1126644611358643, 0.3430878520011902, -0.5744081139564514, -1.5857267379760742, 1.4085721969604492, -1.0893309116363525, -1.0227720737457275, 0.4956306219100952, 0.03823111206293106, 1.338608741760254, 0.39007219672203064, 1.5901196002960205, 2.037167549133301, 0.8294172286987305, 0.4033953845500946, 1.2339398860931396, -0.13565286993980408, -0.46993860602378845, 1.8556995391845703, -0.4300200939178467, 0.487419068813324, 1.071099042892456, -0.33274129033088684, -1.0466623306274414, -0.7697719931602478, -1.2758169174194336, -0.7713392376899719, 1.1316637992858887, 0.077690988779068, -1.098114013671875, 0.22231881320476532, 1.6167466640472412, 0.122457355260849, -0.376828134059906, 0.5639728903770447, 0.3742099702358246, -0.7361235618591309, -0.03674354404211044, -0.8942586779594421, 0.593170702457428, -0.21045304834842682, -0.4148765206336975, 0.2564898431301117, 0.44740673899650574, 1.370077133178711, -0.08538591116666794, 0.1144254133105278, 1.0653023719787598, -1.5016329288482666, 1.5587916374206543, -0.7086990475654602, 0.25096994638442993, -2.361159324645996, 1.346053123474121, -0.7710906267166138, 1.9905939102172852, -2.640831232070923, 0.5251235365867615, -0.5341365933418274, -0.4724265933036804, 0.2693711221218109, -0.37202388048171997, 0.14983291923999786, -0.11429188400506973, -1.1704840660095215, -0.06654436886310577, -0.5914455056190491, 0.602492094039917, 1.0414583683013916, 1.3457696437835693, -1.1439933776855469, -0.3007220923900604, -1.7270970344543457, -0.07677025347948074, -0.7334131598472595, 0.15308183431625366, -1.985668659210205, -0.21126794815063477, -1.864107370376587, -2.3938984870910645, -1.2908477783203125, -0.7870919108390808, 1.122194528579712, 0.13542474806308746, -0.9333747625350952, 1.268120288848877, -0.38395482301712036, -1.8730766773223877, 1.148885726928711, -2.1442668437957764 ]
https://github.com/huggingface/datasets/issues/3177
More control over TQDM when using map/filter with multiple processes
Hi, It's hard to provide an API that would cover all use-cases with tqdm in this project. However, you can make it work by defining a custom decorator (a bit hacky tho) as follows: ```python import datasets def progress_only_on_rank_0(func): def wrapper(*args, **kwargs): rank = kwargs.get("rank") disable_tqdm = kwargs.get("disable_tqdm", False) disable_tqdm = True if rank is not None and rank > 0 else disable_tqdm kwargs["disable_tqdm"] = disable_tqdm return func(*args, **kwargs) return wrapper datasets.Dataset._map_single = progress_only_on_rank_0(datasets.Dataset._map_single) ``` EDIT: Ups, closed by accident. Thanks for the provided links. `Trainer` requires this for training in multi-node distributed setting. However, `Dataset.map` doesn't support that yet. Do you have an API for this in mind? `Dataset.map` is already bloated with the arguments, so IMO it's not a good idea to add a new arg there.
It would help with the clutter in my terminal if tqdm is only shown for rank 0 when using `num_proces>0` in the map and filter methods of datasets. ```python dataset.map(lambda examples: tokenize(examples["text"]), batched=True, num_proc=6) ``` The above snippet leads to a lot of TQDM bars and depending on your terminal, these will not overwrite but keep pushing each other down. ``` #0: 0%| | 0/13 [00:00<?, ?ba/s] #1: 0%| | 0/13 [00:00<?, ?ba/s] #2: 0%| | 0/13 [00:00<?, ?ba/s] #3: 0%| | 0/13 [00:00<?, ?ba/s] #4: 0%| | 0/13 [00:00<?, ?ba/s] #5: 0%| | 0/13 [00:00<?, ?ba/s] #0: 8%| | 1/13 [00:00<?, ?ba/s] #1: 8%| | 1/13 [00:00<?, ?ba/s] ... ``` Instead, it would be welcome if we had the option to only show the progress of rank 0.
1,140
129
More control over TQDM when using map/filter with multiple processes It would help with the clutter in my terminal if tqdm is only shown for rank 0 when using `num_proces>0` in the map and filter methods of datasets. ```python dataset.map(lambda examples: tokenize(examples["text"]), batched=True, num_proc=6) ``` The above snippet leads to a lot of TQDM bars and depending on your terminal, these will not overwrite but keep pushing each other down. ``` #0: 0%| | 0/13 [00:00<?, ?ba/s] #1: 0%| | 0/13 [00:00<?, ?ba/s] #2: 0%| | 0/13 [00:00<?, ?ba/s] #3: 0%| | 0/13 [00:00<?, ?ba/s] #4: 0%| | 0/13 [00:00<?, ?ba/s] #5: 0%| | 0/13 [00:00<?, ?ba/s] #0: 8%| | 1/13 [00:00<?, ?ba/s] #1: 8%| | 1/13 [00:00<?, ?ba/s] ... ``` Instead, it would be welcome if we had the option to only show the progress of rank 0. Hi, It's hard to provide an API that would cover all use-cases with tqdm in this project. However, you can make it work by defining a custom decorator (a bit hacky tho) as follows: ```python import datasets def progress_only_on_rank_0(func): def wrapper(*args, **kwargs): rank = kwargs.get("rank") disable_tqdm = kwargs.get("disable_tqdm", False) disable_tqdm = True if rank is not None and rank > 0 else disable_tqdm kwargs["disable_tqdm"] = disable_tqdm return func(*args, **kwargs) return wrapper datasets.Dataset._map_single = progress_only_on_rank_0(datasets.Dataset._map_single) ``` EDIT: Ups, closed by accident. Thanks for the provided links. `Trainer` requires this for training in multi-node distributed setting. However, `Dataset.map` doesn't support that yet. Do you have an API for this in mind? `Dataset.map` is already bloated with the arguments, so IMO it's not a good idea to add a new arg there.
[ -1.1732048988342285, -0.8198485374450684, -0.8211680054664612, 1.4263813495635986, -0.10249532014131546, -1.2223129272460938, 0.09469931572675705, -1.1753627061843872, 1.492700219154358, -0.8106050491333008, 0.3664986193180084, -1.693397045135498, 0.02309465780854225, -0.6575983166694641, -0.791721761226654, -0.7582508325576782, -0.5349034667015076, -0.6906503438949585, 1.0077095031738281, 2.5648021697998047, 1.2018325328826904, -1.3617764711380005, 2.690272092819214, 0.8309173583984375, -0.3084412217140198, -0.920576810836792, 0.556047797203064, 0.010636336170136929, -1.2289296388626099, -0.4011531174182892, -0.9071073532104492, -0.09513632953166962, -0.5213379859924316, -0.4555529057979584, -0.008077978156507015, 0.40498799085617065, -0.29451295733451843, -0.4101414680480957, -0.5335502624511719, -0.8473971486091614, 0.5032804608345032, -0.42535093426704407, 0.9653142094612122, -0.2728707492351532, 1.7187520265579224, -0.573298990726471, 0.4568290710449219, 0.7271541357040405, 1.3230613470077515, 0.18785519897937775, 0.000008009374141693115, 0.38763049244880676, 0.399575412273407, -0.08551553636789322, 0.5301119685173035, 1.1753804683685303, 0.6490565538406372, 0.4293920397758484, 0.6950419545173645, -2.199810743331909, 1.2458425760269165, -0.9789321422576904, 0.34045979380607605, 1.2776777744293213, -0.8279771208763123, 0.3134775459766388, -1.7490038871765137, -0.05869284272193909, 0.5950958132743835, -2.14121675491333, 0.3277684450149536, -1.2635517120361328, -0.4927392899990082, 0.9275770783424377, 0.3900924324989319, -1.1866644620895386, 0.2259850651025772, -0.476753830909729, 1.0149869918823242, 0.36018842458724976, 0.9990060329437256, -1.6895588636398315, -0.09866894036531448, -0.3166664242744446, 0.06598842144012451, -1.2111244201660156, -1.4571595191955566, 0.5721961259841919, 0.5745954513549805, 0.6025614738464355, -0.09462464600801468, 1.0461426973342896, -0.9866545796394348, 0.9104574918746948, -1.0875762701034546, -1.766105055809021, -1.4710465669631958, -2.312333106994629, -2.238905668258667, 0.747421383857727, -0.45490562915802, -0.5550505518913269, 2.010042667388916, -0.8999575972557068, -1.698102355003357, 1.0837147235870361, 0.34760385751724243, -0.006123553030192852, 2.3985719680786133, 0.1601204127073288, -0.6825911998748779, 0.5079509615898132, -0.8499860763549805, 0.8353049755096436, -0.46753156185150146, 1.3221179246902466, 0.3208652138710022, -0.9896970987319946, 1.5603132247924805, -0.42216363549232483, 0.5533816814422607, -0.7187342643737793, -0.5094414353370667, -0.8173927068710327, 0.3567001521587372, 1.8497780561447144, -0.2767196595668793, 1.4147608280181885, -0.2934044599533081, -1.4887778759002686, -1.5854078531265259, 0.9032001495361328, 0.5341925024986267, -0.805974006652832, 0.17880181968212128, -0.48969459533691406, 0.16282427310943604, -0.041688017547130585, 1.1175130605697632, 1.2347837686538696, 0.7021934390068054, -0.32219216227531433, -0.947060763835907, 0.286006361246109, -0.10295138508081436, -0.8830925822257996, -1.7176257371902466, -0.333576500415802, 0.126008540391922, 0.6409160494804382, -1.2920536994934082, 1.82880437374115, 0.9618291854858398, 1.9783027172088623, 1.1007989645004272, -0.43303245306015015, 1.429396629333496, 0.02812168002128601, 1.8326735496520996, -0.4731327295303345, 0.6452067494392395, -0.4266676902770996, -1.1386862993240356, 0.8867372274398804, -0.3135922849178314, -2.0462169647216797, -0.8038569092750549, -0.781868577003479, -0.28850147128105164, -0.8084732890129089, 0.9983009099960327, -0.3334953784942627, -1.3588449954986572, 0.16767461597919464, -0.7262555360794067, 0.06599066406488419, -1.2279926538467407, 0.3601166903972626, 0.7125191688537598, -0.571882426738739, 0.08078155666589737, -0.21184761822223663, -1.3247196674346924, -0.46040359139442444, 0.19309741258621216, 1.9694042205810547, -0.7517797350883484, 0.8813657164573669, 1.0377753973007202, -0.7202694416046143, 0.03474222123622894, 0.3479280173778534, -0.3537670969963074, 0.8113197088241577, -1.113287091255188, -0.48379459977149963, 1.2329596281051636, -0.11331023275852203, -0.5477418303489685, 1.5067830085754395, 0.7718659043312073, -1.0214691162109375, -0.26786109805107117, -0.13244663178920746, -0.8541534543037415, 0.08477179706096649, -1.618154764175415, -0.013738490641117096, 0.4332278370857239, -1.603922963142395, -0.5166938900947571, -0.2599984407424927, 1.1805930137634277, -0.20268358290195465, 1.4720405340194702, -0.3899745047092438, -0.16407164931297302, -0.3718043863773346, -0.3711014688014984, 0.05140099301934242, -0.23125548660755157, -0.6744440197944641, 0.19563739001750946, -0.6948246359825134, 0.34568920731544495, 1.5689586400985718, 0.35268548130989075, 0.08456950634717941, 0.5233973860740662, 1.021354079246521, 0.36022675037384033, 0.06740354746580124, -0.8406369686126709, -1.5135955810546875, 2.0235321521759033, -1.5285450220108032, 1.981210470199585, 0.8667917847633362, 0.07659400254487991, -1.7848398685455322, -1.8737704753875732, 1.3241630792617798, 1.107072353363037, 2.3069753646850586, 0.6073256731033325, 0.5036988854408264, -0.8453930020332336, -0.6478250026702881, 0.2959257662296295, -1.0625684261322021, -0.737943708896637, 0.10048316419124603, 2.4780478477478027, 1.8265599012374878, -0.48386093974113464, -0.20249643921852112, -0.9462504982948303, 1.4397735595703125, -0.09752821922302246, 0.19159719347953796, 1.9474318027496338, -0.30559712648391724, -1.0652687549591064, 1.196416974067688, -2.5103461742401123, 0.07372002303600311, 2.002978563308716, 0.2824830710887909, 0.1481925994157791, -1.3037267923355103, -0.5702293515205383, -0.34399598836898804, -0.4941655695438385, -1.2031505107879639, 0.5806552767753601, -0.20402924716472626, -0.7530083656311035, -1.4534955024719238, 0.16515907645225525, -1.0887973308563232, -1.5554357767105103, 0.28791964054107666, 1.833828091621399, 2.078187942504883, -0.829436182975769, 1.6518971920013428, -0.3733976483345032, 0.2679690718650818, 1.1692508459091187, 1.3127223253250122, 3.096461534500122, 1.9346064329147339, -1.2616983652114868, 0.6532626748085022, -0.20571257174015045, -0.5376846194267273, 1.102805495262146, -1.2415825128555298, 1.2690151929855347, -0.12605774402618408, -1.1684848070144653, -1.1696691513061523, 0.899999737739563, 0.43301254510879517, 0.09952865540981293, -0.5176641941070557, 1.1530826091766357, 0.1298292577266693, 1.2428929805755615, 0.621198832988739, -0.2549254894256592, 0.48987874388694763, -0.4611209034919739, -0.405422180891037, 1.6263936758041382, 0.20122030377388, -1.4171966314315796, -2.4520554542541504, -0.1534685343503952, -0.9021126627922058, 0.11464986950159073, -0.6956676244735718, -1.1092311143875122, 1.6744674444198608, 0.2619224488735199, -1.2321096658706665, -0.34647101163864136, -0.2664281129837036, -0.5612465143203735, 2.655273199081421, -1.4922020435333252, -0.23745040595531464, -0.9401718974113464, -0.5817765593528748, 1.7411837577819824, -1.1506128311157227, -0.21394382417201996, -1.0781384706497192, -0.5498085021972656, -1.2377525568008423, -0.5231457352638245, 0.017738446593284607, -0.9341150522232056, 0.8809405565261841, 0.16701893508434296, -1.1621726751327515, -0.30306699872016907, -0.911988377571106, 0.889070987701416, -0.10045745223760605, 0.20507019758224487, 1.8644647598266602, 0.4204282760620117, -0.4133731424808502, 0.770824670791626, 1.2498756647109985, 0.6232314705848694, -0.6608070135116577, 0.13093626499176025, -0.6764518022537231, 0.4126698672771454, -1.2349001169204712, 0.28000974655151367, -2.781960964202881, 0.6779114603996277, -0.10574798285961151, -0.027540452778339386, 0.05950427055358887, -1.3299201726913452, 1.206924319267273, 2.646071672439575, -1.1424062252044678, 0.5816803574562073, 0.2534540891647339, 1.3067424297332764, -1.4861629009246826, 0.2746417820453644, -0.4835435748100281, 2.1198160648345947, 0.08549096435308456, 1.2373476028442383, -0.44433677196502686, -2.3337955474853516, 0.7111905217170715, -1.2815994024276733, -1.2825943231582642, 0.8386141657829285, -0.9024495482444763, 0.014756188727915287, -1.3723849058151245, -0.28741422295570374, -0.9723432064056396, -1.066569447517395, 0.6586433053016663, 0.1316530704498291, 0.4390607178211212, -0.7021231055259705, 0.23617681860923767, -2.2777183055877686, -1.4124767780303955, -0.20002788305282593, -0.9210844039916992, 0.4766542911529541, -0.36618202924728394, 0.7796920537948608, -0.0875171646475792, -0.0012109559029340744, 0.3502487540245056, 1.3990986347198486, 3.332970380783081, 0.19980640709400177, 0.3834202289581299, -0.2083044946193695, -0.9051880240440369, 1.326880931854248, 0.9075295925140381, -0.03487398102879524, -0.5570892095565796, -1.0459011793136597, 1.153830647468567, 1.891180157661438, 0.9533061385154724, -0.1114998310804367, -0.7873107194900513, -0.6086403131484985, -0.0606711208820343, 0.30910781025886536, 0.450442373752594, 0.9825152158737183, -0.03250773251056671, 0.09774333238601685, 1.4814187288284302, 1.1634992361068726, -0.5110301971435547, 0.33170899748802185, -0.7301125526428223, -0.4144202768802643, 0.4395942986011505, 0.30466094613075256, -0.06151505559682846, 0.4142686426639557, -1.0729658603668213, -0.28955596685409546, -0.36694586277008057, -0.874681830406189, -0.6683371663093567, -0.41116419434547424, -0.39404934644699097, 1.6041374206542969, 0.09776897728443146, -0.5068477988243103, 0.057435207068920135, -0.7802650332450867, -0.07231214642524719, -1.2048485279083252, 0.2256905734539032, -0.1905987411737442, -0.12094999849796295, -0.0796075165271759, 1.9140435457229614, -0.8667078614234924, -1.9776242971420288, 0.19799505174160004, 0.2662101089954376, -0.3570774495601654, 0.3780372738838196, 1.6024092435836792, 0.5611172318458557, 1.4532243013381958, 1.3598514795303345, 0.9054283499717712, -0.6254138350486755, -1.2975788116455078, 0.6494436264038086, 1.0843870639801025, -1.3341530561447144, 0.7747125625610352, 0.11961141228675842, -0.4589434564113617, 0.5426391363143921, 1.3303292989730835, 0.44068142771720886, -2.0043210983276367, 0.7924692034721375, -0.935056209564209, 0.9078742265701294, 0.7208135724067688, 0.6553148627281189, 0.3814714252948761, 0.72255539894104, -1.1528950929641724, -1.1531460285186768, -0.8202892541885376, -0.7798377275466919, 1.9787516593933105, -0.31464171409606934, 0.6516255736351013, -0.1748032569885254, -1.318396806716919, -0.09790943562984467, 0.7691709399223328, 0.2537885308265686, -0.44503623247146606, 0.8992298245429993, -0.5453574657440186, -1.186525821685791, -1.2974692583084106, -0.42146456241607666, -1.0168660879135132, -0.9683151245117188, 1.0812057256698608, 0.8025767207145691, 0.24727994203567505, 1.9343407154083252, 0.7275079488754272, 0.2338390201330185, -2.6053123474121094, 0.8558964729309082, 0.2619510591030121, -0.10135974735021591, 0.8496009111404419, 0.4013797342777252, 1.035247802734375, 0.05840512365102768, 0.5060007572174072, -2.462080478668213, 2.3633482456207275, -0.164653480052948, 0.7040045857429504, -0.081417977809906, -0.15060274302959442, 1.1188210248947144, 0.5812444090843201, 0.5379415154457092, -0.9797275066375732, 0.5985029339790344, -0.6729640364646912, 1.314189076423645, 0.8571014404296875, -0.8347839117050171, 0.032615818083286285, 1.360502004623413, 0.5387477278709412, -0.43268561363220215, -0.9200661182403564, -0.9550366401672363, 1.025571346282959, 1.7412112951278687, -0.0887543186545372, 0.08668570965528488, 0.8137656450271606, 0.6054658889770508, -1.3446455001831055, -0.017912529408931732, -0.7356222867965698, -0.7524590492248535, 1.6619189977645874, 2.188214063644409, -0.1425667703151703, -0.1679716408252716, -0.7513813376426697, -1.3485187292099, 0.8215515613555908, -0.09129419922828674, 0.08921264111995697, 0.613021731376648, -0.7023122310638428, 1.1813240051269531, 0.7544429302215576, 0.8294607400894165, 0.1852940320968628, 0.2657775580883026, 0.36708635091781616, -0.4270796775817871, -1.0735498666763306, -0.22412040829658508, -1.209233283996582, -2.5943431854248047, 0.40045589208602905, -0.15769647061824799, -1.3529198169708252, 0.010430843569338322, -1.0139435529708862, 0.9723792672157288, -0.5147619843482971, -1.0494389533996582, -1.5637601613998413, 0.22382451593875885, -0.0734306052327156, 1.0155600309371948, -1.5687334537506104, -0.10762202739715576, 1.0995008945465088, 0.8442131280899048, -0.7511729598045349, 0.9414846897125244, 0.33841612935066223, 0.9829389452934265, 0.8410276174545288, -0.33618566393852234, 0.5651184916496277, -0.12732736766338348, -1.378185510635376, 0.43220409750938416, 1.3269280195236206, 0.12979571521282196, 1.4681733846664429, -0.5586938261985779, -0.0677645206451416, 0.3149929940700531, -0.4555700123310089, -0.42141637206077576, -0.520465075969696, 0.6381791234016418, 0.1945236623287201, -0.9326980113983154, -0.07165355235338211, -0.034910086542367935, -0.3158908784389496, 0.16085165739059448, -1.4906774759292603, -0.11264746636152267, -0.3982909619808197, -0.5251376032829285, -1.2599217891693115, 0.08593211323022842, 1.3773788213729858, -0.7496908903121948, -0.137134850025177, 0.4547005593776703, 0.3041784465312958, 0.5391303896903992, 0.7180668115615845, -0.6688158512115479, -0.39543044567108154, -0.3320150077342987, -0.2889446020126343, 0.22930988669395447, 1.3623696565628052, -0.1625906378030777, -0.8740164041519165, 0.7495675683021545, -0.4075453281402588, 0.020867086946964264, 1.8303366899490356, 0.031711310148239136, -0.7905750870704651, 0.2904173731803894, -0.6672043800354004, 1.945792555809021, 1.6555265188217163, 1.207526683807373, -0.19058509171009064, -0.9524248242378235, 0.6692875027656555, -0.3479326665401459, -0.2749558389186859, 0.8298478126525879, 0.3812292516231537, -0.2596324682235718, -1.4587188959121704, 0.5524681210517883, 1.2785989046096802, -0.8909046649932861, -0.8676013946533203, 0.0986991599202156, -0.8058530688285828, 1.144675374031067, 0.6707892417907715, 0.44723448157310486, 0.34198909997940063, 1.6234217882156372, 0.7731379866600037, -0.5230205655097961, 0.5972092747688293, 0.5418359041213989, -0.12352451682090759, -2.1462295055389404, -1.1709345579147339, 0.3399367928504944, -0.4467095136642456, -1.6746374368667603, 1.3652212619781494, -1.0762711763381958, -0.9734720587730408, 0.6596089005470276, 0.0070216236636042595, 1.4166213274002075, 0.42313265800476074, 1.5182397365570068, 2.082071304321289, 0.8263086676597595, 0.38448503613471985, 1.2531555891036987, -0.17991752922534943, -0.5190438628196716, 1.8504377603530884, -0.41409918665885925, 0.4520823359489441, 1.0540355443954468, -0.3430153727531433, -0.9117757678031921, -0.7375787496566772, -1.2578338384628296, -0.7763547301292419, 1.1916733980178833, 0.033218320459127426, -1.0920352935791016, 0.3163798749446869, 1.5503287315368652, 0.08683617413043976, -0.30275270342826843, 0.647858738899231, 0.3945854902267456, -0.775571882724762, -0.054792001843452454, -0.8805328011512756, 0.5407878160476685, -0.135392427444458, -0.2820395231246948, 0.33251118659973145, 0.4226868152618408, 1.3463878631591797, -0.17176340520381927, 0.18800166249275208, 1.075724720954895, -1.478764533996582, 1.5319406986236572, -0.6611610651016235, 0.2402183562517166, -2.402426242828369, 1.4104429483413696, -0.7488202452659607, 1.876976728439331, -2.64080548286438, 0.3373526334762573, -0.5754513740539551, -0.5069143176078796, 0.33166825771331787, -0.25299930572509766, 0.1823199987411499, -0.2325410544872284, -1.1405760049819946, -0.0625368282198906, -0.6047537326812744, 0.43383368849754333, 1.0135416984558105, 1.291022539138794, -1.02696692943573, -0.27783966064453125, -1.7627177238464355, -0.0811578631401062, -0.6536626219749451, 0.3245035409927368, -2.0562188625335693, -0.19178180396556854, -1.9414008855819702, -2.2622437477111816, -1.2999902963638306, -0.8378055691719055, 1.0545456409454346, 0.14650161564350128, -0.9666747450828552, 1.2028013467788696, -0.45279425382614136, -1.7946457862854004, 1.1145970821380615, -2.1681201457977295 ]
https://github.com/huggingface/datasets/issues/3177
More control over TQDM when using map/filter with multiple processes
Inspiration may be found at `transformers`. https://github.com/huggingface/transformers/blob/4a394cf53f05e73ab9bbb4b179a40236a5ffe45a/src/transformers/trainer.py#L1231-L1233 To get unique IDs for each worker, see https://stackoverflow.com/a/10192611/1150683
It would help with the clutter in my terminal if tqdm is only shown for rank 0 when using `num_proces>0` in the map and filter methods of datasets. ```python dataset.map(lambda examples: tokenize(examples["text"]), batched=True, num_proc=6) ``` The above snippet leads to a lot of TQDM bars and depending on your terminal, these will not overwrite but keep pushing each other down. ``` #0: 0%| | 0/13 [00:00<?, ?ba/s] #1: 0%| | 0/13 [00:00<?, ?ba/s] #2: 0%| | 0/13 [00:00<?, ?ba/s] #3: 0%| | 0/13 [00:00<?, ?ba/s] #4: 0%| | 0/13 [00:00<?, ?ba/s] #5: 0%| | 0/13 [00:00<?, ?ba/s] #0: 8%| | 1/13 [00:00<?, ?ba/s] #1: 8%| | 1/13 [00:00<?, ?ba/s] ... ``` Instead, it would be welcome if we had the option to only show the progress of rank 0.
1,140
16
More control over TQDM when using map/filter with multiple processes It would help with the clutter in my terminal if tqdm is only shown for rank 0 when using `num_proces>0` in the map and filter methods of datasets. ```python dataset.map(lambda examples: tokenize(examples["text"]), batched=True, num_proc=6) ``` The above snippet leads to a lot of TQDM bars and depending on your terminal, these will not overwrite but keep pushing each other down. ``` #0: 0%| | 0/13 [00:00<?, ?ba/s] #1: 0%| | 0/13 [00:00<?, ?ba/s] #2: 0%| | 0/13 [00:00<?, ?ba/s] #3: 0%| | 0/13 [00:00<?, ?ba/s] #4: 0%| | 0/13 [00:00<?, ?ba/s] #5: 0%| | 0/13 [00:00<?, ?ba/s] #0: 8%| | 1/13 [00:00<?, ?ba/s] #1: 8%| | 1/13 [00:00<?, ?ba/s] ... ``` Instead, it would be welcome if we had the option to only show the progress of rank 0. Inspiration may be found at `transformers`. https://github.com/huggingface/transformers/blob/4a394cf53f05e73ab9bbb4b179a40236a5ffe45a/src/transformers/trainer.py#L1231-L1233 To get unique IDs for each worker, see https://stackoverflow.com/a/10192611/1150683
[ -1.096755862236023, -0.8034772872924805, -0.9246952533721924, 1.4608101844787598, -0.012608489021658897, -1.2234196662902832, 0.08287712931632996, -1.133273959159851, 1.5177874565124512, -0.7048189640045166, 0.32350146770477295, -1.7377831935882568, 0.010070355609059334, -0.6332583427429199, -0.7634764909744263, -0.7697798013687134, -0.4532097578048706, -0.710020899772644, 0.9752488732337952, 2.634308338165283, 1.2827271223068237, -1.3847689628601074, 2.6614737510681152, 0.7570563554763794, -0.3072516918182373, -0.8920981884002686, 0.5935612916946411, 0.04395701736211777, -1.2190021276474, -0.3976014256477356, -0.8692935705184937, -0.048303209245204926, -0.514275848865509, -0.4592057466506958, 0.014371005818247795, 0.41563475131988525, -0.34531545639038086, -0.357352614402771, -0.49346375465393066, -0.879541277885437, 0.5244649648666382, -0.3973739743232727, 0.9503450989723206, -0.20736578106880188, 1.6801191568374634, -0.5709071755409241, 0.3853583335876465, 0.7088561654090881, 1.2983962297439575, 0.14891397953033447, -0.00004535634070634842, 0.3955458998680115, 0.3554612398147583, -0.13238133490085602, 0.4530508518218994, 1.238364815711975, 0.6061345934867859, 0.4582015872001648, 0.716206967830658, -2.2328240871429443, 1.275363802909851, -0.9417867064476013, 0.2571897506713867, 1.2653305530548096, -0.8408209681510925, 0.34847110509872437, -1.7765446901321411, -0.09997468441724777, 0.5530717372894287, -2.1871392726898193, 0.3529700040817261, -1.261793851852417, -0.5041065812110901, 0.8875701427459717, 0.3233416676521301, -1.1596218347549438, 0.2324734330177307, -0.49352192878723145, 1.0609279870986938, 0.40969520807266235, 1.1018764972686768, -1.7616103887557983, -0.10225654393434525, -0.28911614418029785, 0.04719739407300949, -1.2937170267105103, -1.4987521171569824, 0.47101032733917236, 0.5462967157363892, 0.647117555141449, -0.04021495580673218, 0.9870534539222717, -0.9385753273963928, 0.861001193523407, -1.02494215965271, -1.763169765472412, -1.378257155418396, -2.3045589923858643, -2.2624449729919434, 0.7455779314041138, -0.43259620666503906, -0.5773048400878906, 2.0045409202575684, -0.8637328743934631, -1.716713786125183, 1.081073522567749, 0.3887060880661011, -0.034132130444049835, 2.4277844429016113, 0.25029832124710083, -0.7438834309577942, 0.4930993318557739, -0.8249584436416626, 0.7779069542884827, -0.46499520540237427, 1.3221564292907715, 0.40599149465560913, -0.9822988510131836, 1.595715045928955, -0.4692578911781311, 0.5366286635398865, -0.8020567297935486, -0.47418391704559326, -0.8309285640716553, 0.32872045040130615, 1.8942317962646484, -0.38825738430023193, 1.4886794090270996, -0.33699238300323486, -1.4751754999160767, -1.5317527055740356, 0.9194146394729614, 0.5000225305557251, -0.8579004406929016, 0.1592177301645279, -0.417280375957489, 0.1611480563879013, -0.04558350890874863, 1.0207099914550781, 1.229460597038269, 0.6608449220657349, -0.3000105023384094, -0.9624881744384766, 0.325264573097229, -0.15751752257347107, -0.7990685701370239, -1.7411937713623047, -0.2563074827194214, 0.14535443484783173, 0.6565060019493103, -1.354382872581482, 1.791054368019104, 0.8625120520591736, 2.0170810222625732, 1.0205751657485962, -0.47532546520233154, 1.4581447839736938, 0.02138863317668438, 1.9116387367248535, -0.45918089151382446, 0.6279408931732178, -0.46752142906188965, -1.152718424797058, 0.9762933254241943, -0.28439533710479736, -1.9574270248413086, -0.7519192099571228, -0.8789829611778259, -0.23374125361442566, -0.8182282447814941, 0.9732015132904053, -0.30412906408309937, -1.394537091255188, 0.21404090523719788, -0.7146626710891724, 0.05851272493600845, -1.3118951320648193, 0.306007444858551, 0.7389874458312988, -0.5528039336204529, 0.07907121628522873, -0.23568245768547058, -1.368432879447937, -0.4945250153541565, 0.2830770015716553, 2.0000786781311035, -0.6938948035240173, 0.9082071185112, 1.051366925239563, -0.7476844787597656, 0.07723125070333481, 0.3999099135398865, -0.37817925214767456, 0.8025321960449219, -1.1355409622192383, -0.4621124863624573, 1.1816003322601318, -0.09404313564300537, -0.6156970858573914, 1.4878427982330322, 0.8182690739631653, -1.0554136037826538, -0.26801741123199463, -0.12751449644565582, -0.8269869685173035, 0.07595890015363693, -1.6315075159072876, -0.04819571226835251, 0.3683745861053467, -1.5539569854736328, -0.537530243396759, -0.28513407707214355, 1.1974146366119385, -0.24145565927028656, 1.4907660484313965, -0.3918270468711853, -0.15880635380744934, -0.39738017320632935, -0.379630982875824, 0.026642877608537674, -0.26954835653305054, -0.6623833775520325, 0.2596266269683838, -0.7091943621635437, 0.3283315896987915, 1.5263413190841675, 0.36625027656555176, 0.1151847317814827, 0.4469154477119446, 1.0457078218460083, 0.3727368712425232, 0.060258008539676666, -0.8507804870605469, -1.502520203590393, 2.0545520782470703, -1.5061293840408325, 1.9941587448120117, 0.8559403419494629, 0.05662548542022705, -1.79373037815094, -1.900160312652588, 1.3484070301055908, 1.121872067451477, 2.330814838409424, 0.6276386380195618, 0.5170793533325195, -0.7438325881958008, -0.6621695756912231, 0.2601374387741089, -1.0716421604156494, -0.7309924960136414, 0.15718227624893188, 2.484869956970215, 1.7268365621566772, -0.5250759124755859, -0.26077353954315186, -0.957393229007721, 1.3492358922958374, -0.04088837653398514, 0.12421539425849915, 1.9514788389205933, -0.2796933650970459, -1.015676498413086, 1.1579394340515137, -2.4452879428863525, 0.0892009362578392, 1.9933655261993408, 0.2488548308610916, 0.1345767378807068, -1.3525482416152954, -0.6358136534690857, -0.31615114212036133, -0.5096917152404785, -1.1728718280792236, 0.5743221640586853, -0.22875221073627472, -0.8043707609176636, -1.5110336542129517, 0.13864794373512268, -1.1058790683746338, -1.596494197845459, 0.3299495577812195, 1.8895057439804077, 2.0730013847351074, -0.8659689426422119, 1.6248483657836914, -0.2986275553703308, 0.20258758962154388, 1.2446098327636719, 1.2972304821014404, 3.09443998336792, 1.9480470418930054, -1.273419976234436, 0.7178583741188049, -0.15646816790103912, -0.5169010162353516, 1.1262012720108032, -1.2231343984603882, 1.1778149604797363, -0.1851319819688797, -1.2291553020477295, -1.2092769145965576, 0.9357920289039612, 0.4396626949310303, 0.11222881823778152, -0.5233875513076782, 1.1511746644973755, 0.11530108004808426, 1.2139785289764404, 0.635266125202179, -0.23560470342636108, 0.5271896123886108, -0.4044010043144226, -0.40095317363739014, 1.651840329170227, 0.19122232496738434, -1.4574471712112427, -2.5008320808410645, -0.21561749279499054, -0.873723566532135, 0.08499795198440552, -0.6900243163108826, -1.1347088813781738, 1.6539199352264404, 0.37475019693374634, -1.2198610305786133, -0.33354198932647705, -0.2891715168952942, -0.5811959505081177, 2.619262456893921, -1.581612229347229, -0.24239963293075562, -0.9607565402984619, -0.5550830960273743, 1.677412748336792, -1.1338422298431396, -0.20077447593212128, -0.9958436489105225, -0.5728977918624878, -1.2757809162139893, -0.5193491578102112, -0.019046835601329803, -0.8573336601257324, 0.779443621635437, 0.16571535170078278, -1.143874168395996, -0.2800273299217224, -0.9059398174285889, 0.8559878468513489, -0.11787895858287811, 0.2750113010406494, 1.8857591152191162, 0.4846333861351013, -0.44549375772476196, 0.7390944361686707, 1.2209234237670898, 0.5355602502822876, -0.661750853061676, 0.11954247951507568, -0.6729603409767151, 0.3154969811439514, -1.2831453084945679, 0.24929670989513397, -2.731426954269409, 0.6448365449905396, -0.1508776992559433, -0.0086203059181571, 0.06272859126329422, -1.2640249729156494, 1.2691123485565186, 2.6255862712860107, -1.1329607963562012, 0.5846617221832275, 0.2483757585287094, 1.2929035425186157, -1.48040771484375, 0.275876522064209, -0.4358004331588745, 2.0882177352905273, 0.08758050948381424, 1.2249813079833984, -0.47706282138824463, -2.245344877243042, 0.6411287784576416, -1.2629249095916748, -1.185803771018982, 0.8592776656150818, -0.8218207359313965, 0.048813290894031525, -1.4040071964263916, -0.2610021233558655, -0.9554014205932617, -1.1481266021728516, 0.7449180483818054, 0.052041247487068176, 0.5094822645187378, -0.679149866104126, 0.28237104415893555, -2.2426717281341553, -1.4175446033477783, -0.21293345093727112, -0.9316214323043823, 0.45517027378082275, -0.31862276792526245, 0.7436738014221191, -0.10083233565092087, -0.019501807168126106, 0.2993253469467163, 1.3029420375823975, 3.3886055946350098, 0.26395779848098755, 0.4195592403411865, -0.20683641731739044, -0.9300040602684021, 1.3030846118927002, 0.9535872936248779, -0.049079686403274536, -0.5410245060920715, -1.032972812652588, 1.1823394298553467, 1.9410909414291382, 1.0431963205337524, -0.03445335850119591, -0.8131730556488037, -0.6455316543579102, -0.0038106883876025677, 0.30075782537460327, 0.47007501125335693, 1.0202388763427734, -0.03234187513589859, 0.04533058777451515, 1.4077858924865723, 1.1770492792129517, -0.5384404063224792, 0.4061906933784485, -0.800736665725708, -0.36697715520858765, 0.4139438271522522, 0.2949436902999878, -0.025709079578518867, 0.4352976679801941, -1.1031339168548584, -0.30444735288619995, -0.3559226393699646, -0.8736429214477539, -0.6926525831222534, -0.41892898082733154, -0.30403852462768555, 1.6352698802947998, 0.11943084001541138, -0.4664592146873474, 0.10944090038537979, -0.801372230052948, -0.05944463983178139, -1.184423565864563, 0.20851296186447144, -0.24591317772865295, -0.0510697104036808, -0.014408581890165806, 1.9369524717330933, -0.9306268692016602, -2.0418806076049805, 0.24271737039089203, 0.24817781150341034, -0.43157410621643066, 0.3867236375808716, 1.665949821472168, 0.5749930739402771, 1.3732331991195679, 1.3031023740768433, 0.91948401927948, -0.6803174018859863, -1.2578805685043335, 0.6275638937950134, 1.1000171899795532, -1.3355313539505005, 0.7814931869506836, 0.06610442698001862, -0.4486938714981079, 0.5573552250862122, 1.333272933959961, 0.39688265323638916, -2.0340840816497803, 0.7669414281845093, -0.8745946884155273, 0.8537625074386597, 0.6960333585739136, 0.7106896042823792, 0.38227492570877075, 0.6961707472801208, -1.204577922821045, -1.119632363319397, -0.8133451342582703, -0.6888953447341919, 1.8588285446166992, -0.22866131365299225, 0.5924912095069885, -0.13594159483909607, -1.3073506355285645, -0.042081478983163834, 0.8232156038284302, 0.30071502923965454, -0.45611894130706787, 0.8637664914131165, -0.4948292374610901, -1.1651428937911987, -1.2755075693130493, -0.5116338133811951, -1.0257058143615723, -0.9454134106636047, 1.0394936800003052, 0.7423096895217896, 0.2800881266593933, 1.9359248876571655, 0.7298718094825745, 0.21466438472270966, -2.627192258834839, 0.8854115009307861, 0.32834136486053467, -0.09146910160779953, 0.9132515788078308, 0.3696137070655823, 1.076468825340271, 0.03370999917387962, 0.5214048027992249, -2.4360272884368896, 2.331709384918213, -0.18659773468971252, 0.6950557827949524, -0.07726342976093292, -0.1920653134584427, 1.1241225004196167, 0.516197144985199, 0.5104966759681702, -1.0715124607086182, 0.6597827672958374, -0.7198266386985779, 1.2567356824874878, 0.8945914506912231, -0.8911714553833008, 0.026257526129484177, 1.3543586730957031, 0.48562461137771606, -0.39798861742019653, -0.8789203763008118, -0.9219974279403687, 1.0086522102355957, 1.6933512687683105, -0.07755044102668762, 0.12220403552055359, 0.8878823518753052, 0.6054596304893494, -1.370755672454834, 0.0127992182970047, -0.7466835975646973, -0.7409812808036804, 1.6898607015609741, 2.1275112628936768, -0.11153567582368851, -0.1606741100549698, -0.8259465098381042, -1.3127493858337402, 0.8023203611373901, -0.05674797296524048, 0.0908440425992012, 0.5950449109077454, -0.7445809245109558, 1.2486140727996826, 0.7225682735443115, 0.8699426054954529, 0.13586539030075073, 0.3135075569152832, 0.39344924688339233, -0.45722198486328125, -1.0621581077575684, -0.23681692779064178, -1.2357455492019653, -2.5070598125457764, 0.45239144563674927, -0.15954872965812683, -1.37394118309021, 0.02095053344964981, -1.0773156881332397, 0.9337798357009888, -0.4836035966873169, -1.0922977924346924, -1.527097225189209, 0.2273828685283661, -0.1757543683052063, 1.0002630949020386, -1.5725215673446655, -0.1223004013299942, 1.1752004623413086, 0.871262788772583, -0.7380805611610413, 0.9643128514289856, 0.2542378902435303, 0.9851192235946655, 0.8624797463417053, -0.3163291811943054, 0.5278475880622864, -0.04680756852030754, -1.3441814184188843, 0.4591841697692871, 1.331676721572876, 0.1752406358718872, 1.4534021615982056, -0.5829220414161682, -0.02630266174674034, 0.3179112672805786, -0.3752579092979431, -0.48565107583999634, -0.543817400932312, 0.6217566728591919, 0.1979990154504776, -0.9359690546989441, 0.02785322442650795, -0.04101847484707832, -0.22034722566604614, 0.18351274728775024, -1.526809811592102, -0.130111962556839, -0.3590853214263916, -0.49704378843307495, -1.2734930515289307, 0.12576723098754883, 1.3255670070648193, -0.7401613593101501, -0.15174441039562225, 0.4000205397605896, 0.35712099075317383, 0.5609422326087952, 0.6551812887191772, -0.6037617325782776, -0.4475492238998413, -0.32183635234832764, -0.2842298150062561, 0.29462528228759766, 1.254367709159851, -0.16515646874904633, -0.9402931928634644, 0.7553282380104065, -0.4386675953865051, 0.03786357492208481, 1.878270149230957, -0.016134046018123627, -0.7947442531585693, 0.2574082612991333, -0.6079264283180237, 1.9955840110778809, 1.7178958654403687, 1.2146852016448975, -0.19410189986228943, -0.9368679523468018, 0.687154233455658, -0.3017463684082031, -0.250434011220932, 0.9082102179527283, 0.37718403339385986, -0.2536429762840271, -1.4421920776367188, 0.3989778757095337, 1.336848497390747, -0.8739303350448608, -0.8876754641532898, 0.07026943564414978, -0.8200503587722778, 1.1019428968429565, 0.675844132900238, 0.39809608459472656, 0.33190351724624634, 1.594413161277771, 0.7632088661193848, -0.5464234352111816, 0.6192967891693115, 0.4994964599609375, -0.09656085073947906, -2.1393229961395264, -1.095689058303833, 0.3182374835014343, -0.32625681161880493, -1.5928465127944946, 1.4034042358398438, -1.1216095685958862, -0.9973645210266113, 0.6418485641479492, 0.057579368352890015, 1.3733649253845215, 0.29434192180633545, 1.5489277839660645, 2.093447685241699, 0.8432849645614624, 0.32577741146087646, 1.2128517627716064, -0.1781471222639084, -0.5626269578933716, 1.8498728275299072, -0.4351072907447815, 0.45708370208740234, 1.0469093322753906, -0.37415146827697754, -0.9557430148124695, -0.7356040477752686, -1.234791874885559, -0.7469436526298523, 1.2508598566055298, 0.016723722219467163, -1.1348598003387451, 0.30208438634872437, 1.60723078250885, 0.09491704404354095, -0.3322064280509949, 0.6568492650985718, 0.45257294178009033, -0.7763740420341492, -0.03911445289850235, -0.880474865436554, 0.5362651944160461, -0.07200730592012405, -0.25128623843193054, 0.3428040146827698, 0.4227348566055298, 1.2711730003356934, -0.12650832533836365, 0.2286594808101654, 1.1222537755966187, -1.5088798999786377, 1.6368318796157837, -0.6330606341362, 0.21330754458904266, -2.432973623275757, 1.4058952331542969, -0.7298106551170349, 1.8658257722854614, -2.618492841720581, 0.29365289211273193, -0.6068987846374512, -0.4650023579597473, 0.3173988461494446, -0.3031767010688782, 0.195843905210495, -0.24834157526493073, -1.0343084335327148, -0.16971679031848907, -0.7158461809158325, 0.41057366132736206, 1.0673166513442993, 1.2711455821990967, -0.9935089349746704, -0.2576720714569092, -1.7802983522415161, -0.0644281655550003, -0.6059911251068115, 0.28523147106170654, -1.9960787296295166, -0.18073821067810059, -1.9849544763565063, -2.255537271499634, -1.4131050109863281, -0.8269692659378052, 0.9938817620277405, 0.14350755512714386, -0.9958436489105225, 1.1634037494659424, -0.45685040950775146, -1.7850120067596436, 1.082967758178711, -2.1435048580169678 ]
https://github.com/huggingface/datasets/issues/3172
`SystemError 15` thrown in `Dataset.__del__` when using `Dataset.map()` with `num_proc>1`
NB: even if the error is raised, the dataset is successfully cached. So restarting the script after every `map()` allows to ultimately run the whole preprocessing. But this prevents to realistically run the code over multiple nodes.
## Describe the bug I use `datasets.map` to preprocess some data in my application. The error `SystemError 15` is thrown at the end of the execution of `Dataset.map()` (only with `num_proc>1`. Traceback included bellow. The exception is raised only when the code runs within a specific context. Despite ~10h spent investigating this issue, I have failed to isolate the bug, so let me describe my setup. In my project, `Dataset` is wrapped into a `LightningDataModule` and the data is preprocessed when calling `LightningDataModule.setup()`. Calling `.setup()` in an isolated script works fine (even when wrapped with `hydra.main()`). However, when calling `.setup()` within the experiment script (depends on `pytorch_lightning`), the script crashes and `SystemError 15`. I could avoid throwing this error by modifying ` Dataset.__del__()` (see bellow), but I believe this only moves the problem somewhere else. I am completely stuck with this issue, any hint would be welcome. ```python class Dataset() ... def __del__(self): if hasattr(self, "_data"): _ = self._data # <- ugly trick that allows avoiding the issue. del self._data if hasattr(self, "_indices"): del self._indices ``` ## Steps to reproduce the bug ```python # Unfortunately I couldn't isolate the bug. ``` ## Expected results Calling `Dataset.map()` without throwing an exception. Or at least raising a more detailed exception/traceback. ## Actual results ``` Exception ignored in: <function Dataset.__del__ at 0x7f7cec179160>β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:05<00:00, 1.17ba/s] Traceback (most recent call last): File ".../python3.8/site-packages/datasets/arrow_dataset.py", line 906, in __del__ del self._data File ".../python3.8/site-packages/ray/worker.py", line 1033, in sigterm_handler sys.exit(signum) SystemExit: 15 ``` ## Environment info Tested on 2 environments: **Environment 1.** - `datasets` version: 1.14.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 6.0.0 **Environment 2.** - `datasets` version: 1.14.0 - Platform: Linux-4.18.0-305.19.1.el8_4.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.7 - PyArrow version: 6.0.0
1,141
37
`SystemError 15` thrown in `Dataset.__del__` when using `Dataset.map()` with `num_proc>1` ## Describe the bug I use `datasets.map` to preprocess some data in my application. The error `SystemError 15` is thrown at the end of the execution of `Dataset.map()` (only with `num_proc>1`. Traceback included bellow. The exception is raised only when the code runs within a specific context. Despite ~10h spent investigating this issue, I have failed to isolate the bug, so let me describe my setup. In my project, `Dataset` is wrapped into a `LightningDataModule` and the data is preprocessed when calling `LightningDataModule.setup()`. Calling `.setup()` in an isolated script works fine (even when wrapped with `hydra.main()`). However, when calling `.setup()` within the experiment script (depends on `pytorch_lightning`), the script crashes and `SystemError 15`. I could avoid throwing this error by modifying ` Dataset.__del__()` (see bellow), but I believe this only moves the problem somewhere else. I am completely stuck with this issue, any hint would be welcome. ```python class Dataset() ... def __del__(self): if hasattr(self, "_data"): _ = self._data # <- ugly trick that allows avoiding the issue. del self._data if hasattr(self, "_indices"): del self._indices ``` ## Steps to reproduce the bug ```python # Unfortunately I couldn't isolate the bug. ``` ## Expected results Calling `Dataset.map()` without throwing an exception. Or at least raising a more detailed exception/traceback. ## Actual results ``` Exception ignored in: <function Dataset.__del__ at 0x7f7cec179160>β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:05<00:00, 1.17ba/s] Traceback (most recent call last): File ".../python3.8/site-packages/datasets/arrow_dataset.py", line 906, in __del__ del self._data File ".../python3.8/site-packages/ray/worker.py", line 1033, in sigterm_handler sys.exit(signum) SystemExit: 15 ``` ## Environment info Tested on 2 environments: **Environment 1.** - `datasets` version: 1.14.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 6.0.0 **Environment 2.** - `datasets` version: 1.14.0 - Platform: Linux-4.18.0-305.19.1.el8_4.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.7 - PyArrow version: 6.0.0 NB: even if the error is raised, the dataset is successfully cached. So restarting the script after every `map()` allows to ultimately run the whole preprocessing. But this prevents to realistically run the code over multiple nodes.
[ -1.1256572008132935, -0.8851135969161987, -0.6827611327171326, 1.450364589691162, -0.18745926022529602, -1.290369987487793, 0.28105470538139343, -1.0788518190383911, 1.776857614517212, -0.7800658345222473, 0.3009101152420044, -1.6550285816192627, 0.0002498980611562729, -0.5880305767059326, -0.8328458666801453, -0.8398420810699463, -0.46488770842552185, -0.7566807270050049, 1.0313377380371094, 2.4417684078216553, 1.2001439332962036, -1.3132323026657104, 2.656473398208618, 0.6554797887802124, -0.18419556319713593, -1.0346837043762207, 0.49875620007514954, -0.0631626546382904, -1.2786885499954224, -0.4345577657222748, -0.9413286447525024, -0.09351061284542084, -0.5938616991043091, -0.6227636337280273, 0.03103751689195633, 0.4725525677204132, -0.3422357738018036, -0.5643664598464966, -0.46326813101768494, -0.8602815270423889, 0.5096392035484314, -0.3299400210380554, 0.9322617650032043, -0.3254329264163971, 1.8171533346176147, -0.658410906791687, 0.5608736872673035, 0.78468918800354, 1.332165002822876, 0.24964159727096558, -0.09249693155288696, 0.4723278284072876, 0.4520961344242096, 0.12562021613121033, 0.5211244225502014, 1.1947753429412842, 0.580953061580658, 0.5343669056892395, 0.7413530349731445, -2.2397196292877197, 1.2194092273712158, -1.0046905279159546, 0.3126879632472992, 1.1795990467071533, -0.9274096488952637, 0.22089751064777374, -1.8029508590698242, -0.05870671942830086, 0.5719430446624756, -2.213547706604004, 0.2972020208835602, -1.3876606225967407, -0.40899959206581116, 1.0678236484527588, 0.43406835198402405, -1.2715147733688354, 0.07816673815250397, -0.36092323064804077, 0.9936730265617371, 0.38598713278770447, 1.1278703212738037, -1.6837141513824463, -0.0551098957657814, -0.3416042625904083, 0.18259499967098236, -1.1867284774780273, -1.513588786125183, 0.6046320796012878, 0.7238010168075562, 0.5162524580955505, -0.2254912108182907, 1.0352404117584229, -0.9168687462806702, 0.7408739328384399, -0.9772177934646606, -1.883586049079895, -1.4023433923721313, -2.1214842796325684, -2.2628729343414307, 0.7284823656082153, -0.4411376416683197, -0.47997015714645386, 2.100285530090332, -0.9448794722557068, -1.819656252861023, 1.0821101665496826, 0.2536468207836151, -0.07068666815757751, 2.250727891921997, 0.28069472312927246, -0.715405285358429, 0.4259248375892639, -0.7435665726661682, 0.7547957301139832, -0.3539869785308838, 1.3659608364105225, 0.37584006786346436, -1.0518555641174316, 1.6155160665512085, -0.27898362278938293, 0.6422792077064514, -0.7466445565223694, -0.4949314296245575, -0.6895550489425659, 0.31276845932006836, 2.01255202293396, -0.3590109050273895, 1.4889633655548096, -0.37569019198417664, -1.599100112915039, -1.5663660764694214, 0.9026719331741333, 0.47708386182785034, -0.7198726534843445, 0.10950572788715363, -0.4137439429759979, 0.10788024961948395, -0.03529128432273865, 1.2491588592529297, 1.316269874572754, 0.8903676271438599, -0.36315178871154785, -0.848163902759552, 0.13640987873077393, 0.04906804487109184, -0.7426098585128784, -1.7991946935653687, -0.3991987407207489, 0.11622445285320282, 0.602918803691864, -1.061003565788269, 1.7558706998825073, 0.8412637114524841, 1.9321482181549072, 1.0658618211746216, -0.3206773102283478, 1.4665507078170776, 0.10625492036342621, 1.9067286252975464, -0.36774080991744995, 0.6174294352531433, -0.39188703894615173, -1.1916775703430176, 0.8629434108734131, -0.24865280091762543, -2.0725581645965576, -0.6951000094413757, -0.8145115971565247, -0.10771980881690979, -0.7138111591339111, 0.9153690934181213, -0.27556097507476807, -1.4369935989379883, 0.1755976527929306, -0.8097484111785889, 0.05591558292508125, -1.2071272134780884, 0.2996244728565216, 0.6622897982597351, -0.682598352432251, 0.20779429376125336, -0.2674912214279175, -1.2895643711090088, -0.5156000256538391, 0.3085595965385437, 1.8243392705917358, -0.79152512550354, 0.9986351132392883, 1.0941089391708374, -0.7032536864280701, -0.02391093596816063, 0.37832534313201904, -0.3468831181526184, 0.8307851552963257, -1.0630887746810913, -0.39549046754837036, 1.224774956703186, -0.1808282881975174, -0.6521210670471191, 1.481584906578064, 0.6662384867668152, -0.9941486120223999, -0.0970136970281601, -0.17068782448768616, -0.9077270030975342, 0.07152664661407471, -1.6590867042541504, -0.1309569776058197, 0.47895997762680054, -1.5626815557479858, -0.5366502404212952, -0.18712930381298065, 1.2956620454788208, -0.0588165782392025, 1.4210543632507324, -0.32888391613960266, -0.1957520693540573, -0.3904247283935547, -0.3536050021648407, 0.055787574499845505, -0.21273471415042877, -0.5968838334083557, 0.2063848376274109, -0.754740834236145, 0.3822382688522339, 1.4673802852630615, 0.21162597835063934, -0.017474358901381493, 0.5533021092414856, 1.1048816442489624, 0.32955875992774963, -0.056312445551157, -0.8514382243156433, -1.6091350317001343, 2.0121049880981445, -1.3892710208892822, 1.945712685585022, 0.6818687915802002, -0.04188718646764755, -1.7913721799850464, -1.9406428337097168, 1.3878692388534546, 1.1167303323745728, 2.3515326976776123, 0.5745888352394104, 0.40398961305618286, -0.7448040843009949, -0.593031108379364, 0.36983922123908997, -1.061010718345642, -0.7084890604019165, 0.16293826699256897, 2.387950897216797, 1.7465847730636597, -0.504570484161377, -0.17893800139427185, -1.05910062789917, 1.4176323413848877, -0.2159620225429535, 0.23104405403137207, 1.979678750038147, -0.21407240629196167, -1.0545393228530884, 1.285610556602478, -2.2251362800598145, 0.19788962602615356, 2.01373291015625, 0.1350318193435669, 0.12835414707660675, -1.4375592470169067, -0.5798381567001343, -0.2058178186416626, -0.4029817581176758, -1.1880003213882446, 0.5455441474914551, -0.22250111401081085, -0.7894684076309204, -1.3852072954177856, 0.20378705859184265, -1.0570365190505981, -1.7277557849884033, 0.17312008142471313, 1.9437975883483887, 1.9305503368377686, -0.6513479948043823, 1.622961401939392, -0.36760199069976807, 0.20848922431468964, 1.279296636581421, 1.2366814613342285, 3.143890380859375, 1.9039387702941895, -1.2986012697219849, 0.7172440886497498, -0.11582189798355103, -0.49989232420921326, 1.2136896848678589, -1.1960197687149048, 1.1963564157485962, -0.25852736830711365, -1.1867953538894653, -1.2045578956604004, 0.9275686740875244, 0.47705021500587463, 0.04065284878015518, -0.42189064621925354, 1.161603331565857, 0.076618492603302, 1.333850383758545, 0.5476053357124329, -0.3358871638774872, 0.7802925705909729, -0.35833457112312317, -0.4552901089191437, 1.5148905515670776, 0.32647624611854553, -1.3221063613891602, -2.2842776775360107, -0.17726744711399078, -0.863450288772583, 0.1463879942893982, -0.5855915546417236, -0.9440304040908813, 1.6235381364822388, 0.38594186305999756, -1.2561440467834473, -0.31195685267448425, -0.33187800645828247, -0.5652783513069153, 2.698890447616577, -1.2904778718948364, -0.2768386900424957, -0.9892630577087402, -0.6394625306129456, 1.6925419569015503, -1.213563323020935, -0.2602498531341553, -0.9811103343963623, -0.44718554615974426, -1.241684079170227, -0.6285310983657837, 0.04549071565270424, -0.9443247318267822, 0.9125984311103821, 0.14430342614650726, -1.237990140914917, -0.30239516496658325, -0.8821237087249756, 0.9453220367431641, -0.1521906554698944, 0.13408491015434265, 1.943935513496399, 0.4243132770061493, -0.3934699296951294, 0.752065122127533, 1.071365475654602, 0.5532503128051758, -0.5199944972991943, 0.3454991281032562, -0.6669015884399414, 0.2521202266216278, -1.335314154624939, 0.2655823230743408, -2.827345609664917, 0.612137496471405, -0.025905292481184006, 0.010473627597093582, -0.05619727820158005, -1.3931022882461548, 1.0213135480880737, 2.609795570373535, -1.2326016426086426, 0.4299182891845703, 0.32069259881973267, 1.2069061994552612, -1.5001487731933594, 0.3034454882144928, -0.4421710669994354, 2.1518516540527344, 0.21441863477230072, 1.2293845415115356, -0.3500826358795166, -2.268148422241211, 0.6669782400131226, -1.2451121807098389, -1.2197673320770264, 0.8028319478034973, -0.8424441814422607, 0.01859452575445175, -1.3471077680587769, -0.21421334147453308, -0.8103446960449219, -1.1686551570892334, 0.6992774605751038, 0.17010745406150818, 0.4942394196987152, -0.6376447081565857, 0.3196348547935486, -2.138154983520508, -1.3043209314346313, -0.2796347439289093, -0.9749016761779785, 0.43575018644332886, -0.29804307222366333, 0.6503849625587463, -0.27595511078834534, 0.0007189027965068817, 0.4292791187763214, 1.484238862991333, 3.4338929653167725, 0.16716323792934418, 0.16728296875953674, -0.24853019416332245, -0.8871904611587524, 1.3692466020584106, 0.9222357869148254, -0.2334168404340744, -0.5791563987731934, -1.0344270467758179, 1.1498823165893555, 2.0337934494018555, 0.9404385685920715, 0.06083684787154198, -0.8415759801864624, -0.8090225458145142, -0.04705885797739029, 0.07734565436840057, 0.4781356453895569, 0.8644660115242004, 0.20491473376750946, 0.08721879124641418, 1.324256420135498, 1.0824192762374878, -0.41132599115371704, 0.4301898181438446, -0.8571598529815674, -0.4440683126449585, 0.5364218354225159, 0.35720524191856384, 0.00860566832125187, 0.26002028584480286, -1.0397617816925049, -0.2446349859237671, -0.4107992947101593, -0.9009073376655579, -0.7843169569969177, -0.38671112060546875, -0.3535517752170563, 1.6242355108261108, 0.05445462837815285, -0.49030372500419617, -0.08420217037200928, -0.6766005754470825, -0.040859878063201904, -0.9671544432640076, 0.3167932629585266, -0.12336240708827972, -0.1262984275817871, -0.08134107291698456, 1.6582674980163574, -0.8947870135307312, -1.9590671062469482, 0.33396705985069275, 0.1514335423707962, -0.3863726556301117, 0.27468329668045044, 1.6435197591781616, 0.6286851763725281, 1.3950457572937012, 1.4723930358886719, 0.9596198797225952, -0.6562865376472473, -1.2895303964614868, 0.6201711297035217, 0.8992021083831787, -1.4636752605438232, 0.6784982085227966, 0.13382083177566528, -0.45932990312576294, 0.6270835995674133, 1.2404096126556396, 0.5037272572517395, -2.08801531791687, 0.7199451327323914, -0.8933514356613159, 0.7483136057853699, 0.700383722782135, 0.707467794418335, 0.2012716680765152, 0.800986111164093, -1.1491801738739014, -1.1619906425476074, -0.7496136426925659, -0.7618401646614075, 1.941922903060913, -0.2131803035736084, 0.5023368000984192, -0.15400634706020355, -1.405354380607605, -0.216307133436203, 0.7118403911590576, 0.37544670701026917, -0.6231978535652161, 0.6890423893928528, -0.5782482624053955, -1.06142258644104, -1.3435882329940796, -0.5014569163322449, -1.1226370334625244, -0.9651176333427429, 0.9083344340324402, 0.7784411907196045, 0.3471324145793915, 1.8303362131118774, 0.666248619556427, 0.24748492240905762, -2.6183061599731445, 0.9160643815994263, 0.3745294511318207, -0.13144391775131226, 0.8030384182929993, 0.3374793231487274, 0.9665696024894714, -0.10230948030948639, 0.6941930055618286, -2.4074573516845703, 2.309725046157837, -0.20172595977783203, 0.6269664764404297, 0.048287104815244675, -0.22309726476669312, 1.0478202104568481, 0.5346261262893677, 0.6030502915382385, -1.1084171533584595, 0.6766266226768494, -0.7099647521972656, 1.2492144107818604, 0.7631498575210571, -0.8465299010276794, -0.061163466423749924, 1.422778606414795, 0.48616063594818115, -0.5205634832382202, -0.904366135597229, -1.0791062116622925, 0.9548395872116089, 1.716349720954895, -0.1638934165239334, -0.017423423007130623, 0.8671590685844421, 0.6997189521789551, -1.3234875202178955, 0.02426641434431076, -0.7772929072380066, -0.7391695380210876, 1.5955621004104614, 2.092367172241211, -0.19509834051132202, -0.17493924498558044, -0.8517513275146484, -1.250156044960022, 0.8449327945709229, -0.0030264807865023613, -0.0015910957008600235, 0.6264957189559937, -0.5645798444747925, 1.208782434463501, 0.857281506061554, 0.9540154933929443, 0.2660459578037262, 0.3524121940135956, 0.29573291540145874, -0.33973583579063416, -1.1989818811416626, -0.28339478373527527, -1.0124753713607788, -2.523211717605591, 0.5218673348426819, -0.19121037423610687, -1.4696567058563232, 0.074787437915802, -1.0653518438339233, 0.8431699872016907, -0.588082492351532, -1.089103102684021, -1.4600670337677002, 0.20788909494876862, -0.013197531923651695, 0.9112851619720459, -1.5879583358764648, -0.018412217497825623, 1.2563618421554565, 0.8984710574150085, -0.7705352902412415, 0.9235518574714661, 0.34506309032440186, 1.0428180694580078, 0.9951356053352356, -0.38534244894981384, 0.5369171500205994, 0.008019614964723587, -1.2928611040115356, 0.4937233030796051, 1.1904674768447876, 0.15186630189418793, 1.4969810247421265, -0.608112633228302, 0.005845417268574238, 0.4163549542427063, -0.528562605381012, -0.44570472836494446, -0.6192602515220642, 0.6253646016120911, -0.012371551245450974, -0.8969449996948242, -0.0007082736119627953, 0.03296200558543205, -0.168334499001503, 0.24862927198410034, -1.5707752704620361, -0.12711238861083984, -0.2677106261253357, -0.6588118672370911, -1.1837859153747559, -0.17556855082511902, 1.4215868711471558, -0.736097514629364, -0.20929500460624695, 0.5377440452575684, 0.3135983943939209, 0.5456671714782715, 0.5739179253578186, -0.7002539038658142, -0.42350658774375916, -0.2682572603225708, -0.39719831943511963, 0.3374054729938507, 1.4433603286743164, -0.024901017546653748, -0.9466163516044617, 0.7787512540817261, -0.40996238589286804, 0.034227583557367325, 1.869588017463684, 0.11567479372024536, -0.8552009463310242, 0.22155043482780457, -0.6774331331253052, 1.9680471420288086, 1.8116118907928467, 1.2483922243118286, 0.003069048747420311, -1.0614922046661377, 0.5351414680480957, -0.36952802538871765, -0.3862428367137909, 0.8344606161117554, 0.3550645112991333, -0.23517292737960815, -1.3135881423950195, 0.7371501922607422, 1.3275279998779297, -0.843223512172699, -0.9434491395950317, 0.058756452053785324, -0.7547898888587952, 1.0933679342269897, 0.7331910729408264, 0.3430050015449524, 0.18015196919441223, 1.574092984199524, 0.7847505211830139, -0.343099445104599, 0.5926638841629028, 0.47304025292396545, -0.0710069090127945, -2.1879260540008545, -1.1921637058258057, 0.38965100049972534, -0.5062064528465271, -1.715299129486084, 1.4160356521606445, -1.1532301902770996, -0.9558315873146057, 0.5252717137336731, 0.0745379626750946, 1.511203408241272, 0.3993036150932312, 1.591766595840454, 2.0531787872314453, 0.911801815032959, 0.4185022711753845, 1.3413052558898926, -0.15401577949523926, -0.5236106514930725, 1.7758210897445679, -0.48907437920570374, 0.49330028891563416, 1.0757790803909302, -0.3068802058696747, -1.0614389181137085, -0.8166137337684631, -1.299529790878296, -0.7803850173950195, 1.1188864707946777, 0.03789159283041954, -1.1882052421569824, 0.3258931636810303, 1.5990850925445557, 0.13562506437301636, -0.3090306520462036, 0.7023259401321411, 0.32910117506980896, -0.8428872227668762, -0.03736010938882828, -0.9112192988395691, 0.4836830794811249, -0.1716383993625641, -0.39844855666160583, 0.3937656283378601, 0.41436439752578735, 1.2797590494155884, -0.0736151933670044, 0.057256389409303665, 1.1225239038467407, -1.4697290658950806, 1.5157629251480103, -0.7205516695976257, 0.3233727812767029, -2.3524134159088135, 1.3698228597640991, -0.8236557245254517, 1.8964029550552368, -2.6710548400878906, 0.4111056625843048, -0.5415371656417847, -0.5036700963973999, 0.21309800446033478, -0.26349714398384094, 0.09993405640125275, -0.16259706020355225, -1.2111244201660156, -0.058873120695352554, -0.7407782673835754, 0.6668990254402161, 1.0744984149932861, 1.4280189275741577, -1.1201752424240112, -0.2537951171398163, -1.7557443380355835, -0.1013275682926178, -0.6206730604171753, 0.3856459856033325, -1.9752486944198608, -0.11955741047859192, -1.9247384071350098, -2.3604791164398193, -1.2502902746200562, -0.8510486483573914, 1.002915859222412, 0.07726047933101654, -0.8174768686294556, 1.1634764671325684, -0.3921872675418854, -1.9518882036209106, 1.107117772102356, -2.1926987171173096 ]
https://github.com/huggingface/datasets/issues/3172
`SystemError 15` thrown in `Dataset.__del__` when using `Dataset.map()` with `num_proc>1`
Hi, It's not easy to debug the problem without the script. I may be wrong since I'm not very familiar with PyTorch Lightning, but shouldn't you preprocess the data in the `prepare_data` function of `LightningDataModule` and not in the `setup` function. As you can't modify the module state in `prepare_data` (according to the docs), use the `cache_file_name` argument in `Dataset.map` there, and reload the processed data in `setup` with `Dataset.from_file(cache_file_name)`. If `num_proc>1`, check the docs on the `suffix_template` argument of `Dataset.map` to get an idea what the final `cache_file_names` are going to be. Let me know if this helps.
## Describe the bug I use `datasets.map` to preprocess some data in my application. The error `SystemError 15` is thrown at the end of the execution of `Dataset.map()` (only with `num_proc>1`. Traceback included bellow. The exception is raised only when the code runs within a specific context. Despite ~10h spent investigating this issue, I have failed to isolate the bug, so let me describe my setup. In my project, `Dataset` is wrapped into a `LightningDataModule` and the data is preprocessed when calling `LightningDataModule.setup()`. Calling `.setup()` in an isolated script works fine (even when wrapped with `hydra.main()`). However, when calling `.setup()` within the experiment script (depends on `pytorch_lightning`), the script crashes and `SystemError 15`. I could avoid throwing this error by modifying ` Dataset.__del__()` (see bellow), but I believe this only moves the problem somewhere else. I am completely stuck with this issue, any hint would be welcome. ```python class Dataset() ... def __del__(self): if hasattr(self, "_data"): _ = self._data # <- ugly trick that allows avoiding the issue. del self._data if hasattr(self, "_indices"): del self._indices ``` ## Steps to reproduce the bug ```python # Unfortunately I couldn't isolate the bug. ``` ## Expected results Calling `Dataset.map()` without throwing an exception. Or at least raising a more detailed exception/traceback. ## Actual results ``` Exception ignored in: <function Dataset.__del__ at 0x7f7cec179160>β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:05<00:00, 1.17ba/s] Traceback (most recent call last): File ".../python3.8/site-packages/datasets/arrow_dataset.py", line 906, in __del__ del self._data File ".../python3.8/site-packages/ray/worker.py", line 1033, in sigterm_handler sys.exit(signum) SystemExit: 15 ``` ## Environment info Tested on 2 environments: **Environment 1.** - `datasets` version: 1.14.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 6.0.0 **Environment 2.** - `datasets` version: 1.14.0 - Platform: Linux-4.18.0-305.19.1.el8_4.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.7 - PyArrow version: 6.0.0
1,141
99
`SystemError 15` thrown in `Dataset.__del__` when using `Dataset.map()` with `num_proc>1` ## Describe the bug I use `datasets.map` to preprocess some data in my application. The error `SystemError 15` is thrown at the end of the execution of `Dataset.map()` (only with `num_proc>1`. Traceback included bellow. The exception is raised only when the code runs within a specific context. Despite ~10h spent investigating this issue, I have failed to isolate the bug, so let me describe my setup. In my project, `Dataset` is wrapped into a `LightningDataModule` and the data is preprocessed when calling `LightningDataModule.setup()`. Calling `.setup()` in an isolated script works fine (even when wrapped with `hydra.main()`). However, when calling `.setup()` within the experiment script (depends on `pytorch_lightning`), the script crashes and `SystemError 15`. I could avoid throwing this error by modifying ` Dataset.__del__()` (see bellow), but I believe this only moves the problem somewhere else. I am completely stuck with this issue, any hint would be welcome. ```python class Dataset() ... def __del__(self): if hasattr(self, "_data"): _ = self._data # <- ugly trick that allows avoiding the issue. del self._data if hasattr(self, "_indices"): del self._indices ``` ## Steps to reproduce the bug ```python # Unfortunately I couldn't isolate the bug. ``` ## Expected results Calling `Dataset.map()` without throwing an exception. Or at least raising a more detailed exception/traceback. ## Actual results ``` Exception ignored in: <function Dataset.__del__ at 0x7f7cec179160>β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:05<00:00, 1.17ba/s] Traceback (most recent call last): File ".../python3.8/site-packages/datasets/arrow_dataset.py", line 906, in __del__ del self._data File ".../python3.8/site-packages/ray/worker.py", line 1033, in sigterm_handler sys.exit(signum) SystemExit: 15 ``` ## Environment info Tested on 2 environments: **Environment 1.** - `datasets` version: 1.14.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 6.0.0 **Environment 2.** - `datasets` version: 1.14.0 - Platform: Linux-4.18.0-305.19.1.el8_4.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.7 - PyArrow version: 6.0.0 Hi, It's not easy to debug the problem without the script. I may be wrong since I'm not very familiar with PyTorch Lightning, but shouldn't you preprocess the data in the `prepare_data` function of `LightningDataModule` and not in the `setup` function. As you can't modify the module state in `prepare_data` (according to the docs), use the `cache_file_name` argument in `Dataset.map` there, and reload the processed data in `setup` with `Dataset.from_file(cache_file_name)`. If `num_proc>1`, check the docs on the `suffix_template` argument of `Dataset.map` to get an idea what the final `cache_file_names` are going to be. Let me know if this helps.
[ -1.1256572008132935, -0.8851135969161987, -0.6827611327171326, 1.450364589691162, -0.18745926022529602, -1.290369987487793, 0.28105470538139343, -1.0788518190383911, 1.776857614517212, -0.7800658345222473, 0.3009101152420044, -1.6550285816192627, 0.0002498980611562729, -0.5880305767059326, -0.8328458666801453, -0.8398420810699463, -0.46488770842552185, -0.7566807270050049, 1.0313377380371094, 2.4417684078216553, 1.2001439332962036, -1.3132323026657104, 2.656473398208618, 0.6554797887802124, -0.18419556319713593, -1.0346837043762207, 0.49875620007514954, -0.0631626546382904, -1.2786885499954224, -0.4345577657222748, -0.9413286447525024, -0.09351061284542084, -0.5938616991043091, -0.6227636337280273, 0.03103751689195633, 0.4725525677204132, -0.3422357738018036, -0.5643664598464966, -0.46326813101768494, -0.8602815270423889, 0.5096392035484314, -0.3299400210380554, 0.9322617650032043, -0.3254329264163971, 1.8171533346176147, -0.658410906791687, 0.5608736872673035, 0.78468918800354, 1.332165002822876, 0.24964159727096558, -0.09249693155288696, 0.4723278284072876, 0.4520961344242096, 0.12562021613121033, 0.5211244225502014, 1.1947753429412842, 0.580953061580658, 0.5343669056892395, 0.7413530349731445, -2.2397196292877197, 1.2194092273712158, -1.0046905279159546, 0.3126879632472992, 1.1795990467071533, -0.9274096488952637, 0.22089751064777374, -1.8029508590698242, -0.05870671942830086, 0.5719430446624756, -2.213547706604004, 0.2972020208835602, -1.3876606225967407, -0.40899959206581116, 1.0678236484527588, 0.43406835198402405, -1.2715147733688354, 0.07816673815250397, -0.36092323064804077, 0.9936730265617371, 0.38598713278770447, 1.1278703212738037, -1.6837141513824463, -0.0551098957657814, -0.3416042625904083, 0.18259499967098236, -1.1867284774780273, -1.513588786125183, 0.6046320796012878, 0.7238010168075562, 0.5162524580955505, -0.2254912108182907, 1.0352404117584229, -0.9168687462806702, 0.7408739328384399, -0.9772177934646606, -1.883586049079895, -1.4023433923721313, -2.1214842796325684, -2.2628729343414307, 0.7284823656082153, -0.4411376416683197, -0.47997015714645386, 2.100285530090332, -0.9448794722557068, -1.819656252861023, 1.0821101665496826, 0.2536468207836151, -0.07068666815757751, 2.250727891921997, 0.28069472312927246, -0.715405285358429, 0.4259248375892639, -0.7435665726661682, 0.7547957301139832, -0.3539869785308838, 1.3659608364105225, 0.37584006786346436, -1.0518555641174316, 1.6155160665512085, -0.27898362278938293, 0.6422792077064514, -0.7466445565223694, -0.4949314296245575, -0.6895550489425659, 0.31276845932006836, 2.01255202293396, -0.3590109050273895, 1.4889633655548096, -0.37569019198417664, -1.599100112915039, -1.5663660764694214, 0.9026719331741333, 0.47708386182785034, -0.7198726534843445, 0.10950572788715363, -0.4137439429759979, 0.10788024961948395, -0.03529128432273865, 1.2491588592529297, 1.316269874572754, 0.8903676271438599, -0.36315178871154785, -0.848163902759552, 0.13640987873077393, 0.04906804487109184, -0.7426098585128784, -1.7991946935653687, -0.3991987407207489, 0.11622445285320282, 0.602918803691864, -1.061003565788269, 1.7558706998825073, 0.8412637114524841, 1.9321482181549072, 1.0658618211746216, -0.3206773102283478, 1.4665507078170776, 0.10625492036342621, 1.9067286252975464, -0.36774080991744995, 0.6174294352531433, -0.39188703894615173, -1.1916775703430176, 0.8629434108734131, -0.24865280091762543, -2.0725581645965576, -0.6951000094413757, -0.8145115971565247, -0.10771980881690979, -0.7138111591339111, 0.9153690934181213, -0.27556097507476807, -1.4369935989379883, 0.1755976527929306, -0.8097484111785889, 0.05591558292508125, -1.2071272134780884, 0.2996244728565216, 0.6622897982597351, -0.682598352432251, 0.20779429376125336, -0.2674912214279175, -1.2895643711090088, -0.5156000256538391, 0.3085595965385437, 1.8243392705917358, -0.79152512550354, 0.9986351132392883, 1.0941089391708374, -0.7032536864280701, -0.02391093596816063, 0.37832534313201904, -0.3468831181526184, 0.8307851552963257, -1.0630887746810913, -0.39549046754837036, 1.224774956703186, -0.1808282881975174, -0.6521210670471191, 1.481584906578064, 0.6662384867668152, -0.9941486120223999, -0.0970136970281601, -0.17068782448768616, -0.9077270030975342, 0.07152664661407471, -1.6590867042541504, -0.1309569776058197, 0.47895997762680054, -1.5626815557479858, -0.5366502404212952, -0.18712930381298065, 1.2956620454788208, -0.0588165782392025, 1.4210543632507324, -0.32888391613960266, -0.1957520693540573, -0.3904247283935547, -0.3536050021648407, 0.055787574499845505, -0.21273471415042877, -0.5968838334083557, 0.2063848376274109, -0.754740834236145, 0.3822382688522339, 1.4673802852630615, 0.21162597835063934, -0.017474358901381493, 0.5533021092414856, 1.1048816442489624, 0.32955875992774963, -0.056312445551157, -0.8514382243156433, -1.6091350317001343, 2.0121049880981445, -1.3892710208892822, 1.945712685585022, 0.6818687915802002, -0.04188718646764755, -1.7913721799850464, -1.9406428337097168, 1.3878692388534546, 1.1167303323745728, 2.3515326976776123, 0.5745888352394104, 0.40398961305618286, -0.7448040843009949, -0.593031108379364, 0.36983922123908997, -1.061010718345642, -0.7084890604019165, 0.16293826699256897, 2.387950897216797, 1.7465847730636597, -0.504570484161377, -0.17893800139427185, -1.05910062789917, 1.4176323413848877, -0.2159620225429535, 0.23104405403137207, 1.979678750038147, -0.21407240629196167, -1.0545393228530884, 1.285610556602478, -2.2251362800598145, 0.19788962602615356, 2.01373291015625, 0.1350318193435669, 0.12835414707660675, -1.4375592470169067, -0.5798381567001343, -0.2058178186416626, -0.4029817581176758, -1.1880003213882446, 0.5455441474914551, -0.22250111401081085, -0.7894684076309204, -1.3852072954177856, 0.20378705859184265, -1.0570365190505981, -1.7277557849884033, 0.17312008142471313, 1.9437975883483887, 1.9305503368377686, -0.6513479948043823, 1.622961401939392, -0.36760199069976807, 0.20848922431468964, 1.279296636581421, 1.2366814613342285, 3.143890380859375, 1.9039387702941895, -1.2986012697219849, 0.7172440886497498, -0.11582189798355103, -0.49989232420921326, 1.2136896848678589, -1.1960197687149048, 1.1963564157485962, -0.25852736830711365, -1.1867953538894653, -1.2045578956604004, 0.9275686740875244, 0.47705021500587463, 0.04065284878015518, -0.42189064621925354, 1.161603331565857, 0.076618492603302, 1.333850383758545, 0.5476053357124329, -0.3358871638774872, 0.7802925705909729, -0.35833457112312317, -0.4552901089191437, 1.5148905515670776, 0.32647624611854553, -1.3221063613891602, -2.2842776775360107, -0.17726744711399078, -0.863450288772583, 0.1463879942893982, -0.5855915546417236, -0.9440304040908813, 1.6235381364822388, 0.38594186305999756, -1.2561440467834473, -0.31195685267448425, -0.33187800645828247, -0.5652783513069153, 2.698890447616577, -1.2904778718948364, -0.2768386900424957, -0.9892630577087402, -0.6394625306129456, 1.6925419569015503, -1.213563323020935, -0.2602498531341553, -0.9811103343963623, -0.44718554615974426, -1.241684079170227, -0.6285310983657837, 0.04549071565270424, -0.9443247318267822, 0.9125984311103821, 0.14430342614650726, -1.237990140914917, -0.30239516496658325, -0.8821237087249756, 0.9453220367431641, -0.1521906554698944, 0.13408491015434265, 1.943935513496399, 0.4243132770061493, -0.3934699296951294, 0.752065122127533, 1.071365475654602, 0.5532503128051758, -0.5199944972991943, 0.3454991281032562, -0.6669015884399414, 0.2521202266216278, -1.335314154624939, 0.2655823230743408, -2.827345609664917, 0.612137496471405, -0.025905292481184006, 0.010473627597093582, -0.05619727820158005, -1.3931022882461548, 1.0213135480880737, 2.609795570373535, -1.2326016426086426, 0.4299182891845703, 0.32069259881973267, 1.2069061994552612, -1.5001487731933594, 0.3034454882144928, -0.4421710669994354, 2.1518516540527344, 0.21441863477230072, 1.2293845415115356, -0.3500826358795166, -2.268148422241211, 0.6669782400131226, -1.2451121807098389, -1.2197673320770264, 0.8028319478034973, -0.8424441814422607, 0.01859452575445175, -1.3471077680587769, -0.21421334147453308, -0.8103446960449219, -1.1686551570892334, 0.6992774605751038, 0.17010745406150818, 0.4942394196987152, -0.6376447081565857, 0.3196348547935486, -2.138154983520508, -1.3043209314346313, -0.2796347439289093, -0.9749016761779785, 0.43575018644332886, -0.29804307222366333, 0.6503849625587463, -0.27595511078834534, 0.0007189027965068817, 0.4292791187763214, 1.484238862991333, 3.4338929653167725, 0.16716323792934418, 0.16728296875953674, -0.24853019416332245, -0.8871904611587524, 1.3692466020584106, 0.9222357869148254, -0.2334168404340744, -0.5791563987731934, -1.0344270467758179, 1.1498823165893555, 2.0337934494018555, 0.9404385685920715, 0.06083684787154198, -0.8415759801864624, -0.8090225458145142, -0.04705885797739029, 0.07734565436840057, 0.4781356453895569, 0.8644660115242004, 0.20491473376750946, 0.08721879124641418, 1.324256420135498, 1.0824192762374878, -0.41132599115371704, 0.4301898181438446, -0.8571598529815674, -0.4440683126449585, 0.5364218354225159, 0.35720524191856384, 0.00860566832125187, 0.26002028584480286, -1.0397617816925049, -0.2446349859237671, -0.4107992947101593, -0.9009073376655579, -0.7843169569969177, -0.38671112060546875, -0.3535517752170563, 1.6242355108261108, 0.05445462837815285, -0.49030372500419617, -0.08420217037200928, -0.6766005754470825, -0.040859878063201904, -0.9671544432640076, 0.3167932629585266, -0.12336240708827972, -0.1262984275817871, -0.08134107291698456, 1.6582674980163574, -0.8947870135307312, -1.9590671062469482, 0.33396705985069275, 0.1514335423707962, -0.3863726556301117, 0.27468329668045044, 1.6435197591781616, 0.6286851763725281, 1.3950457572937012, 1.4723930358886719, 0.9596198797225952, -0.6562865376472473, -1.2895303964614868, 0.6201711297035217, 0.8992021083831787, -1.4636752605438232, 0.6784982085227966, 0.13382083177566528, -0.45932990312576294, 0.6270835995674133, 1.2404096126556396, 0.5037272572517395, -2.08801531791687, 0.7199451327323914, -0.8933514356613159, 0.7483136057853699, 0.700383722782135, 0.707467794418335, 0.2012716680765152, 0.800986111164093, -1.1491801738739014, -1.1619906425476074, -0.7496136426925659, -0.7618401646614075, 1.941922903060913, -0.2131803035736084, 0.5023368000984192, -0.15400634706020355, -1.405354380607605, -0.216307133436203, 0.7118403911590576, 0.37544670701026917, -0.6231978535652161, 0.6890423893928528, -0.5782482624053955, -1.06142258644104, -1.3435882329940796, -0.5014569163322449, -1.1226370334625244, -0.9651176333427429, 0.9083344340324402, 0.7784411907196045, 0.3471324145793915, 1.8303362131118774, 0.666248619556427, 0.24748492240905762, -2.6183061599731445, 0.9160643815994263, 0.3745294511318207, -0.13144391775131226, 0.8030384182929993, 0.3374793231487274, 0.9665696024894714, -0.10230948030948639, 0.6941930055618286, -2.4074573516845703, 2.309725046157837, -0.20172595977783203, 0.6269664764404297, 0.048287104815244675, -0.22309726476669312, 1.0478202104568481, 0.5346261262893677, 0.6030502915382385, -1.1084171533584595, 0.6766266226768494, -0.7099647521972656, 1.2492144107818604, 0.7631498575210571, -0.8465299010276794, -0.061163466423749924, 1.422778606414795, 0.48616063594818115, -0.5205634832382202, -0.904366135597229, -1.0791062116622925, 0.9548395872116089, 1.716349720954895, -0.1638934165239334, -0.017423423007130623, 0.8671590685844421, 0.6997189521789551, -1.3234875202178955, 0.02426641434431076, -0.7772929072380066, -0.7391695380210876, 1.5955621004104614, 2.092367172241211, -0.19509834051132202, -0.17493924498558044, -0.8517513275146484, -1.250156044960022, 0.8449327945709229, -0.0030264807865023613, -0.0015910957008600235, 0.6264957189559937, -0.5645798444747925, 1.208782434463501, 0.857281506061554, 0.9540154933929443, 0.2660459578037262, 0.3524121940135956, 0.29573291540145874, -0.33973583579063416, -1.1989818811416626, -0.28339478373527527, -1.0124753713607788, -2.523211717605591, 0.5218673348426819, -0.19121037423610687, -1.4696567058563232, 0.074787437915802, -1.0653518438339233, 0.8431699872016907, -0.588082492351532, -1.089103102684021, -1.4600670337677002, 0.20788909494876862, -0.013197531923651695, 0.9112851619720459, -1.5879583358764648, -0.018412217497825623, 1.2563618421554565, 0.8984710574150085, -0.7705352902412415, 0.9235518574714661, 0.34506309032440186, 1.0428180694580078, 0.9951356053352356, -0.38534244894981384, 0.5369171500205994, 0.008019614964723587, -1.2928611040115356, 0.4937233030796051, 1.1904674768447876, 0.15186630189418793, 1.4969810247421265, -0.608112633228302, 0.005845417268574238, 0.4163549542427063, -0.528562605381012, -0.44570472836494446, -0.6192602515220642, 0.6253646016120911, -0.012371551245450974, -0.8969449996948242, -0.0007082736119627953, 0.03296200558543205, -0.168334499001503, 0.24862927198410034, -1.5707752704620361, -0.12711238861083984, -0.2677106261253357, -0.6588118672370911, -1.1837859153747559, -0.17556855082511902, 1.4215868711471558, -0.736097514629364, -0.20929500460624695, 0.5377440452575684, 0.3135983943939209, 0.5456671714782715, 0.5739179253578186, -0.7002539038658142, -0.42350658774375916, -0.2682572603225708, -0.39719831943511963, 0.3374054729938507, 1.4433603286743164, -0.024901017546653748, -0.9466163516044617, 0.7787512540817261, -0.40996238589286804, 0.034227583557367325, 1.869588017463684, 0.11567479372024536, -0.8552009463310242, 0.22155043482780457, -0.6774331331253052, 1.9680471420288086, 1.8116118907928467, 1.2483922243118286, 0.003069048747420311, -1.0614922046661377, 0.5351414680480957, -0.36952802538871765, -0.3862428367137909, 0.8344606161117554, 0.3550645112991333, -0.23517292737960815, -1.3135881423950195, 0.7371501922607422, 1.3275279998779297, -0.843223512172699, -0.9434491395950317, 0.058756452053785324, -0.7547898888587952, 1.0933679342269897, 0.7331910729408264, 0.3430050015449524, 0.18015196919441223, 1.574092984199524, 0.7847505211830139, -0.343099445104599, 0.5926638841629028, 0.47304025292396545, -0.0710069090127945, -2.1879260540008545, -1.1921637058258057, 0.38965100049972534, -0.5062064528465271, -1.715299129486084, 1.4160356521606445, -1.1532301902770996, -0.9558315873146057, 0.5252717137336731, 0.0745379626750946, 1.511203408241272, 0.3993036150932312, 1.591766595840454, 2.0531787872314453, 0.911801815032959, 0.4185022711753845, 1.3413052558898926, -0.15401577949523926, -0.5236106514930725, 1.7758210897445679, -0.48907437920570374, 0.49330028891563416, 1.0757790803909302, -0.3068802058696747, -1.0614389181137085, -0.8166137337684631, -1.299529790878296, -0.7803850173950195, 1.1188864707946777, 0.03789159283041954, -1.1882052421569824, 0.3258931636810303, 1.5990850925445557, 0.13562506437301636, -0.3090306520462036, 0.7023259401321411, 0.32910117506980896, -0.8428872227668762, -0.03736010938882828, -0.9112192988395691, 0.4836830794811249, -0.1716383993625641, -0.39844855666160583, 0.3937656283378601, 0.41436439752578735, 1.2797590494155884, -0.0736151933670044, 0.057256389409303665, 1.1225239038467407, -1.4697290658950806, 1.5157629251480103, -0.7205516695976257, 0.3233727812767029, -2.3524134159088135, 1.3698228597640991, -0.8236557245254517, 1.8964029550552368, -2.6710548400878906, 0.4111056625843048, -0.5415371656417847, -0.5036700963973999, 0.21309800446033478, -0.26349714398384094, 0.09993405640125275, -0.16259706020355225, -1.2111244201660156, -0.058873120695352554, -0.7407782673835754, 0.6668990254402161, 1.0744984149932861, 1.4280189275741577, -1.1201752424240112, -0.2537951171398163, -1.7557443380355835, -0.1013275682926178, -0.6206730604171753, 0.3856459856033325, -1.9752486944198608, -0.11955741047859192, -1.9247384071350098, -2.3604791164398193, -1.2502902746200562, -0.8510486483573914, 1.002915859222412, 0.07726047933101654, -0.8174768686294556, 1.1634764671325684, -0.3921872675418854, -1.9518882036209106, 1.107117772102356, -2.1926987171173096 ]
https://github.com/huggingface/datasets/issues/3172
`SystemError 15` thrown in `Dataset.__del__` when using `Dataset.map()` with `num_proc>1`
Hi @mariosasko, thank you for the hint, that helped me to move forward with that issue. I did a major refactoring of my project to disentangle my `LightningDataModule` and `Dataset`. Just FYI, it looks like: ```python class Builder(): def __call__() -> DatasetDict: # load and preprocess the data return dataset class DataModule(LightningDataModule): def prepare_data(): self.builder() def setup(): self.dataset = self.builder() ``` Unfortunately, the entanglement between `LightningDataModule` and `Dataset` was not the issue. The culprit was `hydra` and a slight adjustment of the structure of my project solved this issue. The problematic project structure was: ``` src/ | - cli.py | - training/ | -experiment.py # code in experiment.py def run_experiment(config): # preprocess data and run # code in cli.py @hydra.main(...) def run(config): return run_experiment(config) ``` Moving `run()` from `clip.py` to `training.experiment.py` solved the issue with `SystemError 15`. No idea why. Even if the traceback was referring to `Dataset.__del__`, the problem does not seem to be primarily related to `datasets`, so I will close this issue. Thank you for your help!
## Describe the bug I use `datasets.map` to preprocess some data in my application. The error `SystemError 15` is thrown at the end of the execution of `Dataset.map()` (only with `num_proc>1`. Traceback included bellow. The exception is raised only when the code runs within a specific context. Despite ~10h spent investigating this issue, I have failed to isolate the bug, so let me describe my setup. In my project, `Dataset` is wrapped into a `LightningDataModule` and the data is preprocessed when calling `LightningDataModule.setup()`. Calling `.setup()` in an isolated script works fine (even when wrapped with `hydra.main()`). However, when calling `.setup()` within the experiment script (depends on `pytorch_lightning`), the script crashes and `SystemError 15`. I could avoid throwing this error by modifying ` Dataset.__del__()` (see bellow), but I believe this only moves the problem somewhere else. I am completely stuck with this issue, any hint would be welcome. ```python class Dataset() ... def __del__(self): if hasattr(self, "_data"): _ = self._data # <- ugly trick that allows avoiding the issue. del self._data if hasattr(self, "_indices"): del self._indices ``` ## Steps to reproduce the bug ```python # Unfortunately I couldn't isolate the bug. ``` ## Expected results Calling `Dataset.map()` without throwing an exception. Or at least raising a more detailed exception/traceback. ## Actual results ``` Exception ignored in: <function Dataset.__del__ at 0x7f7cec179160>β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:05<00:00, 1.17ba/s] Traceback (most recent call last): File ".../python3.8/site-packages/datasets/arrow_dataset.py", line 906, in __del__ del self._data File ".../python3.8/site-packages/ray/worker.py", line 1033, in sigterm_handler sys.exit(signum) SystemExit: 15 ``` ## Environment info Tested on 2 environments: **Environment 1.** - `datasets` version: 1.14.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 6.0.0 **Environment 2.** - `datasets` version: 1.14.0 - Platform: Linux-4.18.0-305.19.1.el8_4.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.7 - PyArrow version: 6.0.0
1,141
170
`SystemError 15` thrown in `Dataset.__del__` when using `Dataset.map()` with `num_proc>1` ## Describe the bug I use `datasets.map` to preprocess some data in my application. The error `SystemError 15` is thrown at the end of the execution of `Dataset.map()` (only with `num_proc>1`. Traceback included bellow. The exception is raised only when the code runs within a specific context. Despite ~10h spent investigating this issue, I have failed to isolate the bug, so let me describe my setup. In my project, `Dataset` is wrapped into a `LightningDataModule` and the data is preprocessed when calling `LightningDataModule.setup()`. Calling `.setup()` in an isolated script works fine (even when wrapped with `hydra.main()`). However, when calling `.setup()` within the experiment script (depends on `pytorch_lightning`), the script crashes and `SystemError 15`. I could avoid throwing this error by modifying ` Dataset.__del__()` (see bellow), but I believe this only moves the problem somewhere else. I am completely stuck with this issue, any hint would be welcome. ```python class Dataset() ... def __del__(self): if hasattr(self, "_data"): _ = self._data # <- ugly trick that allows avoiding the issue. del self._data if hasattr(self, "_indices"): del self._indices ``` ## Steps to reproduce the bug ```python # Unfortunately I couldn't isolate the bug. ``` ## Expected results Calling `Dataset.map()` without throwing an exception. Or at least raising a more detailed exception/traceback. ## Actual results ``` Exception ignored in: <function Dataset.__del__ at 0x7f7cec179160>β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:05<00:00, 1.17ba/s] Traceback (most recent call last): File ".../python3.8/site-packages/datasets/arrow_dataset.py", line 906, in __del__ del self._data File ".../python3.8/site-packages/ray/worker.py", line 1033, in sigterm_handler sys.exit(signum) SystemExit: 15 ``` ## Environment info Tested on 2 environments: **Environment 1.** - `datasets` version: 1.14.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 6.0.0 **Environment 2.** - `datasets` version: 1.14.0 - Platform: Linux-4.18.0-305.19.1.el8_4.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.7 - PyArrow version: 6.0.0 Hi @mariosasko, thank you for the hint, that helped me to move forward with that issue. I did a major refactoring of my project to disentangle my `LightningDataModule` and `Dataset`. Just FYI, it looks like: ```python class Builder(): def __call__() -> DatasetDict: # load and preprocess the data return dataset class DataModule(LightningDataModule): def prepare_data(): self.builder() def setup(): self.dataset = self.builder() ``` Unfortunately, the entanglement between `LightningDataModule` and `Dataset` was not the issue. The culprit was `hydra` and a slight adjustment of the structure of my project solved this issue. The problematic project structure was: ``` src/ | - cli.py | - training/ | -experiment.py # code in experiment.py def run_experiment(config): # preprocess data and run # code in cli.py @hydra.main(...) def run(config): return run_experiment(config) ``` Moving `run()` from `clip.py` to `training.experiment.py` solved the issue with `SystemError 15`. No idea why. Even if the traceback was referring to `Dataset.__del__`, the problem does not seem to be primarily related to `datasets`, so I will close this issue. Thank you for your help!
[ -1.1256572008132935, -0.8851135969161987, -0.6827611327171326, 1.450364589691162, -0.18745926022529602, -1.290369987487793, 0.28105470538139343, -1.0788518190383911, 1.776857614517212, -0.7800658345222473, 0.3009101152420044, -1.6550285816192627, 0.0002498980611562729, -0.5880305767059326, -0.8328458666801453, -0.8398420810699463, -0.46488770842552185, -0.7566807270050049, 1.0313377380371094, 2.4417684078216553, 1.2001439332962036, -1.3132323026657104, 2.656473398208618, 0.6554797887802124, -0.18419556319713593, -1.0346837043762207, 0.49875620007514954, -0.0631626546382904, -1.2786885499954224, -0.4345577657222748, -0.9413286447525024, -0.09351061284542084, -0.5938616991043091, -0.6227636337280273, 0.03103751689195633, 0.4725525677204132, -0.3422357738018036, -0.5643664598464966, -0.46326813101768494, -0.8602815270423889, 0.5096392035484314, -0.3299400210380554, 0.9322617650032043, -0.3254329264163971, 1.8171533346176147, -0.658410906791687, 0.5608736872673035, 0.78468918800354, 1.332165002822876, 0.24964159727096558, -0.09249693155288696, 0.4723278284072876, 0.4520961344242096, 0.12562021613121033, 0.5211244225502014, 1.1947753429412842, 0.580953061580658, 0.5343669056892395, 0.7413530349731445, -2.2397196292877197, 1.2194092273712158, -1.0046905279159546, 0.3126879632472992, 1.1795990467071533, -0.9274096488952637, 0.22089751064777374, -1.8029508590698242, -0.05870671942830086, 0.5719430446624756, -2.213547706604004, 0.2972020208835602, -1.3876606225967407, -0.40899959206581116, 1.0678236484527588, 0.43406835198402405, -1.2715147733688354, 0.07816673815250397, -0.36092323064804077, 0.9936730265617371, 0.38598713278770447, 1.1278703212738037, -1.6837141513824463, -0.0551098957657814, -0.3416042625904083, 0.18259499967098236, -1.1867284774780273, -1.513588786125183, 0.6046320796012878, 0.7238010168075562, 0.5162524580955505, -0.2254912108182907, 1.0352404117584229, -0.9168687462806702, 0.7408739328384399, -0.9772177934646606, -1.883586049079895, -1.4023433923721313, -2.1214842796325684, -2.2628729343414307, 0.7284823656082153, -0.4411376416683197, -0.47997015714645386, 2.100285530090332, -0.9448794722557068, -1.819656252861023, 1.0821101665496826, 0.2536468207836151, -0.07068666815757751, 2.250727891921997, 0.28069472312927246, -0.715405285358429, 0.4259248375892639, -0.7435665726661682, 0.7547957301139832, -0.3539869785308838, 1.3659608364105225, 0.37584006786346436, -1.0518555641174316, 1.6155160665512085, -0.27898362278938293, 0.6422792077064514, -0.7466445565223694, -0.4949314296245575, -0.6895550489425659, 0.31276845932006836, 2.01255202293396, -0.3590109050273895, 1.4889633655548096, -0.37569019198417664, -1.599100112915039, -1.5663660764694214, 0.9026719331741333, 0.47708386182785034, -0.7198726534843445, 0.10950572788715363, -0.4137439429759979, 0.10788024961948395, -0.03529128432273865, 1.2491588592529297, 1.316269874572754, 0.8903676271438599, -0.36315178871154785, -0.848163902759552, 0.13640987873077393, 0.04906804487109184, -0.7426098585128784, -1.7991946935653687, -0.3991987407207489, 0.11622445285320282, 0.602918803691864, -1.061003565788269, 1.7558706998825073, 0.8412637114524841, 1.9321482181549072, 1.0658618211746216, -0.3206773102283478, 1.4665507078170776, 0.10625492036342621, 1.9067286252975464, -0.36774080991744995, 0.6174294352531433, -0.39188703894615173, -1.1916775703430176, 0.8629434108734131, -0.24865280091762543, -2.0725581645965576, -0.6951000094413757, -0.8145115971565247, -0.10771980881690979, -0.7138111591339111, 0.9153690934181213, -0.27556097507476807, -1.4369935989379883, 0.1755976527929306, -0.8097484111785889, 0.05591558292508125, -1.2071272134780884, 0.2996244728565216, 0.6622897982597351, -0.682598352432251, 0.20779429376125336, -0.2674912214279175, -1.2895643711090088, -0.5156000256538391, 0.3085595965385437, 1.8243392705917358, -0.79152512550354, 0.9986351132392883, 1.0941089391708374, -0.7032536864280701, -0.02391093596816063, 0.37832534313201904, -0.3468831181526184, 0.8307851552963257, -1.0630887746810913, -0.39549046754837036, 1.224774956703186, -0.1808282881975174, -0.6521210670471191, 1.481584906578064, 0.6662384867668152, -0.9941486120223999, -0.0970136970281601, -0.17068782448768616, -0.9077270030975342, 0.07152664661407471, -1.6590867042541504, -0.1309569776058197, 0.47895997762680054, -1.5626815557479858, -0.5366502404212952, -0.18712930381298065, 1.2956620454788208, -0.0588165782392025, 1.4210543632507324, -0.32888391613960266, -0.1957520693540573, -0.3904247283935547, -0.3536050021648407, 0.055787574499845505, -0.21273471415042877, -0.5968838334083557, 0.2063848376274109, -0.754740834236145, 0.3822382688522339, 1.4673802852630615, 0.21162597835063934, -0.017474358901381493, 0.5533021092414856, 1.1048816442489624, 0.32955875992774963, -0.056312445551157, -0.8514382243156433, -1.6091350317001343, 2.0121049880981445, -1.3892710208892822, 1.945712685585022, 0.6818687915802002, -0.04188718646764755, -1.7913721799850464, -1.9406428337097168, 1.3878692388534546, 1.1167303323745728, 2.3515326976776123, 0.5745888352394104, 0.40398961305618286, -0.7448040843009949, -0.593031108379364, 0.36983922123908997, -1.061010718345642, -0.7084890604019165, 0.16293826699256897, 2.387950897216797, 1.7465847730636597, -0.504570484161377, -0.17893800139427185, -1.05910062789917, 1.4176323413848877, -0.2159620225429535, 0.23104405403137207, 1.979678750038147, -0.21407240629196167, -1.0545393228530884, 1.285610556602478, -2.2251362800598145, 0.19788962602615356, 2.01373291015625, 0.1350318193435669, 0.12835414707660675, -1.4375592470169067, -0.5798381567001343, -0.2058178186416626, -0.4029817581176758, -1.1880003213882446, 0.5455441474914551, -0.22250111401081085, -0.7894684076309204, -1.3852072954177856, 0.20378705859184265, -1.0570365190505981, -1.7277557849884033, 0.17312008142471313, 1.9437975883483887, 1.9305503368377686, -0.6513479948043823, 1.622961401939392, -0.36760199069976807, 0.20848922431468964, 1.279296636581421, 1.2366814613342285, 3.143890380859375, 1.9039387702941895, -1.2986012697219849, 0.7172440886497498, -0.11582189798355103, -0.49989232420921326, 1.2136896848678589, -1.1960197687149048, 1.1963564157485962, -0.25852736830711365, -1.1867953538894653, -1.2045578956604004, 0.9275686740875244, 0.47705021500587463, 0.04065284878015518, -0.42189064621925354, 1.161603331565857, 0.076618492603302, 1.333850383758545, 0.5476053357124329, -0.3358871638774872, 0.7802925705909729, -0.35833457112312317, -0.4552901089191437, 1.5148905515670776, 0.32647624611854553, -1.3221063613891602, -2.2842776775360107, -0.17726744711399078, -0.863450288772583, 0.1463879942893982, -0.5855915546417236, -0.9440304040908813, 1.6235381364822388, 0.38594186305999756, -1.2561440467834473, -0.31195685267448425, -0.33187800645828247, -0.5652783513069153, 2.698890447616577, -1.2904778718948364, -0.2768386900424957, -0.9892630577087402, -0.6394625306129456, 1.6925419569015503, -1.213563323020935, -0.2602498531341553, -0.9811103343963623, -0.44718554615974426, -1.241684079170227, -0.6285310983657837, 0.04549071565270424, -0.9443247318267822, 0.9125984311103821, 0.14430342614650726, -1.237990140914917, -0.30239516496658325, -0.8821237087249756, 0.9453220367431641, -0.1521906554698944, 0.13408491015434265, 1.943935513496399, 0.4243132770061493, -0.3934699296951294, 0.752065122127533, 1.071365475654602, 0.5532503128051758, -0.5199944972991943, 0.3454991281032562, -0.6669015884399414, 0.2521202266216278, -1.335314154624939, 0.2655823230743408, -2.827345609664917, 0.612137496471405, -0.025905292481184006, 0.010473627597093582, -0.05619727820158005, -1.3931022882461548, 1.0213135480880737, 2.609795570373535, -1.2326016426086426, 0.4299182891845703, 0.32069259881973267, 1.2069061994552612, -1.5001487731933594, 0.3034454882144928, -0.4421710669994354, 2.1518516540527344, 0.21441863477230072, 1.2293845415115356, -0.3500826358795166, -2.268148422241211, 0.6669782400131226, -1.2451121807098389, -1.2197673320770264, 0.8028319478034973, -0.8424441814422607, 0.01859452575445175, -1.3471077680587769, -0.21421334147453308, -0.8103446960449219, -1.1686551570892334, 0.6992774605751038, 0.17010745406150818, 0.4942394196987152, -0.6376447081565857, 0.3196348547935486, -2.138154983520508, -1.3043209314346313, -0.2796347439289093, -0.9749016761779785, 0.43575018644332886, -0.29804307222366333, 0.6503849625587463, -0.27595511078834534, 0.0007189027965068817, 0.4292791187763214, 1.484238862991333, 3.4338929653167725, 0.16716323792934418, 0.16728296875953674, -0.24853019416332245, -0.8871904611587524, 1.3692466020584106, 0.9222357869148254, -0.2334168404340744, -0.5791563987731934, -1.0344270467758179, 1.1498823165893555, 2.0337934494018555, 0.9404385685920715, 0.06083684787154198, -0.8415759801864624, -0.8090225458145142, -0.04705885797739029, 0.07734565436840057, 0.4781356453895569, 0.8644660115242004, 0.20491473376750946, 0.08721879124641418, 1.324256420135498, 1.0824192762374878, -0.41132599115371704, 0.4301898181438446, -0.8571598529815674, -0.4440683126449585, 0.5364218354225159, 0.35720524191856384, 0.00860566832125187, 0.26002028584480286, -1.0397617816925049, -0.2446349859237671, -0.4107992947101593, -0.9009073376655579, -0.7843169569969177, -0.38671112060546875, -0.3535517752170563, 1.6242355108261108, 0.05445462837815285, -0.49030372500419617, -0.08420217037200928, -0.6766005754470825, -0.040859878063201904, -0.9671544432640076, 0.3167932629585266, -0.12336240708827972, -0.1262984275817871, -0.08134107291698456, 1.6582674980163574, -0.8947870135307312, -1.9590671062469482, 0.33396705985069275, 0.1514335423707962, -0.3863726556301117, 0.27468329668045044, 1.6435197591781616, 0.6286851763725281, 1.3950457572937012, 1.4723930358886719, 0.9596198797225952, -0.6562865376472473, -1.2895303964614868, 0.6201711297035217, 0.8992021083831787, -1.4636752605438232, 0.6784982085227966, 0.13382083177566528, -0.45932990312576294, 0.6270835995674133, 1.2404096126556396, 0.5037272572517395, -2.08801531791687, 0.7199451327323914, -0.8933514356613159, 0.7483136057853699, 0.700383722782135, 0.707467794418335, 0.2012716680765152, 0.800986111164093, -1.1491801738739014, -1.1619906425476074, -0.7496136426925659, -0.7618401646614075, 1.941922903060913, -0.2131803035736084, 0.5023368000984192, -0.15400634706020355, -1.405354380607605, -0.216307133436203, 0.7118403911590576, 0.37544670701026917, -0.6231978535652161, 0.6890423893928528, -0.5782482624053955, -1.06142258644104, -1.3435882329940796, -0.5014569163322449, -1.1226370334625244, -0.9651176333427429, 0.9083344340324402, 0.7784411907196045, 0.3471324145793915, 1.8303362131118774, 0.666248619556427, 0.24748492240905762, -2.6183061599731445, 0.9160643815994263, 0.3745294511318207, -0.13144391775131226, 0.8030384182929993, 0.3374793231487274, 0.9665696024894714, -0.10230948030948639, 0.6941930055618286, -2.4074573516845703, 2.309725046157837, -0.20172595977783203, 0.6269664764404297, 0.048287104815244675, -0.22309726476669312, 1.0478202104568481, 0.5346261262893677, 0.6030502915382385, -1.1084171533584595, 0.6766266226768494, -0.7099647521972656, 1.2492144107818604, 0.7631498575210571, -0.8465299010276794, -0.061163466423749924, 1.422778606414795, 0.48616063594818115, -0.5205634832382202, -0.904366135597229, -1.0791062116622925, 0.9548395872116089, 1.716349720954895, -0.1638934165239334, -0.017423423007130623, 0.8671590685844421, 0.6997189521789551, -1.3234875202178955, 0.02426641434431076, -0.7772929072380066, -0.7391695380210876, 1.5955621004104614, 2.092367172241211, -0.19509834051132202, -0.17493924498558044, -0.8517513275146484, -1.250156044960022, 0.8449327945709229, -0.0030264807865023613, -0.0015910957008600235, 0.6264957189559937, -0.5645798444747925, 1.208782434463501, 0.857281506061554, 0.9540154933929443, 0.2660459578037262, 0.3524121940135956, 0.29573291540145874, -0.33973583579063416, -1.1989818811416626, -0.28339478373527527, -1.0124753713607788, -2.523211717605591, 0.5218673348426819, -0.19121037423610687, -1.4696567058563232, 0.074787437915802, -1.0653518438339233, 0.8431699872016907, -0.588082492351532, -1.089103102684021, -1.4600670337677002, 0.20788909494876862, -0.013197531923651695, 0.9112851619720459, -1.5879583358764648, -0.018412217497825623, 1.2563618421554565, 0.8984710574150085, -0.7705352902412415, 0.9235518574714661, 0.34506309032440186, 1.0428180694580078, 0.9951356053352356, -0.38534244894981384, 0.5369171500205994, 0.008019614964723587, -1.2928611040115356, 0.4937233030796051, 1.1904674768447876, 0.15186630189418793, 1.4969810247421265, -0.608112633228302, 0.005845417268574238, 0.4163549542427063, -0.528562605381012, -0.44570472836494446, -0.6192602515220642, 0.6253646016120911, -0.012371551245450974, -0.8969449996948242, -0.0007082736119627953, 0.03296200558543205, -0.168334499001503, 0.24862927198410034, -1.5707752704620361, -0.12711238861083984, -0.2677106261253357, -0.6588118672370911, -1.1837859153747559, -0.17556855082511902, 1.4215868711471558, -0.736097514629364, -0.20929500460624695, 0.5377440452575684, 0.3135983943939209, 0.5456671714782715, 0.5739179253578186, -0.7002539038658142, -0.42350658774375916, -0.2682572603225708, -0.39719831943511963, 0.3374054729938507, 1.4433603286743164, -0.024901017546653748, -0.9466163516044617, 0.7787512540817261, -0.40996238589286804, 0.034227583557367325, 1.869588017463684, 0.11567479372024536, -0.8552009463310242, 0.22155043482780457, -0.6774331331253052, 1.9680471420288086, 1.8116118907928467, 1.2483922243118286, 0.003069048747420311, -1.0614922046661377, 0.5351414680480957, -0.36952802538871765, -0.3862428367137909, 0.8344606161117554, 0.3550645112991333, -0.23517292737960815, -1.3135881423950195, 0.7371501922607422, 1.3275279998779297, -0.843223512172699, -0.9434491395950317, 0.058756452053785324, -0.7547898888587952, 1.0933679342269897, 0.7331910729408264, 0.3430050015449524, 0.18015196919441223, 1.574092984199524, 0.7847505211830139, -0.343099445104599, 0.5926638841629028, 0.47304025292396545, -0.0710069090127945, -2.1879260540008545, -1.1921637058258057, 0.38965100049972534, -0.5062064528465271, -1.715299129486084, 1.4160356521606445, -1.1532301902770996, -0.9558315873146057, 0.5252717137336731, 0.0745379626750946, 1.511203408241272, 0.3993036150932312, 1.591766595840454, 2.0531787872314453, 0.911801815032959, 0.4185022711753845, 1.3413052558898926, -0.15401577949523926, -0.5236106514930725, 1.7758210897445679, -0.48907437920570374, 0.49330028891563416, 1.0757790803909302, -0.3068802058696747, -1.0614389181137085, -0.8166137337684631, -1.299529790878296, -0.7803850173950195, 1.1188864707946777, 0.03789159283041954, -1.1882052421569824, 0.3258931636810303, 1.5990850925445557, 0.13562506437301636, -0.3090306520462036, 0.7023259401321411, 0.32910117506980896, -0.8428872227668762, -0.03736010938882828, -0.9112192988395691, 0.4836830794811249, -0.1716383993625641, -0.39844855666160583, 0.3937656283378601, 0.41436439752578735, 1.2797590494155884, -0.0736151933670044, 0.057256389409303665, 1.1225239038467407, -1.4697290658950806, 1.5157629251480103, -0.7205516695976257, 0.3233727812767029, -2.3524134159088135, 1.3698228597640991, -0.8236557245254517, 1.8964029550552368, -2.6710548400878906, 0.4111056625843048, -0.5415371656417847, -0.5036700963973999, 0.21309800446033478, -0.26349714398384094, 0.09993405640125275, -0.16259706020355225, -1.2111244201660156, -0.058873120695352554, -0.7407782673835754, 0.6668990254402161, 1.0744984149932861, 1.4280189275741577, -1.1201752424240112, -0.2537951171398163, -1.7557443380355835, -0.1013275682926178, -0.6206730604171753, 0.3856459856033325, -1.9752486944198608, -0.11955741047859192, -1.9247384071350098, -2.3604791164398193, -1.2502902746200562, -0.8510486483573914, 1.002915859222412, 0.07726047933101654, -0.8174768686294556, 1.1634764671325684, -0.3921872675418854, -1.9518882036209106, 1.107117772102356, -2.1926987171173096 ]
https://github.com/huggingface/datasets/issues/3172
`SystemError 15` thrown in `Dataset.__del__` when using `Dataset.map()` with `num_proc>1`
Please allow me to revive this discussion, as I have an extremely similar issue. Instead of an error, my datasets functions simply aren't caching properly. My setup is almost the same as yours, with hydra to configure my experiment parameters. @vlievin Could you confirm if your code correctly loads the cache? If so, do you have any public code that I can reference for comparison? I will post a full example with hydra that illustrates this problem in a little bit, probably on another thread.
## Describe the bug I use `datasets.map` to preprocess some data in my application. The error `SystemError 15` is thrown at the end of the execution of `Dataset.map()` (only with `num_proc>1`. Traceback included bellow. The exception is raised only when the code runs within a specific context. Despite ~10h spent investigating this issue, I have failed to isolate the bug, so let me describe my setup. In my project, `Dataset` is wrapped into a `LightningDataModule` and the data is preprocessed when calling `LightningDataModule.setup()`. Calling `.setup()` in an isolated script works fine (even when wrapped with `hydra.main()`). However, when calling `.setup()` within the experiment script (depends on `pytorch_lightning`), the script crashes and `SystemError 15`. I could avoid throwing this error by modifying ` Dataset.__del__()` (see bellow), but I believe this only moves the problem somewhere else. I am completely stuck with this issue, any hint would be welcome. ```python class Dataset() ... def __del__(self): if hasattr(self, "_data"): _ = self._data # <- ugly trick that allows avoiding the issue. del self._data if hasattr(self, "_indices"): del self._indices ``` ## Steps to reproduce the bug ```python # Unfortunately I couldn't isolate the bug. ``` ## Expected results Calling `Dataset.map()` without throwing an exception. Or at least raising a more detailed exception/traceback. ## Actual results ``` Exception ignored in: <function Dataset.__del__ at 0x7f7cec179160>β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:05<00:00, 1.17ba/s] Traceback (most recent call last): File ".../python3.8/site-packages/datasets/arrow_dataset.py", line 906, in __del__ del self._data File ".../python3.8/site-packages/ray/worker.py", line 1033, in sigterm_handler sys.exit(signum) SystemExit: 15 ``` ## Environment info Tested on 2 environments: **Environment 1.** - `datasets` version: 1.14.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 6.0.0 **Environment 2.** - `datasets` version: 1.14.0 - Platform: Linux-4.18.0-305.19.1.el8_4.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.7 - PyArrow version: 6.0.0
1,141
85
`SystemError 15` thrown in `Dataset.__del__` when using `Dataset.map()` with `num_proc>1` ## Describe the bug I use `datasets.map` to preprocess some data in my application. The error `SystemError 15` is thrown at the end of the execution of `Dataset.map()` (only with `num_proc>1`. Traceback included bellow. The exception is raised only when the code runs within a specific context. Despite ~10h spent investigating this issue, I have failed to isolate the bug, so let me describe my setup. In my project, `Dataset` is wrapped into a `LightningDataModule` and the data is preprocessed when calling `LightningDataModule.setup()`. Calling `.setup()` in an isolated script works fine (even when wrapped with `hydra.main()`). However, when calling `.setup()` within the experiment script (depends on `pytorch_lightning`), the script crashes and `SystemError 15`. I could avoid throwing this error by modifying ` Dataset.__del__()` (see bellow), but I believe this only moves the problem somewhere else. I am completely stuck with this issue, any hint would be welcome. ```python class Dataset() ... def __del__(self): if hasattr(self, "_data"): _ = self._data # <- ugly trick that allows avoiding the issue. del self._data if hasattr(self, "_indices"): del self._indices ``` ## Steps to reproduce the bug ```python # Unfortunately I couldn't isolate the bug. ``` ## Expected results Calling `Dataset.map()` without throwing an exception. Or at least raising a more detailed exception/traceback. ## Actual results ``` Exception ignored in: <function Dataset.__del__ at 0x7f7cec179160>β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:05<00:00, 1.17ba/s] Traceback (most recent call last): File ".../python3.8/site-packages/datasets/arrow_dataset.py", line 906, in __del__ del self._data File ".../python3.8/site-packages/ray/worker.py", line 1033, in sigterm_handler sys.exit(signum) SystemExit: 15 ``` ## Environment info Tested on 2 environments: **Environment 1.** - `datasets` version: 1.14.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 6.0.0 **Environment 2.** - `datasets` version: 1.14.0 - Platform: Linux-4.18.0-305.19.1.el8_4.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.7 - PyArrow version: 6.0.0 Please allow me to revive this discussion, as I have an extremely similar issue. Instead of an error, my datasets functions simply aren't caching properly. My setup is almost the same as yours, with hydra to configure my experiment parameters. @vlievin Could you confirm if your code correctly loads the cache? If so, do you have any public code that I can reference for comparison? I will post a full example with hydra that illustrates this problem in a little bit, probably on another thread.
[ -1.1256572008132935, -0.8851135969161987, -0.6827611327171326, 1.450364589691162, -0.18745926022529602, -1.290369987487793, 0.28105470538139343, -1.0788518190383911, 1.776857614517212, -0.7800658345222473, 0.3009101152420044, -1.6550285816192627, 0.0002498980611562729, -0.5880305767059326, -0.8328458666801453, -0.8398420810699463, -0.46488770842552185, -0.7566807270050049, 1.0313377380371094, 2.4417684078216553, 1.2001439332962036, -1.3132323026657104, 2.656473398208618, 0.6554797887802124, -0.18419556319713593, -1.0346837043762207, 0.49875620007514954, -0.0631626546382904, -1.2786885499954224, -0.4345577657222748, -0.9413286447525024, -0.09351061284542084, -0.5938616991043091, -0.6227636337280273, 0.03103751689195633, 0.4725525677204132, -0.3422357738018036, -0.5643664598464966, -0.46326813101768494, -0.8602815270423889, 0.5096392035484314, -0.3299400210380554, 0.9322617650032043, -0.3254329264163971, 1.8171533346176147, -0.658410906791687, 0.5608736872673035, 0.78468918800354, 1.332165002822876, 0.24964159727096558, -0.09249693155288696, 0.4723278284072876, 0.4520961344242096, 0.12562021613121033, 0.5211244225502014, 1.1947753429412842, 0.580953061580658, 0.5343669056892395, 0.7413530349731445, -2.2397196292877197, 1.2194092273712158, -1.0046905279159546, 0.3126879632472992, 1.1795990467071533, -0.9274096488952637, 0.22089751064777374, -1.8029508590698242, -0.05870671942830086, 0.5719430446624756, -2.213547706604004, 0.2972020208835602, -1.3876606225967407, -0.40899959206581116, 1.0678236484527588, 0.43406835198402405, -1.2715147733688354, 0.07816673815250397, -0.36092323064804077, 0.9936730265617371, 0.38598713278770447, 1.1278703212738037, -1.6837141513824463, -0.0551098957657814, -0.3416042625904083, 0.18259499967098236, -1.1867284774780273, -1.513588786125183, 0.6046320796012878, 0.7238010168075562, 0.5162524580955505, -0.2254912108182907, 1.0352404117584229, -0.9168687462806702, 0.7408739328384399, -0.9772177934646606, -1.883586049079895, -1.4023433923721313, -2.1214842796325684, -2.2628729343414307, 0.7284823656082153, -0.4411376416683197, -0.47997015714645386, 2.100285530090332, -0.9448794722557068, -1.819656252861023, 1.0821101665496826, 0.2536468207836151, -0.07068666815757751, 2.250727891921997, 0.28069472312927246, -0.715405285358429, 0.4259248375892639, -0.7435665726661682, 0.7547957301139832, -0.3539869785308838, 1.3659608364105225, 0.37584006786346436, -1.0518555641174316, 1.6155160665512085, -0.27898362278938293, 0.6422792077064514, -0.7466445565223694, -0.4949314296245575, -0.6895550489425659, 0.31276845932006836, 2.01255202293396, -0.3590109050273895, 1.4889633655548096, -0.37569019198417664, -1.599100112915039, -1.5663660764694214, 0.9026719331741333, 0.47708386182785034, -0.7198726534843445, 0.10950572788715363, -0.4137439429759979, 0.10788024961948395, -0.03529128432273865, 1.2491588592529297, 1.316269874572754, 0.8903676271438599, -0.36315178871154785, -0.848163902759552, 0.13640987873077393, 0.04906804487109184, -0.7426098585128784, -1.7991946935653687, -0.3991987407207489, 0.11622445285320282, 0.602918803691864, -1.061003565788269, 1.7558706998825073, 0.8412637114524841, 1.9321482181549072, 1.0658618211746216, -0.3206773102283478, 1.4665507078170776, 0.10625492036342621, 1.9067286252975464, -0.36774080991744995, 0.6174294352531433, -0.39188703894615173, -1.1916775703430176, 0.8629434108734131, -0.24865280091762543, -2.0725581645965576, -0.6951000094413757, -0.8145115971565247, -0.10771980881690979, -0.7138111591339111, 0.9153690934181213, -0.27556097507476807, -1.4369935989379883, 0.1755976527929306, -0.8097484111785889, 0.05591558292508125, -1.2071272134780884, 0.2996244728565216, 0.6622897982597351, -0.682598352432251, 0.20779429376125336, -0.2674912214279175, -1.2895643711090088, -0.5156000256538391, 0.3085595965385437, 1.8243392705917358, -0.79152512550354, 0.9986351132392883, 1.0941089391708374, -0.7032536864280701, -0.02391093596816063, 0.37832534313201904, -0.3468831181526184, 0.8307851552963257, -1.0630887746810913, -0.39549046754837036, 1.224774956703186, -0.1808282881975174, -0.6521210670471191, 1.481584906578064, 0.6662384867668152, -0.9941486120223999, -0.0970136970281601, -0.17068782448768616, -0.9077270030975342, 0.07152664661407471, -1.6590867042541504, -0.1309569776058197, 0.47895997762680054, -1.5626815557479858, -0.5366502404212952, -0.18712930381298065, 1.2956620454788208, -0.0588165782392025, 1.4210543632507324, -0.32888391613960266, -0.1957520693540573, -0.3904247283935547, -0.3536050021648407, 0.055787574499845505, -0.21273471415042877, -0.5968838334083557, 0.2063848376274109, -0.754740834236145, 0.3822382688522339, 1.4673802852630615, 0.21162597835063934, -0.017474358901381493, 0.5533021092414856, 1.1048816442489624, 0.32955875992774963, -0.056312445551157, -0.8514382243156433, -1.6091350317001343, 2.0121049880981445, -1.3892710208892822, 1.945712685585022, 0.6818687915802002, -0.04188718646764755, -1.7913721799850464, -1.9406428337097168, 1.3878692388534546, 1.1167303323745728, 2.3515326976776123, 0.5745888352394104, 0.40398961305618286, -0.7448040843009949, -0.593031108379364, 0.36983922123908997, -1.061010718345642, -0.7084890604019165, 0.16293826699256897, 2.387950897216797, 1.7465847730636597, -0.504570484161377, -0.17893800139427185, -1.05910062789917, 1.4176323413848877, -0.2159620225429535, 0.23104405403137207, 1.979678750038147, -0.21407240629196167, -1.0545393228530884, 1.285610556602478, -2.2251362800598145, 0.19788962602615356, 2.01373291015625, 0.1350318193435669, 0.12835414707660675, -1.4375592470169067, -0.5798381567001343, -0.2058178186416626, -0.4029817581176758, -1.1880003213882446, 0.5455441474914551, -0.22250111401081085, -0.7894684076309204, -1.3852072954177856, 0.20378705859184265, -1.0570365190505981, -1.7277557849884033, 0.17312008142471313, 1.9437975883483887, 1.9305503368377686, -0.6513479948043823, 1.622961401939392, -0.36760199069976807, 0.20848922431468964, 1.279296636581421, 1.2366814613342285, 3.143890380859375, 1.9039387702941895, -1.2986012697219849, 0.7172440886497498, -0.11582189798355103, -0.49989232420921326, 1.2136896848678589, -1.1960197687149048, 1.1963564157485962, -0.25852736830711365, -1.1867953538894653, -1.2045578956604004, 0.9275686740875244, 0.47705021500587463, 0.04065284878015518, -0.42189064621925354, 1.161603331565857, 0.076618492603302, 1.333850383758545, 0.5476053357124329, -0.3358871638774872, 0.7802925705909729, -0.35833457112312317, -0.4552901089191437, 1.5148905515670776, 0.32647624611854553, -1.3221063613891602, -2.2842776775360107, -0.17726744711399078, -0.863450288772583, 0.1463879942893982, -0.5855915546417236, -0.9440304040908813, 1.6235381364822388, 0.38594186305999756, -1.2561440467834473, -0.31195685267448425, -0.33187800645828247, -0.5652783513069153, 2.698890447616577, -1.2904778718948364, -0.2768386900424957, -0.9892630577087402, -0.6394625306129456, 1.6925419569015503, -1.213563323020935, -0.2602498531341553, -0.9811103343963623, -0.44718554615974426, -1.241684079170227, -0.6285310983657837, 0.04549071565270424, -0.9443247318267822, 0.9125984311103821, 0.14430342614650726, -1.237990140914917, -0.30239516496658325, -0.8821237087249756, 0.9453220367431641, -0.1521906554698944, 0.13408491015434265, 1.943935513496399, 0.4243132770061493, -0.3934699296951294, 0.752065122127533, 1.071365475654602, 0.5532503128051758, -0.5199944972991943, 0.3454991281032562, -0.6669015884399414, 0.2521202266216278, -1.335314154624939, 0.2655823230743408, -2.827345609664917, 0.612137496471405, -0.025905292481184006, 0.010473627597093582, -0.05619727820158005, -1.3931022882461548, 1.0213135480880737, 2.609795570373535, -1.2326016426086426, 0.4299182891845703, 0.32069259881973267, 1.2069061994552612, -1.5001487731933594, 0.3034454882144928, -0.4421710669994354, 2.1518516540527344, 0.21441863477230072, 1.2293845415115356, -0.3500826358795166, -2.268148422241211, 0.6669782400131226, -1.2451121807098389, -1.2197673320770264, 0.8028319478034973, -0.8424441814422607, 0.01859452575445175, -1.3471077680587769, -0.21421334147453308, -0.8103446960449219, -1.1686551570892334, 0.6992774605751038, 0.17010745406150818, 0.4942394196987152, -0.6376447081565857, 0.3196348547935486, -2.138154983520508, -1.3043209314346313, -0.2796347439289093, -0.9749016761779785, 0.43575018644332886, -0.29804307222366333, 0.6503849625587463, -0.27595511078834534, 0.0007189027965068817, 0.4292791187763214, 1.484238862991333, 3.4338929653167725, 0.16716323792934418, 0.16728296875953674, -0.24853019416332245, -0.8871904611587524, 1.3692466020584106, 0.9222357869148254, -0.2334168404340744, -0.5791563987731934, -1.0344270467758179, 1.1498823165893555, 2.0337934494018555, 0.9404385685920715, 0.06083684787154198, -0.8415759801864624, -0.8090225458145142, -0.04705885797739029, 0.07734565436840057, 0.4781356453895569, 0.8644660115242004, 0.20491473376750946, 0.08721879124641418, 1.324256420135498, 1.0824192762374878, -0.41132599115371704, 0.4301898181438446, -0.8571598529815674, -0.4440683126449585, 0.5364218354225159, 0.35720524191856384, 0.00860566832125187, 0.26002028584480286, -1.0397617816925049, -0.2446349859237671, -0.4107992947101593, -0.9009073376655579, -0.7843169569969177, -0.38671112060546875, -0.3535517752170563, 1.6242355108261108, 0.05445462837815285, -0.49030372500419617, -0.08420217037200928, -0.6766005754470825, -0.040859878063201904, -0.9671544432640076, 0.3167932629585266, -0.12336240708827972, -0.1262984275817871, -0.08134107291698456, 1.6582674980163574, -0.8947870135307312, -1.9590671062469482, 0.33396705985069275, 0.1514335423707962, -0.3863726556301117, 0.27468329668045044, 1.6435197591781616, 0.6286851763725281, 1.3950457572937012, 1.4723930358886719, 0.9596198797225952, -0.6562865376472473, -1.2895303964614868, 0.6201711297035217, 0.8992021083831787, -1.4636752605438232, 0.6784982085227966, 0.13382083177566528, -0.45932990312576294, 0.6270835995674133, 1.2404096126556396, 0.5037272572517395, -2.08801531791687, 0.7199451327323914, -0.8933514356613159, 0.7483136057853699, 0.700383722782135, 0.707467794418335, 0.2012716680765152, 0.800986111164093, -1.1491801738739014, -1.1619906425476074, -0.7496136426925659, -0.7618401646614075, 1.941922903060913, -0.2131803035736084, 0.5023368000984192, -0.15400634706020355, -1.405354380607605, -0.216307133436203, 0.7118403911590576, 0.37544670701026917, -0.6231978535652161, 0.6890423893928528, -0.5782482624053955, -1.06142258644104, -1.3435882329940796, -0.5014569163322449, -1.1226370334625244, -0.9651176333427429, 0.9083344340324402, 0.7784411907196045, 0.3471324145793915, 1.8303362131118774, 0.666248619556427, 0.24748492240905762, -2.6183061599731445, 0.9160643815994263, 0.3745294511318207, -0.13144391775131226, 0.8030384182929993, 0.3374793231487274, 0.9665696024894714, -0.10230948030948639, 0.6941930055618286, -2.4074573516845703, 2.309725046157837, -0.20172595977783203, 0.6269664764404297, 0.048287104815244675, -0.22309726476669312, 1.0478202104568481, 0.5346261262893677, 0.6030502915382385, -1.1084171533584595, 0.6766266226768494, -0.7099647521972656, 1.2492144107818604, 0.7631498575210571, -0.8465299010276794, -0.061163466423749924, 1.422778606414795, 0.48616063594818115, -0.5205634832382202, -0.904366135597229, -1.0791062116622925, 0.9548395872116089, 1.716349720954895, -0.1638934165239334, -0.017423423007130623, 0.8671590685844421, 0.6997189521789551, -1.3234875202178955, 0.02426641434431076, -0.7772929072380066, -0.7391695380210876, 1.5955621004104614, 2.092367172241211, -0.19509834051132202, -0.17493924498558044, -0.8517513275146484, -1.250156044960022, 0.8449327945709229, -0.0030264807865023613, -0.0015910957008600235, 0.6264957189559937, -0.5645798444747925, 1.208782434463501, 0.857281506061554, 0.9540154933929443, 0.2660459578037262, 0.3524121940135956, 0.29573291540145874, -0.33973583579063416, -1.1989818811416626, -0.28339478373527527, -1.0124753713607788, -2.523211717605591, 0.5218673348426819, -0.19121037423610687, -1.4696567058563232, 0.074787437915802, -1.0653518438339233, 0.8431699872016907, -0.588082492351532, -1.089103102684021, -1.4600670337677002, 0.20788909494876862, -0.013197531923651695, 0.9112851619720459, -1.5879583358764648, -0.018412217497825623, 1.2563618421554565, 0.8984710574150085, -0.7705352902412415, 0.9235518574714661, 0.34506309032440186, 1.0428180694580078, 0.9951356053352356, -0.38534244894981384, 0.5369171500205994, 0.008019614964723587, -1.2928611040115356, 0.4937233030796051, 1.1904674768447876, 0.15186630189418793, 1.4969810247421265, -0.608112633228302, 0.005845417268574238, 0.4163549542427063, -0.528562605381012, -0.44570472836494446, -0.6192602515220642, 0.6253646016120911, -0.012371551245450974, -0.8969449996948242, -0.0007082736119627953, 0.03296200558543205, -0.168334499001503, 0.24862927198410034, -1.5707752704620361, -0.12711238861083984, -0.2677106261253357, -0.6588118672370911, -1.1837859153747559, -0.17556855082511902, 1.4215868711471558, -0.736097514629364, -0.20929500460624695, 0.5377440452575684, 0.3135983943939209, 0.5456671714782715, 0.5739179253578186, -0.7002539038658142, -0.42350658774375916, -0.2682572603225708, -0.39719831943511963, 0.3374054729938507, 1.4433603286743164, -0.024901017546653748, -0.9466163516044617, 0.7787512540817261, -0.40996238589286804, 0.034227583557367325, 1.869588017463684, 0.11567479372024536, -0.8552009463310242, 0.22155043482780457, -0.6774331331253052, 1.9680471420288086, 1.8116118907928467, 1.2483922243118286, 0.003069048747420311, -1.0614922046661377, 0.5351414680480957, -0.36952802538871765, -0.3862428367137909, 0.8344606161117554, 0.3550645112991333, -0.23517292737960815, -1.3135881423950195, 0.7371501922607422, 1.3275279998779297, -0.843223512172699, -0.9434491395950317, 0.058756452053785324, -0.7547898888587952, 1.0933679342269897, 0.7331910729408264, 0.3430050015449524, 0.18015196919441223, 1.574092984199524, 0.7847505211830139, -0.343099445104599, 0.5926638841629028, 0.47304025292396545, -0.0710069090127945, -2.1879260540008545, -1.1921637058258057, 0.38965100049972534, -0.5062064528465271, -1.715299129486084, 1.4160356521606445, -1.1532301902770996, -0.9558315873146057, 0.5252717137336731, 0.0745379626750946, 1.511203408241272, 0.3993036150932312, 1.591766595840454, 2.0531787872314453, 0.911801815032959, 0.4185022711753845, 1.3413052558898926, -0.15401577949523926, -0.5236106514930725, 1.7758210897445679, -0.48907437920570374, 0.49330028891563416, 1.0757790803909302, -0.3068802058696747, -1.0614389181137085, -0.8166137337684631, -1.299529790878296, -0.7803850173950195, 1.1188864707946777, 0.03789159283041954, -1.1882052421569824, 0.3258931636810303, 1.5990850925445557, 0.13562506437301636, -0.3090306520462036, 0.7023259401321411, 0.32910117506980896, -0.8428872227668762, -0.03736010938882828, -0.9112192988395691, 0.4836830794811249, -0.1716383993625641, -0.39844855666160583, 0.3937656283378601, 0.41436439752578735, 1.2797590494155884, -0.0736151933670044, 0.057256389409303665, 1.1225239038467407, -1.4697290658950806, 1.5157629251480103, -0.7205516695976257, 0.3233727812767029, -2.3524134159088135, 1.3698228597640991, -0.8236557245254517, 1.8964029550552368, -2.6710548400878906, 0.4111056625843048, -0.5415371656417847, -0.5036700963973999, 0.21309800446033478, -0.26349714398384094, 0.09993405640125275, -0.16259706020355225, -1.2111244201660156, -0.058873120695352554, -0.7407782673835754, 0.6668990254402161, 1.0744984149932861, 1.4280189275741577, -1.1201752424240112, -0.2537951171398163, -1.7557443380355835, -0.1013275682926178, -0.6206730604171753, 0.3856459856033325, -1.9752486944198608, -0.11955741047859192, -1.9247384071350098, -2.3604791164398193, -1.2502902746200562, -0.8510486483573914, 1.002915859222412, 0.07726047933101654, -0.8174768686294556, 1.1634764671325684, -0.3921872675418854, -1.9518882036209106, 1.107117772102356, -2.1926987171173096 ]
https://github.com/huggingface/datasets/issues/3172
`SystemError 15` thrown in `Dataset.__del__` when using `Dataset.map()` with `num_proc>1`
Hello @mariomeissner, very sorry for the late reply, I hope you have found a solution to your problem! I don't have public code at the moment. I have not experienced any other issue with hydra, even if I don't understand why changing the location of the definition of `run()` fixed the problem. Overall, I don't have issue with caching anymore, even when 1. using custom fingerprints using the argument `new_fingerprint 2. when using `num_proc>1`
## Describe the bug I use `datasets.map` to preprocess some data in my application. The error `SystemError 15` is thrown at the end of the execution of `Dataset.map()` (only with `num_proc>1`. Traceback included bellow. The exception is raised only when the code runs within a specific context. Despite ~10h spent investigating this issue, I have failed to isolate the bug, so let me describe my setup. In my project, `Dataset` is wrapped into a `LightningDataModule` and the data is preprocessed when calling `LightningDataModule.setup()`. Calling `.setup()` in an isolated script works fine (even when wrapped with `hydra.main()`). However, when calling `.setup()` within the experiment script (depends on `pytorch_lightning`), the script crashes and `SystemError 15`. I could avoid throwing this error by modifying ` Dataset.__del__()` (see bellow), but I believe this only moves the problem somewhere else. I am completely stuck with this issue, any hint would be welcome. ```python class Dataset() ... def __del__(self): if hasattr(self, "_data"): _ = self._data # <- ugly trick that allows avoiding the issue. del self._data if hasattr(self, "_indices"): del self._indices ``` ## Steps to reproduce the bug ```python # Unfortunately I couldn't isolate the bug. ``` ## Expected results Calling `Dataset.map()` without throwing an exception. Or at least raising a more detailed exception/traceback. ## Actual results ``` Exception ignored in: <function Dataset.__del__ at 0x7f7cec179160>β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:05<00:00, 1.17ba/s] Traceback (most recent call last): File ".../python3.8/site-packages/datasets/arrow_dataset.py", line 906, in __del__ del self._data File ".../python3.8/site-packages/ray/worker.py", line 1033, in sigterm_handler sys.exit(signum) SystemExit: 15 ``` ## Environment info Tested on 2 environments: **Environment 1.** - `datasets` version: 1.14.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 6.0.0 **Environment 2.** - `datasets` version: 1.14.0 - Platform: Linux-4.18.0-305.19.1.el8_4.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.7 - PyArrow version: 6.0.0
1,141
74
`SystemError 15` thrown in `Dataset.__del__` when using `Dataset.map()` with `num_proc>1` ## Describe the bug I use `datasets.map` to preprocess some data in my application. The error `SystemError 15` is thrown at the end of the execution of `Dataset.map()` (only with `num_proc>1`. Traceback included bellow. The exception is raised only when the code runs within a specific context. Despite ~10h spent investigating this issue, I have failed to isolate the bug, so let me describe my setup. In my project, `Dataset` is wrapped into a `LightningDataModule` and the data is preprocessed when calling `LightningDataModule.setup()`. Calling `.setup()` in an isolated script works fine (even when wrapped with `hydra.main()`). However, when calling `.setup()` within the experiment script (depends on `pytorch_lightning`), the script crashes and `SystemError 15`. I could avoid throwing this error by modifying ` Dataset.__del__()` (see bellow), but I believe this only moves the problem somewhere else. I am completely stuck with this issue, any hint would be welcome. ```python class Dataset() ... def __del__(self): if hasattr(self, "_data"): _ = self._data # <- ugly trick that allows avoiding the issue. del self._data if hasattr(self, "_indices"): del self._indices ``` ## Steps to reproduce the bug ```python # Unfortunately I couldn't isolate the bug. ``` ## Expected results Calling `Dataset.map()` without throwing an exception. Or at least raising a more detailed exception/traceback. ## Actual results ``` Exception ignored in: <function Dataset.__del__ at 0x7f7cec179160>β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:05<00:00, 1.17ba/s] Traceback (most recent call last): File ".../python3.8/site-packages/datasets/arrow_dataset.py", line 906, in __del__ del self._data File ".../python3.8/site-packages/ray/worker.py", line 1033, in sigterm_handler sys.exit(signum) SystemExit: 15 ``` ## Environment info Tested on 2 environments: **Environment 1.** - `datasets` version: 1.14.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 6.0.0 **Environment 2.** - `datasets` version: 1.14.0 - Platform: Linux-4.18.0-305.19.1.el8_4.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.7 - PyArrow version: 6.0.0 Hello @mariomeissner, very sorry for the late reply, I hope you have found a solution to your problem! I don't have public code at the moment. I have not experienced any other issue with hydra, even if I don't understand why changing the location of the definition of `run()` fixed the problem. Overall, I don't have issue with caching anymore, even when 1. using custom fingerprints using the argument `new_fingerprint 2. when using `num_proc>1`
[ -1.1256572008132935, -0.8851135969161987, -0.6827611327171326, 1.450364589691162, -0.18745926022529602, -1.290369987487793, 0.28105470538139343, -1.0788518190383911, 1.776857614517212, -0.7800658345222473, 0.3009101152420044, -1.6550285816192627, 0.0002498980611562729, -0.5880305767059326, -0.8328458666801453, -0.8398420810699463, -0.46488770842552185, -0.7566807270050049, 1.0313377380371094, 2.4417684078216553, 1.2001439332962036, -1.3132323026657104, 2.656473398208618, 0.6554797887802124, -0.18419556319713593, -1.0346837043762207, 0.49875620007514954, -0.0631626546382904, -1.2786885499954224, -0.4345577657222748, -0.9413286447525024, -0.09351061284542084, -0.5938616991043091, -0.6227636337280273, 0.03103751689195633, 0.4725525677204132, -0.3422357738018036, -0.5643664598464966, -0.46326813101768494, -0.8602815270423889, 0.5096392035484314, -0.3299400210380554, 0.9322617650032043, -0.3254329264163971, 1.8171533346176147, -0.658410906791687, 0.5608736872673035, 0.78468918800354, 1.332165002822876, 0.24964159727096558, -0.09249693155288696, 0.4723278284072876, 0.4520961344242096, 0.12562021613121033, 0.5211244225502014, 1.1947753429412842, 0.580953061580658, 0.5343669056892395, 0.7413530349731445, -2.2397196292877197, 1.2194092273712158, -1.0046905279159546, 0.3126879632472992, 1.1795990467071533, -0.9274096488952637, 0.22089751064777374, -1.8029508590698242, -0.05870671942830086, 0.5719430446624756, -2.213547706604004, 0.2972020208835602, -1.3876606225967407, -0.40899959206581116, 1.0678236484527588, 0.43406835198402405, -1.2715147733688354, 0.07816673815250397, -0.36092323064804077, 0.9936730265617371, 0.38598713278770447, 1.1278703212738037, -1.6837141513824463, -0.0551098957657814, -0.3416042625904083, 0.18259499967098236, -1.1867284774780273, -1.513588786125183, 0.6046320796012878, 0.7238010168075562, 0.5162524580955505, -0.2254912108182907, 1.0352404117584229, -0.9168687462806702, 0.7408739328384399, -0.9772177934646606, -1.883586049079895, -1.4023433923721313, -2.1214842796325684, -2.2628729343414307, 0.7284823656082153, -0.4411376416683197, -0.47997015714645386, 2.100285530090332, -0.9448794722557068, -1.819656252861023, 1.0821101665496826, 0.2536468207836151, -0.07068666815757751, 2.250727891921997, 0.28069472312927246, -0.715405285358429, 0.4259248375892639, -0.7435665726661682, 0.7547957301139832, -0.3539869785308838, 1.3659608364105225, 0.37584006786346436, -1.0518555641174316, 1.6155160665512085, -0.27898362278938293, 0.6422792077064514, -0.7466445565223694, -0.4949314296245575, -0.6895550489425659, 0.31276845932006836, 2.01255202293396, -0.3590109050273895, 1.4889633655548096, -0.37569019198417664, -1.599100112915039, -1.5663660764694214, 0.9026719331741333, 0.47708386182785034, -0.7198726534843445, 0.10950572788715363, -0.4137439429759979, 0.10788024961948395, -0.03529128432273865, 1.2491588592529297, 1.316269874572754, 0.8903676271438599, -0.36315178871154785, -0.848163902759552, 0.13640987873077393, 0.04906804487109184, -0.7426098585128784, -1.7991946935653687, -0.3991987407207489, 0.11622445285320282, 0.602918803691864, -1.061003565788269, 1.7558706998825073, 0.8412637114524841, 1.9321482181549072, 1.0658618211746216, -0.3206773102283478, 1.4665507078170776, 0.10625492036342621, 1.9067286252975464, -0.36774080991744995, 0.6174294352531433, -0.39188703894615173, -1.1916775703430176, 0.8629434108734131, -0.24865280091762543, -2.0725581645965576, -0.6951000094413757, -0.8145115971565247, -0.10771980881690979, -0.7138111591339111, 0.9153690934181213, -0.27556097507476807, -1.4369935989379883, 0.1755976527929306, -0.8097484111785889, 0.05591558292508125, -1.2071272134780884, 0.2996244728565216, 0.6622897982597351, -0.682598352432251, 0.20779429376125336, -0.2674912214279175, -1.2895643711090088, -0.5156000256538391, 0.3085595965385437, 1.8243392705917358, -0.79152512550354, 0.9986351132392883, 1.0941089391708374, -0.7032536864280701, -0.02391093596816063, 0.37832534313201904, -0.3468831181526184, 0.8307851552963257, -1.0630887746810913, -0.39549046754837036, 1.224774956703186, -0.1808282881975174, -0.6521210670471191, 1.481584906578064, 0.6662384867668152, -0.9941486120223999, -0.0970136970281601, -0.17068782448768616, -0.9077270030975342, 0.07152664661407471, -1.6590867042541504, -0.1309569776058197, 0.47895997762680054, -1.5626815557479858, -0.5366502404212952, -0.18712930381298065, 1.2956620454788208, -0.0588165782392025, 1.4210543632507324, -0.32888391613960266, -0.1957520693540573, -0.3904247283935547, -0.3536050021648407, 0.055787574499845505, -0.21273471415042877, -0.5968838334083557, 0.2063848376274109, -0.754740834236145, 0.3822382688522339, 1.4673802852630615, 0.21162597835063934, -0.017474358901381493, 0.5533021092414856, 1.1048816442489624, 0.32955875992774963, -0.056312445551157, -0.8514382243156433, -1.6091350317001343, 2.0121049880981445, -1.3892710208892822, 1.945712685585022, 0.6818687915802002, -0.04188718646764755, -1.7913721799850464, -1.9406428337097168, 1.3878692388534546, 1.1167303323745728, 2.3515326976776123, 0.5745888352394104, 0.40398961305618286, -0.7448040843009949, -0.593031108379364, 0.36983922123908997, -1.061010718345642, -0.7084890604019165, 0.16293826699256897, 2.387950897216797, 1.7465847730636597, -0.504570484161377, -0.17893800139427185, -1.05910062789917, 1.4176323413848877, -0.2159620225429535, 0.23104405403137207, 1.979678750038147, -0.21407240629196167, -1.0545393228530884, 1.285610556602478, -2.2251362800598145, 0.19788962602615356, 2.01373291015625, 0.1350318193435669, 0.12835414707660675, -1.4375592470169067, -0.5798381567001343, -0.2058178186416626, -0.4029817581176758, -1.1880003213882446, 0.5455441474914551, -0.22250111401081085, -0.7894684076309204, -1.3852072954177856, 0.20378705859184265, -1.0570365190505981, -1.7277557849884033, 0.17312008142471313, 1.9437975883483887, 1.9305503368377686, -0.6513479948043823, 1.622961401939392, -0.36760199069976807, 0.20848922431468964, 1.279296636581421, 1.2366814613342285, 3.143890380859375, 1.9039387702941895, -1.2986012697219849, 0.7172440886497498, -0.11582189798355103, -0.49989232420921326, 1.2136896848678589, -1.1960197687149048, 1.1963564157485962, -0.25852736830711365, -1.1867953538894653, -1.2045578956604004, 0.9275686740875244, 0.47705021500587463, 0.04065284878015518, -0.42189064621925354, 1.161603331565857, 0.076618492603302, 1.333850383758545, 0.5476053357124329, -0.3358871638774872, 0.7802925705909729, -0.35833457112312317, -0.4552901089191437, 1.5148905515670776, 0.32647624611854553, -1.3221063613891602, -2.2842776775360107, -0.17726744711399078, -0.863450288772583, 0.1463879942893982, -0.5855915546417236, -0.9440304040908813, 1.6235381364822388, 0.38594186305999756, -1.2561440467834473, -0.31195685267448425, -0.33187800645828247, -0.5652783513069153, 2.698890447616577, -1.2904778718948364, -0.2768386900424957, -0.9892630577087402, -0.6394625306129456, 1.6925419569015503, -1.213563323020935, -0.2602498531341553, -0.9811103343963623, -0.44718554615974426, -1.241684079170227, -0.6285310983657837, 0.04549071565270424, -0.9443247318267822, 0.9125984311103821, 0.14430342614650726, -1.237990140914917, -0.30239516496658325, -0.8821237087249756, 0.9453220367431641, -0.1521906554698944, 0.13408491015434265, 1.943935513496399, 0.4243132770061493, -0.3934699296951294, 0.752065122127533, 1.071365475654602, 0.5532503128051758, -0.5199944972991943, 0.3454991281032562, -0.6669015884399414, 0.2521202266216278, -1.335314154624939, 0.2655823230743408, -2.827345609664917, 0.612137496471405, -0.025905292481184006, 0.010473627597093582, -0.05619727820158005, -1.3931022882461548, 1.0213135480880737, 2.609795570373535, -1.2326016426086426, 0.4299182891845703, 0.32069259881973267, 1.2069061994552612, -1.5001487731933594, 0.3034454882144928, -0.4421710669994354, 2.1518516540527344, 0.21441863477230072, 1.2293845415115356, -0.3500826358795166, -2.268148422241211, 0.6669782400131226, -1.2451121807098389, -1.2197673320770264, 0.8028319478034973, -0.8424441814422607, 0.01859452575445175, -1.3471077680587769, -0.21421334147453308, -0.8103446960449219, -1.1686551570892334, 0.6992774605751038, 0.17010745406150818, 0.4942394196987152, -0.6376447081565857, 0.3196348547935486, -2.138154983520508, -1.3043209314346313, -0.2796347439289093, -0.9749016761779785, 0.43575018644332886, -0.29804307222366333, 0.6503849625587463, -0.27595511078834534, 0.0007189027965068817, 0.4292791187763214, 1.484238862991333, 3.4338929653167725, 0.16716323792934418, 0.16728296875953674, -0.24853019416332245, -0.8871904611587524, 1.3692466020584106, 0.9222357869148254, -0.2334168404340744, -0.5791563987731934, -1.0344270467758179, 1.1498823165893555, 2.0337934494018555, 0.9404385685920715, 0.06083684787154198, -0.8415759801864624, -0.8090225458145142, -0.04705885797739029, 0.07734565436840057, 0.4781356453895569, 0.8644660115242004, 0.20491473376750946, 0.08721879124641418, 1.324256420135498, 1.0824192762374878, -0.41132599115371704, 0.4301898181438446, -0.8571598529815674, -0.4440683126449585, 0.5364218354225159, 0.35720524191856384, 0.00860566832125187, 0.26002028584480286, -1.0397617816925049, -0.2446349859237671, -0.4107992947101593, -0.9009073376655579, -0.7843169569969177, -0.38671112060546875, -0.3535517752170563, 1.6242355108261108, 0.05445462837815285, -0.49030372500419617, -0.08420217037200928, -0.6766005754470825, -0.040859878063201904, -0.9671544432640076, 0.3167932629585266, -0.12336240708827972, -0.1262984275817871, -0.08134107291698456, 1.6582674980163574, -0.8947870135307312, -1.9590671062469482, 0.33396705985069275, 0.1514335423707962, -0.3863726556301117, 0.27468329668045044, 1.6435197591781616, 0.6286851763725281, 1.3950457572937012, 1.4723930358886719, 0.9596198797225952, -0.6562865376472473, -1.2895303964614868, 0.6201711297035217, 0.8992021083831787, -1.4636752605438232, 0.6784982085227966, 0.13382083177566528, -0.45932990312576294, 0.6270835995674133, 1.2404096126556396, 0.5037272572517395, -2.08801531791687, 0.7199451327323914, -0.8933514356613159, 0.7483136057853699, 0.700383722782135, 0.707467794418335, 0.2012716680765152, 0.800986111164093, -1.1491801738739014, -1.1619906425476074, -0.7496136426925659, -0.7618401646614075, 1.941922903060913, -0.2131803035736084, 0.5023368000984192, -0.15400634706020355, -1.405354380607605, -0.216307133436203, 0.7118403911590576, 0.37544670701026917, -0.6231978535652161, 0.6890423893928528, -0.5782482624053955, -1.06142258644104, -1.3435882329940796, -0.5014569163322449, -1.1226370334625244, -0.9651176333427429, 0.9083344340324402, 0.7784411907196045, 0.3471324145793915, 1.8303362131118774, 0.666248619556427, 0.24748492240905762, -2.6183061599731445, 0.9160643815994263, 0.3745294511318207, -0.13144391775131226, 0.8030384182929993, 0.3374793231487274, 0.9665696024894714, -0.10230948030948639, 0.6941930055618286, -2.4074573516845703, 2.309725046157837, -0.20172595977783203, 0.6269664764404297, 0.048287104815244675, -0.22309726476669312, 1.0478202104568481, 0.5346261262893677, 0.6030502915382385, -1.1084171533584595, 0.6766266226768494, -0.7099647521972656, 1.2492144107818604, 0.7631498575210571, -0.8465299010276794, -0.061163466423749924, 1.422778606414795, 0.48616063594818115, -0.5205634832382202, -0.904366135597229, -1.0791062116622925, 0.9548395872116089, 1.716349720954895, -0.1638934165239334, -0.017423423007130623, 0.8671590685844421, 0.6997189521789551, -1.3234875202178955, 0.02426641434431076, -0.7772929072380066, -0.7391695380210876, 1.5955621004104614, 2.092367172241211, -0.19509834051132202, -0.17493924498558044, -0.8517513275146484, -1.250156044960022, 0.8449327945709229, -0.0030264807865023613, -0.0015910957008600235, 0.6264957189559937, -0.5645798444747925, 1.208782434463501, 0.857281506061554, 0.9540154933929443, 0.2660459578037262, 0.3524121940135956, 0.29573291540145874, -0.33973583579063416, -1.1989818811416626, -0.28339478373527527, -1.0124753713607788, -2.523211717605591, 0.5218673348426819, -0.19121037423610687, -1.4696567058563232, 0.074787437915802, -1.0653518438339233, 0.8431699872016907, -0.588082492351532, -1.089103102684021, -1.4600670337677002, 0.20788909494876862, -0.013197531923651695, 0.9112851619720459, -1.5879583358764648, -0.018412217497825623, 1.2563618421554565, 0.8984710574150085, -0.7705352902412415, 0.9235518574714661, 0.34506309032440186, 1.0428180694580078, 0.9951356053352356, -0.38534244894981384, 0.5369171500205994, 0.008019614964723587, -1.2928611040115356, 0.4937233030796051, 1.1904674768447876, 0.15186630189418793, 1.4969810247421265, -0.608112633228302, 0.005845417268574238, 0.4163549542427063, -0.528562605381012, -0.44570472836494446, -0.6192602515220642, 0.6253646016120911, -0.012371551245450974, -0.8969449996948242, -0.0007082736119627953, 0.03296200558543205, -0.168334499001503, 0.24862927198410034, -1.5707752704620361, -0.12711238861083984, -0.2677106261253357, -0.6588118672370911, -1.1837859153747559, -0.17556855082511902, 1.4215868711471558, -0.736097514629364, -0.20929500460624695, 0.5377440452575684, 0.3135983943939209, 0.5456671714782715, 0.5739179253578186, -0.7002539038658142, -0.42350658774375916, -0.2682572603225708, -0.39719831943511963, 0.3374054729938507, 1.4433603286743164, -0.024901017546653748, -0.9466163516044617, 0.7787512540817261, -0.40996238589286804, 0.034227583557367325, 1.869588017463684, 0.11567479372024536, -0.8552009463310242, 0.22155043482780457, -0.6774331331253052, 1.9680471420288086, 1.8116118907928467, 1.2483922243118286, 0.003069048747420311, -1.0614922046661377, 0.5351414680480957, -0.36952802538871765, -0.3862428367137909, 0.8344606161117554, 0.3550645112991333, -0.23517292737960815, -1.3135881423950195, 0.7371501922607422, 1.3275279998779297, -0.843223512172699, -0.9434491395950317, 0.058756452053785324, -0.7547898888587952, 1.0933679342269897, 0.7331910729408264, 0.3430050015449524, 0.18015196919441223, 1.574092984199524, 0.7847505211830139, -0.343099445104599, 0.5926638841629028, 0.47304025292396545, -0.0710069090127945, -2.1879260540008545, -1.1921637058258057, 0.38965100049972534, -0.5062064528465271, -1.715299129486084, 1.4160356521606445, -1.1532301902770996, -0.9558315873146057, 0.5252717137336731, 0.0745379626750946, 1.511203408241272, 0.3993036150932312, 1.591766595840454, 2.0531787872314453, 0.911801815032959, 0.4185022711753845, 1.3413052558898926, -0.15401577949523926, -0.5236106514930725, 1.7758210897445679, -0.48907437920570374, 0.49330028891563416, 1.0757790803909302, -0.3068802058696747, -1.0614389181137085, -0.8166137337684631, -1.299529790878296, -0.7803850173950195, 1.1188864707946777, 0.03789159283041954, -1.1882052421569824, 0.3258931636810303, 1.5990850925445557, 0.13562506437301636, -0.3090306520462036, 0.7023259401321411, 0.32910117506980896, -0.8428872227668762, -0.03736010938882828, -0.9112192988395691, 0.4836830794811249, -0.1716383993625641, -0.39844855666160583, 0.3937656283378601, 0.41436439752578735, 1.2797590494155884, -0.0736151933670044, 0.057256389409303665, 1.1225239038467407, -1.4697290658950806, 1.5157629251480103, -0.7205516695976257, 0.3233727812767029, -2.3524134159088135, 1.3698228597640991, -0.8236557245254517, 1.8964029550552368, -2.6710548400878906, 0.4111056625843048, -0.5415371656417847, -0.5036700963973999, 0.21309800446033478, -0.26349714398384094, 0.09993405640125275, -0.16259706020355225, -1.2111244201660156, -0.058873120695352554, -0.7407782673835754, 0.6668990254402161, 1.0744984149932861, 1.4280189275741577, -1.1201752424240112, -0.2537951171398163, -1.7557443380355835, -0.1013275682926178, -0.6206730604171753, 0.3856459856033325, -1.9752486944198608, -0.11955741047859192, -1.9247384071350098, -2.3604791164398193, -1.2502902746200562, -0.8510486483573914, 1.002915859222412, 0.07726047933101654, -0.8174768686294556, 1.1634764671325684, -0.3921872675418854, -1.9518882036209106, 1.107117772102356, -2.1926987171173096 ]
https://github.com/huggingface/datasets/issues/3172
`SystemError 15` thrown in `Dataset.__del__` when using `Dataset.map()` with `num_proc>1`
I solved my issue by turning the map callable into a class static method, like they do in `lightning-transformers`. Very strange...
## Describe the bug I use `datasets.map` to preprocess some data in my application. The error `SystemError 15` is thrown at the end of the execution of `Dataset.map()` (only with `num_proc>1`. Traceback included bellow. The exception is raised only when the code runs within a specific context. Despite ~10h spent investigating this issue, I have failed to isolate the bug, so let me describe my setup. In my project, `Dataset` is wrapped into a `LightningDataModule` and the data is preprocessed when calling `LightningDataModule.setup()`. Calling `.setup()` in an isolated script works fine (even when wrapped with `hydra.main()`). However, when calling `.setup()` within the experiment script (depends on `pytorch_lightning`), the script crashes and `SystemError 15`. I could avoid throwing this error by modifying ` Dataset.__del__()` (see bellow), but I believe this only moves the problem somewhere else. I am completely stuck with this issue, any hint would be welcome. ```python class Dataset() ... def __del__(self): if hasattr(self, "_data"): _ = self._data # <- ugly trick that allows avoiding the issue. del self._data if hasattr(self, "_indices"): del self._indices ``` ## Steps to reproduce the bug ```python # Unfortunately I couldn't isolate the bug. ``` ## Expected results Calling `Dataset.map()` without throwing an exception. Or at least raising a more detailed exception/traceback. ## Actual results ``` Exception ignored in: <function Dataset.__del__ at 0x7f7cec179160>β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:05<00:00, 1.17ba/s] Traceback (most recent call last): File ".../python3.8/site-packages/datasets/arrow_dataset.py", line 906, in __del__ del self._data File ".../python3.8/site-packages/ray/worker.py", line 1033, in sigterm_handler sys.exit(signum) SystemExit: 15 ``` ## Environment info Tested on 2 environments: **Environment 1.** - `datasets` version: 1.14.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 6.0.0 **Environment 2.** - `datasets` version: 1.14.0 - Platform: Linux-4.18.0-305.19.1.el8_4.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.7 - PyArrow version: 6.0.0
1,141
21
`SystemError 15` thrown in `Dataset.__del__` when using `Dataset.map()` with `num_proc>1` ## Describe the bug I use `datasets.map` to preprocess some data in my application. The error `SystemError 15` is thrown at the end of the execution of `Dataset.map()` (only with `num_proc>1`. Traceback included bellow. The exception is raised only when the code runs within a specific context. Despite ~10h spent investigating this issue, I have failed to isolate the bug, so let me describe my setup. In my project, `Dataset` is wrapped into a `LightningDataModule` and the data is preprocessed when calling `LightningDataModule.setup()`. Calling `.setup()` in an isolated script works fine (even when wrapped with `hydra.main()`). However, when calling `.setup()` within the experiment script (depends on `pytorch_lightning`), the script crashes and `SystemError 15`. I could avoid throwing this error by modifying ` Dataset.__del__()` (see bellow), but I believe this only moves the problem somewhere else. I am completely stuck with this issue, any hint would be welcome. ```python class Dataset() ... def __del__(self): if hasattr(self, "_data"): _ = self._data # <- ugly trick that allows avoiding the issue. del self._data if hasattr(self, "_indices"): del self._indices ``` ## Steps to reproduce the bug ```python # Unfortunately I couldn't isolate the bug. ``` ## Expected results Calling `Dataset.map()` without throwing an exception. Or at least raising a more detailed exception/traceback. ## Actual results ``` Exception ignored in: <function Dataset.__del__ at 0x7f7cec179160>β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:05<00:00, 1.17ba/s] Traceback (most recent call last): File ".../python3.8/site-packages/datasets/arrow_dataset.py", line 906, in __del__ del self._data File ".../python3.8/site-packages/ray/worker.py", line 1033, in sigterm_handler sys.exit(signum) SystemExit: 15 ``` ## Environment info Tested on 2 environments: **Environment 1.** - `datasets` version: 1.14.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 6.0.0 **Environment 2.** - `datasets` version: 1.14.0 - Platform: Linux-4.18.0-305.19.1.el8_4.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.7 - PyArrow version: 6.0.0 I solved my issue by turning the map callable into a class static method, like they do in `lightning-transformers`. Very strange...
[ -1.1256572008132935, -0.8851135969161987, -0.6827611327171326, 1.450364589691162, -0.18745926022529602, -1.290369987487793, 0.28105470538139343, -1.0788518190383911, 1.776857614517212, -0.7800658345222473, 0.3009101152420044, -1.6550285816192627, 0.0002498980611562729, -0.5880305767059326, -0.8328458666801453, -0.8398420810699463, -0.46488770842552185, -0.7566807270050049, 1.0313377380371094, 2.4417684078216553, 1.2001439332962036, -1.3132323026657104, 2.656473398208618, 0.6554797887802124, -0.18419556319713593, -1.0346837043762207, 0.49875620007514954, -0.0631626546382904, -1.2786885499954224, -0.4345577657222748, -0.9413286447525024, -0.09351061284542084, -0.5938616991043091, -0.6227636337280273, 0.03103751689195633, 0.4725525677204132, -0.3422357738018036, -0.5643664598464966, -0.46326813101768494, -0.8602815270423889, 0.5096392035484314, -0.3299400210380554, 0.9322617650032043, -0.3254329264163971, 1.8171533346176147, -0.658410906791687, 0.5608736872673035, 0.78468918800354, 1.332165002822876, 0.24964159727096558, -0.09249693155288696, 0.4723278284072876, 0.4520961344242096, 0.12562021613121033, 0.5211244225502014, 1.1947753429412842, 0.580953061580658, 0.5343669056892395, 0.7413530349731445, -2.2397196292877197, 1.2194092273712158, -1.0046905279159546, 0.3126879632472992, 1.1795990467071533, -0.9274096488952637, 0.22089751064777374, -1.8029508590698242, -0.05870671942830086, 0.5719430446624756, -2.213547706604004, 0.2972020208835602, -1.3876606225967407, -0.40899959206581116, 1.0678236484527588, 0.43406835198402405, -1.2715147733688354, 0.07816673815250397, -0.36092323064804077, 0.9936730265617371, 0.38598713278770447, 1.1278703212738037, -1.6837141513824463, -0.0551098957657814, -0.3416042625904083, 0.18259499967098236, -1.1867284774780273, -1.513588786125183, 0.6046320796012878, 0.7238010168075562, 0.5162524580955505, -0.2254912108182907, 1.0352404117584229, -0.9168687462806702, 0.7408739328384399, -0.9772177934646606, -1.883586049079895, -1.4023433923721313, -2.1214842796325684, -2.2628729343414307, 0.7284823656082153, -0.4411376416683197, -0.47997015714645386, 2.100285530090332, -0.9448794722557068, -1.819656252861023, 1.0821101665496826, 0.2536468207836151, -0.07068666815757751, 2.250727891921997, 0.28069472312927246, -0.715405285358429, 0.4259248375892639, -0.7435665726661682, 0.7547957301139832, -0.3539869785308838, 1.3659608364105225, 0.37584006786346436, -1.0518555641174316, 1.6155160665512085, -0.27898362278938293, 0.6422792077064514, -0.7466445565223694, -0.4949314296245575, -0.6895550489425659, 0.31276845932006836, 2.01255202293396, -0.3590109050273895, 1.4889633655548096, -0.37569019198417664, -1.599100112915039, -1.5663660764694214, 0.9026719331741333, 0.47708386182785034, -0.7198726534843445, 0.10950572788715363, -0.4137439429759979, 0.10788024961948395, -0.03529128432273865, 1.2491588592529297, 1.316269874572754, 0.8903676271438599, -0.36315178871154785, -0.848163902759552, 0.13640987873077393, 0.04906804487109184, -0.7426098585128784, -1.7991946935653687, -0.3991987407207489, 0.11622445285320282, 0.602918803691864, -1.061003565788269, 1.7558706998825073, 0.8412637114524841, 1.9321482181549072, 1.0658618211746216, -0.3206773102283478, 1.4665507078170776, 0.10625492036342621, 1.9067286252975464, -0.36774080991744995, 0.6174294352531433, -0.39188703894615173, -1.1916775703430176, 0.8629434108734131, -0.24865280091762543, -2.0725581645965576, -0.6951000094413757, -0.8145115971565247, -0.10771980881690979, -0.7138111591339111, 0.9153690934181213, -0.27556097507476807, -1.4369935989379883, 0.1755976527929306, -0.8097484111785889, 0.05591558292508125, -1.2071272134780884, 0.2996244728565216, 0.6622897982597351, -0.682598352432251, 0.20779429376125336, -0.2674912214279175, -1.2895643711090088, -0.5156000256538391, 0.3085595965385437, 1.8243392705917358, -0.79152512550354, 0.9986351132392883, 1.0941089391708374, -0.7032536864280701, -0.02391093596816063, 0.37832534313201904, -0.3468831181526184, 0.8307851552963257, -1.0630887746810913, -0.39549046754837036, 1.224774956703186, -0.1808282881975174, -0.6521210670471191, 1.481584906578064, 0.6662384867668152, -0.9941486120223999, -0.0970136970281601, -0.17068782448768616, -0.9077270030975342, 0.07152664661407471, -1.6590867042541504, -0.1309569776058197, 0.47895997762680054, -1.5626815557479858, -0.5366502404212952, -0.18712930381298065, 1.2956620454788208, -0.0588165782392025, 1.4210543632507324, -0.32888391613960266, -0.1957520693540573, -0.3904247283935547, -0.3536050021648407, 0.055787574499845505, -0.21273471415042877, -0.5968838334083557, 0.2063848376274109, -0.754740834236145, 0.3822382688522339, 1.4673802852630615, 0.21162597835063934, -0.017474358901381493, 0.5533021092414856, 1.1048816442489624, 0.32955875992774963, -0.056312445551157, -0.8514382243156433, -1.6091350317001343, 2.0121049880981445, -1.3892710208892822, 1.945712685585022, 0.6818687915802002, -0.04188718646764755, -1.7913721799850464, -1.9406428337097168, 1.3878692388534546, 1.1167303323745728, 2.3515326976776123, 0.5745888352394104, 0.40398961305618286, -0.7448040843009949, -0.593031108379364, 0.36983922123908997, -1.061010718345642, -0.7084890604019165, 0.16293826699256897, 2.387950897216797, 1.7465847730636597, -0.504570484161377, -0.17893800139427185, -1.05910062789917, 1.4176323413848877, -0.2159620225429535, 0.23104405403137207, 1.979678750038147, -0.21407240629196167, -1.0545393228530884, 1.285610556602478, -2.2251362800598145, 0.19788962602615356, 2.01373291015625, 0.1350318193435669, 0.12835414707660675, -1.4375592470169067, -0.5798381567001343, -0.2058178186416626, -0.4029817581176758, -1.1880003213882446, 0.5455441474914551, -0.22250111401081085, -0.7894684076309204, -1.3852072954177856, 0.20378705859184265, -1.0570365190505981, -1.7277557849884033, 0.17312008142471313, 1.9437975883483887, 1.9305503368377686, -0.6513479948043823, 1.622961401939392, -0.36760199069976807, 0.20848922431468964, 1.279296636581421, 1.2366814613342285, 3.143890380859375, 1.9039387702941895, -1.2986012697219849, 0.7172440886497498, -0.11582189798355103, -0.49989232420921326, 1.2136896848678589, -1.1960197687149048, 1.1963564157485962, -0.25852736830711365, -1.1867953538894653, -1.2045578956604004, 0.9275686740875244, 0.47705021500587463, 0.04065284878015518, -0.42189064621925354, 1.161603331565857, 0.076618492603302, 1.333850383758545, 0.5476053357124329, -0.3358871638774872, 0.7802925705909729, -0.35833457112312317, -0.4552901089191437, 1.5148905515670776, 0.32647624611854553, -1.3221063613891602, -2.2842776775360107, -0.17726744711399078, -0.863450288772583, 0.1463879942893982, -0.5855915546417236, -0.9440304040908813, 1.6235381364822388, 0.38594186305999756, -1.2561440467834473, -0.31195685267448425, -0.33187800645828247, -0.5652783513069153, 2.698890447616577, -1.2904778718948364, -0.2768386900424957, -0.9892630577087402, -0.6394625306129456, 1.6925419569015503, -1.213563323020935, -0.2602498531341553, -0.9811103343963623, -0.44718554615974426, -1.241684079170227, -0.6285310983657837, 0.04549071565270424, -0.9443247318267822, 0.9125984311103821, 0.14430342614650726, -1.237990140914917, -0.30239516496658325, -0.8821237087249756, 0.9453220367431641, -0.1521906554698944, 0.13408491015434265, 1.943935513496399, 0.4243132770061493, -0.3934699296951294, 0.752065122127533, 1.071365475654602, 0.5532503128051758, -0.5199944972991943, 0.3454991281032562, -0.6669015884399414, 0.2521202266216278, -1.335314154624939, 0.2655823230743408, -2.827345609664917, 0.612137496471405, -0.025905292481184006, 0.010473627597093582, -0.05619727820158005, -1.3931022882461548, 1.0213135480880737, 2.609795570373535, -1.2326016426086426, 0.4299182891845703, 0.32069259881973267, 1.2069061994552612, -1.5001487731933594, 0.3034454882144928, -0.4421710669994354, 2.1518516540527344, 0.21441863477230072, 1.2293845415115356, -0.3500826358795166, -2.268148422241211, 0.6669782400131226, -1.2451121807098389, -1.2197673320770264, 0.8028319478034973, -0.8424441814422607, 0.01859452575445175, -1.3471077680587769, -0.21421334147453308, -0.8103446960449219, -1.1686551570892334, 0.6992774605751038, 0.17010745406150818, 0.4942394196987152, -0.6376447081565857, 0.3196348547935486, -2.138154983520508, -1.3043209314346313, -0.2796347439289093, -0.9749016761779785, 0.43575018644332886, -0.29804307222366333, 0.6503849625587463, -0.27595511078834534, 0.0007189027965068817, 0.4292791187763214, 1.484238862991333, 3.4338929653167725, 0.16716323792934418, 0.16728296875953674, -0.24853019416332245, -0.8871904611587524, 1.3692466020584106, 0.9222357869148254, -0.2334168404340744, -0.5791563987731934, -1.0344270467758179, 1.1498823165893555, 2.0337934494018555, 0.9404385685920715, 0.06083684787154198, -0.8415759801864624, -0.8090225458145142, -0.04705885797739029, 0.07734565436840057, 0.4781356453895569, 0.8644660115242004, 0.20491473376750946, 0.08721879124641418, 1.324256420135498, 1.0824192762374878, -0.41132599115371704, 0.4301898181438446, -0.8571598529815674, -0.4440683126449585, 0.5364218354225159, 0.35720524191856384, 0.00860566832125187, 0.26002028584480286, -1.0397617816925049, -0.2446349859237671, -0.4107992947101593, -0.9009073376655579, -0.7843169569969177, -0.38671112060546875, -0.3535517752170563, 1.6242355108261108, 0.05445462837815285, -0.49030372500419617, -0.08420217037200928, -0.6766005754470825, -0.040859878063201904, -0.9671544432640076, 0.3167932629585266, -0.12336240708827972, -0.1262984275817871, -0.08134107291698456, 1.6582674980163574, -0.8947870135307312, -1.9590671062469482, 0.33396705985069275, 0.1514335423707962, -0.3863726556301117, 0.27468329668045044, 1.6435197591781616, 0.6286851763725281, 1.3950457572937012, 1.4723930358886719, 0.9596198797225952, -0.6562865376472473, -1.2895303964614868, 0.6201711297035217, 0.8992021083831787, -1.4636752605438232, 0.6784982085227966, 0.13382083177566528, -0.45932990312576294, 0.6270835995674133, 1.2404096126556396, 0.5037272572517395, -2.08801531791687, 0.7199451327323914, -0.8933514356613159, 0.7483136057853699, 0.700383722782135, 0.707467794418335, 0.2012716680765152, 0.800986111164093, -1.1491801738739014, -1.1619906425476074, -0.7496136426925659, -0.7618401646614075, 1.941922903060913, -0.2131803035736084, 0.5023368000984192, -0.15400634706020355, -1.405354380607605, -0.216307133436203, 0.7118403911590576, 0.37544670701026917, -0.6231978535652161, 0.6890423893928528, -0.5782482624053955, -1.06142258644104, -1.3435882329940796, -0.5014569163322449, -1.1226370334625244, -0.9651176333427429, 0.9083344340324402, 0.7784411907196045, 0.3471324145793915, 1.8303362131118774, 0.666248619556427, 0.24748492240905762, -2.6183061599731445, 0.9160643815994263, 0.3745294511318207, -0.13144391775131226, 0.8030384182929993, 0.3374793231487274, 0.9665696024894714, -0.10230948030948639, 0.6941930055618286, -2.4074573516845703, 2.309725046157837, -0.20172595977783203, 0.6269664764404297, 0.048287104815244675, -0.22309726476669312, 1.0478202104568481, 0.5346261262893677, 0.6030502915382385, -1.1084171533584595, 0.6766266226768494, -0.7099647521972656, 1.2492144107818604, 0.7631498575210571, -0.8465299010276794, -0.061163466423749924, 1.422778606414795, 0.48616063594818115, -0.5205634832382202, -0.904366135597229, -1.0791062116622925, 0.9548395872116089, 1.716349720954895, -0.1638934165239334, -0.017423423007130623, 0.8671590685844421, 0.6997189521789551, -1.3234875202178955, 0.02426641434431076, -0.7772929072380066, -0.7391695380210876, 1.5955621004104614, 2.092367172241211, -0.19509834051132202, -0.17493924498558044, -0.8517513275146484, -1.250156044960022, 0.8449327945709229, -0.0030264807865023613, -0.0015910957008600235, 0.6264957189559937, -0.5645798444747925, 1.208782434463501, 0.857281506061554, 0.9540154933929443, 0.2660459578037262, 0.3524121940135956, 0.29573291540145874, -0.33973583579063416, -1.1989818811416626, -0.28339478373527527, -1.0124753713607788, -2.523211717605591, 0.5218673348426819, -0.19121037423610687, -1.4696567058563232, 0.074787437915802, -1.0653518438339233, 0.8431699872016907, -0.588082492351532, -1.089103102684021, -1.4600670337677002, 0.20788909494876862, -0.013197531923651695, 0.9112851619720459, -1.5879583358764648, -0.018412217497825623, 1.2563618421554565, 0.8984710574150085, -0.7705352902412415, 0.9235518574714661, 0.34506309032440186, 1.0428180694580078, 0.9951356053352356, -0.38534244894981384, 0.5369171500205994, 0.008019614964723587, -1.2928611040115356, 0.4937233030796051, 1.1904674768447876, 0.15186630189418793, 1.4969810247421265, -0.608112633228302, 0.005845417268574238, 0.4163549542427063, -0.528562605381012, -0.44570472836494446, -0.6192602515220642, 0.6253646016120911, -0.012371551245450974, -0.8969449996948242, -0.0007082736119627953, 0.03296200558543205, -0.168334499001503, 0.24862927198410034, -1.5707752704620361, -0.12711238861083984, -0.2677106261253357, -0.6588118672370911, -1.1837859153747559, -0.17556855082511902, 1.4215868711471558, -0.736097514629364, -0.20929500460624695, 0.5377440452575684, 0.3135983943939209, 0.5456671714782715, 0.5739179253578186, -0.7002539038658142, -0.42350658774375916, -0.2682572603225708, -0.39719831943511963, 0.3374054729938507, 1.4433603286743164, -0.024901017546653748, -0.9466163516044617, 0.7787512540817261, -0.40996238589286804, 0.034227583557367325, 1.869588017463684, 0.11567479372024536, -0.8552009463310242, 0.22155043482780457, -0.6774331331253052, 1.9680471420288086, 1.8116118907928467, 1.2483922243118286, 0.003069048747420311, -1.0614922046661377, 0.5351414680480957, -0.36952802538871765, -0.3862428367137909, 0.8344606161117554, 0.3550645112991333, -0.23517292737960815, -1.3135881423950195, 0.7371501922607422, 1.3275279998779297, -0.843223512172699, -0.9434491395950317, 0.058756452053785324, -0.7547898888587952, 1.0933679342269897, 0.7331910729408264, 0.3430050015449524, 0.18015196919441223, 1.574092984199524, 0.7847505211830139, -0.343099445104599, 0.5926638841629028, 0.47304025292396545, -0.0710069090127945, -2.1879260540008545, -1.1921637058258057, 0.38965100049972534, -0.5062064528465271, -1.715299129486084, 1.4160356521606445, -1.1532301902770996, -0.9558315873146057, 0.5252717137336731, 0.0745379626750946, 1.511203408241272, 0.3993036150932312, 1.591766595840454, 2.0531787872314453, 0.911801815032959, 0.4185022711753845, 1.3413052558898926, -0.15401577949523926, -0.5236106514930725, 1.7758210897445679, -0.48907437920570374, 0.49330028891563416, 1.0757790803909302, -0.3068802058696747, -1.0614389181137085, -0.8166137337684631, -1.299529790878296, -0.7803850173950195, 1.1188864707946777, 0.03789159283041954, -1.1882052421569824, 0.3258931636810303, 1.5990850925445557, 0.13562506437301636, -0.3090306520462036, 0.7023259401321411, 0.32910117506980896, -0.8428872227668762, -0.03736010938882828, -0.9112192988395691, 0.4836830794811249, -0.1716383993625641, -0.39844855666160583, 0.3937656283378601, 0.41436439752578735, 1.2797590494155884, -0.0736151933670044, 0.057256389409303665, 1.1225239038467407, -1.4697290658950806, 1.5157629251480103, -0.7205516695976257, 0.3233727812767029, -2.3524134159088135, 1.3698228597640991, -0.8236557245254517, 1.8964029550552368, -2.6710548400878906, 0.4111056625843048, -0.5415371656417847, -0.5036700963973999, 0.21309800446033478, -0.26349714398384094, 0.09993405640125275, -0.16259706020355225, -1.2111244201660156, -0.058873120695352554, -0.7407782673835754, 0.6668990254402161, 1.0744984149932861, 1.4280189275741577, -1.1201752424240112, -0.2537951171398163, -1.7557443380355835, -0.1013275682926178, -0.6206730604171753, 0.3856459856033325, -1.9752486944198608, -0.11955741047859192, -1.9247384071350098, -2.3604791164398193, -1.2502902746200562, -0.8510486483573914, 1.002915859222412, 0.07726047933101654, -0.8174768686294556, 1.1634764671325684, -0.3921872675418854, -1.9518882036209106, 1.107117772102356, -2.1926987171173096 ]
https://github.com/huggingface/datasets/issues/3172
`SystemError 15` thrown in `Dataset.__del__` when using `Dataset.map()` with `num_proc>1`
I have this issue with datasets v2.5.2 with Python 3.8.10 on Ubuntu 20.04.4 LTS. It does not occur when num_proc=1. When num_proc>1, it intermittently occurs and will cause process to hang. As previously mentioned, it occurs even when datasets have been previously cached. I have tried wrapping logic in a static class as suggested with @mariomeissner with no improvement.
## Describe the bug I use `datasets.map` to preprocess some data in my application. The error `SystemError 15` is thrown at the end of the execution of `Dataset.map()` (only with `num_proc>1`. Traceback included bellow. The exception is raised only when the code runs within a specific context. Despite ~10h spent investigating this issue, I have failed to isolate the bug, so let me describe my setup. In my project, `Dataset` is wrapped into a `LightningDataModule` and the data is preprocessed when calling `LightningDataModule.setup()`. Calling `.setup()` in an isolated script works fine (even when wrapped with `hydra.main()`). However, when calling `.setup()` within the experiment script (depends on `pytorch_lightning`), the script crashes and `SystemError 15`. I could avoid throwing this error by modifying ` Dataset.__del__()` (see bellow), but I believe this only moves the problem somewhere else. I am completely stuck with this issue, any hint would be welcome. ```python class Dataset() ... def __del__(self): if hasattr(self, "_data"): _ = self._data # <- ugly trick that allows avoiding the issue. del self._data if hasattr(self, "_indices"): del self._indices ``` ## Steps to reproduce the bug ```python # Unfortunately I couldn't isolate the bug. ``` ## Expected results Calling `Dataset.map()` without throwing an exception. Or at least raising a more detailed exception/traceback. ## Actual results ``` Exception ignored in: <function Dataset.__del__ at 0x7f7cec179160>β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:05<00:00, 1.17ba/s] Traceback (most recent call last): File ".../python3.8/site-packages/datasets/arrow_dataset.py", line 906, in __del__ del self._data File ".../python3.8/site-packages/ray/worker.py", line 1033, in sigterm_handler sys.exit(signum) SystemExit: 15 ``` ## Environment info Tested on 2 environments: **Environment 1.** - `datasets` version: 1.14.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 6.0.0 **Environment 2.** - `datasets` version: 1.14.0 - Platform: Linux-4.18.0-305.19.1.el8_4.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.7 - PyArrow version: 6.0.0
1,141
59
`SystemError 15` thrown in `Dataset.__del__` when using `Dataset.map()` with `num_proc>1` ## Describe the bug I use `datasets.map` to preprocess some data in my application. The error `SystemError 15` is thrown at the end of the execution of `Dataset.map()` (only with `num_proc>1`. Traceback included bellow. The exception is raised only when the code runs within a specific context. Despite ~10h spent investigating this issue, I have failed to isolate the bug, so let me describe my setup. In my project, `Dataset` is wrapped into a `LightningDataModule` and the data is preprocessed when calling `LightningDataModule.setup()`. Calling `.setup()` in an isolated script works fine (even when wrapped with `hydra.main()`). However, when calling `.setup()` within the experiment script (depends on `pytorch_lightning`), the script crashes and `SystemError 15`. I could avoid throwing this error by modifying ` Dataset.__del__()` (see bellow), but I believe this only moves the problem somewhere else. I am completely stuck with this issue, any hint would be welcome. ```python class Dataset() ... def __del__(self): if hasattr(self, "_data"): _ = self._data # <- ugly trick that allows avoiding the issue. del self._data if hasattr(self, "_indices"): del self._indices ``` ## Steps to reproduce the bug ```python # Unfortunately I couldn't isolate the bug. ``` ## Expected results Calling `Dataset.map()` without throwing an exception. Or at least raising a more detailed exception/traceback. ## Actual results ``` Exception ignored in: <function Dataset.__del__ at 0x7f7cec179160>β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:05<00:00, 1.17ba/s] Traceback (most recent call last): File ".../python3.8/site-packages/datasets/arrow_dataset.py", line 906, in __del__ del self._data File ".../python3.8/site-packages/ray/worker.py", line 1033, in sigterm_handler sys.exit(signum) SystemExit: 15 ``` ## Environment info Tested on 2 environments: **Environment 1.** - `datasets` version: 1.14.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 6.0.0 **Environment 2.** - `datasets` version: 1.14.0 - Platform: Linux-4.18.0-305.19.1.el8_4.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.7 - PyArrow version: 6.0.0 I have this issue with datasets v2.5.2 with Python 3.8.10 on Ubuntu 20.04.4 LTS. It does not occur when num_proc=1. When num_proc>1, it intermittently occurs and will cause process to hang. As previously mentioned, it occurs even when datasets have been previously cached. I have tried wrapping logic in a static class as suggested with @mariomeissner with no improvement.
[ -1.1256572008132935, -0.8851135969161987, -0.6827611327171326, 1.450364589691162, -0.18745926022529602, -1.290369987487793, 0.28105470538139343, -1.0788518190383911, 1.776857614517212, -0.7800658345222473, 0.3009101152420044, -1.6550285816192627, 0.0002498980611562729, -0.5880305767059326, -0.8328458666801453, -0.8398420810699463, -0.46488770842552185, -0.7566807270050049, 1.0313377380371094, 2.4417684078216553, 1.2001439332962036, -1.3132323026657104, 2.656473398208618, 0.6554797887802124, -0.18419556319713593, -1.0346837043762207, 0.49875620007514954, -0.0631626546382904, -1.2786885499954224, -0.4345577657222748, -0.9413286447525024, -0.09351061284542084, -0.5938616991043091, -0.6227636337280273, 0.03103751689195633, 0.4725525677204132, -0.3422357738018036, -0.5643664598464966, -0.46326813101768494, -0.8602815270423889, 0.5096392035484314, -0.3299400210380554, 0.9322617650032043, -0.3254329264163971, 1.8171533346176147, -0.658410906791687, 0.5608736872673035, 0.78468918800354, 1.332165002822876, 0.24964159727096558, -0.09249693155288696, 0.4723278284072876, 0.4520961344242096, 0.12562021613121033, 0.5211244225502014, 1.1947753429412842, 0.580953061580658, 0.5343669056892395, 0.7413530349731445, -2.2397196292877197, 1.2194092273712158, -1.0046905279159546, 0.3126879632472992, 1.1795990467071533, -0.9274096488952637, 0.22089751064777374, -1.8029508590698242, -0.05870671942830086, 0.5719430446624756, -2.213547706604004, 0.2972020208835602, -1.3876606225967407, -0.40899959206581116, 1.0678236484527588, 0.43406835198402405, -1.2715147733688354, 0.07816673815250397, -0.36092323064804077, 0.9936730265617371, 0.38598713278770447, 1.1278703212738037, -1.6837141513824463, -0.0551098957657814, -0.3416042625904083, 0.18259499967098236, -1.1867284774780273, -1.513588786125183, 0.6046320796012878, 0.7238010168075562, 0.5162524580955505, -0.2254912108182907, 1.0352404117584229, -0.9168687462806702, 0.7408739328384399, -0.9772177934646606, -1.883586049079895, -1.4023433923721313, -2.1214842796325684, -2.2628729343414307, 0.7284823656082153, -0.4411376416683197, -0.47997015714645386, 2.100285530090332, -0.9448794722557068, -1.819656252861023, 1.0821101665496826, 0.2536468207836151, -0.07068666815757751, 2.250727891921997, 0.28069472312927246, -0.715405285358429, 0.4259248375892639, -0.7435665726661682, 0.7547957301139832, -0.3539869785308838, 1.3659608364105225, 0.37584006786346436, -1.0518555641174316, 1.6155160665512085, -0.27898362278938293, 0.6422792077064514, -0.7466445565223694, -0.4949314296245575, -0.6895550489425659, 0.31276845932006836, 2.01255202293396, -0.3590109050273895, 1.4889633655548096, -0.37569019198417664, -1.599100112915039, -1.5663660764694214, 0.9026719331741333, 0.47708386182785034, -0.7198726534843445, 0.10950572788715363, -0.4137439429759979, 0.10788024961948395, -0.03529128432273865, 1.2491588592529297, 1.316269874572754, 0.8903676271438599, -0.36315178871154785, -0.848163902759552, 0.13640987873077393, 0.04906804487109184, -0.7426098585128784, -1.7991946935653687, -0.3991987407207489, 0.11622445285320282, 0.602918803691864, -1.061003565788269, 1.7558706998825073, 0.8412637114524841, 1.9321482181549072, 1.0658618211746216, -0.3206773102283478, 1.4665507078170776, 0.10625492036342621, 1.9067286252975464, -0.36774080991744995, 0.6174294352531433, -0.39188703894615173, -1.1916775703430176, 0.8629434108734131, -0.24865280091762543, -2.0725581645965576, -0.6951000094413757, -0.8145115971565247, -0.10771980881690979, -0.7138111591339111, 0.9153690934181213, -0.27556097507476807, -1.4369935989379883, 0.1755976527929306, -0.8097484111785889, 0.05591558292508125, -1.2071272134780884, 0.2996244728565216, 0.6622897982597351, -0.682598352432251, 0.20779429376125336, -0.2674912214279175, -1.2895643711090088, -0.5156000256538391, 0.3085595965385437, 1.8243392705917358, -0.79152512550354, 0.9986351132392883, 1.0941089391708374, -0.7032536864280701, -0.02391093596816063, 0.37832534313201904, -0.3468831181526184, 0.8307851552963257, -1.0630887746810913, -0.39549046754837036, 1.224774956703186, -0.1808282881975174, -0.6521210670471191, 1.481584906578064, 0.6662384867668152, -0.9941486120223999, -0.0970136970281601, -0.17068782448768616, -0.9077270030975342, 0.07152664661407471, -1.6590867042541504, -0.1309569776058197, 0.47895997762680054, -1.5626815557479858, -0.5366502404212952, -0.18712930381298065, 1.2956620454788208, -0.0588165782392025, 1.4210543632507324, -0.32888391613960266, -0.1957520693540573, -0.3904247283935547, -0.3536050021648407, 0.055787574499845505, -0.21273471415042877, -0.5968838334083557, 0.2063848376274109, -0.754740834236145, 0.3822382688522339, 1.4673802852630615, 0.21162597835063934, -0.017474358901381493, 0.5533021092414856, 1.1048816442489624, 0.32955875992774963, -0.056312445551157, -0.8514382243156433, -1.6091350317001343, 2.0121049880981445, -1.3892710208892822, 1.945712685585022, 0.6818687915802002, -0.04188718646764755, -1.7913721799850464, -1.9406428337097168, 1.3878692388534546, 1.1167303323745728, 2.3515326976776123, 0.5745888352394104, 0.40398961305618286, -0.7448040843009949, -0.593031108379364, 0.36983922123908997, -1.061010718345642, -0.7084890604019165, 0.16293826699256897, 2.387950897216797, 1.7465847730636597, -0.504570484161377, -0.17893800139427185, -1.05910062789917, 1.4176323413848877, -0.2159620225429535, 0.23104405403137207, 1.979678750038147, -0.21407240629196167, -1.0545393228530884, 1.285610556602478, -2.2251362800598145, 0.19788962602615356, 2.01373291015625, 0.1350318193435669, 0.12835414707660675, -1.4375592470169067, -0.5798381567001343, -0.2058178186416626, -0.4029817581176758, -1.1880003213882446, 0.5455441474914551, -0.22250111401081085, -0.7894684076309204, -1.3852072954177856, 0.20378705859184265, -1.0570365190505981, -1.7277557849884033, 0.17312008142471313, 1.9437975883483887, 1.9305503368377686, -0.6513479948043823, 1.622961401939392, -0.36760199069976807, 0.20848922431468964, 1.279296636581421, 1.2366814613342285, 3.143890380859375, 1.9039387702941895, -1.2986012697219849, 0.7172440886497498, -0.11582189798355103, -0.49989232420921326, 1.2136896848678589, -1.1960197687149048, 1.1963564157485962, -0.25852736830711365, -1.1867953538894653, -1.2045578956604004, 0.9275686740875244, 0.47705021500587463, 0.04065284878015518, -0.42189064621925354, 1.161603331565857, 0.076618492603302, 1.333850383758545, 0.5476053357124329, -0.3358871638774872, 0.7802925705909729, -0.35833457112312317, -0.4552901089191437, 1.5148905515670776, 0.32647624611854553, -1.3221063613891602, -2.2842776775360107, -0.17726744711399078, -0.863450288772583, 0.1463879942893982, -0.5855915546417236, -0.9440304040908813, 1.6235381364822388, 0.38594186305999756, -1.2561440467834473, -0.31195685267448425, -0.33187800645828247, -0.5652783513069153, 2.698890447616577, -1.2904778718948364, -0.2768386900424957, -0.9892630577087402, -0.6394625306129456, 1.6925419569015503, -1.213563323020935, -0.2602498531341553, -0.9811103343963623, -0.44718554615974426, -1.241684079170227, -0.6285310983657837, 0.04549071565270424, -0.9443247318267822, 0.9125984311103821, 0.14430342614650726, -1.237990140914917, -0.30239516496658325, -0.8821237087249756, 0.9453220367431641, -0.1521906554698944, 0.13408491015434265, 1.943935513496399, 0.4243132770061493, -0.3934699296951294, 0.752065122127533, 1.071365475654602, 0.5532503128051758, -0.5199944972991943, 0.3454991281032562, -0.6669015884399414, 0.2521202266216278, -1.335314154624939, 0.2655823230743408, -2.827345609664917, 0.612137496471405, -0.025905292481184006, 0.010473627597093582, -0.05619727820158005, -1.3931022882461548, 1.0213135480880737, 2.609795570373535, -1.2326016426086426, 0.4299182891845703, 0.32069259881973267, 1.2069061994552612, -1.5001487731933594, 0.3034454882144928, -0.4421710669994354, 2.1518516540527344, 0.21441863477230072, 1.2293845415115356, -0.3500826358795166, -2.268148422241211, 0.6669782400131226, -1.2451121807098389, -1.2197673320770264, 0.8028319478034973, -0.8424441814422607, 0.01859452575445175, -1.3471077680587769, -0.21421334147453308, -0.8103446960449219, -1.1686551570892334, 0.6992774605751038, 0.17010745406150818, 0.4942394196987152, -0.6376447081565857, 0.3196348547935486, -2.138154983520508, -1.3043209314346313, -0.2796347439289093, -0.9749016761779785, 0.43575018644332886, -0.29804307222366333, 0.6503849625587463, -0.27595511078834534, 0.0007189027965068817, 0.4292791187763214, 1.484238862991333, 3.4338929653167725, 0.16716323792934418, 0.16728296875953674, -0.24853019416332245, -0.8871904611587524, 1.3692466020584106, 0.9222357869148254, -0.2334168404340744, -0.5791563987731934, -1.0344270467758179, 1.1498823165893555, 2.0337934494018555, 0.9404385685920715, 0.06083684787154198, -0.8415759801864624, -0.8090225458145142, -0.04705885797739029, 0.07734565436840057, 0.4781356453895569, 0.8644660115242004, 0.20491473376750946, 0.08721879124641418, 1.324256420135498, 1.0824192762374878, -0.41132599115371704, 0.4301898181438446, -0.8571598529815674, -0.4440683126449585, 0.5364218354225159, 0.35720524191856384, 0.00860566832125187, 0.26002028584480286, -1.0397617816925049, -0.2446349859237671, -0.4107992947101593, -0.9009073376655579, -0.7843169569969177, -0.38671112060546875, -0.3535517752170563, 1.6242355108261108, 0.05445462837815285, -0.49030372500419617, -0.08420217037200928, -0.6766005754470825, -0.040859878063201904, -0.9671544432640076, 0.3167932629585266, -0.12336240708827972, -0.1262984275817871, -0.08134107291698456, 1.6582674980163574, -0.8947870135307312, -1.9590671062469482, 0.33396705985069275, 0.1514335423707962, -0.3863726556301117, 0.27468329668045044, 1.6435197591781616, 0.6286851763725281, 1.3950457572937012, 1.4723930358886719, 0.9596198797225952, -0.6562865376472473, -1.2895303964614868, 0.6201711297035217, 0.8992021083831787, -1.4636752605438232, 0.6784982085227966, 0.13382083177566528, -0.45932990312576294, 0.6270835995674133, 1.2404096126556396, 0.5037272572517395, -2.08801531791687, 0.7199451327323914, -0.8933514356613159, 0.7483136057853699, 0.700383722782135, 0.707467794418335, 0.2012716680765152, 0.800986111164093, -1.1491801738739014, -1.1619906425476074, -0.7496136426925659, -0.7618401646614075, 1.941922903060913, -0.2131803035736084, 0.5023368000984192, -0.15400634706020355, -1.405354380607605, -0.216307133436203, 0.7118403911590576, 0.37544670701026917, -0.6231978535652161, 0.6890423893928528, -0.5782482624053955, -1.06142258644104, -1.3435882329940796, -0.5014569163322449, -1.1226370334625244, -0.9651176333427429, 0.9083344340324402, 0.7784411907196045, 0.3471324145793915, 1.8303362131118774, 0.666248619556427, 0.24748492240905762, -2.6183061599731445, 0.9160643815994263, 0.3745294511318207, -0.13144391775131226, 0.8030384182929993, 0.3374793231487274, 0.9665696024894714, -0.10230948030948639, 0.6941930055618286, -2.4074573516845703, 2.309725046157837, -0.20172595977783203, 0.6269664764404297, 0.048287104815244675, -0.22309726476669312, 1.0478202104568481, 0.5346261262893677, 0.6030502915382385, -1.1084171533584595, 0.6766266226768494, -0.7099647521972656, 1.2492144107818604, 0.7631498575210571, -0.8465299010276794, -0.061163466423749924, 1.422778606414795, 0.48616063594818115, -0.5205634832382202, -0.904366135597229, -1.0791062116622925, 0.9548395872116089, 1.716349720954895, -0.1638934165239334, -0.017423423007130623, 0.8671590685844421, 0.6997189521789551, -1.3234875202178955, 0.02426641434431076, -0.7772929072380066, -0.7391695380210876, 1.5955621004104614, 2.092367172241211, -0.19509834051132202, -0.17493924498558044, -0.8517513275146484, -1.250156044960022, 0.8449327945709229, -0.0030264807865023613, -0.0015910957008600235, 0.6264957189559937, -0.5645798444747925, 1.208782434463501, 0.857281506061554, 0.9540154933929443, 0.2660459578037262, 0.3524121940135956, 0.29573291540145874, -0.33973583579063416, -1.1989818811416626, -0.28339478373527527, -1.0124753713607788, -2.523211717605591, 0.5218673348426819, -0.19121037423610687, -1.4696567058563232, 0.074787437915802, -1.0653518438339233, 0.8431699872016907, -0.588082492351532, -1.089103102684021, -1.4600670337677002, 0.20788909494876862, -0.013197531923651695, 0.9112851619720459, -1.5879583358764648, -0.018412217497825623, 1.2563618421554565, 0.8984710574150085, -0.7705352902412415, 0.9235518574714661, 0.34506309032440186, 1.0428180694580078, 0.9951356053352356, -0.38534244894981384, 0.5369171500205994, 0.008019614964723587, -1.2928611040115356, 0.4937233030796051, 1.1904674768447876, 0.15186630189418793, 1.4969810247421265, -0.608112633228302, 0.005845417268574238, 0.4163549542427063, -0.528562605381012, -0.44570472836494446, -0.6192602515220642, 0.6253646016120911, -0.012371551245450974, -0.8969449996948242, -0.0007082736119627953, 0.03296200558543205, -0.168334499001503, 0.24862927198410034, -1.5707752704620361, -0.12711238861083984, -0.2677106261253357, -0.6588118672370911, -1.1837859153747559, -0.17556855082511902, 1.4215868711471558, -0.736097514629364, -0.20929500460624695, 0.5377440452575684, 0.3135983943939209, 0.5456671714782715, 0.5739179253578186, -0.7002539038658142, -0.42350658774375916, -0.2682572603225708, -0.39719831943511963, 0.3374054729938507, 1.4433603286743164, -0.024901017546653748, -0.9466163516044617, 0.7787512540817261, -0.40996238589286804, 0.034227583557367325, 1.869588017463684, 0.11567479372024536, -0.8552009463310242, 0.22155043482780457, -0.6774331331253052, 1.9680471420288086, 1.8116118907928467, 1.2483922243118286, 0.003069048747420311, -1.0614922046661377, 0.5351414680480957, -0.36952802538871765, -0.3862428367137909, 0.8344606161117554, 0.3550645112991333, -0.23517292737960815, -1.3135881423950195, 0.7371501922607422, 1.3275279998779297, -0.843223512172699, -0.9434491395950317, 0.058756452053785324, -0.7547898888587952, 1.0933679342269897, 0.7331910729408264, 0.3430050015449524, 0.18015196919441223, 1.574092984199524, 0.7847505211830139, -0.343099445104599, 0.5926638841629028, 0.47304025292396545, -0.0710069090127945, -2.1879260540008545, -1.1921637058258057, 0.38965100049972534, -0.5062064528465271, -1.715299129486084, 1.4160356521606445, -1.1532301902770996, -0.9558315873146057, 0.5252717137336731, 0.0745379626750946, 1.511203408241272, 0.3993036150932312, 1.591766595840454, 2.0531787872314453, 0.911801815032959, 0.4185022711753845, 1.3413052558898926, -0.15401577949523926, -0.5236106514930725, 1.7758210897445679, -0.48907437920570374, 0.49330028891563416, 1.0757790803909302, -0.3068802058696747, -1.0614389181137085, -0.8166137337684631, -1.299529790878296, -0.7803850173950195, 1.1188864707946777, 0.03789159283041954, -1.1882052421569824, 0.3258931636810303, 1.5990850925445557, 0.13562506437301636, -0.3090306520462036, 0.7023259401321411, 0.32910117506980896, -0.8428872227668762, -0.03736010938882828, -0.9112192988395691, 0.4836830794811249, -0.1716383993625641, -0.39844855666160583, 0.3937656283378601, 0.41436439752578735, 1.2797590494155884, -0.0736151933670044, 0.057256389409303665, 1.1225239038467407, -1.4697290658950806, 1.5157629251480103, -0.7205516695976257, 0.3233727812767029, -2.3524134159088135, 1.3698228597640991, -0.8236557245254517, 1.8964029550552368, -2.6710548400878906, 0.4111056625843048, -0.5415371656417847, -0.5036700963973999, 0.21309800446033478, -0.26349714398384094, 0.09993405640125275, -0.16259706020355225, -1.2111244201660156, -0.058873120695352554, -0.7407782673835754, 0.6668990254402161, 1.0744984149932861, 1.4280189275741577, -1.1201752424240112, -0.2537951171398163, -1.7557443380355835, -0.1013275682926178, -0.6206730604171753, 0.3856459856033325, -1.9752486944198608, -0.11955741047859192, -1.9247384071350098, -2.3604791164398193, -1.2502902746200562, -0.8510486483573914, 1.002915859222412, 0.07726047933101654, -0.8174768686294556, 1.1634764671325684, -0.3921872675418854, -1.9518882036209106, 1.107117772102356, -2.1926987171173096 ]
https://github.com/huggingface/datasets/issues/3171
Raise exceptions instead of using assertions for control flow
Adding the remaining tasks for this issue to help new code contributors. $ cd src/datasets && ack assert -lc - [x] commands/convert.py:1 - [x] arrow_reader.py:3 - [x] load.py:7 - [x] utils/py_utils.py:2 - [x] features/features.py:9 - [x] arrow_writer.py:7 - [x] search.py:6 - [x] table.py:1 - [x] metric.py:3 - [x] tasks/image_classification.py:1 - [x] arrow_dataset.py:17 - [x] fingerprint.py:6 - [x] io/json.py:1 - [x] io/csv.py:1
Motivated by https://github.com/huggingface/transformers/issues/12789 in Transformers, one welcoming change would be replacing assertions with proper exceptions. The only type of assertions we should keep are those used as sanity checks. Currently, there is a total of 87 files with the `assert` statements (located under `datasets` and `src/datasets`), so when working on this, to manage the PR size, only modify 4-5 files at most before submitting a PR.
1,142
61
Raise exceptions instead of using assertions for control flow Motivated by https://github.com/huggingface/transformers/issues/12789 in Transformers, one welcoming change would be replacing assertions with proper exceptions. The only type of assertions we should keep are those used as sanity checks. Currently, there is a total of 87 files with the `assert` statements (located under `datasets` and `src/datasets`), so when working on this, to manage the PR size, only modify 4-5 files at most before submitting a PR. Adding the remaining tasks for this issue to help new code contributors. $ cd src/datasets && ack assert -lc - [x] commands/convert.py:1 - [x] arrow_reader.py:3 - [x] load.py:7 - [x] utils/py_utils.py:2 - [x] features/features.py:9 - [x] arrow_writer.py:7 - [x] search.py:6 - [x] table.py:1 - [x] metric.py:3 - [x] tasks/image_classification.py:1 - [x] arrow_dataset.py:17 - [x] fingerprint.py:6 - [x] io/json.py:1 - [x] io/csv.py:1
[ -1.3465375900268555, -0.7987534999847412, -0.8411737084388733, 1.452647089958191, -0.16265514492988586, -1.2206523418426514, 0.07383418083190918, -1.0279417037963867, 1.6717920303344727, -0.7665635943412781, 0.35935431718826294, -1.6804202795028687, 0.10921455174684525, -0.5468869209289551, -0.7322077751159668, -0.8960798382759094, -0.37743130326271057, -0.7699211239814758, 1.0938633680343628, 2.456829071044922, 1.1526201963424683, -1.5082510709762573, 2.6879711151123047, 0.8163058757781982, -0.2114950716495514, -1.001222014427185, 0.4789150655269623, 0.1875804364681244, -1.4205902814865112, -0.2420271635055542, -0.9597532153129578, -0.10266993939876556, -0.5727074146270752, -0.524162769317627, 0.09013449400663376, 0.25503626465797424, -0.2076578140258789, -0.27653902769088745, -0.48497724533081055, -0.7784107327461243, 0.4424320161342621, -0.31019842624664307, 0.7948077321052551, -0.3506861925125122, 1.7300385236740112, -0.5986318588256836, 0.3304220139980316, 0.6924097537994385, 1.2286224365234375, 0.16036808490753174, -0.08586879074573517, 0.3047439754009247, 0.3534582257270813, -0.02206113189458847, 0.5061922669410706, 1.2016021013259888, 0.6182006001472473, 0.43486765027046204, 0.7944487929344177, -2.237332820892334, 1.3293744325637817, -0.9268338084220886, 0.2232009768486023, 1.3769004344940186, -1.0656297206878662, 0.3766884207725525, -1.7593446969985962, -0.09304170310497284, 0.6475846767425537, -2.2468459606170654, 0.24771583080291748, -1.2511996030807495, -0.6718226671218872, 0.9821467995643616, 0.3867185413837433, -1.2612866163253784, 0.10772048681974411, -0.5176470279693604, 1.0769847631454468, 0.36720359325408936, 1.1410707235336304, -1.724537968635559, 0.12129759043455124, -0.23095420002937317, 0.16484591364860535, -1.4238147735595703, -1.4739902019500732, 0.5985159277915955, 0.7408304810523987, 0.6279111504554749, -0.029093513265252113, 0.8233449459075928, -1.1640664339065552, 0.8748060464859009, -0.975678563117981, -1.7275530099868774, -1.3596374988555908, -2.3659121990203857, -2.313962459564209, 0.809746265411377, -0.4594496786594391, -0.5141157507896423, 2.0265185832977295, -1.0250275135040283, -1.772673487663269, 1.1796350479125977, 0.31331202387809753, 0.043291885405778885, 2.5008480548858643, 0.13162168860435486, -0.7034848928451538, 0.4076380431652069, -0.8419566750526428, 0.750921368598938, -0.3279985189437866, 1.1710339784622192, 0.4217873513698578, -0.9668049216270447, 1.6326351165771484, -0.4172414243221283, 0.5359348058700562, -0.776904284954071, -0.4485398530960083, -0.6929899454116821, 0.29174503684043884, 1.9330461025238037, -0.30611294507980347, 1.577383279800415, -0.27747517824172974, -1.329612374305725, -1.4909576177597046, 0.7891183495521545, 0.5185622572898865, -0.7682849168777466, 0.07845637947320938, -0.3191748857498169, 0.1673576533794403, -0.05438129976391792, 1.0718566179275513, 1.270007610321045, 0.7307037115097046, -0.321444571018219, -0.9223629832267761, 0.15619030594825745, -0.04075279459357262, -0.7273274660110474, -1.8228265047073364, -0.26637154817581177, 0.1080961748957634, 0.7226525545120239, -1.3264679908752441, 1.7666932344436646, 0.8212935924530029, 2.0223889350891113, 0.9227674007415771, -0.4252762198448181, 1.5070604085922241, -0.024292584508657455, 1.9306306838989258, -0.4245438277721405, 0.7993156909942627, -0.34343811869621277, -1.1580126285552979, 0.9244836568832397, -0.37441059947013855, -2.0834124088287354, -0.7186456918716431, -0.7488475441932678, -0.20316234230995178, -0.7890440225601196, 1.0356136560440063, -0.22367867827415466, -1.491519808769226, 0.27275213599205017, -0.6113648414611816, 0.1309795379638672, -1.243750810623169, 0.17632603645324707, 0.739122211933136, -0.6284310817718506, 0.00028866901993751526, -0.378004789352417, -1.3336302042007446, -0.5212598443031311, 0.29526183009147644, 1.8343772888183594, -0.6886785626411438, 1.003374695777893, 1.089590072631836, -0.5863897800445557, 0.022454869002103806, 0.347407728433609, -0.31248798966407776, 0.8276309370994568, -1.091931939125061, -0.46214765310287476, 1.0956056118011475, -0.04386520013213158, -0.61936354637146, 1.4231016635894775, 0.8311190009117126, -0.9744808673858643, -0.21251949667930603, -0.18309831619262695, -0.6643545627593994, 0.06326046586036682, -1.6333216428756714, -0.045598696917295456, 0.3063933551311493, -1.4664795398712158, -0.3279808461666107, -0.10984255373477936, 1.3794838190078735, -0.2541992962360382, 1.401221752166748, -0.3473096787929535, -0.1923506259918213, -0.317464143037796, -0.3393954634666443, 0.11067701876163483, -0.14481839537620544, -0.5411716103553772, 0.3230435252189636, -0.7226328253746033, 0.29091131687164307, 1.4281060695648193, 0.45425093173980713, 0.22405719757080078, 0.4135367274284363, 1.0204514265060425, 0.3919128179550171, -0.04012928158044815, -0.9537573456764221, -1.6625721454620361, 2.1151952743530273, -1.513460636138916, 2.2547738552093506, 0.8234336972236633, -0.025893740355968475, -1.8049551248550415, -1.8587712049484253, 1.36452054977417, 1.0764355659484863, 2.3458828926086426, 0.6055178046226501, 0.36890366673469543, -0.8918517827987671, -0.6478687524795532, 0.32752349972724915, -0.95453280210495, -0.6824607849121094, 0.2145167589187622, 2.419869899749756, 1.647829294204712, -0.32384243607521057, -0.04559129849076271, -0.9117459058761597, 1.3871519565582275, -0.20661044120788574, 0.23171475529670715, 1.9883028268814087, -0.24359768629074097, -1.1917181015014648, 1.1070177555084229, -2.4440994262695312, 0.1338837444782257, 2.0047974586486816, 0.24183589220046997, 0.039158739149570465, -1.3720537424087524, -0.6154521107673645, -0.36805444955825806, -0.4404922127723694, -1.1669825315475464, 0.5049290657043457, -0.2126137912273407, -0.8876579403877258, -1.4022847414016724, 0.060943007469177246, -1.1938159465789795, -1.7194123268127441, 0.3691011369228363, 1.7449694871902466, 2.1213252544403076, -0.8326654434204102, 1.4276487827301025, -0.31555837392807007, -0.02282952517271042, 1.2766064405441284, 1.2234212160110474, 2.9835140705108643, 1.8034405708312988, -1.319568157196045, 0.7012906670570374, -0.18881893157958984, -0.37882837653160095, 1.0482375621795654, -1.139611840248108, 1.3331202268600464, -0.1321614384651184, -1.2519197463989258, -1.3513423204421997, 1.1044453382492065, 0.4302164912223816, 0.05742768198251724, -0.5772925019264221, 1.331892490386963, 0.11191499978303909, 1.2937411069869995, 0.44054365158081055, -0.21754705905914307, 0.49186283349990845, -0.37896454334259033, -0.4937378466129303, 1.6369972229003906, 0.05850420892238617, -1.5264058113098145, -2.4017791748046875, -0.24903175234794617, -0.8945752382278442, -0.08302923291921616, -0.6825341582298279, -1.1018444299697876, 1.6886423826217651, 0.4408259093761444, -1.2762607336044312, -0.16177397966384888, -0.3555649518966675, -0.6195268034934998, 2.6271276473999023, -1.5252974033355713, -0.2691616415977478, -0.9012889266014099, -0.43720149993896484, 1.5475915670394897, -1.1068578958511353, -0.12050019204616547, -0.9694193005561829, -0.535266101360321, -1.2764456272125244, -0.5735880732536316, -0.10949738323688507, -0.9118919372558594, 0.6836685538291931, 0.14243465662002563, -1.1911519765853882, -0.43566250801086426, -0.8500909805297852, 0.7718265056610107, -0.061530500650405884, 0.35813477635383606, 1.9643971920013428, 0.3289641737937927, -0.38458898663520813, 0.7641071677207947, 1.2098621129989624, 0.6384038925170898, -0.60779869556427, 0.29773056507110596, -0.5590984225273132, 0.4763032793998718, -1.1556659936904907, 0.2374933362007141, -2.933091163635254, 0.7271358370780945, -0.06157587468624115, 0.022444915026426315, -0.06054561212658882, -1.2572147846221924, 1.1836436986923218, 2.7873921394348145, -1.0161226987838745, 0.39752352237701416, 0.31163015961647034, 1.2071254253387451, -1.5296952724456787, 0.19453281164169312, -0.5278316736221313, 2.157179832458496, 0.13759267330169678, 1.1038354635238647, -0.6039569973945618, -2.2976021766662598, 0.6937825679779053, -1.2334656715393066, -1.00002920627594, 0.9007827639579773, -0.7833619713783264, 0.2438710331916809, -1.4016908407211304, -0.09688088297843933, -0.9842650890350342, -1.2109787464141846, 0.5035116672515869, 0.13462558388710022, 0.5787081122398376, -0.694987416267395, 0.25607267022132874, -2.27671217918396, -1.399782657623291, -0.10142720490694046, -1.0179628133773804, 0.6081188321113586, -0.26688092947006226, 0.7868870496749878, -0.09471345692873001, 0.04706590622663498, 0.3533746898174286, 1.3903933763504028, 3.3539011478424072, 0.1920759379863739, 0.3609039783477783, -0.2074645459651947, -0.890021026134491, 1.410941243171692, 0.9947878122329712, -0.0906129851937294, -0.527431309223175, -0.9153425693511963, 1.3566868305206299, 2.0577292442321777, 1.035757303237915, 0.05771304666996002, -0.7967801690101624, -0.7037234306335449, 0.13821685314178467, 0.23189648985862732, 0.48083218932151794, 1.0045067071914673, -0.046757783740758896, 0.08553376793861389, 1.5066815614700317, 1.262007713317871, -0.5534027814865112, 0.4403614401817322, -0.9731277823448181, -0.4312506914138794, 0.5742035508155823, 0.4019755423069, 0.056891992688179016, 0.46382635831832886, -1.1212413311004639, -0.2671567499637604, -0.24605491757392883, -0.8944587111473083, -0.7387056350708008, -0.2638595402240753, -0.49475497007369995, 1.6198028326034546, 0.02908674255013466, -0.41855865716934204, 0.07949961721897125, -0.834734320640564, -0.03338950127363205, -1.1119194030761719, 0.3226768374443054, -0.161899596452713, 0.047090884298086166, -0.10329755395650864, 1.8603973388671875, -0.9096960425376892, -1.9763553142547607, 0.24550271034240723, 0.17431044578552246, -0.4076513350009918, 0.17070600390434265, 1.7940447330474854, 0.5779282450675964, 1.4432177543640137, 1.2587724924087524, 0.9026076197624207, -0.6533238887786865, -1.353716492652893, 0.7083548903465271, 1.0015869140625, -1.4239383935928345, 0.9470714330673218, -0.19694486260414124, -0.5017000436782837, 0.5880600214004517, 1.4571164846420288, 0.3353406488895416, -2.1081809997558594, 0.7067723870277405, -1.0329891443252563, 0.8473510146141052, 0.7287012338638306, 0.7090395092964172, 0.11588560789823532, 0.8616306185722351, -1.239043116569519, -1.0860693454742432, -0.848077118396759, -0.6836211085319519, 1.758771538734436, -0.2484392523765564, 0.5080865025520325, -0.25857216119766235, -1.3794080018997192, -0.0765359029173851, 0.5427224636077881, 0.35341522097587585, -0.3115134537220001, 0.940008282661438, -0.6709514260292053, -1.157447338104248, -1.2645983695983887, -0.536976158618927, -0.9502804279327393, -0.9398619532585144, 1.0795226097106934, 0.8390578627586365, 0.3607650697231293, 1.8571839332580566, 0.5573198199272156, 0.11595828086137772, -2.603834867477417, 0.898857831954956, 0.2623738646507263, -0.08410970121622086, 0.9488863348960876, 0.27568119764328003, 1.0325943231582642, -0.03994768112897873, 0.49555009603500366, -2.393874406814575, 2.3515515327453613, -0.1791583001613617, 0.6183037757873535, 0.09012191742658615, -0.03924378752708435, 0.9723480939865112, 0.6076841354370117, 0.5166666507720947, -1.0615934133529663, 0.6766020059585571, -0.701444149017334, 1.2855806350708008, 0.8041475415229797, -0.7244804501533508, -0.038515493273735046, 1.2469357252120972, 0.36195051670074463, -0.39434272050857544, -0.8158252239227295, -0.9196913838386536, 0.9928723573684692, 1.7316161394119263, 0.00433006789535284, 0.04004210978746414, 0.743464469909668, 0.635143518447876, -1.363885760307312, -0.05115705356001854, -0.818046510219574, -0.7490767240524292, 1.6346745491027832, 2.072802782058716, -0.1355031132698059, -0.0830220878124237, -0.6962982416152954, -1.3914897441864014, 0.8054219484329224, -0.23840048909187317, 0.11100967228412628, 0.6627167463302612, -0.5931459069252014, 1.124061107635498, 0.7786965370178223, 0.9684972167015076, 0.08302801102399826, 0.3804211914539337, 0.08060922473669052, -0.3657805621623993, -1.244178295135498, -0.3350568413734436, -0.9909731149673462, -2.4879937171936035, 0.3705497682094574, -0.3310149610042572, -1.5529286861419678, -0.017825167626142502, -0.991125762462616, 0.7427291870117188, -0.5245071053504944, -1.05254065990448, -1.331011414527893, 0.2948508560657501, -0.14312589168548584, 1.0028048753738403, -1.4730061292648315, -0.03600058704614639, 1.2285407781600952, 0.9447270631790161, -0.5930885672569275, 1.024596929550171, 0.24417957663536072, 1.0910555124282837, 0.8059685826301575, -0.3201989233493805, 0.40566959977149963, 0.13938382267951965, -1.2236626148223877, 0.35151898860931396, 1.194496512413025, 0.06902948766946793, 1.4176228046417236, -0.4913221597671509, -0.04069255292415619, 0.416917622089386, -0.5210996270179749, -0.42474186420440674, -0.6224179267883301, 0.8168779015541077, -0.1010747030377388, -0.9237120747566223, 0.05603805184364319, -0.06814804673194885, -0.21789205074310303, 0.2935887575149536, -1.4183344841003418, -0.22323602437973022, -0.4315433204174042, -0.5042057633399963, -1.2803850173950195, 0.11598170548677444, 1.3191344738006592, -0.7244951725006104, -0.07719971984624863, 0.39443492889404297, 0.3607906401157379, 0.5987052917480469, 0.8414905667304993, -0.5179536938667297, -0.581743597984314, -0.1917656660079956, -0.24912720918655396, 0.37006303668022156, 1.069746494293213, -0.13775774836540222, -1.0417181253433228, 0.8026373982429504, -0.3551809787750244, 0.12298952788114548, 1.997646689414978, 0.015361307188868523, -0.8414123058319092, 0.3251267075538635, -0.7032461166381836, 1.9040286540985107, 1.733550786972046, 1.1759932041168213, -0.1440875232219696, -0.9537451267242432, 0.7123240232467651, -0.25712838768959045, -0.3606818914413452, 0.7737813591957092, 0.46206286549568176, -0.2521578371524811, -1.4594850540161133, 0.4796651601791382, 1.2039427757263184, -0.8436460494995117, -0.7986871600151062, 0.19119718670845032, -0.7318477630615234, 1.0830692052841187, 0.7570294737815857, 0.36802273988723755, 0.40869367122650146, 1.5182524919509888, 0.7158794403076172, -0.5688496828079224, 0.41287243366241455, 0.47076520323753357, -0.053385160863399506, -2.00417423248291, -1.0235954523086548, 0.17092683911323547, -0.3928373157978058, -1.5345317125320435, 1.2703981399536133, -1.259450078010559, -0.8973924517631531, 0.5018035769462585, 0.08807133138179779, 1.197092056274414, 0.11694199591875076, 1.6648752689361572, 2.0403075218200684, 0.9333168268203735, 0.2344217598438263, 1.2803930044174194, -0.10835500061511993, -0.5356884598731995, 1.7591038942337036, -0.5499098896980286, 0.6077412962913513, 1.005397081375122, -0.34217366576194763, -0.9699417948722839, -0.876302182674408, -1.1010369062423706, -0.72314453125, 1.2043453454971313, 0.1909470558166504, -1.2328071594238281, 0.18219810724258423, 1.4188714027404785, 0.08386385440826416, -0.20363962650299072, 0.6396187543869019, 0.36717846989631653, -0.8008110523223877, -0.224910706281662, -0.936172604560852, 0.5069987773895264, -0.27756673097610474, -0.2552576959133148, 0.33533281087875366, 0.4583970606327057, 1.257433295249939, -0.006518949288874865, 0.1331983506679535, 1.1882050037384033, -1.5052298307418823, 1.468691349029541, -0.7012885212898254, 0.3658139109611511, -2.329221725463867, 1.3470144271850586, -0.7589796781539917, 1.9209243059158325, -2.7095329761505127, 0.42963650822639465, -0.5154550075531006, -0.46722930669784546, 0.18880712985992432, -0.34076160192489624, 0.2650825083255768, -0.09796731173992157, -1.0610487461090088, -0.10646512359380722, -0.8881053924560547, 0.470408171415329, 1.101729154586792, 1.3437689542770386, -1.1020264625549316, -0.3328975439071655, -1.7217183113098145, -0.27482661604881287, -0.7618262767791748, 0.33108603954315186, -1.9472728967666626, -0.03066273406147957, -2.044055938720703, -2.3193764686584473, -1.516110897064209, -0.9091407060623169, 1.12760591506958, 0.1336502730846405, -0.8136328458786011, 1.0761061906814575, -0.37166112661361694, -1.8401297330856323, 1.139853835105896, -2.0419070720672607 ]
https://github.com/huggingface/datasets/issues/3171
Raise exceptions instead of using assertions for control flow
Hi all, I am interested in taking up `fingerprint.py`, `search.py`, `arrow_writer.py` and `metric.py`. Will raise a PR soon!
Motivated by https://github.com/huggingface/transformers/issues/12789 in Transformers, one welcoming change would be replacing assertions with proper exceptions. The only type of assertions we should keep are those used as sanity checks. Currently, there is a total of 87 files with the `assert` statements (located under `datasets` and `src/datasets`), so when working on this, to manage the PR size, only modify 4-5 files at most before submitting a PR.
1,142
18
Raise exceptions instead of using assertions for control flow Motivated by https://github.com/huggingface/transformers/issues/12789 in Transformers, one welcoming change would be replacing assertions with proper exceptions. The only type of assertions we should keep are those used as sanity checks. Currently, there is a total of 87 files with the `assert` statements (located under `datasets` and `src/datasets`), so when working on this, to manage the PR size, only modify 4-5 files at most before submitting a PR. Hi all, I am interested in taking up `fingerprint.py`, `search.py`, `arrow_writer.py` and `metric.py`. Will raise a PR soon!
[ -1.1491758823394775, -0.9067763090133667, -0.8584375381469727, 1.4407182931900024, -0.24954241514205933, -1.3536908626556396, 0.22718903422355652, -1.0899450778961182, 1.7442253828048706, -0.8560987710952759, 0.4315868020057678, -1.6795883178710938, 0.07003068923950195, -0.6154617667198181, -0.7052659392356873, -0.924200713634491, -0.36280855536460876, -0.8338930010795593, 0.998242974281311, 2.550602436065674, 1.196794033050537, -1.2906728982925415, 2.6132946014404297, 0.6743698120117188, -0.30336442589759827, -1.0003619194030762, 0.5529199242591858, 0.07897838950157166, -1.191828727722168, -0.4914611279964447, -0.9816828966140747, -0.020588427782058716, -0.5993322134017944, -0.6231433749198914, 0.0033611152321100235, 0.4688456952571869, -0.28077611327171326, -0.3202193081378937, -0.4622620940208435, -0.8613613247871399, 0.5334208011627197, -0.40536296367645264, 0.999789834022522, -0.41950976848602295, 1.750754952430725, -0.4863731861114502, 0.35421302914619446, 0.7456349730491638, 1.411065936088562, 0.14468050003051758, -0.14151868224143982, 0.1988506019115448, 0.33170291781425476, -0.055257733911275864, 0.4857810437679291, 1.1613051891326904, 0.5452585220336914, 0.6255881190299988, 0.6685386896133423, -2.184868097305298, 1.3568933010101318, -1.047132134437561, 0.3123038411140442, 1.3329490423202515, -0.96002596616745, 0.2662971615791321, -1.8201903104782104, -0.04316651076078415, 0.5231752395629883, -2.3084676265716553, 0.28386190533638, -1.231689691543579, -0.4681766927242279, 1.0256811380386353, 0.3400113880634308, -1.3075913190841675, 0.12612584233283997, -0.3285316228866577, 1.0180704593658447, 0.4220198392868042, 1.0539147853851318, -1.745729684829712, 0.06181462109088898, -0.3445039987564087, 0.06097232550382614, -1.3657928705215454, -1.4155524969100952, 0.5569114089012146, 0.6901347041130066, 0.5935341119766235, -0.16685307025909424, 0.9655750393867493, -0.9308879375457764, 0.8250794410705566, -0.8678320050239563, -1.714417576789856, -1.2906379699707031, -2.2425529956817627, -2.3860137462615967, 0.8278821110725403, -0.5627075433731079, -0.5585948824882507, 1.9998092651367188, -0.9893415570259094, -1.8640265464782715, 1.134718418121338, 0.3644357919692993, -0.012906454503536224, 2.391474485397339, 0.24451610445976257, -0.5814628005027771, 0.3963916003704071, -0.7562582492828369, 0.8329616189002991, -0.5405646562576294, 1.3675378561019897, 0.5105427503585815, -1.0987579822540283, 1.6752088069915771, -0.3851243555545807, 0.5602859854698181, -0.7159343957901001, -0.5442060232162476, -0.8478754162788391, 0.40996477007865906, 1.8728163242340088, -0.40114399790763855, 1.489587664604187, -0.4291551113128662, -1.4624531269073486, -1.5998324155807495, 0.9558886885643005, 0.541013777256012, -0.7635375261306763, 0.0691709816455841, -0.36167851090431213, 0.11419843882322311, -0.02535397931933403, 1.135866403579712, 1.191498875617981, 0.7868057489395142, -0.31615301966667175, -0.8771696090698242, 0.30793219804763794, 0.0196873489767313, -0.6674721240997314, -1.793556571006775, -0.4069424569606781, 0.11394239217042923, 0.610702633857727, -1.0999488830566406, 1.8160734176635742, 0.9692348837852478, 2.016706943511963, 0.8841659426689148, -0.3595988154411316, 1.5285086631774902, -0.11168459802865982, 1.953729271888733, -0.4140356183052063, 0.7401009202003479, -0.3913300037384033, -1.2022547721862793, 0.9721958637237549, -0.2755350172519684, -2.017836570739746, -0.7982979416847229, -0.9497975707054138, -0.14693713188171387, -0.711887776851654, 0.9970486164093018, -0.28961971402168274, -1.4126791954040527, 0.14490622282028198, -0.5620982646942139, 0.002838730812072754, -1.3120789527893066, 0.3345475494861603, 0.7159788608551025, -0.6682203412055969, 0.05816952884197235, -0.2900741398334503, -1.2674225568771362, -0.5549750328063965, 0.25798577070236206, 1.9435076713562012, -0.6877095103263855, 0.9963783025741577, 1.0404613018035889, -0.8040161728858948, -0.05326414480805397, 0.37365221977233887, -0.28189975023269653, 0.7511575222015381, -1.0034984350204468, -0.4070828855037689, 1.184751033782959, -0.11842893064022064, -0.6507769823074341, 1.3913214206695557, 0.7296617031097412, -1.0758613348007202, -0.13194681704044342, -0.32290512323379517, -0.7574849128723145, 0.1508486270904541, -1.580642580986023, -0.03169873356819153, 0.3854195475578308, -1.4346641302108765, -0.4206193685531616, -0.16805249452590942, 1.3280447721481323, -0.1491459608078003, 1.33926260471344, -0.22347217798233032, -0.2978818416595459, -0.33160972595214844, -0.3916953504085541, 0.17086783051490784, -0.09537691622972488, -0.5740644931793213, 0.2555128037929535, -0.68761146068573, 0.4494255483150482, 1.487458348274231, 0.2292887568473816, 0.053656816482543945, 0.5011171102523804, 1.0194262266159058, 0.3195186257362366, -0.028727933764457703, -0.9651566743850708, -1.5017660856246948, 2.0165860652923584, -1.4690221548080444, 1.9915211200714111, 0.6661461591720581, -0.023838035762310028, -1.6706408262252808, -1.8742984533309937, 1.3907890319824219, 1.2003958225250244, 2.2624809741973877, 0.6433566808700562, 0.29603487253189087, -0.8089939951896667, -0.666189968585968, 0.36712148785591125, -1.1360396146774292, -0.7065829634666443, 0.12749221920967102, 2.2710063457489014, 1.7255553007125854, -0.5224266052246094, -0.2037532925605774, -1.0573982000350952, 1.307051658630371, -0.18751904368400574, 0.22949835658073425, 2.0266079902648926, -0.4246048629283905, -1.2107136249542236, 1.1451029777526855, -2.331876039505005, 0.11529397964477539, 2.0614233016967773, 0.23224401473999023, 0.15885987877845764, -1.5056923627853394, -0.5955147743225098, -0.17856261134147644, -0.4861460030078888, -1.264740228652954, 0.6037187576293945, -0.22174593806266785, -0.8260331749916077, -1.436100721359253, 0.28422197699546814, -1.1299065351486206, -1.7251681089401245, 0.29943498969078064, 1.9153145551681519, 2.0992980003356934, -0.7571407556533813, 1.5187381505966187, -0.24953576922416687, 0.10772425681352615, 1.3070679903030396, 1.239013671875, 2.981776714324951, 1.8226318359375, -1.1638209819793701, 0.7319932579994202, -0.2188999354839325, -0.4963569641113281, 1.1670970916748047, -1.0701628923416138, 1.2867244482040405, -0.19625777006149292, -1.0687427520751953, -1.4130821228027344, 0.8737014532089233, 0.426642507314682, 0.06133940815925598, -0.41771793365478516, 1.2633204460144043, 0.1638946831226349, 1.2313696146011353, 0.5149900913238525, -0.39215508103370667, 0.6786552667617798, -0.36135923862457275, -0.46183639764785767, 1.5586973428726196, 0.27985879778862, -1.357269287109375, -2.3728976249694824, -0.17525815963745117, -0.8521686792373657, -0.01925053820014, -0.5649175643920898, -0.9488754272460938, 1.7248070240020752, 0.45169830322265625, -1.2395167350769043, -0.2263701856136322, -0.3210853040218353, -0.5828449726104736, 2.595392942428589, -1.353338360786438, -0.1986527144908905, -0.8897271156311035, -0.4890694320201874, 1.6939234733581543, -1.1820622682571411, -0.18766775727272034, -0.9419124126434326, -0.5024510025978088, -1.3083057403564453, -0.6089569330215454, -0.10949909687042236, -0.956605076789856, 0.7611581087112427, 0.2055761218070984, -1.13444983959198, -0.4217042922973633, -0.7818536758422852, 0.8299347758293152, -0.06036348268389702, 0.3347097635269165, 1.8814681768417358, 0.4495936632156372, -0.2935187816619873, 0.793583333492279, 1.109366774559021, 0.4912336468696594, -0.5014366507530212, 0.37773269414901733, -0.6606506705284119, 0.3438175618648529, -1.1985706090927124, 0.30976203083992004, -2.966104745864868, 0.6067434549331665, -0.22005972266197205, -0.06738027930259705, -0.12171179056167603, -1.4065368175506592, 1.1470476388931274, 2.695850372314453, -1.129853367805481, 0.48532649874687195, 0.24825820326805115, 1.1853742599487305, -1.4512702226638794, 0.20565444231033325, -0.39414694905281067, 2.1441595554351807, 0.16239729523658752, 1.1945347785949707, -0.5174160003662109, -2.2058770656585693, 0.6101957559585571, -1.2859766483306885, -1.17058265209198, 0.8082482218742371, -0.7286515235900879, -0.08404963463544846, -1.3726202249526978, -0.12453564256429672, -0.8887956738471985, -1.3552290201187134, 0.8203906416893005, 0.16977974772453308, 0.532214879989624, -0.62188720703125, 0.34292399883270264, -2.118969440460205, -1.3946000337600708, -0.20624783635139465, -1.0221307277679443, 0.4386378228664398, -0.21459802985191345, 0.6185985803604126, -0.15496563911437988, 0.01421043649315834, 0.3837825655937195, 1.4744442701339722, 3.4033825397491455, 0.11815906316041946, 0.3709065914154053, -0.11291657388210297, -0.885685920715332, 1.5220139026641846, 1.0395793914794922, -0.08243155479431152, -0.5696167945861816, -0.9967033863067627, 1.2421125173568726, 2.059170722961426, 1.0327848196029663, 0.08770035207271576, -0.898036539554596, -0.7035520672798157, -0.06610217690467834, 0.1526789665222168, 0.47145015001296997, 0.9183602333068848, 0.06784481555223465, -0.0006105098873376846, 1.3321794271469116, 1.1510261297225952, -0.49378517270088196, 0.4903503954410553, -0.8692930340766907, -0.35292965173721313, 0.42698296904563904, 0.2943747043609619, 0.04098576307296753, 0.44089019298553467, -1.0076504945755005, -0.27789080142974854, -0.2514931857585907, -0.947991669178009, -0.7975395321846008, -0.4356336295604706, -0.4173097610473633, 1.6956828832626343, 0.044048745185136795, -0.4937763512134552, 0.024983607232570648, -0.8039819598197937, -0.04236521199345589, -0.9772316217422485, 0.15460094809532166, -0.20851656794548035, -0.15223276615142822, -0.08102049678564072, 1.7809569835662842, -0.9197009205818176, -2.0330216884613037, 0.2816530764102936, 0.24724477529525757, -0.44659939408302307, 0.30031970143318176, 1.617967128753662, 0.5273181796073914, 1.5095171928405762, 1.3348662853240967, 1.038493037223816, -0.6883292198181152, -1.3676692247390747, 0.7926943302154541, 0.9281327724456787, -1.456083059310913, 0.8201971650123596, 0.029774341732263565, -0.33874547481536865, 0.612476110458374, 1.2425636053085327, 0.44549795985221863, -2.09834623336792, 0.7159005403518677, -0.9767318964004517, 0.8132030367851257, 0.6834567189216614, 0.8036710619926453, 0.2859523892402649, 0.7874036431312561, -1.2172309160232544, -1.2019240856170654, -0.7739323377609253, -0.6754503846168518, 1.8647481203079224, -0.20310097932815552, 0.6616469025611877, -0.14343154430389404, -1.3568860292434692, -0.2408749759197235, 0.6486826539039612, 0.43222326040267944, -0.41356325149536133, 0.7815338969230652, -0.6705986261367798, -1.0300002098083496, -1.4133853912353516, -0.4662024974822998, -1.1586251258850098, -0.9736329317092896, 1.011208176612854, 0.8415865302085876, 0.3085014224052429, 1.8636280298233032, 0.5759704113006592, 0.285367876291275, -2.601226329803467, 0.9241327047348022, 0.3992452323436737, -0.03785892575979233, 0.8475779294967651, 0.36495691537857056, 1.0434229373931885, -0.09550701826810837, 0.5721931457519531, -2.3313915729522705, 2.354445695877075, -0.18012657761573792, 0.6033628582954407, 0.18420767784118652, -0.22845640778541565, 1.086879849433899, 0.453024297952652, 0.6065850257873535, -1.1609688997268677, 0.6362760066986084, -0.7577633261680603, 1.30100417137146, 0.8505613207817078, -0.7761925458908081, -0.05211004987359047, 1.3751720190048218, 0.5401698350906372, -0.41445985436439514, -0.8357306122779846, -1.0297132730484009, 0.9303183555603027, 1.6690741777420044, -0.15890464186668396, -0.09104625880718231, 0.7370224595069885, 0.6004313826560974, -1.3181456327438354, 0.005736099556088448, -0.7659512758255005, -0.7246626615524292, 1.6611242294311523, 1.969332218170166, -0.21811926364898682, -0.21139010787010193, -0.9217501282691956, -1.2003368139266968, 0.7579166889190674, 0.01603573188185692, -0.024467773735523224, 0.5542653203010559, -0.6373758912086487, 1.2403068542480469, 0.9176186323165894, 0.9545687437057495, 0.18415841460227966, 0.4808588922023773, 0.2644098103046417, -0.4014502465724945, -1.1009242534637451, -0.34524035453796387, -1.1321417093276978, -2.7953813076019287, 0.5153521299362183, -0.4121938645839691, -1.4380290508270264, -0.061998073011636734, -1.0803437232971191, 0.8289076685905457, -0.6079787015914917, -1.026248574256897, -1.3530404567718506, 0.24983781576156616, -0.15842127799987793, 0.8806270360946655, -1.617109775543213, 0.03833678737282753, 1.2889647483825684, 0.9940110445022583, -0.8203470706939697, 0.9503149390220642, 0.23579218983650208, 1.0192625522613525, 0.8523258566856384, -0.37841707468032837, 0.5814754366874695, -0.0025458461605012417, -1.3025972843170166, 0.44539910554885864, 1.174129843711853, 0.06490721553564072, 1.3788617849349976, -0.5376260280609131, -0.001909992191940546, 0.4110518991947174, -0.5355895161628723, -0.5456394553184509, -0.5773152112960815, 0.7956716418266296, -0.009765011258423328, -0.944694459438324, 0.14571252465248108, -0.029585808515548706, -0.22500181198120117, 0.25514429807662964, -1.4966771602630615, -0.38281452655792236, -0.3238736689090729, -0.49111947417259216, -1.3144690990447998, 0.009235231205821037, 1.315582513809204, -0.5641178488731384, -0.20308804512023926, 0.5106154680252075, 0.38519421219825745, 0.509900689125061, 0.6213112473487854, -0.6703253388404846, -0.5215988755226135, -0.3294559717178345, -0.30934378504753113, 0.4300021231174469, 1.2548754215240479, -0.17068850994110107, -0.999597430229187, 0.7807498574256897, -0.3128855228424072, 0.007201701402664185, 1.9631365537643433, 0.0810917392373085, -0.9357081055641174, 0.2813326418399811, -0.6188746690750122, 1.9017857313156128, 1.698208212852478, 1.1434870958328247, -0.0236167274415493, -0.899506151676178, 0.6904996633529663, -0.261715829372406, -0.30653953552246094, 0.9400122761726379, 0.4491462707519531, -0.1709318459033966, -1.4610406160354614, 0.5402673482894897, 1.3413255214691162, -0.8222029805183411, -0.9584638476371765, 0.07981379330158234, -0.7366346716880798, 1.0495507717132568, 0.8470650911331177, 0.3583258390426636, 0.3505661189556122, 1.6106860637664795, 0.7400258183479309, -0.4476964771747589, 0.537570059299469, 0.3761512041091919, -0.10678759217262268, -2.027451992034912, -1.0984773635864258, 0.29522305727005005, -0.4929063618183136, -1.5331789255142212, 1.3560563325881958, -1.0697102546691895, -0.9406671524047852, 0.5565553903579712, 0.08784593641757965, 1.5273823738098145, 0.2986094653606415, 1.529518961906433, 2.0620667934417725, 0.8454630970954895, 0.21729519963264465, 1.293130874633789, -0.21759521961212158, -0.46652671694755554, 1.8632224798202515, -0.49018990993499756, 0.4493802785873413, 1.1023788452148438, -0.3077588379383087, -0.9436517953872681, -0.8302512168884277, -1.1986472606658936, -0.6688570976257324, 1.2298099994659424, 0.202610582113266, -1.2000352144241333, 0.2676532566547394, 1.4966042041778564, 0.10220945626497269, -0.24042955040931702, 0.6556137800216675, 0.4613298177719116, -0.8409350514411926, -0.059710793197155, -0.9328076839447021, 0.49238044023513794, -0.23414087295532227, -0.38947805762290955, 0.45863544940948486, 0.40783563256263733, 1.2133122682571411, -0.1203102171421051, 0.18869727849960327, 0.951874315738678, -1.3977155685424805, 1.4959602355957031, -0.6412615776062012, 0.28394338488578796, -2.3315656185150146, 1.3914599418640137, -0.8357451558113098, 1.9450205564498901, -2.6867334842681885, 0.37507039308547974, -0.47327926754951477, -0.41767618060112, 0.2872779071331024, -0.43122225999832153, 0.1863652467727661, -0.19444164633750916, -1.1069409847259521, -0.06031462550163269, -0.6695563197135925, 0.5879371166229248, 0.9978790283203125, 1.340281367301941, -1.1316713094711304, -0.3315776586532593, -1.840688943862915, -0.12465056031942368, -0.5753172039985657, 0.3828052282333374, -2.0768043994903564, -0.181783527135849, -1.9879070520401, -2.2346627712249756, -1.3207703828811646, -0.7582820653915405, 1.1550590991973877, 0.09722425043582916, -0.7689251899719238, 1.1046265363693237, -0.27792567014694214, -1.887055516242981, 1.0245598554611206, -2.1014227867126465 ]
https://github.com/huggingface/datasets/issues/3168
OpenSLR/83 is empty
Hi @tyrius02, thanks for reporting. I see you self-assigned this issue: are you working on this?
## Describe the bug As the summary says, openslr / SLR83 / train is empty. The dataset returned after loading indicates there are **zero** rows. The correct number should be **17877**. ## Steps to reproduce the bug ```python import datasets datasets.load_dataset('openslr', 'SLR83') ``` ## Expected results ``` DatasetDict({ train: Dataset({ features: ['path', 'audio', 'sentence'], num_rows: 17877 }) }) ``` ## Actual results ``` DatasetDict({ train: Dataset({ features: ['path', 'audio', 'sentence'], num_rows: 0 }) }) ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.1.dev0 (master HEAD) - Platform: Ubuntu 20.04 - Python version: 3.7.10 - PyArrow version: 3.0.0
1,143
16
OpenSLR/83 is empty ## Describe the bug As the summary says, openslr / SLR83 / train is empty. The dataset returned after loading indicates there are **zero** rows. The correct number should be **17877**. ## Steps to reproduce the bug ```python import datasets datasets.load_dataset('openslr', 'SLR83') ``` ## Expected results ``` DatasetDict({ train: Dataset({ features: ['path', 'audio', 'sentence'], num_rows: 17877 }) }) ``` ## Actual results ``` DatasetDict({ train: Dataset({ features: ['path', 'audio', 'sentence'], num_rows: 0 }) }) ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.1.dev0 (master HEAD) - Platform: Ubuntu 20.04 - Python version: 3.7.10 - PyArrow version: 3.0.0 Hi @tyrius02, thanks for reporting. I see you self-assigned this issue: are you working on this?
[ -1.1639569997787476, -0.9612900614738464, -0.7580885887145996, 1.4381530284881592, -0.2405116707086563, -1.2051752805709839, 0.1510688066482544, -0.9826123714447021, 1.768053650856018, -0.7353419661521912, 0.30043044686317444, -1.7498258352279663, -0.009621880017220974, -0.6658338904380798, -0.8184748888015747, -0.7992940545082092, -0.41199129819869995, -0.720141589641571, 0.9645638465881348, 2.4317851066589355, 1.0914477109909058, -1.4386179447174072, 2.6465487480163574, 0.6659125685691833, -0.1807229071855545, -0.9654303789138794, 0.507082462310791, -0.026092104613780975, -1.303287386894226, -0.34806349873542786, -0.9124338030815125, -0.06607429683208466, -0.5112594962120056, -0.5877220630645752, 0.08339802175760269, 0.4792550504207611, -0.2506440579891205, -0.5054600834846497, -0.3770243227481842, -0.81866055727005, 0.4239199161529541, -0.3974723219871521, 0.9069110155105591, -0.35890236496925354, 1.766472578048706, -0.5581178069114685, 0.4112008810043335, 0.6650729179382324, 1.3781863451004028, 0.15864591300487518, -0.0003693830221891403, 0.44705313444137573, 0.38031113147735596, 0.06405691802501678, 0.4937846064567566, 1.160278558731079, 0.5870054364204407, 0.4258730411529541, 0.8471313118934631, -2.3016650676727295, 1.2250628471374512, -0.996221125125885, 0.3443780541419983, 1.3554588556289673, -1.0424747467041016, 0.34703370928764343, -1.7670440673828125, 0.01049045566469431, 0.5852380990982056, -2.1789591312408447, 0.31421032547950745, -1.287278652191162, -0.4148520231246948, 0.9873412251472473, 0.34276649355888367, -1.2845267057418823, 0.08705855906009674, -0.3566027581691742, 0.9914391040802002, 0.36636775732040405, 1.0495686531066895, -1.7330702543258667, -0.01890193298459053, -0.30440381169319153, 0.08976113796234131, -1.3148553371429443, -1.5382622480392456, 0.5242307782173157, 0.6419570446014404, 0.6629680395126343, -0.19991667568683624, 0.9352151155471802, -1.0640883445739746, 0.7490413188934326, -1.0637216567993164, -1.7866477966308594, -1.3556855916976929, -2.229159116744995, -2.256563425064087, 0.7936018705368042, -0.40052250027656555, -0.4672635495662689, 2.033843755722046, -0.9437218308448792, -1.809032917022705, 1.1623011827468872, 0.3797032833099365, 0.010173148475587368, 2.284158706665039, 0.20031589269638062, -0.7640928030014038, 0.5298875570297241, -0.8197348117828369, 0.7289476990699768, -0.408334344625473, 1.403485894203186, 0.46657437086105347, -0.9749502539634705, 1.6863809823989868, -0.43755102157592773, 0.5211127400398254, -0.7293294072151184, -0.4654026925563812, -0.8201428651809692, 0.31240418553352356, 1.9010685682296753, -0.28020012378692627, 1.4624305963516235, -0.3410504460334778, -1.569072961807251, -1.4905859231948853, 0.833340585231781, 0.5314055681228638, -0.7575086951255798, 0.1721310168504715, -0.3448852300643921, 0.17655645310878754, -0.17023023962974548, 1.1708521842956543, 1.2281451225280762, 0.6966671347618103, -0.27154746651649475, -0.9660725593566895, 0.27678385376930237, -0.022370118647813797, -0.7031668424606323, -1.772589087486267, -0.35534414649009705, 0.11856356263160706, 0.6606930494308472, -1.1703251600265503, 1.6922249794006348, 0.8166279792785645, 1.9479663372039795, 0.9142082929611206, -0.31477001309394836, 1.527860164642334, 0.1190912127494812, 1.916138768196106, -0.5501446723937988, 0.7169882655143738, -0.46685999631881714, -1.0721856355667114, 0.8811798095703125, -0.363941490650177, -2.02919340133667, -0.6813569664955139, -0.950962483882904, -0.18645261228084564, -0.7792449593544006, 1.0257614850997925, -0.2601529359817505, -1.477830171585083, 0.3160559833049774, -0.7934176325798035, 0.18032178282737732, -1.219667911529541, 0.2832415699958801, 0.7652580738067627, -0.5496594905853271, 0.09094945341348648, -0.30242177844047546, -1.3537944555282593, -0.503783643245697, 0.36066463589668274, 1.8574912548065186, -0.8570968508720398, 0.9801229238510132, 0.9004448056221008, -0.6364967823028564, -0.02806020900607109, 0.31157490611076355, -0.2932012379169464, 0.8679607510566711, -1.1004445552825928, -0.4440959095954895, 1.1672141551971436, -0.16361212730407715, -0.6086776852607727, 1.4212671518325806, 0.7619544267654419, -1.0141292810440063, -0.20501486957073212, -0.17238231003284454, -0.7613350749015808, -0.04683450609445572, -1.6625499725341797, -0.11224823445081711, 0.42022520303726196, -1.5039372444152832, -0.4868898391723633, -0.17943327128887177, 1.2723878622055054, -0.13086825609207153, 1.3424123525619507, -0.27587613463401794, -0.25593245029449463, -0.421903520822525, -0.4747864902019501, 0.1977510005235672, -0.2718331813812256, -0.6261488199234009, 0.24691970646381378, -0.7479759454727173, 0.42517441511154175, 1.321361780166626, 0.35710039734840393, 0.06421405076980591, 0.610373318195343, 1.1426005363464355, 0.3311830759048462, 0.024622544646263123, -0.9113819599151611, -1.6647307872772217, 2.0095458030700684, -1.521953821182251, 1.9368922710418701, 0.5760767459869385, -0.041747964918613434, -1.6724448204040527, -1.9165877103805542, 1.450515627861023, 1.1740593910217285, 2.3021886348724365, 0.6672136187553406, 0.44598299264907837, -0.8465242981910706, -0.6795188188552856, 0.2359410971403122, -1.0164663791656494, -0.7781367897987366, 0.13090172410011292, 2.4332826137542725, 1.7414960861206055, -0.47508466243743896, -0.21162649989128113, -1.0424143075942993, 1.4621456861495972, -0.19226135313510895, 0.34405142068862915, 1.9771615266799927, -0.27391156554222107, -1.0620834827423096, 1.2366634607315063, -2.3648793697357178, 0.2191644161939621, 2.0167500972747803, 0.2132091075181961, 0.1675536334514618, -1.3376514911651611, -0.7329650521278381, -0.19625642895698547, -0.3868494927883148, -1.2997649908065796, 0.5165511965751648, -0.2702867388725281, -0.798926591873169, -1.3950711488723755, 0.19344907999038696, -1.0852720737457275, -1.6557962894439697, 0.23205803334712982, 1.9262738227844238, 2.0800371170043945, -0.7241882681846619, 1.569434404373169, -0.19893814623355865, 0.33518657088279724, 1.3428361415863037, 1.2042678594589233, 3.052602767944336, 1.9633418321609497, -1.2367548942565918, 0.666346549987793, -0.100767582654953, -0.4789329469203949, 1.3327289819717407, -1.1575965881347656, 1.160806655883789, -0.15273435413837433, -1.188644528388977, -1.213936448097229, 0.8907070159912109, 0.4548933804035187, 0.03565877676010132, -0.45243215560913086, 1.2387566566467285, -0.06537608802318573, 1.316739559173584, 0.6550353765487671, -0.3495388329029083, 0.6171387434005737, -0.3801478147506714, -0.4494268000125885, 1.5921635627746582, 0.12312710285186768, -1.3983370065689087, -2.3770649433135986, -0.2598937749862671, -0.8908471465110779, 0.015834596008062363, -0.5693399906158447, -1.0165643692016602, 1.687562346458435, 0.41019827127456665, -1.2225017547607422, -0.2126459777355194, -0.28352150321006775, -0.5801003575325012, 2.669093370437622, -1.4175984859466553, -0.32474008202552795, -1.0128597021102905, -0.5617129802703857, 1.685743808746338, -1.1449503898620605, -0.1946917474269867, -1.0176317691802979, -0.5701461434364319, -1.3433066606521606, -0.596225380897522, -0.05103296414017677, -0.8811620473861694, 0.9404026865959167, 0.15152616798877716, -1.2420246601104736, -0.32369956374168396, -0.9993716478347778, 0.793777585029602, -0.1682826727628708, 0.27428609132766724, 1.8788946866989136, 0.5071331858634949, -0.3242854177951813, 0.7381002306938171, 1.1544376611709595, 0.70282381772995, -0.6594598889350891, 0.30682218074798584, -0.6039650440216064, 0.3346116244792938, -1.3678231239318848, 0.2793194353580475, -2.8870530128479004, 0.5962002277374268, -0.03444594889879227, -0.05743170529603958, -0.09959176182746887, -1.3338210582733154, 1.1042988300323486, 2.534754514694214, -1.2225933074951172, 0.49313193559646606, 0.26556703448295593, 1.2961674928665161, -1.662138819694519, 0.1934833526611328, -0.4229932427406311, 2.2038347721099854, 0.13794584572315216, 1.181632161140442, -0.40377867221832275, -2.249981164932251, 0.5981868505477905, -1.3043876886367798, -1.1304672956466675, 0.6291966438293457, -0.8935405611991882, 0.22719357907772064, -1.5083746910095215, -0.15723934769630432, -0.8930341005325317, -1.2255386114120483, 0.7213584184646606, 0.07512370496988297, 0.4005361497402191, -0.5818964838981628, 0.3998792767524719, -2.1510071754455566, -1.3443464040756226, -0.22464556992053986, -0.9084458947181702, 0.505919337272644, -0.24280807375907898, 0.7469086050987244, -0.15201175212860107, -0.026024308055639267, 0.27518409490585327, 1.4372097253799438, 3.332719326019287, 0.189652681350708, 0.37170031666755676, -0.14415457844734192, -0.8899931907653809, 1.446089506149292, 1.049721121788025, -0.08183925598859787, -0.5468578338623047, -1.08454430103302, 1.3854416608810425, 1.9820947647094727, 0.9646944403648376, 0.03887183591723442, -0.7496075630187988, -0.7331900000572205, 0.028741713613271713, 0.09467845410108566, 0.48874565958976746, 0.8058334589004517, 0.11555390059947968, 0.06802459061145782, 1.3886674642562866, 1.1176609992980957, -0.36688342690467834, 0.42610639333724976, -0.8657476902008057, -0.492581844329834, 0.4896385073661804, 0.309768944978714, 0.0014784513041377068, 0.2857591509819031, -1.0539742708206177, -0.273791640996933, -0.25256073474884033, -0.9149988293647766, -0.7032892107963562, -0.4385618567466736, -0.4135530889034271, 1.6218185424804688, 0.08247414231300354, -0.5804744362831116, -0.07602698355913162, -0.6857401132583618, 0.006461366079747677, -1.033425211906433, 0.23830284178256989, -0.23588010668754578, -0.03975324705243111, -0.20402078330516815, 1.692451000213623, -0.9028077721595764, -2.0325372219085693, 0.1606440395116806, 0.36913713812828064, -0.42548105120658875, 0.1386849731206894, 1.622158169746399, 0.6048970222473145, 1.4390003681182861, 1.4048635959625244, 1.0151115655899048, -0.6894452571868896, -1.3181544542312622, 0.6321835517883301, 0.9506511688232422, -1.4374803304672241, 0.7815585136413574, 0.030819043517112732, -0.5698617696762085, 0.5999869704246521, 1.3585312366485596, 0.47739094495773315, -1.9952013492584229, 0.7465333342552185, -0.9654661417007446, 0.8140111565589905, 0.8063002228736877, 0.7517762780189514, 0.2537202537059784, 0.7696892023086548, -1.3109688758850098, -1.0636051893234253, -0.8274228572845459, -0.5909706950187683, 1.9163790941238403, -0.2741456627845764, 0.5004485845565796, -0.09099863469600677, -1.3101531267166138, -0.12871882319450378, 0.6366013288497925, 0.36095568537712097, -0.39937567710876465, 0.7363553047180176, -0.5896115303039551, -1.1177188158035278, -1.2902119159698486, -0.5299636721611023, -1.0121883153915405, -0.9583128690719604, 0.9477347135543823, 0.894402801990509, 0.38858848810195923, 1.8473538160324097, 0.6544292569160461, 0.09678255021572113, -2.5766749382019043, 0.8607628345489502, 0.31002378463745117, -0.10203596949577332, 0.7530572414398193, 0.2569974660873413, 1.1171355247497559, -0.13985101878643036, 0.5904721021652222, -2.440317153930664, 2.2039923667907715, -0.25638240575790405, 0.6734225153923035, 0.010078937746584415, -0.11425282806158066, 1.0635511875152588, 0.4199247360229492, 0.522107720375061, -1.062498688697815, 0.6677579879760742, -0.670593798160553, 1.2726343870162964, 0.8979340195655823, -0.8516470789909363, -0.05166664347052574, 1.305814504623413, 0.4169439971446991, -0.5515444874763489, -1.0101176500320435, -0.8658169507980347, 0.9557725191116333, 1.6941324472427368, -0.1124400645494461, -0.07132089883089066, 0.9898000955581665, 0.7274675369262695, -1.2573989629745483, 0.027211040258407593, -0.719983696937561, -0.6189864873886108, 1.7448570728302002, 2.0708398818969727, -0.17694337666034698, -0.09843423217535019, -0.8285422325134277, -1.2748098373413086, 0.7908186912536621, 0.07865665853023529, -0.014412770047783852, 0.7691495418548584, -0.618526816368103, 1.0570199489593506, 0.7907238602638245, 0.8446499109268188, 0.1677418351173401, 0.32273125648498535, 0.31958234310150146, -0.2754781246185303, -1.1513592004776, -0.3088500499725342, -1.0629916191101074, -2.522836685180664, 0.4556376338005066, -0.2710716426372528, -1.364639401435852, 0.058156102895736694, -1.043639063835144, 0.9918498992919922, -0.5845974683761597, -1.175552487373352, -1.4406265020370483, 0.24975551664829254, -0.038636501878499985, 0.8285850882530212, -1.6061679124832153, 0.005134463310241699, 1.2826824188232422, 0.8539043068885803, -0.699015200138092, 1.02338445186615, 0.281123548746109, 1.045831561088562, 0.8607772588729858, -0.36292508244514465, 0.5233051180839539, 0.0809786319732666, -1.3277705907821655, 0.6144815683364868, 1.1997743844985962, 0.0995122417807579, 1.5692538022994995, -0.5276033282279968, -0.01782909967005253, 0.4114830791950226, -0.48661941289901733, -0.4229808449745178, -0.5969035625457764, 0.6652265191078186, 0.08307019621133804, -0.8956742286682129, 0.025232508778572083, 0.05572950094938278, -0.15579694509506226, 0.22560139000415802, -1.5171067714691162, -0.13496658205986023, -0.24202200770378113, -0.6236160397529602, -1.158703327178955, -0.1070779412984848, 1.3775584697723389, -0.6895135641098022, -0.20937654376029968, 0.5719656944274902, 0.2673836648464203, 0.4974873661994934, 0.6442829966545105, -0.6171322464942932, -0.395148366689682, -0.24231746792793274, -0.35048797726631165, 0.32167163491249084, 1.311306118965149, -0.10817597806453705, -1.050605058670044, 0.670926570892334, -0.3700180649757385, 0.022268999367952347, 1.8544912338256836, 0.029231097549200058, -0.8907358646392822, 0.2860608696937561, -0.7372355461120605, 1.9930506944656372, 1.6959766149520874, 1.3314119577407837, -0.08735718578100204, -1.0165902376174927, 0.6086897850036621, -0.29882046580314636, -0.4288592040538788, 0.850492537021637, 0.4413129985332489, -0.14951573312282562, -1.2787740230560303, 0.7399364113807678, 1.2894032001495361, -0.9354757070541382, -0.9427163004875183, 0.258149653673172, -0.77454674243927, 1.0773183107376099, 0.726246178150177, 0.4101342558860779, 0.3099822700023651, 1.6900889873504639, 0.7811813354492188, -0.4100010395050049, 0.5367139577865601, 0.5627925395965576, -0.12500639259815216, -2.0621941089630127, -1.2167177200317383, 0.3151990473270416, -0.44516244530677795, -1.6419873237609863, 1.3226252794265747, -1.1621806621551514, -0.8127338886260986, 0.5466551780700684, 0.1741076409816742, 1.4914610385894775, 0.3965965211391449, 1.5864050388336182, 1.9644417762756348, 0.8103612065315247, 0.38080501556396484, 1.2916114330291748, -0.1155451238155365, -0.47902369499206543, 1.7232133150100708, -0.49412083625793457, 0.5643308758735657, 1.0820996761322021, -0.34219232201576233, -1.1695811748504639, -0.7600831389427185, -1.2572636604309082, -0.6100261807441711, 1.1052659749984741, 0.14289870858192444, -1.2839716672897339, 0.29244813323020935, 1.5570809841156006, 0.012450900860130787, -0.3543107211589813, 0.6347073912620544, 0.3333609104156494, -0.8404008746147156, -0.06500672549009323, -0.9247243404388428, 0.47882530093193054, -0.21812106668949127, -0.25821977853775024, 0.2754038870334625, 0.5423693060874939, 1.2997734546661377, 0.04109887778759003, 0.13998542726039886, 1.2164546251296997, -1.3967392444610596, 1.4693167209625244, -0.7928016781806946, 0.28108516335487366, -2.374058961868286, 1.3974685668945312, -0.86033034324646, 1.9360066652297974, -2.7471256256103516, 0.36564716696739197, -0.5660863518714905, -0.4322975277900696, 0.23663704097270966, -0.29875457286834717, 0.15822122991085052, -0.054344430565834045, -1.2376532554626465, -0.03297785669565201, -0.8129394054412842, 0.5532705187797546, 1.1372772455215454, 1.369417428970337, -1.1514476537704468, -0.2766382694244385, -1.7537117004394531, -0.17486213147640228, -0.6177257299423218, 0.39800992608070374, -2.008251428604126, -0.12699270248413086, -1.9064327478408813, -2.342470645904541, -1.3946895599365234, -0.8267269134521484, 1.1030842065811157, 0.04210081696510315, -0.8360158801078796, 1.155822992324829, -0.2793193459510803, -1.7855639457702637, 1.0603752136230469, -2.18831205368042 ]
https://github.com/huggingface/datasets/issues/3168
OpenSLR/83 is empty
@albertvillanova Yes. Figured I introduced the broken config, I should fix it too. I've got it working, but I'm struggling with one of the tests. I've started a PR so I/we can work through it.
## Describe the bug As the summary says, openslr / SLR83 / train is empty. The dataset returned after loading indicates there are **zero** rows. The correct number should be **17877**. ## Steps to reproduce the bug ```python import datasets datasets.load_dataset('openslr', 'SLR83') ``` ## Expected results ``` DatasetDict({ train: Dataset({ features: ['path', 'audio', 'sentence'], num_rows: 17877 }) }) ``` ## Actual results ``` DatasetDict({ train: Dataset({ features: ['path', 'audio', 'sentence'], num_rows: 0 }) }) ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.1.dev0 (master HEAD) - Platform: Ubuntu 20.04 - Python version: 3.7.10 - PyArrow version: 3.0.0
1,143
35
OpenSLR/83 is empty ## Describe the bug As the summary says, openslr / SLR83 / train is empty. The dataset returned after loading indicates there are **zero** rows. The correct number should be **17877**. ## Steps to reproduce the bug ```python import datasets datasets.load_dataset('openslr', 'SLR83') ``` ## Expected results ``` DatasetDict({ train: Dataset({ features: ['path', 'audio', 'sentence'], num_rows: 17877 }) }) ``` ## Actual results ``` DatasetDict({ train: Dataset({ features: ['path', 'audio', 'sentence'], num_rows: 0 }) }) ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.1.dev0 (master HEAD) - Platform: Ubuntu 20.04 - Python version: 3.7.10 - PyArrow version: 3.0.0 @albertvillanova Yes. Figured I introduced the broken config, I should fix it too. I've got it working, but I'm struggling with one of the tests. I've started a PR so I/we can work through it.
[ -1.1781080961227417, -0.9597163200378418, -0.7798928618431091, 1.426313042640686, -0.23168079555034637, -1.200372338294983, 0.1673726588487625, -0.968491792678833, 1.743032693862915, -0.7391090393066406, 0.31458520889282227, -1.7466412782669067, -0.009990445338189602, -0.6543440818786621, -0.8028513789176941, -0.7886530756950378, -0.4217502176761627, -0.7395450472831726, 0.9881588816642761, 2.4337494373321533, 1.0436040163040161, -1.448941946029663, 2.640774965286255, 0.6381638646125793, -0.12200471758842468, -1.0080472230911255, 0.531818151473999, -0.03267929330468178, -1.2850189208984375, -0.3931933343410492, -0.9118818640708923, -0.03596452623605728, -0.5367940068244934, -0.5927259922027588, 0.06696575880050659, 0.4277099072933197, -0.24376845359802246, -0.49939918518066406, -0.3983595371246338, -0.8060088157653809, 0.4072360694408417, -0.43108969926834106, 0.9090467095375061, -0.3405435383319855, 1.7942663431167603, -0.5094479322433472, 0.41157737374305725, 0.6963436007499695, 1.3970714807510376, 0.21962527930736542, -0.01469412911683321, 0.4614437222480774, 0.4248153865337372, 0.052842266857624054, 0.517555296421051, 1.1326762437820435, 0.5643283724784851, 0.40049877762794495, 0.8370746374130249, -2.288283586502075, 1.22245192527771, -0.9890269041061401, 0.3727704882621765, 1.3779947757720947, -0.9924464821815491, 0.34449902176856995, -1.7509492635726929, 0.014433045871555805, 0.602137565612793, -2.197984218597412, 0.29423898458480835, -1.3110312223434448, -0.38206449151039124, 1.0054773092269897, 0.34324607253074646, -1.2679221630096436, 0.07527820020914078, -0.3383539319038391, 0.9498541951179504, 0.3507348597049713, 1.1119188070297241, -1.7247960567474365, -0.040362387895584106, -0.3063487410545349, 0.11385507136583328, -1.2744156122207642, -1.52776038646698, 0.47876080870628357, 0.66256183385849, 0.6474295854568481, -0.21573400497436523, 0.9442955255508423, -1.0351210832595825, 0.7589960098266602, -1.018758773803711, -1.7911558151245117, -1.3822777271270752, -2.19180965423584, -2.241360902786255, 0.8323516249656677, -0.4245813488960266, -0.4617292582988739, 2.0378196239471436, -0.950531005859375, -1.8021397590637207, 1.1774080991744995, 0.34853821992874146, 0.006493248976767063, 2.3105177879333496, 0.1771322637796402, -0.7557814717292786, 0.5341497659683228, -0.8044513463973999, 0.7397950887680054, -0.38793447613716125, 1.4143019914627075, 0.4666266441345215, -0.95677250623703, 1.6816226243972778, -0.428613543510437, 0.5136255621910095, -0.6961401104927063, -0.4444846510887146, -0.8334670066833496, 0.3006189465522766, 1.9393126964569092, -0.26856887340545654, 1.4925071001052856, -0.361544132232666, -1.5847673416137695, -1.5400501489639282, 0.8728418946266174, 0.4748302400112152, -0.7889533042907715, 0.1426108032464981, -0.3294629156589508, 0.2004219889640808, -0.14092163741588593, 1.155470609664917, 1.2502878904342651, 0.7170603275299072, -0.2475244402885437, -0.9822486042976379, 0.26667821407318115, -0.052596356719732285, -0.6786379218101501, -1.7573665380477905, -0.3635667562484741, 0.14758245646953583, 0.6622334718704224, -1.149898886680603, 1.7072957754135132, 0.8514889478683472, 1.9173071384429932, 0.9371029138565063, -0.33146241307258606, 1.5636237859725952, 0.14136061072349548, 1.930466890335083, -0.5041709542274475, 0.671671986579895, -0.45512402057647705, -1.0576565265655518, 0.884381115436554, -0.3442622423171997, -2.005012273788452, -0.7121022939682007, -0.9630113244056702, -0.17366695404052734, -0.7448172569274902, 0.9801480770111084, -0.2825522720813751, -1.48721444606781, 0.3164689540863037, -0.7847115397453308, 0.1948641687631607, -1.2226474285125732, 0.29909348487854004, 0.7701212167739868, -0.5779574513435364, 0.11019525676965714, -0.31655988097190857, -1.3738434314727783, -0.5018541812896729, 0.36507344245910645, 1.8803191184997559, -0.8309720158576965, 0.9590801000595093, 0.9348036050796509, -0.6655703783035278, -0.06476123631000519, 0.3270225524902344, -0.2816225290298462, 0.8418816924095154, -1.1215322017669678, -0.43080008029937744, 1.1590969562530518, -0.18513262271881104, -0.5918232798576355, 1.4377782344818115, 0.775022566318512, -1.024106502532959, -0.18034102022647858, -0.16297172009944916, -0.7455342411994934, -0.0033352053724229336, -1.6778249740600586, -0.10644331574440002, 0.41559627652168274, -1.4949389696121216, -0.48003479838371277, -0.20423315465450287, 1.2575995922088623, -0.09646598994731903, 1.358937382698059, -0.3282249867916107, -0.22263203561306, -0.43781915307044983, -0.4816683530807495, 0.22174407541751862, -0.27946749329566956, -0.6444328427314758, 0.25385671854019165, -0.7492555975914001, 0.4246673882007599, 1.3261620998382568, 0.37800201773643494, 0.04704327508807182, 0.6128790378570557, 1.1607661247253418, 0.3427772521972656, 0.0631999671459198, -0.9318517446517944, -1.610182285308838, 2.0523574352264404, -1.5146045684814453, 1.9196785688400269, 0.542072057723999, -0.05484519153833389, -1.6644796133041382, -1.9076690673828125, 1.4461188316345215, 1.178208351135254, 2.2856438159942627, 0.638552725315094, 0.4475214183330536, -0.8240483999252319, -0.6356241703033447, 0.20822177827358246, -1.0018543004989624, -0.7871043086051941, 0.14571958780288696, 2.4145760536193848, 1.7406830787658691, -0.5023624897003174, -0.17577578127384186, -1.0435415506362915, 1.462602972984314, -0.23161348700523376, 0.30856817960739136, 1.9921600818634033, -0.2225245237350464, -1.0734822750091553, 1.2380906343460083, -2.328852653503418, 0.23045134544372559, 2.009915828704834, 0.20250961184501648, 0.16182230412960052, -1.349835753440857, -0.6895285248756409, -0.1943684071302414, -0.3910590708255768, -1.2850812673568726, 0.5359882116317749, -0.28320902585983276, -0.7901567220687866, -1.3915774822235107, 0.21032345294952393, -1.0879814624786377, -1.6769176721572876, 0.22291529178619385, 1.9170249700546265, 2.0725460052490234, -0.7182499766349792, 1.5463030338287354, -0.20420673489570618, 0.3344228267669678, 1.3408385515213013, 1.199876308441162, 3.0524299144744873, 2.000931978225708, -1.232187271118164, 0.608668863773346, -0.1359393149614334, -0.46470266580581665, 1.3062167167663574, -1.1717298030853271, 1.185213565826416, -0.13904403150081635, -1.205150842666626, -1.19357168674469, 0.9116607308387756, 0.46079200506210327, 0.03240717202425003, -0.42828628420829773, 1.2269583940505981, -0.09061896055936813, 1.2751703262329102, 0.6255506277084351, -0.3456147015094757, 0.6032516360282898, -0.36291709542274475, -0.4608432650566101, 1.5887268781661987, 0.11283107101917267, -1.4241867065429688, -2.3792030811309814, -0.2890184819698334, -0.9082996845245361, 0.020023472607135773, -0.5575587153434753, -1.0009117126464844, 1.6382050514221191, 0.4016101360321045, -1.194159984588623, -0.2822626531124115, -0.29119881987571716, -0.6077108979225159, 2.6930148601531982, -1.3882567882537842, -0.3419856131076813, -0.9945753216743469, -0.5670910477638245, 1.7045170068740845, -1.1605796813964844, -0.19850918650627136, -1.0534747838974, -0.5693394541740417, -1.3378340005874634, -0.5772889852523804, -0.07379715144634247, -0.9114567637443542, 0.917335033416748, 0.19844384491443634, -1.2110522985458374, -0.3200087249279022, -1.011941909790039, 0.7818393111228943, -0.1587992161512375, 0.25580859184265137, 1.8517335653305054, 0.47168874740600586, -0.32139915227890015, 0.7349663376808167, 1.1650683879852295, 0.6794417500495911, -0.6145582795143127, 0.29251980781555176, -0.614116370677948, 0.30140751600265503, -1.3700323104858398, 0.26813387870788574, -2.883101463317871, 0.604967474937439, -0.05716706067323685, -0.03650561720132828, -0.14941109716892242, -1.308670163154602, 1.1440869569778442, 2.514087677001953, -1.220844030380249, 0.5053920745849609, 0.2618017792701721, 1.3254716396331787, -1.665849208831787, 0.22382184863090515, -0.43100297451019287, 2.2097678184509277, 0.1613999754190445, 1.1357479095458984, -0.3913654386997223, -2.287213087081909, 0.6196502447128296, -1.277337670326233, -1.1116007566452026, 0.6226979494094849, -0.8914409875869751, 0.16971637308597565, -1.5204401016235352, -0.1604587733745575, -0.8614240884780884, -1.1786513328552246, 0.7191116213798523, 0.06546568125486374, 0.40859055519104004, -0.5895893573760986, 0.39074480533599854, -2.1815025806427, -1.414732813835144, -0.23264813423156738, -0.9437941312789917, 0.5311182737350464, -0.2805498540401459, 0.7487475275993347, -0.16053327918052673, -0.024137314409017563, 0.29734084010124207, 1.472805142402649, 3.3302016258239746, 0.2463259994983673, 0.4038330912590027, -0.13103875517845154, -0.8825766444206238, 1.4354937076568604, 1.0085254907608032, -0.14434419572353363, -0.5331611037254333, -1.124816656112671, 1.3930250406265259, 1.9949133396148682, 0.9697624444961548, 0.022924888879060745, -0.7274940013885498, -0.7181499004364014, 0.017722025513648987, 0.0923142358660698, 0.5205484628677368, 0.8165050148963928, 0.12430304288864136, 0.056058093905448914, 1.369868516921997, 1.1114320755004883, -0.3906441330909729, 0.43799686431884766, -0.8603647351264954, -0.4898951053619385, 0.5195600986480713, 0.28719285130500793, 0.0022793468087911606, 0.3286701440811157, -1.0585979223251343, -0.2511788308620453, -0.2652831971645355, -0.9223259687423706, -0.7400968670845032, -0.4283433258533478, -0.371839314699173, 1.6354597806930542, 0.10468512028455734, -0.6159339547157288, -0.0735112652182579, -0.6901862621307373, -0.009509360417723656, -1.0276589393615723, 0.1966126710176468, -0.22165155410766602, -0.06224549561738968, -0.17565570771694183, 1.6794517040252686, -0.9185404181480408, -2.031125545501709, 0.14433960616588593, 0.3599538505077362, -0.3997722268104553, 0.192571759223938, 1.638073444366455, 0.5760417580604553, 1.4319769144058228, 1.4356045722961426, 0.9979173541069031, -0.6807436347007751, -1.3033438920974731, 0.6404804587364197, 0.90194171667099, -1.4033955335617065, 0.7564400434494019, 0.027667779475450516, -0.5799870491027832, 0.6400311589241028, 1.3454234600067139, 0.46339961886405945, -2.017401933670044, 0.7692524790763855, -0.9901774525642395, 0.8165055513381958, 0.7970017790794373, 0.7647714614868164, 0.2472761571407318, 0.7590199112892151, -1.2918733358383179, -1.087738275527954, -0.835601806640625, -0.6243565082550049, 1.9003762006759644, -0.23391729593276978, 0.49828505516052246, -0.07315246760845184, -1.3165255784988403, -0.14168468117713928, 0.6684048771858215, 0.3396762013435364, -0.4120180606842041, 0.7315506935119629, -0.6230289936065674, -1.1593496799468994, -1.3243218660354614, -0.5178342461585999, -1.0376676321029663, -0.9601315855979919, 0.9612743258476257, 0.8467426896095276, 0.33895283937454224, 1.8202537298202515, 0.6958885192871094, 0.09612525254487991, -2.581233263015747, 0.883282482624054, 0.3056904673576355, -0.10590215027332306, 0.756384551525116, 0.2423303723335266, 1.1105754375457764, -0.13676267862319946, 0.6058109402656555, -2.4073374271392822, 2.214632749557495, -0.29114797711372375, 0.6853899955749512, 0.014877473004162312, -0.12346893548965454, 1.0355826616287231, 0.4272060692310333, 0.5567022562026978, -1.0870195627212524, 0.6844986081123352, -0.7250498533248901, 1.2609449625015259, 0.8827607035636902, -0.8323369026184082, -0.03469295799732208, 1.3450478315353394, 0.4327468276023865, -0.5535939931869507, -1.0131903886795044, -0.9051260352134705, 0.9659072160720825, 1.724958062171936, -0.11971955746412277, -0.10529640316963196, 0.9353569149971008, 0.7298325300216675, -1.278174877166748, 0.03487137332558632, -0.6936032772064209, -0.6153698563575745, 1.7607369422912598, 2.0848538875579834, -0.1874779611825943, -0.14593258500099182, -0.8290217518806458, -1.298154354095459, 0.7443740367889404, 0.08271123468875885, 0.001243075355887413, 0.7696852684020996, -0.6020569801330566, 1.0747936964035034, 0.8309008479118347, 0.8538487553596497, 0.17295688390731812, 0.29599031805992126, 0.3305310904979706, -0.26986339688301086, -1.1318342685699463, -0.31254687905311584, -1.0733251571655273, -2.5127148628234863, 0.41976433992385864, -0.27170127630233765, -1.3900622129440308, 0.056260138750076294, -1.0242335796356201, 0.9830555319786072, -0.5660644173622131, -1.1553748846054077, -1.4285681247711182, 0.22164110839366913, -0.048730771988630295, 0.8158618807792664, -1.6070265769958496, -0.015312068164348602, 1.2893301248550415, 0.8849461674690247, -0.7296856045722961, 1.003983974456787, 0.30514922738075256, 1.0387290716171265, 0.882423460483551, -0.4077550768852234, 0.5388383865356445, 0.07231126725673676, -1.3250300884246826, 0.6137314438819885, 1.1790441274642944, 0.12544351816177368, 1.5139009952545166, -0.5688958764076233, -0.013601851649582386, 0.39282864332199097, -0.5015358924865723, -0.44224438071250916, -0.6046210527420044, 0.6354588270187378, 0.03296651318669319, -0.8916390538215637, 0.05462830513715744, 0.02041938155889511, -0.14875270426273346, 0.24761024117469788, -1.5276671648025513, -0.156624436378479, -0.2452399730682373, -0.6337207555770874, -1.1536736488342285, -0.12777720391750336, 1.4069459438323975, -0.6942855715751648, -0.22000545263290405, 0.5667170882225037, 0.29841965436935425, 0.47751614451408386, 0.6009308099746704, -0.5991991758346558, -0.3936612010002136, -0.21617908775806427, -0.34871500730514526, 0.32938727736473083, 1.2852081060409546, -0.1460791528224945, -1.0340745449066162, 0.7017717957496643, -0.36266615986824036, 0.03289073705673218, 1.8456748723983765, 0.03329372778534889, -0.8906768560409546, 0.2831817865371704, -0.7630413770675659, 1.9836127758026123, 1.7216825485229492, 1.3146501779556274, -0.10059672594070435, -1.0327943563461304, 0.60162353515625, -0.3111269474029541, -0.44355344772338867, 0.8326691389083862, 0.4461697041988373, -0.15299464762210846, -1.291096568107605, 0.7103888392448425, 1.2866151332855225, -0.8763036727905273, -0.9181854724884033, 0.1936817467212677, -0.7938948273658752, 1.0728822946548462, 0.700430691242218, 0.402360737323761, 0.25772565603256226, 1.691453456878662, 0.7911627292633057, -0.41577762365341187, 0.5545800924301147, 0.5729086399078369, -0.14020651578903198, -2.0897393226623535, -1.2128071784973145, 0.2794586718082428, -0.40925145149230957, -1.6553560495376587, 1.3122937679290771, -1.1596920490264893, -0.814153790473938, 0.5693038105964661, 0.1668611615896225, 1.504052758216858, 0.4341391921043396, 1.5703994035720825, 1.9582511186599731, 0.8311284780502319, 0.39859962463378906, 1.2465801239013672, -0.11227244883775711, -0.4629411995410919, 1.7479406595230103, -0.433376669883728, 0.5406093597412109, 1.0739792585372925, -0.345403790473938, -1.125447392463684, -0.7719216346740723, -1.2822352647781372, -0.5972384214401245, 1.094276785850525, 0.15786272287368774, -1.306539535522461, 0.29810410737991333, 1.5493227243423462, 0.04499144107103348, -0.3613956868648529, 0.635013997554779, 0.373658150434494, -0.8477844595909119, -0.0698586031794548, -0.9660873413085938, 0.4759114682674408, -0.2201586216688156, -0.2800707519054413, 0.3256821036338806, 0.5088797211647034, 1.3402481079101562, 0.059457145631313324, 0.16081030666828156, 1.2472425699234009, -1.3814051151275635, 1.4708263874053955, -0.7982524037361145, 0.29038307070732117, -2.3472275733947754, 1.3985538482666016, -0.8570522665977478, 1.9648069143295288, -2.7036774158477783, 0.3917762339115143, -0.6252555251121521, -0.41918501257896423, 0.2560422718524933, -0.3192431628704071, 0.14650210738182068, -0.05416546389460564, -1.2406448125839233, -0.06718490272760391, -0.770824134349823, 0.5211047530174255, 1.1558942794799805, 1.4039134979248047, -1.1085106134414673, -0.28214430809020996, -1.7657201290130615, -0.18145857751369476, -0.5773841738700867, 0.40879949927330017, -2.0096802711486816, -0.15008169412612915, -1.9282885789871216, -2.3415558338165283, -1.3758984804153442, -0.8264736533164978, 1.1194958686828613, 0.07845812290906906, -0.7880911231040955, 1.146571397781372, -0.2928585112094879, -1.7673691511154175, 1.0620085000991821, -2.1951663494110107 ]
https://github.com/huggingface/datasets/issues/3167
bookcorpusopen no longer works
I tried with the latest changes from #3280 on google colab and it worked fine :) We'll do a new release soon, in the meantime you can use the updated version with: ```python load_dataset("bookcorpusopen", revision="master") ```
## Describe the bug When using the latest version of datasets (1.14.0), I cannot use the `bookcorpusopen` dataset. The process blocks always around `9924 examples [00:06, 1439.61 examples/s]` when preparing the dataset. I also noticed that after half an hour the process is automatically killed because of the RAM usage (the machine has 1TB of RAM...). This did not happen with 1.4.1. I tried also `rm -rf ~/.cache/huggingface` but did not help. Changing python version between 3.7, 3.8 and 3.9 did not help too. ## Steps to reproduce the bug ```python import datasets d = datasets.load_dataset('bookcorpusopen') ``` ## Expected results A clear and concise description of the expected results. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.0 - Platform: Linux-5.4.0-1054-aws-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 4.0.1
1,144
36
bookcorpusopen no longer works ## Describe the bug When using the latest version of datasets (1.14.0), I cannot use the `bookcorpusopen` dataset. The process blocks always around `9924 examples [00:06, 1439.61 examples/s]` when preparing the dataset. I also noticed that after half an hour the process is automatically killed because of the RAM usage (the machine has 1TB of RAM...). This did not happen with 1.4.1. I tried also `rm -rf ~/.cache/huggingface` but did not help. Changing python version between 3.7, 3.8 and 3.9 did not help too. ## Steps to reproduce the bug ```python import datasets d = datasets.load_dataset('bookcorpusopen') ``` ## Expected results A clear and concise description of the expected results. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.0 - Platform: Linux-5.4.0-1054-aws-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 4.0.1 I tried with the latest changes from #3280 on google colab and it worked fine :) We'll do a new release soon, in the meantime you can use the updated version with: ```python load_dataset("bookcorpusopen", revision="master") ```
[ -1.1713382005691528, -0.8597288131713867, -0.7467466592788696, 1.462351679801941, -0.11907734721899033, -1.257006049156189, 0.1193060353398323, -1.015738844871521, 1.7440966367721558, -0.8353912234306335, 0.29046764969825745, -1.6421194076538086, 0.02283443510532379, -0.5554172992706299, -0.7156279683113098, -0.9152025580406189, -0.39088109135627747, -0.6992711424827576, 1.0623468160629272, 2.5006303787231445, 1.142828106880188, -1.3819464445114136, 2.674093246459961, 0.7333554625511169, -0.19457083940505981, -0.981168806552887, 0.5409013628959656, -0.04954344034194946, -1.4577393531799316, -0.342654287815094, -0.9160938858985901, -0.05686880648136139, -0.5868617296218872, -0.6692982316017151, 0.001986425369977951, 0.32289576530456543, -0.31253781914711, -0.538240373134613, -0.46252062916755676, -0.841720461845398, 0.39877647161483765, -0.30957216024398804, 0.870686948299408, -0.3965889811515808, 1.8038824796676636, -0.5675481557846069, 0.48642387986183167, 0.7232484817504883, 1.3221476078033447, 0.24579615890979767, -0.00932086817920208, 0.3886834681034088, 0.43076205253601074, 0.046563077718019485, 0.43750113248825073, 1.1315243244171143, 0.5709335803985596, 0.4091201424598694, 0.7460357546806335, -2.233266830444336, 1.3326679468154907, -0.9622021317481995, 0.2791570723056793, 1.2851394414901733, -0.9779288172721863, 0.30560794472694397, -1.7198395729064941, -0.02670104056596756, 0.4537840783596039, -2.2527153491973877, 0.20269550383090973, -1.3122940063476562, -0.48478829860687256, 1.0390803813934326, 0.382636159658432, -1.2726449966430664, 0.0037297243252396584, -0.37755441665649414, 0.9524426460266113, 0.4733443260192871, 1.210067629814148, -1.7306674718856812, -0.06394073367118835, -0.3131958246231079, 0.14438435435295105, -1.269437551498413, -1.49459969997406, 0.4929305613040924, 0.7462610006332397, 0.5369329452514648, -0.10609420388936996, 0.9628143310546875, -0.9296593070030212, 0.7634254693984985, -0.904753565788269, -1.8519054651260376, -1.4227091073989868, -2.2582545280456543, -2.332976818084717, 0.7323359251022339, -0.5128767490386963, -0.44719451665878296, 2.0258212089538574, -1.0600162744522095, -1.807486653327942, 1.1191389560699463, 0.27574461698532104, -0.0532815158367157, 2.3009965419769287, 0.18000094592571259, -0.7547851800918579, 0.4809141457080841, -0.7602002024650574, 0.6664332747459412, -0.44292452931404114, 1.253490924835205, 0.43798893690109253, -1.0402357578277588, 1.5714035034179688, -0.3750985264778137, 0.5618793368339539, -0.7066183090209961, -0.34558287262916565, -0.7918046712875366, 0.2849923372268677, 1.9171175956726074, -0.34965547919273376, 1.5749799013137817, -0.2606123685836792, -1.54979407787323, -1.5620297193527222, 0.8254767060279846, 0.5140276551246643, -0.6523385643959045, 0.17909546196460724, -0.278433233499527, 0.05191180855035782, -0.00364626944065094, 1.122824788093567, 1.3129314184188843, 0.8396199345588684, -0.25359833240509033, -0.893857479095459, 0.2912982404232025, -0.0867968499660492, -0.6922096610069275, -1.754920244216919, -0.37924447655677795, 0.11107087135314941, 0.6377512812614441, -1.2015366554260254, 1.7313756942749023, 0.8739052414894104, 1.9312511682510376, 1.0477631092071533, -0.37188050150871277, 1.538143277168274, 0.15546153485774994, 1.9452213048934937, -0.3647471070289612, 0.7447988986968994, -0.4331778585910797, -1.1630440950393677, 0.7905109524726868, -0.3591463565826416, -2.0272867679595947, -0.6300172209739685, -0.8866602182388306, -0.13759270310401917, -0.7606639862060547, 1.0065077543258667, -0.2686661183834076, -1.3957053422927856, 0.24795876443386078, -0.7941597104072571, 0.0860576257109642, -1.3001374006271362, 0.3020661175251007, 0.8125259280204773, -0.6528559923171997, 0.116531603038311, -0.33285224437713623, -1.3393304347991943, -0.48952949047088623, 0.3402457535266876, 1.7734094858169556, -0.7612584233283997, 1.0494295358657837, 0.9833897352218628, -0.7138933539390564, -0.057042188942432404, 0.3927895724773407, -0.33638930320739746, 0.9067202210426331, -1.0419096946716309, -0.323903352022171, 1.1701778173446655, -0.251476913690567, -0.6069900989532471, 1.4133974313735962, 0.6704385876655579, -0.9444807171821594, -0.1100563257932663, -0.13873238861560822, -0.834425151348114, 0.03296343609690666, -1.6739126443862915, -0.09068528562784195, 0.36244603991508484, -1.5873786211013794, -0.5610873103141785, -0.15844964981079102, 1.2857990264892578, -0.07607606053352356, 1.432708501815796, -0.3403869867324829, -0.17434166371822357, -0.4995425045490265, -0.3436059355735779, 0.17251066863536835, -0.2345605045557022, -0.6083962917327881, 0.3485323488712311, -0.7366310954093933, 0.27890482544898987, 1.3982653617858887, 0.3194497227668762, 0.019414201378822327, 0.6168127655982971, 1.096150517463684, 0.3936931788921356, -0.09845226258039474, -0.8398982882499695, -1.6074483394622803, 2.0777862071990967, -1.4047892093658447, 2.0073554515838623, 0.7286028265953064, -0.09212536364793777, -1.8369865417480469, -1.9785304069519043, 1.405662178993225, 1.0640130043029785, 2.341668128967285, 0.6200966238975525, 0.5062874555587769, -0.7794027924537659, -0.6275635957717896, 0.34196949005126953, -0.974740207195282, -0.820421040058136, 0.13039454817771912, 2.3854174613952637, 1.6647560596466064, -0.4390396475791931, -0.16034355759620667, -1.0782378911972046, 1.4502562284469604, -0.1315326690673828, 0.2369711995124817, 1.9253642559051514, -0.22678327560424805, -1.0452457666397095, 1.286124348640442, -2.2518370151519775, 0.1619897037744522, 1.984719157218933, 0.18896493315696716, 0.0162094347178936, -1.3702173233032227, -0.7339098453521729, -0.17638787627220154, -0.4307064116001129, -1.2738265991210938, 0.5250313878059387, -0.21212494373321533, -0.7635142207145691, -1.4233607053756714, 0.15556280314922333, -1.0222359895706177, -1.7522774934768677, 0.17584075033664703, 1.837587833404541, 1.9448015689849854, -0.7213627696037292, 1.5441701412200928, -0.20436356961727142, 0.2212693691253662, 1.2000617980957031, 1.09762442111969, 3.1883862018585205, 1.9699547290802002, -1.2966837882995605, 0.6985090970993042, -0.0015162895433604717, -0.4333367645740509, 1.206282138824463, -1.1867201328277588, 1.2704412937164307, -0.21141314506530762, -1.2118281126022339, -1.2354153394699097, 0.8916058540344238, 0.46014663577079773, 0.008765880949795246, -0.46868759393692017, 1.205631971359253, 0.036451537162065506, 1.270116925239563, 0.5542376637458801, -0.2535722851753235, 0.6679159998893738, -0.42373359203338623, -0.49549737572669983, 1.5706721544265747, 0.24042454361915588, -1.32379949092865, -2.342073678970337, -0.20504361391067505, -0.8416041135787964, 0.012838426046073437, -0.6152619123458862, -0.9009539484977722, 1.6324732303619385, 0.570560097694397, -1.134165644645691, -0.2805081307888031, -0.40964752435684204, -0.673954963684082, 2.6732311248779297, -1.3739957809448242, -0.2152784913778305, -0.9938344955444336, -0.6440516114234924, 1.5540049076080322, -1.2545664310455322, -0.1964491456747055, -1.0610578060150146, -0.49200037121772766, -1.2844089269638062, -0.6189314723014832, -0.09793446958065033, -0.8964135646820068, 0.8120899200439453, 0.18689103424549103, -1.2593555450439453, -0.3167816698551178, -0.965604305267334, 0.8134312629699707, -0.048170290887355804, 0.20446845889091492, 1.860853910446167, 0.39666837453842163, -0.39117881655693054, 0.6765440106391907, 1.1016210317611694, 0.653839647769928, -0.6301586031913757, 0.36289986968040466, -0.6678485870361328, 0.2554100751876831, -1.2952299118041992, 0.2588879466056824, -2.8283679485321045, 0.6287629008293152, -0.03457334265112877, -0.05593538284301758, -0.10812979191541672, -1.2620471715927124, 1.0929985046386719, 2.561516523361206, -1.2107807397842407, 0.5453814268112183, 0.25332558155059814, 1.2320307493209839, -1.58706796169281, 0.25823020935058594, -0.4633062481880188, 2.1994082927703857, 0.20674334466457367, 1.1258867979049683, -0.40825745463371277, -2.3383822441101074, 0.6328021883964539, -1.2609974145889282, -1.1931015253067017, 0.8388684391975403, -0.8160452246665955, 0.03170878440141678, -1.3283721208572388, -0.1612025797367096, -0.7570052146911621, -1.1943645477294922, 0.6395552158355713, 0.09459119290113449, 0.5760316252708435, -0.6312111616134644, 0.3277222812175751, -2.2142598628997803, -1.2955909967422485, -0.25217559933662415, -0.9233919382095337, 0.38408201932907104, -0.3165597915649414, 0.7617188096046448, -0.23044222593307495, -0.020453883334994316, 0.32738786935806274, 1.3380522727966309, 3.409205913543701, 0.1520167887210846, 0.3727073073387146, -0.11273431777954102, -1.0273090600967407, 1.4499303102493286, 0.97069251537323, -0.24857768416404724, -0.5693455338478088, -1.0508290529251099, 1.2443656921386719, 1.9405531883239746, 1.0881023406982422, 0.09127350151538849, -0.829942524433136, -0.802433967590332, 0.04036599397659302, 0.11972749978303909, 0.49660179018974304, 0.903598427772522, 0.17488251626491547, 0.09873159229755402, 1.5029125213623047, 1.1494994163513184, -0.35146385431289673, 0.440125435590744, -0.8362486362457275, -0.4695393741130829, 0.5848732590675354, 0.4154999256134033, -0.03452590852975845, 0.2736108899116516, -1.0591249465942383, -0.244565948843956, -0.3763589859008789, -0.9499390125274658, -0.6681608557701111, -0.43433621525764465, -0.3491387963294983, 1.7014812231063843, 0.047313522547483444, -0.49105602502822876, -0.12377817928791046, -0.7933561205863953, 0.04634090140461922, -1.0073206424713135, 0.4332435429096222, -0.17258447408676147, 0.0017004869878292084, -0.06013539433479309, 1.7591015100479126, -0.9397499561309814, -2.0828821659088135, 0.2562573254108429, 0.1923731118440628, -0.38104456663131714, 0.12413600832223892, 1.6411422491073608, 0.6257068514823914, 1.3857440948486328, 1.4859793186187744, 1.0003470182418823, -0.701266348361969, -1.3338640928268433, 0.5994216203689575, 0.9620217084884644, -1.4136003255844116, 0.7452070713043213, 0.06770524382591248, -0.5952792763710022, 0.6096883416175842, 1.2768272161483765, 0.4198353886604309, -1.9954015016555786, 0.7632307410240173, -0.8570467829704285, 0.7423503994941711, 0.7224170565605164, 0.742626428604126, 0.07321147620677948, 0.7332965135574341, -1.2829196453094482, -1.124656081199646, -0.7072975635528564, -0.699664831161499, 1.8707789182662964, -0.2767565846443176, 0.4713210463523865, -0.24254414439201355, -1.3424350023269653, -0.08396033942699432, 0.5992174744606018, 0.26603683829307556, -0.4223322570323944, 0.8134757280349731, -0.6182267665863037, -1.229800820350647, -1.4171886444091797, -0.4559110701084137, -1.044577956199646, -0.9197472929954529, 0.9956783056259155, 0.7946101427078247, 0.364704966545105, 1.828889012336731, 0.7130627632141113, 0.18099619448184967, -2.627047061920166, 0.8280719518661499, 0.3290008306503296, 0.01686641201376915, 0.8537043333053589, 0.2740362584590912, 1.0661370754241943, -0.17748776078224182, 0.6170143485069275, -2.3920979499816895, 2.356916904449463, -0.27056610584259033, 0.6910884380340576, 0.03944767266511917, -0.09606796503067017, 1.002573013305664, 0.5791400074958801, 0.6252268552780151, -1.0811879634857178, 0.7734927535057068, -0.7108464241027832, 1.2698622941970825, 0.8768501877784729, -0.8683200478553772, -0.07147472351789474, 1.2567216157913208, 0.4581306576728821, -0.46310654282569885, -0.9065587520599365, -1.0780266523361206, 0.9594454169273376, 1.7999145984649658, -0.01859680563211441, 0.05275529995560646, 0.8597618341445923, 0.6558440923690796, -1.386792778968811, 0.06920826435089111, -0.7590512633323669, -0.7371823191642761, 1.6467790603637695, 2.020158052444458, -0.05616862699389458, -0.17506486177444458, -0.773709237575531, -1.2607673406600952, 0.7484255433082581, 0.12478632479906082, 0.0548701211810112, 0.7570390105247498, -0.5687329769134521, 1.1414237022399902, 0.8824267983436584, 0.8992969989776611, 0.282289981842041, 0.2149464339017868, 0.2618303894996643, -0.2492569535970688, -1.2457144260406494, -0.1950451135635376, -0.9657875895500183, -2.4905707836151123, 0.45781081914901733, -0.18371187150478363, -1.4844387769699097, 0.022954408079385757, -0.9978572130203247, 0.8615249395370483, -0.5058277249336243, -1.1318697929382324, -1.4477418661117554, 0.18077729642391205, -0.14364421367645264, 0.846555233001709, -1.5128003358840942, -0.057290010154247284, 1.3052154779434204, 0.9775488972663879, -0.6635982990264893, 1.042725920677185, 0.22430483996868134, 1.0210721492767334, 0.935632586479187, -0.4357256293296814, 0.4311370253562927, 0.20047444105148315, -1.3537708520889282, 0.4334530234336853, 1.1694202423095703, 0.2250506430864334, 1.5235581398010254, -0.6686630249023438, 0.049118272960186005, 0.385672926902771, -0.38184571266174316, -0.5004510283470154, -0.7229157090187073, 0.7338501214981079, -0.023367635905742645, -0.8922111392021179, 0.07188533246517181, -0.04850089177489281, -0.20003792643547058, 0.18019583821296692, -1.5484426021575928, -0.07638934254646301, -0.3277275860309601, -0.7213030457496643, -1.2198387384414673, -0.08269543200731277, 1.3712470531463623, -0.8462796807289124, -0.13090196251869202, 0.4792136549949646, 0.2615865468978882, 0.5159822702407837, 0.632093608379364, -0.600736141204834, -0.39637455344200134, -0.21030256152153015, -0.41329437494277954, 0.36101803183555603, 1.329933524131775, -0.08833839744329453, -0.9284643530845642, 0.7069311738014221, -0.3394073247909546, 0.0631122887134552, 1.937699317932129, 0.08272696286439896, -0.9079557061195374, 0.2565532326698303, -0.6818332076072693, 1.9809876680374146, 1.710526466369629, 1.3723667860031128, -0.07806751132011414, -1.0552377700805664, 0.585777759552002, -0.3011801540851593, -0.4420101046562195, 0.9062334895133972, 0.46507906913757324, -0.24382713437080383, -1.2833088636398315, 0.6400946974754333, 1.2551904916763306, -0.8708399534225464, -0.8786371350288391, 0.11125613749027252, -0.7818000316619873, 1.0471583604812622, 0.79022616147995, 0.34991562366485596, 0.2823580503463745, 1.6839027404785156, 0.7880691885948181, -0.5069884657859802, 0.5666735172271729, 0.4836135506629944, -0.13646401464939117, -2.0196471214294434, -1.115316390991211, 0.39357975125312805, -0.4680355191230774, -1.6408063173294067, 1.3656600713729858, -1.2137525081634521, -0.9453697800636292, 0.5678808093070984, 0.10215673595666885, 1.4201369285583496, 0.3339267373085022, 1.5851248502731323, 2.0342516899108887, 0.8808788657188416, 0.33554211258888245, 1.2632607221603394, -0.13453274965286255, -0.41369953751564026, 1.7545028924942017, -0.4057423770427704, 0.534113883972168, 1.0938687324523926, -0.4053773880004883, -1.0908784866333008, -0.8090181350708008, -1.2177029848098755, -0.6938756704330444, 1.14444100856781, 0.10446314513683319, -1.2009812593460083, 0.2809197008609772, 1.5170528888702393, 0.1677335798740387, -0.242103710770607, 0.6603847146034241, 0.39682498574256897, -0.7324716448783875, -0.03853720799088478, -1.027820110321045, 0.4684330224990845, -0.20229999721050262, -0.3656415641307831, 0.3374992311000824, 0.4792153537273407, 1.3324031829833984, 0.01820812001824379, 0.1316700428724289, 1.3224891424179077, -1.3413856029510498, 1.4834197759628296, -0.8000473976135254, 0.21997950971126556, -2.329139232635498, 1.4550495147705078, -0.8524943590164185, 1.8789947032928467, -2.6627094745635986, 0.4309249818325043, -0.5448041558265686, -0.4503176808357239, 0.3043718934059143, -0.363628089427948, 0.1351669877767563, -0.22050289809703827, -1.1913597583770752, -0.19750376045703888, -0.8053205013275146, 0.5294217467308044, 1.139432430267334, 1.372914433479309, -1.0948121547698975, -0.3034810423851013, -1.7365566492080688, -0.11833744496107101, -0.6320048570632935, 0.4190342128276825, -1.870703101158142, -0.1740550845861435, -1.9275215864181519, -2.460740327835083, -1.2647347450256348, -0.8161247372627258, 1.137614369392395, 0.072882741689682, -0.7879567742347717, 1.1126571893692017, -0.3128151297569275, -1.8565748929977417, 1.1361920833587646, -2.2232506275177 ]
https://github.com/huggingface/datasets/issues/3164
Add raw data files to the Hub with GitHub LFS for canonical dataset
Hi @zlucia, I would actually suggest hosting the dataset as a huggingface.co-hosted dataset. The only difference with a "canonical"/legacy dataset is that it's nested under an organization (here `stanford` or `stanfordnlp` for instance – completely up to you) but then you can upload your data using git-lfs (unlike "canonical" datasets where we don't host the data) Let me know if this fits your use case! cc'ing @osanseviero @lhoestq and rest of the team πŸ€—
I'm interested in sharing the CaseHOLD dataset (https://arxiv.org/abs/2104.08671) as a canonical dataset on the HuggingFace Hub and would like to add the raw data files to the Hub with GitHub LFS, since it seems like a more sustainable long term storage solution, compared to other storage solutions available to my team. From what I can tell, this option is not immediately supported if one follows the sharing steps detailed here: [https://huggingface.co/docs/datasets/share_dataset.html#sharing-a-canonical-dataset](https://huggingface.co/docs/datasets/share_dataset.html#sharing-a-canonical-dataset), since GitHub LFS is not supported for public forks. Is there a way to request this? Thanks!
1,145
74
Add raw data files to the Hub with GitHub LFS for canonical dataset I'm interested in sharing the CaseHOLD dataset (https://arxiv.org/abs/2104.08671) as a canonical dataset on the HuggingFace Hub and would like to add the raw data files to the Hub with GitHub LFS, since it seems like a more sustainable long term storage solution, compared to other storage solutions available to my team. From what I can tell, this option is not immediately supported if one follows the sharing steps detailed here: [https://huggingface.co/docs/datasets/share_dataset.html#sharing-a-canonical-dataset](https://huggingface.co/docs/datasets/share_dataset.html#sharing-a-canonical-dataset), since GitHub LFS is not supported for public forks. Is there a way to request this? Thanks! Hi @zlucia, I would actually suggest hosting the dataset as a huggingface.co-hosted dataset. The only difference with a "canonical"/legacy dataset is that it's nested under an organization (here `stanford` or `stanfordnlp` for instance – completely up to you) but then you can upload your data using git-lfs (unlike "canonical" datasets where we don't host the data) Let me know if this fits your use case! cc'ing @osanseviero @lhoestq and rest of the team πŸ€—
[ -1.2527854442596436, -1.03347909450531, -0.7845445275306702, 1.3781174421310425, -0.09623227268457413, -1.3032963275909424, 0.04748610407114029, -1.0734508037567139, 1.6342811584472656, -0.7610678672790527, 0.35408908128738403, -1.728800654411316, -0.06977874785661697, -0.5358561873435974, -0.770576536655426, -0.9330642819404602, -0.39963051676750183, -0.8022686243057251, 1.014760136604309, 2.5091123580932617, 1.084828495979309, -1.412699580192566, 2.7357349395751953, 0.6586719155311584, -0.11045630276203156, -1.0190914869308472, 0.5608407855033875, 0.04822218418121338, -1.247417688369751, -0.40521442890167236, -0.9536731839179993, -0.02668745256960392, -0.574302077293396, -0.5335472822189331, 0.057452231645584106, 0.40274396538734436, -0.20573197305202484, -0.3830868899822235, -0.5905225276947021, -0.7175182700157166, 0.5117194652557373, -0.3673844337463379, 0.9901682138442993, -0.2838152348995209, 1.9008759260177612, -0.5419695377349854, 0.3839319944381714, 0.6634888052940369, 1.3095626831054688, 0.17557060718536377, 0.07721879333257675, 0.18827900290489197, 0.3645915687084198, -0.04036818444728851, 0.4338652193546295, 1.181899070739746, 0.6147848963737488, 0.5410220623016357, 0.6741371750831604, -2.1979448795318604, 1.3143582344055176, -1.0266300439834595, 0.3629063367843628, 1.4578036069869995, -0.9722899198532104, 0.471109539270401, -1.7857366800308228, -0.08291937410831451, 0.5321118235588074, -2.2201550006866455, 0.0870034396648407, -1.233589768409729, -0.40316250920295715, 0.9948985576629639, 0.22910040616989136, -1.2354893684387207, 0.27019748091697693, -0.43591704964637756, 1.0586868524551392, 0.4953588545322418, 1.2274894714355469, -1.7376642227172852, 0.06795582920312881, -0.3461475074291229, 0.17076627910137177, -1.3321471214294434, -1.5916781425476074, 0.5530915856361389, 0.6523252725601196, 0.5958712697029114, -0.09546948969364166, 0.9088254570960999, -0.9907599091529846, 0.8405096530914307, -0.8860726952552795, -1.5888245105743408, -1.4344112873077393, -2.3006224632263184, -2.4132351875305176, 0.7446067929267883, -0.5260749459266663, -0.5030792355537415, 1.9847968816757202, -1.1102079153060913, -1.7954580783843994, 1.1170542240142822, 0.2859833240509033, -0.002968273591250181, 2.409440755844116, 0.21824894845485687, -0.6638821959495544, 0.41699090600013733, -0.6969752907752991, 0.7595231533050537, -0.3317752778530121, 1.3103829622268677, 0.5513311624526978, -0.9905551075935364, 1.5481458902359009, -0.503517746925354, 0.5205491185188293, -0.6927594542503357, -0.5381926894187927, -0.8800243735313416, 0.339216023683548, 1.8321887254714966, -0.39785218238830566, 1.5975757837295532, -0.4030574560165405, -1.5618997812271118, -1.6585242748260498, 0.8115553259849548, 0.44601404666900635, -0.8486199975013733, 0.0009228186681866646, -0.3599056601524353, 0.12578848004341125, 0.005006927065551281, 1.1109651327133179, 1.1515355110168457, 0.6581222414970398, -0.33271685242652893, -0.852057695388794, 0.26701638102531433, -0.032527077943086624, -0.6382937431335449, -1.77040433883667, -0.3684530556201935, 0.24170733988285065, 0.5909572839736938, -1.2076560258865356, 1.7716124057769775, 0.9197673201560974, 1.9188095331192017, 0.9374629855155945, -0.3576953411102295, 1.4807729721069336, 0.029551608487963676, 1.9288023710250854, -0.5050891637802124, 0.7153641581535339, -0.36595070362091064, -1.2695744037628174, 0.728450357913971, -0.3444189131259918, -2.010573625564575, -0.7766731381416321, -0.9289495944976807, -0.20114320516586304, -0.7502241134643555, 0.952397882938385, -0.31472915410995483, -1.435768723487854, 0.2893071472644806, -0.5627918243408203, 0.15352053940296173, -1.2712910175323486, 0.28950247168540955, 0.7610785365104675, -0.678480863571167, 0.014252858236432076, -0.11679355055093765, -1.3157384395599365, -0.43473732471466064, 0.2610577940940857, 1.9111398458480835, -0.7619192600250244, 0.8877582550048828, 1.0003560781478882, -0.6648362278938293, 0.060969844460487366, 0.31915339827537537, -0.30633777379989624, 0.8740283846855164, -0.9777070879936218, -0.3566979765892029, 1.2294244766235352, -0.2000296711921692, -0.6784704923629761, 1.456505298614502, 0.7331584095954895, -0.9712550640106201, -0.20197728276252747, -0.17810077965259552, -0.8260946273803711, -0.056917041540145874, -1.5673978328704834, -0.14418521523475647, 0.2332310676574707, -1.4425098896026611, -0.44257819652557373, -0.29136621952056885, 1.2111972570419312, -0.15380465984344482, 1.389572262763977, -0.37378624081611633, -0.2393593043088913, -0.44027358293533325, -0.46841517090797424, 0.24076710641384125, -0.2621828317642212, -0.6592918634414673, 0.2507909834384918, -0.8453812003135681, 0.2972841262817383, 1.4741207361221313, 0.4326102137565613, 0.13033710420131683, 0.5293994545936584, 1.109653353691101, 0.29316917061805725, -0.07344961911439896, -0.9185846447944641, -1.5976277589797974, 2.0238423347473145, -1.451647400856018, 1.9443718194961548, 0.8117608428001404, -0.10966143012046814, -1.7751046419143677, -1.8141616582870483, 1.3607209920883179, 1.171337366104126, 2.4368624687194824, 0.5134578943252563, 0.334441602230072, -0.8845720887184143, -0.6415615677833557, 0.33592888712882996, -0.9672538042068481, -0.7342162132263184, 0.10267189890146255, 2.2925493717193604, 1.7494670152664185, -0.5726621150970459, -0.1719498336315155, -1.0780295133590698, 1.3214383125305176, -0.16019700467586517, 0.2723154127597809, 2.032139301300049, -0.3679581582546234, -1.1227047443389893, 1.272386074066162, -2.3984787464141846, 0.10500463843345642, 1.8893471956253052, 0.30166128277778625, 0.03559674322605133, -1.4296875, -0.661823034286499, -0.25163739919662476, -0.43075641989707947, -1.2616944313049316, 0.5165197253227234, -0.2200004607439041, -0.7771837115287781, -1.5237771272659302, 0.06433630734682083, -1.1761263608932495, -1.649139165878296, 0.3646383583545685, 1.7998945713043213, 2.053215503692627, -0.8181348443031311, 1.4687399864196777, -0.18511395156383514, 0.26201626658439636, 1.2380754947662354, 1.2109624147415161, 3.139960289001465, 1.9016085863113403, -1.2744085788726807, 0.7249318361282349, -0.1664736270904541, -0.4993576109409332, 1.2496165037155151, -1.019221544265747, 1.2916990518569946, -0.159076988697052, -1.2012815475463867, -1.295246958732605, 1.0055760145187378, 0.48685166239738464, 0.04437210410833359, -0.5024552345275879, 1.2575269937515259, 0.12476567924022675, 1.323065996170044, 0.5656046271324158, -0.3909020721912384, 0.6037437915802002, -0.3791273534297943, -0.5627065896987915, 1.549920678138733, 0.12027320265769958, -1.4622762203216553, -2.319765329360962, -0.25712457299232483, -0.8652046322822571, -0.06259608268737793, -0.5863529443740845, -0.9776641130447388, 1.585669755935669, 0.41995009779930115, -1.306216835975647, -0.27207261323928833, -0.4317074418067932, -0.617375373840332, 2.6592822074890137, -1.4474472999572754, -0.212912917137146, -0.9576606154441833, -0.5417197346687317, 1.58762788772583, -1.1893198490142822, -0.17703446745872498, -1.0830942392349243, -0.6941834688186646, -1.417989730834961, -0.5350796580314636, 0.01817786879837513, -0.9585187435150146, 0.7305399179458618, 0.1422523558139801, -1.0139212608337402, -0.25020071864128113, -0.871631920337677, 0.9119641184806824, -0.14094632863998413, 0.33128026127815247, 1.918404459953308, 0.40486884117126465, -0.38770270347595215, 0.6632912158966064, 1.1372826099395752, 0.6412151455879211, -0.6498879194259644, 0.12475737929344177, -0.7430244088172913, 0.28071001172065735, -1.3176666498184204, 0.25184109807014465, -2.895038604736328, 0.6383763551712036, -0.07457371056079865, -0.12336351722478867, 0.04322494566440582, -1.3063687086105347, 1.0567182302474976, 2.539820432662964, -1.1883774995803833, 0.42067810893058777, 0.3132827877998352, 1.154541015625, -1.617343544960022, 0.3655072748661041, -0.41686826944351196, 2.0698041915893555, 0.18494245409965515, 1.126596212387085, -0.5062075853347778, -2.1438541412353516, 0.5050094127655029, -1.2952449321746826, -1.1994531154632568, 0.8420470356941223, -0.9069626927375793, 0.1106625571846962, -1.416142225265503, -0.1253538876771927, -0.9437007904052734, -1.309269905090332, 0.7780845761299133, 0.09656976163387299, 0.48905494809150696, -0.6186434626579285, 0.3773496448993683, -2.2451772689819336, -1.4250849485397339, -0.21663802862167358, -0.9451563954353333, 0.4645325541496277, -0.36126118898391724, 0.7345017194747925, -0.11595655977725983, 0.061368346214294434, 0.36552953720092773, 1.3746830224990845, 3.391174077987671, 0.3062480390071869, 0.4563503861427307, -0.08763857185840607, -1.0138967037200928, 1.5357396602630615, 0.92258620262146, -0.20595142245292664, -0.5267559885978699, -0.9919185042381287, 1.3505175113677979, 1.9227006435394287, 1.082678198814392, -0.0005433801561594009, -0.7561271786689758, -0.6789747476577759, 0.0724017322063446, 0.1726549118757248, 0.41888657212257385, 0.895302951335907, -0.01440337672829628, 0.190696582198143, 1.4646997451782227, 1.288286566734314, -0.4026487469673157, 0.40240776538848877, -0.8306570053100586, -0.48285505175590515, 0.4990144670009613, 0.29456400871276855, 0.009725131094455719, 0.4018496870994568, -1.0352423191070557, -0.30555498600006104, -0.3959721624851227, -0.9453004002571106, -0.734162449836731, -0.43810009956359863, -0.36846551299095154, 1.6450437307357788, 0.08657633513212204, -0.5584322810173035, 0.026433667168021202, -0.7985638976097107, -0.17157875001430511, -1.0343607664108276, 0.24363572895526886, -0.07724784314632416, -0.06330103427171707, -0.09946569055318832, 1.717555046081543, -0.9898980259895325, -2.139514923095703, 0.2528596520423889, 0.3001849949359894, -0.39182430505752563, 0.10953507572412491, 1.5938061475753784, 0.4364171624183655, 1.4127874374389648, 1.3681539297103882, 0.9738931655883789, -0.6588038206100464, -1.3147213459014893, 0.7131819725036621, 0.8996425271034241, -1.3864004611968994, 0.9214515089988708, -0.09723389148712158, -0.5588399171829224, 0.7218818664550781, 1.2184135913848877, 0.32439327239990234, -1.9121522903442383, 0.835842490196228, -0.8878324627876282, 0.7778497934341431, 0.6620156168937683, 0.8681626319885254, 0.11921170353889465, 0.759466826915741, -1.2795833349227905, -1.1362028121948242, -0.7356085181236267, -0.5691058039665222, 1.9188683032989502, -0.1355380266904831, 0.5889107584953308, -0.1646280586719513, -1.246918797492981, -0.04619324952363968, 0.7284196615219116, 0.3372778594493866, -0.4098951816558838, 0.9172376394271851, -0.6592827439308167, -1.067477822303772, -1.3448774814605713, -0.3939620852470398, -1.0328865051269531, -0.906632661819458, 1.0513842105865479, 0.8267127275466919, 0.31126999855041504, 1.888466715812683, 0.5740554928779602, 0.2797488570213318, -2.686918020248413, 0.9471743106842041, 0.22035376727581024, -0.026374178007245064, 0.8943066596984863, 0.2309434711933136, 1.0731942653656006, -0.030052822083234787, 0.5216028690338135, -2.354698896408081, 2.232598304748535, -0.242240771651268, 0.715422511100769, -0.17125312983989716, -0.26546230912208557, 1.0596342086791992, 0.5919672250747681, 0.6235973238945007, -1.1924529075622559, 0.6804462671279907, -0.576504647731781, 1.0984523296356201, 0.9912092089653015, -0.8455767035484314, 0.016012191772460938, 1.3747683763504028, 0.6431716680526733, -0.45125532150268555, -0.995395302772522, -0.8370604515075684, 0.9928736686706543, 1.7752456665039062, -0.013477666303515434, -0.02700093202292919, 0.8719627857208252, 0.7030775547027588, -1.2927860021591187, 0.16006144881248474, -0.7423297166824341, -0.7164736986160278, 1.6864652633666992, 2.027219772338867, 0.02497248910367489, -0.13203610479831696, -0.6101572513580322, -1.1982746124267578, 0.7531408667564392, 0.0719514787197113, 0.2244245707988739, 0.7721972465515137, -0.7185280919075012, 1.1416561603546143, 0.7948327660560608, 0.9570847749710083, 0.17891626060009003, 0.25099653005599976, 0.3432455360889435, -0.2130206674337387, -1.1781790256500244, -0.20915517210960388, -1.083251953125, -2.498277187347412, 0.4742376208305359, -0.22510786354541779, -1.4820880889892578, 0.06469836086034775, -0.9474350810050964, 0.9304018020629883, -0.5430569648742676, -1.0906710624694824, -1.4846774339675903, 0.2675265371799469, -0.055981069803237915, 0.7991407513618469, -1.6212596893310547, -0.030426694080233574, 1.226090669631958, 0.914493978023529, -0.5781415700912476, 0.9880186319351196, 0.2562861442565918, 0.9553585648536682, 0.8131138682365417, -0.37201544642448425, 0.49209925532341003, 0.10176219791173935, -1.3914530277252197, 0.41575735807418823, 1.1488596200942993, 0.20365062355995178, 1.3964624404907227, -0.5016289353370667, 0.13935783505439758, 0.4322036802768707, -0.5140545964241028, -0.40118008852005005, -0.5605939030647278, 0.6939395070075989, 0.08560804277658463, -0.7904724478721619, 0.07828907668590546, -0.0820937305688858, -0.21813061833381653, 0.1661146581172943, -1.4794018268585205, -0.27116861939430237, -0.42011454701423645, -0.6186332702636719, -1.2637101411819458, 0.04954158514738083, 1.443171739578247, -0.8098226189613342, -0.15819744765758514, 0.516589879989624, 0.38082700967788696, 0.5430088639259338, 0.6517726182937622, -0.596657395362854, -0.3117978572845459, -0.28303632140159607, -0.2811475694179535, 0.28708723187446594, 1.21772038936615, -0.24241970479488373, -0.9936806559562683, 0.7372393012046814, -0.37089627981185913, 0.09913942962884903, 1.9221413135528564, 0.08782858401536942, -0.7829685807228088, 0.32743707299232483, -0.6899899840354919, 1.8412725925445557, 1.7548807859420776, 1.3571529388427734, -0.07262034714221954, -0.9102787971496582, 0.6078027486801147, -0.279922753572464, -0.37140944600105286, 1.0465747117996216, 0.3898358941078186, -0.15482868254184723, -1.3979284763336182, 0.6388429403305054, 1.2311664819717407, -0.8907923102378845, -0.6848959922790527, 0.06311013549566269, -0.8302258253097534, 1.123482584953308, 0.7219817042350769, 0.39658841490745544, 0.22672733664512634, 1.6230474710464478, 0.7265674471855164, -0.46471601724624634, 0.516108512878418, 0.5086157917976379, -0.1587098240852356, -2.1200618743896484, -0.9841265082359314, 0.2671360969543457, -0.37353742122650146, -1.4630780220031738, 1.322447419166565, -1.1912670135498047, -0.9442330598831177, 0.5657275319099426, 0.06509425491094589, 1.4807807207107544, 0.3893986642360687, 1.6817734241485596, 2.1147043704986572, 0.8873673677444458, 0.3009730577468872, 1.3216811418533325, -0.024020101875066757, -0.3398435413837433, 1.7889615297317505, -0.4259944558143616, 0.5462390184402466, 1.05410897731781, -0.4330316483974457, -0.9843866229057312, -0.8058829307556152, -1.2033792734146118, -0.5830641388893127, 1.1286466121673584, 0.11861807107925415, -1.1083097457885742, 0.299797385931015, 1.5950000286102295, 0.028732774779200554, -0.31189361214637756, 0.6345391273498535, 0.45053908228874207, -0.6846733689308167, -0.0766177773475647, -0.9150819778442383, 0.47076019644737244, -0.2515403628349304, -0.33916977047920227, 0.33588793873786926, 0.46217238903045654, 1.206324577331543, 0.050273746252059937, 0.14407001435756683, 1.329669713973999, -1.4047653675079346, 1.442914366722107, -0.6924545168876648, 0.25530582666397095, -2.458712577819824, 1.4447364807128906, -0.8331919312477112, 1.9114856719970703, -2.590977907180786, 0.4283677935600281, -0.5991002917289734, -0.5596618056297302, 0.34829622507095337, -0.37694185972213745, 0.06843492388725281, -0.14297424256801605, -1.0013561248779297, -0.11196034401655197, -0.746206521987915, 0.5773588418960571, 1.0994787216186523, 1.3012855052947998, -1.1056021451950073, -0.32832926511764526, -1.7438089847564697, -0.19425064325332642, -0.6439835429191589, 0.37866702675819397, -1.9677751064300537, -0.1906583607196808, -1.9708573818206787, -2.495640993118286, -1.3995201587677002, -0.7983579635620117, 1.1442675590515137, 0.18914614617824554, -0.9332048892974854, 1.107179045677185, -0.4575960040092468, -1.8394968509674072, 1.106477975845337, -2.176018238067627 ]
https://github.com/huggingface/datasets/issues/3164
Add raw data files to the Hub with GitHub LFS for canonical dataset
Hi @zlucia, As @julien-c pointed out, the way to store/host raw data files in our Hub is by using what we call "community" datasets: - either at your personal namespace: `load_dataset("zlucia/casehold")` - or at an organization namespace: for example, if you create the organization `reglab`, then `load_dataset("reglab/casehold")` Please note that "canonical" datasets do not normally store/host their raw data at our Hub, but in a third-party server. For "canonical" datasets, we just host the "loading script", that is, a Python script that downloads the raw data from a third-party server, creates the HuggingFace dataset from it and caches it locally. In order to create an organization namespace in our Hub, please follow this link: https://huggingface.co/organizations/new There are already many organizations at our Hub (complete list here: https://huggingface.co/organizations), such as: - Stanford CRFM: https://huggingface.co/stanford-crfm - Stanford NLP: https://huggingface.co/stanfordnlp - Stanford CS329S: Machine Learning Systems Design: https://huggingface.co/stanford-cs329s Also note that you in your organization namespace: - you can add any number of members - you can store both raw datasets and models, and those can be immediately accessed using `datasets` and `transformers` Once you have created an organization, these are the steps to upload/host a raw dataset: - The no-code procedure: https://huggingface.co/docs/datasets/upload_dataset.html - Using the command line (terminal): https://huggingface.co/docs/datasets/share.html#add-a-community-dataset Please, feel free to ping me if you have any further questions or need help.
I'm interested in sharing the CaseHOLD dataset (https://arxiv.org/abs/2104.08671) as a canonical dataset on the HuggingFace Hub and would like to add the raw data files to the Hub with GitHub LFS, since it seems like a more sustainable long term storage solution, compared to other storage solutions available to my team. From what I can tell, this option is not immediately supported if one follows the sharing steps detailed here: [https://huggingface.co/docs/datasets/share_dataset.html#sharing-a-canonical-dataset](https://huggingface.co/docs/datasets/share_dataset.html#sharing-a-canonical-dataset), since GitHub LFS is not supported for public forks. Is there a way to request this? Thanks!
1,145
222
Add raw data files to the Hub with GitHub LFS for canonical dataset I'm interested in sharing the CaseHOLD dataset (https://arxiv.org/abs/2104.08671) as a canonical dataset on the HuggingFace Hub and would like to add the raw data files to the Hub with GitHub LFS, since it seems like a more sustainable long term storage solution, compared to other storage solutions available to my team. From what I can tell, this option is not immediately supported if one follows the sharing steps detailed here: [https://huggingface.co/docs/datasets/share_dataset.html#sharing-a-canonical-dataset](https://huggingface.co/docs/datasets/share_dataset.html#sharing-a-canonical-dataset), since GitHub LFS is not supported for public forks. Is there a way to request this? Thanks! Hi @zlucia, As @julien-c pointed out, the way to store/host raw data files in our Hub is by using what we call "community" datasets: - either at your personal namespace: `load_dataset("zlucia/casehold")` - or at an organization namespace: for example, if you create the organization `reglab`, then `load_dataset("reglab/casehold")` Please note that "canonical" datasets do not normally store/host their raw data at our Hub, but in a third-party server. For "canonical" datasets, we just host the "loading script", that is, a Python script that downloads the raw data from a third-party server, creates the HuggingFace dataset from it and caches it locally. In order to create an organization namespace in our Hub, please follow this link: https://huggingface.co/organizations/new There are already many organizations at our Hub (complete list here: https://huggingface.co/organizations), such as: - Stanford CRFM: https://huggingface.co/stanford-crfm - Stanford NLP: https://huggingface.co/stanfordnlp - Stanford CS329S: Machine Learning Systems Design: https://huggingface.co/stanford-cs329s Also note that you in your organization namespace: - you can add any number of members - you can store both raw datasets and models, and those can be immediately accessed using `datasets` and `transformers` Once you have created an organization, these are the steps to upload/host a raw dataset: - The no-code procedure: https://huggingface.co/docs/datasets/upload_dataset.html - Using the command line (terminal): https://huggingface.co/docs/datasets/share.html#add-a-community-dataset Please, feel free to ping me if you have any further questions or need help.
[ -1.1749579906463623, -0.976858377456665, -0.7925111055374146, 1.393868088722229, -0.09657111018896103, -1.3233355283737183, 0.06094920262694359, -1.0533950328826904, 1.574756145477295, -0.6517153382301331, 0.34306833148002625, -1.7460047006607056, -0.10316997766494751, -0.5294932723045349, -0.7831681370735168, -0.8587839007377625, -0.43503203988075256, -0.8519464135169983, 0.9739166498184204, 2.5046451091766357, 1.2461010217666626, -1.4355264902114868, 2.7028470039367676, 0.7160235047340393, -0.1736094206571579, -1.0093470811843872, 0.5492887496948242, -0.01774442009627819, -1.3077294826507568, -0.4225638210773468, -0.9419592022895813, -0.035923946648836136, -0.5791357159614563, -0.5094059109687805, 0.07830726355314255, 0.47284582257270813, -0.1839798092842102, -0.306643545627594, -0.639163613319397, -0.6815435886383057, 0.5162283778190613, -0.3298369348049164, 1.020938754081726, -0.3334188163280487, 1.8256863355636597, -0.5922602415084839, 0.3873142600059509, 0.7108030915260315, 1.326219081878662, 0.16938139498233795, 0.05754147842526436, 0.1727149784564972, 0.33329227566719055, -0.019053854048252106, 0.47249817848205566, 1.2753852605819702, 0.6373451352119446, 0.49419572949409485, 0.7118064165115356, -2.188232421875, 1.3212178945541382, -0.9548022747039795, 0.381071001291275, 1.452135443687439, -0.8830161690711975, 0.3866402506828308, -1.8198918104171753, -0.08865600824356079, 0.505009651184082, -2.202411413192749, 0.1645735502243042, -1.2012732028961182, -0.46052244305610657, 0.9998666644096375, 0.24145914614200592, -1.2498100996017456, 0.26221850514411926, -0.4274510145187378, 0.9805741310119629, 0.508877158164978, 1.2476156949996948, -1.709303379058838, 0.08053157478570938, -0.3065425753593445, 0.15564057230949402, -1.230098843574524, -1.5968726873397827, 0.5355031490325928, 0.5997968316078186, 0.6434746980667114, -0.1515943557024002, 0.9081584215164185, -1.076775074005127, 0.8576924204826355, -0.8968436121940613, -1.6606507301330566, -1.4505527019500732, -2.301266670227051, -2.4059813022613525, 0.7786649465560913, -0.5669017434120178, -0.4250299036502838, 1.9910805225372314, -1.0410802364349365, -1.7321183681488037, 1.0996406078338623, 0.3335532248020172, 0.07512866705656052, 2.352238416671753, 0.26487478613853455, -0.7050390839576721, 0.4304390549659729, -0.738413393497467, 0.8030224442481995, -0.3128907084465027, 1.314878225326538, 0.523838222026825, -1.0268489122390747, 1.5450398921966553, -0.485105961561203, 0.5178358554840088, -0.6661393046379089, -0.4898664057254791, -0.7712498307228088, 0.3125525712966919, 1.8053022623062134, -0.38432878255844116, 1.575100302696228, -0.32345345616340637, -1.5573369264602661, -1.5809779167175293, 0.7937241792678833, 0.48115530610084534, -0.8143494725227356, 0.02328413724899292, -0.44928207993507385, 0.06879258155822754, -0.061131883412599564, 1.0861555337905884, 1.1457570791244507, 0.7086392641067505, -0.4101122319698334, -0.8339987397193909, 0.18333029747009277, -0.05944430083036423, -0.6634344458580017, -1.7506881952285767, -0.3175968527793884, 0.272233784198761, 0.5546463131904602, -1.2453267574310303, 1.8094871044158936, 0.9597839713096619, 2.031148672103882, 0.9285745024681091, -0.389874130487442, 1.4968847036361694, 0.01802397146821022, 1.8975948095321655, -0.5052499175071716, 0.6270509958267212, -0.40947502851486206, -1.3227040767669678, 0.9075348377227783, -0.3879701793193817, -2.0259251594543457, -0.745740532875061, -0.8768354058265686, -0.21000806987285614, -0.794161856174469, 0.9574599862098694, -0.21793486177921295, -1.3911473751068115, 0.21992561221122742, -0.5965538024902344, 0.08828949928283691, -1.281203269958496, 0.2304750382900238, 0.7231002449989319, -0.7177073359489441, -0.028367958962917328, -0.15550243854522705, -1.3155996799468994, -0.48385632038116455, 0.28962579369544983, 1.8857018947601318, -0.6978749632835388, 0.9209827184677124, 1.044569492340088, -0.6577432155609131, 0.09456221014261246, 0.29802170395851135, -0.3798794150352478, 0.8549327254295349, -1.004711389541626, -0.41376298666000366, 1.1485419273376465, -0.1454780101776123, -0.6578818559646606, 1.4675445556640625, 0.7233531475067139, -1.0103336572647095, -0.2500566840171814, -0.14145098626613617, -0.8164868950843811, -0.06615220755338669, -1.4898935556411743, -0.07466737926006317, 0.24414636194705963, -1.4676427841186523, -0.43133673071861267, -0.25325435400009155, 1.2536721229553223, -0.16724266111850739, 1.3729636669158936, -0.30049243569374084, -0.13928434252738953, -0.41854625940322876, -0.49250808358192444, 0.1448042094707489, -0.22008660435676575, -0.6291133761405945, 0.3183874785900116, -0.8978225588798523, 0.310919851064682, 1.490199089050293, 0.33623063564300537, 0.09412706643342972, 0.45530611276626587, 1.0898785591125488, 0.4103107750415802, -0.07999514788389206, -0.9274718165397644, -1.534488558769226, 2.0646169185638428, -1.469407320022583, 1.9438626766204834, 0.8892099857330322, -0.0044317469000816345, -1.8502960205078125, -1.8325029611587524, 1.3350054025650024, 1.1884013414382935, 2.464137077331543, 0.5274069309234619, 0.3649102747440338, -0.8443506956100464, -0.6413140296936035, 0.39988890290260315, -0.9812994003295898, -0.6712927222251892, 0.11305930465459824, 2.344724178314209, 1.786553978919983, -0.5318564176559448, -0.23582322895526886, -0.9456982016563416, 1.3107367753982544, -0.18400222063064575, 0.25700634717941284, 2.077657461166382, -0.3081896901130676, -1.0077205896377563, 1.3397859334945679, -2.392808198928833, 0.18331274390220642, 1.9582252502441406, 0.2786043584346771, 0.1215730607509613, -1.390357494354248, -0.6669381856918335, -0.21804308891296387, -0.5215635299682617, -1.2155587673187256, 0.53265380859375, -0.22820980846881866, -0.8636807203292847, -1.5147361755371094, 0.08932293951511383, -1.2046397924423218, -1.7268357276916504, 0.38472265005111694, 1.7844051122665405, 2.092427968978882, -0.8433743119239807, 1.4140052795410156, -0.23572999238967896, 0.13535833358764648, 1.1961395740509033, 1.2283759117126465, 3.0777502059936523, 1.8813896179199219, -1.2742693424224854, 0.7217335104942322, -0.18860255181789398, -0.4713142514228821, 1.2049919366836548, -0.9969270825386047, 1.2116812467575073, -0.2367258220911026, -1.2150682210922241, -1.2360843420028687, 1.0785367488861084, 0.4732818603515625, 0.04646505042910576, -0.5469025373458862, 1.1985433101654053, 0.1542082130908966, 1.302459478378296, 0.6399297714233398, -0.36568379402160645, 0.5421250462532043, -0.34089869260787964, -0.5315860509872437, 1.536703109741211, 0.1597454696893692, -1.4827133417129517, -2.368828296661377, -0.23826420307159424, -0.9102376103401184, -0.04966532811522484, -0.5981191992759705, -0.9780141711235046, 1.601958990097046, 0.4107080399990082, -1.3094826936721802, -0.26666656136512756, -0.37815502285957336, -0.49085819721221924, 2.626066207885742, -1.4372484683990479, -0.17688119411468506, -0.9514086842536926, -0.5055864453315735, 1.6241164207458496, -1.1827722787857056, -0.2033795416355133, -1.1016597747802734, -0.6492375135421753, -1.3729609251022339, -0.612213134765625, 0.08427847921848297, -0.8752650022506714, 0.7274631857872009, 0.13656575977802277, -1.065225601196289, -0.24749262630939484, -0.8971853256225586, 0.9558400511741638, -0.14476032555103302, 0.278911292552948, 1.9609678983688354, 0.4212420880794525, -0.3745766878128052, 0.6799037456512451, 1.1536296606063843, 0.6295667886734009, -0.6386739611625671, 0.07438487559556961, -0.7142853140830994, 0.3138390779495239, -1.430490493774414, 0.19861994683742523, -2.8536365032196045, 0.6522477865219116, -0.035392966121435165, -0.08803196251392365, 0.032147761434316635, -1.3156715631484985, 1.0788217782974243, 2.514212131500244, -1.2053309679031372, 0.42361393570899963, 0.3685879409313202, 1.1142396926879883, -1.5850648880004883, 0.28768157958984375, -0.4302070140838623, 2.0734262466430664, 0.10363780707120895, 1.1875797510147095, -0.5232674479484558, -2.1855010986328125, 0.5186976790428162, -1.3506090641021729, -1.0778988599777222, 0.8395553827285767, -0.9003213047981262, 0.18039415776729584, -1.5293604135513306, -0.14524048566818237, -0.9321475625038147, -1.2858116626739502, 0.7434872388839722, 0.06140212342143059, 0.4557356536388397, -0.683613657951355, 0.37815743684768677, -2.1988351345062256, -1.4107742309570312, -0.18168117105960846, -0.908769965171814, 0.4789622724056244, -0.34022629261016846, 0.747887134552002, -0.0913463830947876, 0.04150867089629173, 0.3307575285434723, 1.2969169616699219, 3.4724464416503906, 0.22724701464176178, 0.3719536066055298, -0.12345778197050095, -1.0508110523223877, 1.4845044612884521, 0.9880591034889221, -0.14654752612113953, -0.5806569457054138, -0.9950587749481201, 1.354383111000061, 1.9923179149627686, 1.1244326829910278, 0.03428003937005997, -0.851498544216156, -0.7325066924095154, 0.08245435357093811, 0.17401574552059174, 0.4669152796268463, 0.9311273097991943, -0.0337202250957489, 0.11940339207649231, 1.4972283840179443, 1.2294517755508423, -0.3086925446987152, 0.3621446192264557, -0.8937502503395081, -0.485488623380661, 0.43653348088264465, 0.33731409907341003, 0.0933525562286377, 0.4683079421520233, -1.0472043752670288, -0.3486621379852295, -0.408809095621109, -0.9227144122123718, -0.7452046871185303, -0.482072114944458, -0.39986366033554077, 1.630725383758545, 0.049308858811855316, -0.46700236201286316, 0.06511089205741882, -0.7659161686897278, -0.15243470668792725, -1.0782161951065063, 0.28534936904907227, -0.10118194669485092, 0.006737648509442806, -0.2059459537267685, 1.7459172010421753, -0.9554476737976074, -2.109938621520996, 0.2436312884092331, 0.288215309381485, -0.4212754964828491, 0.0964970737695694, 1.669759750366211, 0.47715145349502563, 1.3258987665176392, 1.3580338954925537, 1.0025899410247803, -0.6296424865722656, -1.3014767169952393, 0.6990351676940918, 1.0431941747665405, -1.3906267881393433, 0.9188820123672485, -0.1366390734910965, -0.5202489495277405, 0.6639029383659363, 1.2467199563980103, 0.3891005218029022, -1.9711257219314575, 0.8086532950401306, -0.8943844437599182, 0.8289205431938171, 0.6586195230484009, 0.8664829730987549, 0.17583556473255157, 0.6867866516113281, -1.3196508884429932, -1.1248068809509277, -0.7077961564064026, -0.6447245478630066, 1.9281771183013916, -0.18236824870109558, 0.5611717700958252, -0.2479649782180786, -1.3108315467834473, -0.09980607032775879, 0.7154238224029541, 0.30293524265289307, -0.47197800874710083, 0.8306858539581299, -0.5849288105964661, -1.0261930227279663, -1.3510690927505493, -0.3770841956138611, -0.9846333861351013, -0.8830841779708862, 1.0782219171524048, 0.7760323882102966, 0.38971057534217834, 1.897624135017395, 0.6363521814346313, 0.2895413637161255, -2.638063430786133, 0.8980212211608887, 0.2694254219532013, -0.027680598199367523, 0.965700089931488, 0.27311307191848755, 1.0835565328598022, -0.06500765681266785, 0.5739433765411377, -2.339984655380249, 2.170198678970337, -0.14709177613258362, 0.6525899171829224, -0.043841972947120667, -0.31302130222320557, 1.0669350624084473, 0.5698363780975342, 0.5466846823692322, -1.1651312112808228, 0.6243175864219666, -0.5497913360595703, 1.0517971515655518, 0.9310619235038757, -0.8469062447547913, -0.0030138730071485043, 1.3484609127044678, 0.6009251475334167, -0.4579644799232483, -0.9525063037872314, -0.7979214191436768, 0.9850773811340332, 1.8012795448303223, -0.025546040385961533, 0.06493378430604935, 0.9263202548027039, 0.6576539874076843, -1.3286173343658447, 0.09338866174221039, -0.7433413863182068, -0.7104640007019043, 1.6906652450561523, 2.005558729171753, -0.055930640548467636, -0.12875397503376007, -0.6402902603149414, -1.272156000137329, 0.7713574767112732, -0.019603099673986435, 0.17209294438362122, 0.7241754531860352, -0.7060880064964294, 1.169750690460205, 0.6771078705787659, 0.9746797680854797, 0.06288869678974152, 0.26117920875549316, 0.3297806978225708, -0.31740602850914, -1.1370943784713745, -0.30237653851509094, -1.066125750541687, -2.503594160079956, 0.5000328421592712, -0.18185117840766907, -1.4556550979614258, -0.027313053607940674, -0.9818065762519836, 0.9447120428085327, -0.5321043729782104, -1.072253704071045, -1.4729645252227783, 0.31427958607673645, -0.11336231976747513, 0.8415043950080872, -1.638040542602539, -0.1151786595582962, 1.197853684425354, 0.8991295695304871, -0.6247636079788208, 1.0044323205947876, 0.21860724687576294, 0.9490472078323364, 0.7548224925994873, -0.34498217701911926, 0.4800790250301361, 0.21095840632915497, -1.4000006914138794, 0.3833487629890442, 1.186698079109192, 0.15966716408729553, 1.3598436117172241, -0.5130855441093445, 0.15878216922283173, 0.4191913902759552, -0.5020238161087036, -0.41325289011001587, -0.5071353316307068, 0.6504955291748047, 0.11358440667390823, -0.9634277820587158, 0.0008597215637564659, -0.08462172746658325, -0.23361200094223022, 0.16847200691699982, -1.4326019287109375, -0.25075843930244446, -0.39271873235702515, -0.5467926263809204, -1.308245301246643, 0.06130170449614525, 1.3937561511993408, -0.7156919240951538, -0.19615498185157776, 0.5309624075889587, 0.3217964172363281, 0.5520176887512207, 0.6392081379890442, -0.625883936882019, -0.3550541400909424, -0.28849825263023376, -0.3455323576927185, 0.2765519917011261, 1.2747904062271118, -0.13510584831237793, -0.9723232388496399, 0.7084100842475891, -0.42930740118026733, 0.0942034125328064, 1.988627552986145, 0.06808449327945709, -0.793586790561676, 0.3789418339729309, -0.6387245655059814, 1.8173032999038696, 1.7424490451812744, 1.3426300287246704, -0.05739763751626015, -0.836603581905365, 0.6643391251564026, -0.2686697542667389, -0.3700506091117859, 1.0570487976074219, 0.3312619626522064, -0.18095763027668, -1.4946787357330322, 0.5947176814079285, 1.294944405555725, -0.9249842166900635, -0.7298181056976318, 0.10624657571315765, -0.8801387548446655, 1.1466009616851807, 0.7086421847343445, 0.39055827260017395, 0.23517100512981415, 1.5739002227783203, 0.7576622366905212, -0.4770931303501129, 0.5472263097763062, 0.4947756826877594, -0.1395755112171173, -2.044931173324585, -0.9843611121177673, 0.3059781789779663, -0.3800014853477478, -1.4744240045547485, 1.371519923210144, -1.2331570386886597, -0.9838676452636719, 0.5307785868644714, 0.014784787781536579, 1.3649520874023438, 0.3751450479030609, 1.706756353378296, 2.1026196479797363, 0.8807103037834167, 0.29449665546417236, 1.30189847946167, -0.02134382352232933, -0.3858940303325653, 1.7885196208953857, -0.42764654755592346, 0.6074735522270203, 1.0308148860931396, -0.3977448344230652, -1.044577717781067, -0.7922378778457642, -1.1772092580795288, -0.6724811792373657, 1.2025586366653442, 0.10967127233743668, -1.0735373497009277, 0.2807074785232544, 1.6272382736206055, 0.09065975993871689, -0.28136786818504333, 0.6505804061889648, 0.4193173944950104, -0.7601401805877686, -0.07362468540668488, -0.879970908164978, 0.4880199134349823, -0.2003290057182312, -0.3086155951023102, 0.3240417540073395, 0.5024036765098572, 1.2879170179367065, 0.03644554316997528, 0.1438482701778412, 1.2186945676803589, -1.424890160560608, 1.51211416721344, -0.6425248980522156, 0.20503416657447815, -2.4691085815429688, 1.4306339025497437, -0.8155421018600464, 1.89918851852417, -2.6259655952453613, 0.38264888525009155, -0.5145386457443237, -0.5311297178268433, 0.2762516140937805, -0.35146912932395935, 0.09993264824151993, -0.15009361505508423, -1.0016435384750366, -0.0672709047794342, -0.7174055576324463, 0.580897331237793, 1.1021451950073242, 1.3661333322525024, -1.1138969659805298, -0.4233625531196594, -1.736703872680664, -0.20614632964134216, -0.6782209277153015, 0.2820129096508026, -1.9303219318389893, -0.17637358605861664, -1.9433149099349976, -2.433065176010132, -1.466554045677185, -0.878935694694519, 1.1619304418563843, 0.22021295130252838, -0.9473819136619568, 1.074779987335205, -0.4437899589538574, -1.8413530588150024, 1.0638692378997803, -2.163511276245117 ]
https://github.com/huggingface/datasets/issues/3164
Add raw data files to the Hub with GitHub LFS for canonical dataset
Ah I see, I think I was unclear whether there were benefits to uploading a canonical dataset vs. a community provided dataset. Thanks for clarifying. I'll see if we want to create an organization namespace and otherwise, will upload the dataset under my personal namespace.
I'm interested in sharing the CaseHOLD dataset (https://arxiv.org/abs/2104.08671) as a canonical dataset on the HuggingFace Hub and would like to add the raw data files to the Hub with GitHub LFS, since it seems like a more sustainable long term storage solution, compared to other storage solutions available to my team. From what I can tell, this option is not immediately supported if one follows the sharing steps detailed here: [https://huggingface.co/docs/datasets/share_dataset.html#sharing-a-canonical-dataset](https://huggingface.co/docs/datasets/share_dataset.html#sharing-a-canonical-dataset), since GitHub LFS is not supported for public forks. Is there a way to request this? Thanks!
1,145
45
Add raw data files to the Hub with GitHub LFS for canonical dataset I'm interested in sharing the CaseHOLD dataset (https://arxiv.org/abs/2104.08671) as a canonical dataset on the HuggingFace Hub and would like to add the raw data files to the Hub with GitHub LFS, since it seems like a more sustainable long term storage solution, compared to other storage solutions available to my team. From what I can tell, this option is not immediately supported if one follows the sharing steps detailed here: [https://huggingface.co/docs/datasets/share_dataset.html#sharing-a-canonical-dataset](https://huggingface.co/docs/datasets/share_dataset.html#sharing-a-canonical-dataset), since GitHub LFS is not supported for public forks. Is there a way to request this? Thanks! Ah I see, I think I was unclear whether there were benefits to uploading a canonical dataset vs. a community provided dataset. Thanks for clarifying. I'll see if we want to create an organization namespace and otherwise, will upload the dataset under my personal namespace.
[ -1.2852940559387207, -1.0434821844100952, -0.8062720894813538, 1.3362914323806763, -0.10872884094715118, -1.3458601236343384, 0.056563083082437515, -1.0520015954971313, 1.6428329944610596, -0.8153623938560486, 0.3243493139743805, -1.7059617042541504, -0.048681437969207764, -0.5002539157867432, -0.7629550695419312, -0.9787638187408447, -0.42932644486427307, -0.8283577561378479, 0.9900968074798584, 2.5480337142944336, 1.1101367473602295, -1.4316933155059814, 2.7210421562194824, 0.673384964466095, -0.16040052473545074, -1.0577040910720825, 0.6121331453323364, 0.07412897795438766, -1.2487345933914185, -0.4001605808734894, -0.9280409216880798, 0.03732066601514816, -0.5587581396102905, -0.47974035143852234, 0.09438494592905045, 0.38661056756973267, -0.14698311686515808, -0.3323791027069092, -0.5962998270988464, -0.7165522575378418, 0.539506733417511, -0.3693477213382721, 1.0431808233261108, -0.30506011843681335, 1.8819330930709839, -0.5426509380340576, 0.3792882263660431, 0.6821140050888062, 1.2887083292007446, 0.10868453979492188, 0.061555925756692886, 0.14068232476711273, 0.38096433877944946, 0.0023336103186011314, 0.35137319564819336, 1.1209583282470703, 0.5708678364753723, 0.5312296748161316, 0.6962788105010986, -2.212641477584839, 1.3932580947875977, -0.9651556611061096, 0.39249542355537415, 1.4521501064300537, -0.9420809745788574, 0.47429153323173523, -1.7824702262878418, -0.11562351882457733, 0.5271078944206238, -2.2617623805999756, 0.07944348454475403, -1.250301480293274, -0.4300943613052368, 0.9599315524101257, 0.2769698202610016, -1.203615427017212, 0.31398385763168335, -0.5318279266357422, 1.024564266204834, 0.581256628036499, 1.2397093772888184, -1.7227065563201904, 0.05422130599617958, -0.314699649810791, 0.16198305785655975, -1.3747565746307373, -1.5551707744598389, 0.6010242700576782, 0.6061496734619141, 0.6266034841537476, -0.06691241264343262, 0.8271232843399048, -0.9549421072006226, 0.8015507459640503, -0.8657545447349548, -1.5702372789382935, -1.408426284790039, -2.3506343364715576, -2.476500988006592, 0.7454668879508972, -0.49460649490356445, -0.530554473400116, 1.946097731590271, -1.09962797164917, -1.8117653131484985, 1.1376768350601196, 0.25227120518684387, 0.06938451528549194, 2.4084551334381104, 0.17994807660579681, -0.636512815952301, 0.39532211422920227, -0.717259407043457, 0.8208467364311218, -0.3499027192592621, 1.3080391883850098, 0.6069536805152893, -0.9527503848075867, 1.5638736486434937, -0.4817313551902771, 0.4840039908885956, -0.6361004114151001, -0.5419396162033081, -0.8959212899208069, 0.3529678285121918, 1.7928273677825928, -0.37677717208862305, 1.5758548974990845, -0.3967652916908264, -1.5486220121383667, -1.646782636642456, 0.8217641115188599, 0.5035057663917542, -0.894394040107727, -0.011612549424171448, -0.4195156395435333, 0.09604894369840622, 0.011998026631772518, 1.068629503250122, 1.1318362951278687, 0.6564415693283081, -0.3276912569999695, -0.9046999216079712, 0.27297720313072205, -0.04127002879977226, -0.6152679920196533, -1.8349404335021973, -0.357098788022995, 0.2647930085659027, 0.6712642312049866, -1.1952176094055176, 1.7050514221191406, 0.9758045673370361, 1.997065782546997, 0.9215971231460571, -0.38595354557037354, 1.4832007884979248, -0.046981584280729294, 1.8933029174804688, -0.522702693939209, 0.7345848083496094, -0.3627142608165741, -1.2742786407470703, 0.7743040323257446, -0.3605116903781891, -2.022782325744629, -0.7729728817939758, -0.9287955164909363, -0.24309141933918, -0.803450882434845, 0.9740745425224304, -0.3103923499584198, -1.423248529434204, 0.24485193192958832, -0.5901129841804504, 0.15508438646793365, -1.269454836845398, 0.2388022094964981, 0.7356380820274353, -0.6025362610816956, -0.013711009174585342, -0.14123302698135376, -1.3313233852386475, -0.46909287571907043, 0.2562354803085327, 1.8416802883148193, -0.7291823625564575, 0.9214226603507996, 0.9355035424232483, -0.6112939715385437, 0.06301634758710861, 0.3141646981239319, -0.2871646583080292, 0.8430790305137634, -0.9840852618217468, -0.32474443316459656, 1.1678497791290283, -0.2062639743089676, -0.6481566429138184, 1.5206865072250366, 0.7854036688804626, -0.9460887908935547, -0.22098152339458466, -0.20639723539352417, -0.8686609268188477, -0.09335196018218994, -1.5549585819244385, -0.1685747653245926, 0.20797492563724518, -1.4689182043075562, -0.4103889465332031, -0.28690144419670105, 1.201928973197937, -0.14606799185276031, 1.3707327842712402, -0.3247838616371155, -0.2534804046154022, -0.3805784583091736, -0.46188288927078247, 0.26932573318481445, -0.21048393845558167, -0.6070674061775208, 0.24586094915866852, -0.922900915145874, 0.3333720266819, 1.5005786418914795, 0.43021243810653687, 0.16127412021160126, 0.5136391520500183, 1.0449265241622925, 0.3460199236869812, -0.08120982348918915, -0.908685564994812, -1.592781662940979, 2.0891263484954834, -1.5020220279693604, 1.9069081544876099, 0.7955332398414612, -0.10981237143278122, -1.7843338251113892, -1.7427955865859985, 1.3266183137893677, 1.1309739351272583, 2.3972373008728027, 0.5634624361991882, 0.33143940567970276, -0.8555130958557129, -0.6363452672958374, 0.3136865496635437, -0.9952061176300049, -0.6970365643501282, 0.11242013424634933, 2.2581422328948975, 1.726027250289917, -0.5981552004814148, -0.15239845216274261, -1.059183120727539, 1.334839105606079, -0.12907521426677704, 0.22530719637870789, 2.0272507667541504, -0.3516385555267334, -1.094636082649231, 1.221933126449585, -2.395944595336914, 0.09207043796777725, 1.865563988685608, 0.2748742699623108, 0.08206217736005783, -1.4696693420410156, -0.6978179216384888, -0.24863331019878387, -0.4072009027004242, -1.2689456939697266, 0.5083969831466675, -0.2425827831029892, -0.82048100233078, -1.5387593507766724, 0.07251964509487152, -1.2304760217666626, -1.6913180351257324, 0.3989669382572174, 1.8162052631378174, 2.0590779781341553, -0.7987021207809448, 1.447221040725708, -0.2240930199623108, 0.1918153464794159, 1.2374964952468872, 1.1550469398498535, 3.0803725719451904, 1.872083306312561, -1.2494834661483765, 0.7399621605873108, -0.1535780131816864, -0.528920590877533, 1.245190143585205, -0.9800004363059998, 1.230454444885254, -0.1675511598587036, -1.1770415306091309, -1.261286735534668, 1.041700005531311, 0.44815531373023987, 0.050867896527051926, -0.5319108366966248, 1.3075991868972778, 0.04765341803431511, 1.3303974866867065, 0.5768530964851379, -0.40654364228248596, 0.58890700340271, -0.37210988998413086, -0.5632331371307373, 1.549099087715149, 0.14116933941841125, -1.4929736852645874, -2.3532700538635254, -0.3192700743675232, -0.8342074751853943, -0.07123921066522598, -0.5464467406272888, -1.0023428201675415, 1.5994510650634766, 0.4152906835079193, -1.2947813272476196, -0.2798832654953003, -0.408469557762146, -0.6182538866996765, 2.6314504146575928, -1.4214184284210205, -0.21286772191524506, -0.9142197370529175, -0.49388498067855835, 1.567367672920227, -1.228237509727478, -0.1783948838710785, -1.079637885093689, -0.6840677261352539, -1.447650671005249, -0.5492702126502991, -0.02607801929116249, -1.0163202285766602, 0.6359264254570007, 0.09770412743091583, -0.9481692314147949, -0.1822769194841385, -0.8086273670196533, 0.9052044749259949, -0.06382753700017929, 0.35633257031440735, 1.967549443244934, 0.40560778975486755, -0.384517639875412, 0.6069247126579285, 1.121786117553711, 0.6563206911087036, -0.7121577262878418, 0.040453411638736725, -0.7504366040229797, 0.22607772052288055, -1.3057392835617065, 0.2522377371788025, -2.8851325511932373, 0.6572875380516052, -0.06940043717622757, -0.13207431137561798, 0.05767103657126427, -1.2759548425674438, 1.1013165712356567, 2.572625160217285, -1.239109754562378, 0.40441060066223145, 0.31863394379615784, 1.1701321601867676, -1.5684967041015625, 0.40366941690444946, -0.36334171891212463, 2.099163293838501, 0.2500642240047455, 1.1291056871414185, -0.5079546570777893, -2.174009323120117, 0.5540888905525208, -1.3108904361724854, -1.1599199771881104, 0.8032644987106323, -0.8714518547058105, 0.04907023161649704, -1.4525502920150757, -0.08577436208724976, -0.9510690569877625, -1.326300859451294, 0.7654850482940674, 0.12672249972820282, 0.537505030632019, -0.6457360982894897, 0.34509986639022827, -2.2498514652252197, -1.4246498346328735, -0.20429721474647522, -0.9374945759773254, 0.5134851336479187, -0.3541664183139801, 0.7359215021133423, -0.11384601891040802, 0.06953305751085281, 0.3456316292285919, 1.3348828554153442, 3.4711124897003174, 0.3052573800086975, 0.44363516569137573, -0.06254570186138153, -1.0172972679138184, 1.5814381837844849, 0.9472135901451111, -0.13627249002456665, -0.5095927715301514, -0.9466153979301453, 1.3692355155944824, 1.9924638271331787, 1.0661795139312744, 0.03265385329723358, -0.7591955065727234, -0.6004442572593689, 0.10658074915409088, 0.20087884366512299, 0.44176214933395386, 0.882329523563385, -0.009296484291553497, 0.12517091631889343, 1.4580744504928589, 1.266676902770996, -0.3681815266609192, 0.4362102150917053, -0.8509294390678406, -0.46813762187957764, 0.5432392358779907, 0.2872491180896759, -0.03765401244163513, 0.48576661944389343, -1.0520755052566528, -0.2773516774177551, -0.3958107829093933, -0.972557008266449, -0.7603496313095093, -0.43122100830078125, -0.4225698411464691, 1.6871098279953003, 0.12048127502202988, -0.5083888173103333, 0.043776705861091614, -0.7667953372001648, -0.18207959830760956, -1.0495941638946533, 0.2667014002799988, -0.08159349858760834, 0.02373051643371582, -0.09116575866937637, 1.780052661895752, -0.9470101594924927, -2.124514579772949, 0.23090995848178864, 0.27989688515663147, -0.4491685628890991, 0.1504071056842804, 1.5700089931488037, 0.39644986391067505, 1.3957805633544922, 1.385676383972168, 0.966649055480957, -0.6909534335136414, -1.2766318321228027, 0.6897726655006409, 0.902399480342865, -1.4064867496490479, 0.9725551605224609, -0.08987277001142502, -0.5757685303688049, 0.7543975114822388, 1.2396708726882935, 0.3410082459449768, -1.9846590757369995, 0.8418967723846436, -0.8610489368438721, 0.8063598275184631, 0.6265558004379272, 0.8629290461540222, 0.17528241872787476, 0.7545542120933533, -1.3194904327392578, -1.1260706186294556, -0.7788434028625488, -0.5699059367179871, 1.9575369358062744, -0.14778415858745575, 0.6242337226867676, -0.1931493878364563, -1.1795481443405151, -0.05686433985829353, 0.7196654677391052, 0.312116801738739, -0.4227760434150696, 0.9029959440231323, -0.6661668419837952, -1.1079013347625732, -1.3064906597137451, -0.4270313084125519, -0.9789448976516724, -0.8987216353416443, 1.095684289932251, 0.8124516606330872, 0.33420702815055847, 1.8674534559249878, 0.5265404582023621, 0.2575528919696808, -2.701932907104492, 0.8693890571594238, 0.22374995052814484, 0.06233065947890282, 0.9198135137557983, 0.22005905210971832, 1.1153368949890137, -0.06184018403291702, 0.544700562953949, -2.3113834857940674, 2.173499584197998, -0.260482519865036, 0.7200735807418823, -0.13580192625522614, -0.24150541424751282, 1.0869141817092896, 0.6291105151176453, 0.6323693990707397, -1.2049669027328491, 0.6872891187667847, -0.5826206803321838, 1.1198450326919556, 0.9836294054985046, -0.8274003863334656, -0.02646247297525406, 1.3819624185562134, 0.6402462124824524, -0.3866909444332123, -0.9501604437828064, -0.8001246452331543, 0.9251264333724976, 1.7699928283691406, -0.06515907496213913, -0.004213677253574133, 0.8665581345558167, 0.6698349714279175, -1.3298358917236328, 0.09010954946279526, -0.7269776463508606, -0.6978718638420105, 1.6681588888168335, 2.0352559089660645, 0.008656457997858524, -0.07313729077577591, -0.6207273602485657, -1.239607572555542, 0.7529367208480835, 0.009729810990393162, 0.18189772963523865, 0.6939914226531982, -0.6932368874549866, 1.176125407218933, 0.7289173603057861, 0.9988730549812317, 0.12894585728645325, 0.2730623483657837, 0.32035356760025024, -0.23083831369876862, -1.1226691007614136, -0.26799166202545166, -1.074915885925293, -2.4443113803863525, 0.5204401612281799, -0.28068307042121887, -1.5444750785827637, 0.017108391970396042, -0.9799544811248779, 0.9666601419448853, -0.5624880790710449, -1.0476242303848267, -1.4789702892303467, 0.24247555434703827, -0.10573739558458328, 0.8249667882919312, -1.6346309185028076, 0.005692886188626289, 1.2681330442428589, 0.8150932192802429, -0.5351319909095764, 1.068773627281189, 0.27633950114250183, 0.9654384255409241, 0.746042788028717, -0.36070552468299866, 0.4736397862434387, 0.14567801356315613, -1.396054983139038, 0.44107308983802795, 1.1217188835144043, 0.20007888972759247, 1.3426684141159058, -0.4960072636604309, 0.14488962292671204, 0.4319341778755188, -0.5238576531410217, -0.3628953993320465, -0.524437665939331, 0.7255945205688477, 0.1252518594264984, -0.8463484644889832, 0.06100079044699669, -0.0873088464140892, -0.2654169797897339, 0.2310352921485901, -1.4757490158081055, -0.36694151163101196, -0.4919981062412262, -0.5585315227508545, -1.3384480476379395, 0.05564816668629646, 1.4578430652618408, -0.8132667541503906, -0.1477729231119156, 0.49896004796028137, 0.44275137782096863, 0.5675442218780518, 0.6566100120544434, -0.599734902381897, -0.3454362452030182, -0.33296576142311096, -0.29790371656417847, 0.25660189986228943, 1.1832579374313354, -0.2622753083705902, -1.0349653959274292, 0.7489454746246338, -0.3626585900783539, 0.059542108327150345, 1.974589228630066, 0.06100183352828026, -0.7537608742713928, 0.30390235781669617, -0.6815357804298401, 1.8668781518936157, 1.7341945171356201, 1.3891383409500122, -0.10313209891319275, -0.8886125087738037, 0.5679196119308472, -0.20112201571464539, -0.343941330909729, 1.0463626384735107, 0.4414995610713959, -0.12170808017253876, -1.432224988937378, 0.6187053322792053, 1.2438851594924927, -0.9171172380447388, -0.7288016080856323, 0.026534851640462875, -0.8046958446502686, 1.187641978263855, 0.6983321905136108, 0.41193887591362, 0.19680631160736084, 1.6072076559066772, 0.6761645078659058, -0.5078761577606201, 0.48145192861557007, 0.4879598915576935, -0.13164444267749786, -2.1336216926574707, -0.9189302325248718, 0.25803667306900024, -0.31089556217193604, -1.4530624151229858, 1.3242946863174438, -1.166327953338623, -0.9144599437713623, 0.5605819225311279, 0.09423816949129105, 1.4924061298370361, 0.38419467210769653, 1.720460295677185, 2.1132988929748535, 0.8830698132514954, 0.2715492844581604, 1.336888313293457, -0.021258383989334106, -0.3800256550312042, 1.741544485092163, -0.35653579235076904, 0.5782732963562012, 1.0763415098190308, -0.4399639666080475, -0.925873875617981, -0.7919632792472839, -1.12620210647583, -0.5156265497207642, 1.1586217880249023, 0.1493501365184784, -1.1045846939086914, 0.24806420505046844, 1.585144281387329, 0.1003199890255928, -0.27319127321243286, 0.5806734561920166, 0.45252275466918945, -0.6915711760520935, -0.10483113676309586, -0.9743306636810303, 0.43806204199790955, -0.24896728992462158, -0.3668937683105469, 0.37423986196517944, 0.48123860359191895, 1.1515867710113525, 0.020201221108436584, 0.18979838490486145, 1.327517032623291, -1.3811386823654175, 1.425568699836731, -0.6546987891197205, 0.24791397154331207, -2.435107946395874, 1.4197442531585693, -0.794921338558197, 1.9442386627197266, -2.605454921722412, 0.3413757085800171, -0.6130204796791077, -0.5231072902679443, 0.31682124733924866, -0.35676953196525574, 0.059215519577264786, -0.19803865253925323, -0.953942060470581, -0.060975607484579086, -0.7734518647193909, 0.5752386450767517, 1.1038588285446167, 1.3255972862243652, -1.1245366334915161, -0.29215872287750244, -1.7237714529037476, -0.26705554127693176, -0.7433011531829834, 0.33705592155456543, -1.9341394901275635, -0.13464243710041046, -1.9579851627349854, -2.515050172805786, -1.5108692646026611, -0.8106619119644165, 1.1267828941345215, 0.14923705160617828, -0.8901366591453552, 1.0679243803024292, -0.40197238326072693, -1.8585134744644165, 1.1380950212478638, -2.133453369140625 ]
https://github.com/huggingface/datasets/issues/3162
`datasets-cli test` should work with datasets without scripts
> It would be really useful to be able to run `datasets-cli test`for datasets that don't have scripts attached to them (whether the datasets are private or not). > > I wasn't able to run the script for a private test dataset that I had created on the hub (https://huggingface.co/datasets/huggingface/DataMeasurementsTest/tree/main) -- although @lhoestq came to save the day! why don't you try to share that info with people, so you can also save some days.
It would be really useful to be able to run `datasets-cli test`for datasets that don't have scripts attached to them (whether the datasets are private or not). I wasn't able to run the script for a private test dataset that I had created on the hub (https://huggingface.co/datasets/huggingface/DataMeasurementsTest/tree/main) -- although @lhoestq came to save the day!
1,146
75
`datasets-cli test` should work with datasets without scripts It would be really useful to be able to run `datasets-cli test`for datasets that don't have scripts attached to them (whether the datasets are private or not). I wasn't able to run the script for a private test dataset that I had created on the hub (https://huggingface.co/datasets/huggingface/DataMeasurementsTest/tree/main) -- although @lhoestq came to save the day! > It would be really useful to be able to run `datasets-cli test`for datasets that don't have scripts attached to them (whether the datasets are private or not). > > I wasn't able to run the script for a private test dataset that I had created on the hub (https://huggingface.co/datasets/huggingface/DataMeasurementsTest/tree/main) -- although @lhoestq came to save the day! why don't you try to share that info with people, so you can also save some days.
[ -1.1942999362945557, -0.968590259552002, -0.8166863918304443, 1.4075016975402832, -0.04359383136034012, -1.2315858602523804, -0.07663621753454208, -1.1036940813064575, 1.7049996852874756, -0.7670934200286865, 0.29267093539237976, -1.6851131916046143, -0.002896423451602459, -0.6527590155601501, -0.7920385599136353, -0.913302481174469, -0.40169939398765564, -0.758314311504364, 0.894074022769928, 2.5755178928375244, 1.0230647325515747, -1.3879928588867188, 2.7537920475006104, 0.6605745553970337, -0.18199966847896576, -1.0503902435302734, 0.5687836408615112, 0.05744049325585365, -1.1511526107788086, -0.383836954832077, -1.0077805519104004, -0.01249731332063675, -0.6151835918426514, -0.613498330116272, 0.13339991867542267, 0.31812989711761475, -0.2054319828748703, -0.2935863137245178, -0.5675956010818481, -0.6606830954551697, 0.5092178583145142, -0.35129454731941223, 1.0766128301620483, -0.42605242133140564, 1.8854787349700928, -0.5111668109893799, 0.31657129526138306, 0.5937572717666626, 1.4491451978683472, 0.22341425716876984, -0.006330565083771944, 0.27822038531303406, 0.3648340106010437, 0.037066616117954254, 0.3947553038597107, 1.0752418041229248, 0.5518159866333008, 0.6163516044616699, 0.6573614478111267, -2.205448627471924, 1.334973931312561, -0.9666868448257446, 0.2653821110725403, 1.3694602251052856, -0.9586051106452942, 0.5310546159744263, -1.7253172397613525, -0.025331731885671616, 0.619964063167572, -2.256568193435669, 0.05337143689393997, -1.1856786012649536, -0.4844297766685486, 1.0459158420562744, 0.18826605379581451, -1.2423275709152222, 0.3281407058238983, -0.4322372078895569, 1.0929147005081177, 0.4960118532180786, 1.209064245223999, -1.742856740951538, 0.2198970466852188, -0.32040488719940186, 0.030717894434928894, -1.3654967546463013, -1.5006322860717773, 0.6390207409858704, 0.6456462740898132, 0.6255538463592529, -0.03876307234168053, 0.8476879000663757, -0.9047353863716125, 0.79544597864151, -0.8635237812995911, -1.6265487670898438, -1.3120009899139404, -2.2275447845458984, -2.4270875453948975, 0.7690616250038147, -0.4118003249168396, -0.4793119728565216, 1.9646947383880615, -1.0733375549316406, -1.8850312232971191, 1.1393461227416992, 0.3162062466144562, 0.051668036729097366, 2.45298433303833, 0.12058326601982117, -0.6455881595611572, 0.49544841051101685, -0.6172710657119751, 0.8757510781288147, -0.34608587622642517, 1.4757107496261597, 0.6070746779441833, -1.0866130590438843, 1.7189083099365234, -0.5019655227661133, 0.5249857306480408, -0.6441637277603149, -0.5339051485061646, -0.9438630938529968, 0.40671417117118835, 1.9224340915679932, -0.39062514901161194, 1.6856318712234497, -0.39104413986206055, -1.6130701303482056, -1.5690079927444458, 0.7500815391540527, 0.5032913684844971, -0.9366974234580994, 0.13546434044837952, -0.41563934087753296, 0.11030799895524979, -0.044621843844652176, 1.117059350013733, 1.1520713567733765, 0.5975947380065918, -0.20619352161884308, -0.8798397183418274, 0.22813460230827332, -0.05777772143483162, -0.6399856805801392, -1.8583585023880005, -0.41269049048423767, 0.17666815221309662, 0.6423649191856384, -1.1796380281448364, 1.6748030185699463, 0.8775746822357178, 1.830896258354187, 1.104171872138977, -0.1823781281709671, 1.4431912899017334, -0.026499148458242416, 1.8866349458694458, -0.5388526320457458, 0.684553325176239, -0.36743322014808655, -1.2575912475585938, 0.7420127391815186, -0.4252506196498871, -2.0532114505767822, -0.8276417255401611, -0.8298465013504028, -0.2081698179244995, -0.7835493087768555, 0.9092579483985901, -0.29757553339004517, -1.399378776550293, 0.2604142725467682, -0.5672516226768494, 0.22296962141990662, -1.2725554704666138, 0.3123512268066406, 0.8179701566696167, -0.7678504586219788, -0.09014133363962173, -0.30763164162635803, -1.3761529922485352, -0.498898983001709, 0.2481544464826584, 1.9713246822357178, -0.7925790548324585, 0.9348178505897522, 0.8110596537590027, -0.7080463171005249, 0.004890955053269863, 0.4309631586074829, -0.2940760552883148, 0.8044893741607666, -1.0735604763031006, -0.3501654267311096, 1.1722456216812134, -0.22238482534885406, -0.6390120387077332, 1.4107153415679932, 0.8138501048088074, -1.0046888589859009, -0.13693895936012268, -0.34968218207359314, -0.8664746880531311, -0.08239323645830154, -1.5964475870132446, -0.19864684343338013, 0.1681751310825348, -1.4113478660583496, -0.5202836990356445, -0.18999965488910675, 1.238247275352478, -0.18199262022972107, 1.2660770416259766, -0.3748641908168793, -0.2738514244556427, -0.44485267996788025, -0.5526808500289917, 0.22429127991199493, -0.11165274679660797, -0.7333299517631531, 0.2145530879497528, -0.8358208537101746, 0.38588830828666687, 1.4074699878692627, 0.4876146614551544, 0.13331429660320282, 0.6110737919807434, 1.1017544269561768, 0.2538057863712311, -0.08533261716365814, -0.9017812609672546, -1.6600695848464966, 2.0349011421203613, -1.4359338283538818, 1.9379982948303223, 0.6952129602432251, -0.08866913616657257, -1.7515809535980225, -1.727655053138733, 1.4614405632019043, 1.1498427391052246, 2.2964577674865723, 0.5782781839370728, 0.3189278841018677, -0.838562548160553, -0.771186113357544, 0.44860872626304626, -0.9905983805656433, -0.8358644247055054, 0.09323285520076752, 2.3345327377319336, 1.8069013357162476, -0.5915690064430237, -0.2446659654378891, -0.9829233288764954, 1.2322287559509277, -0.24628491699695587, 0.2203962355852127, 1.9967318773269653, -0.5171136260032654, -1.0824875831604004, 1.358910083770752, -2.3677337169647217, 0.164378821849823, 1.962527871131897, 0.2115476429462433, 0.07183735817670822, -1.4257506132125854, -0.6950358748435974, -0.11481516063213348, -0.34992140531539917, -1.3088406324386597, 0.5396503806114197, -0.305319219827652, -0.8416991233825684, -1.4727071523666382, 0.0662725418806076, -1.2206825017929077, -1.53966224193573, 0.4542006254196167, 1.8076788187026978, 2.0854318141937256, -0.7125219702720642, 1.5160455703735352, -0.19156304001808167, 0.25552770495414734, 1.306339979171753, 1.262513279914856, 3.1808254718780518, 1.8756614923477173, -1.158743977546692, 0.7272759079933167, -0.17245058715343475, -0.508874237537384, 1.2579412460327148, -1.0255458354949951, 1.2313982248306274, -0.3364870250225067, -1.2048062086105347, -1.364008903503418, 0.9893975257873535, 0.4923504590988159, -0.037858977913856506, -0.4985225796699524, 1.2393651008605957, -0.007092083804309368, 1.2712194919586182, 0.45178478956222534, -0.500724196434021, 0.5208050608634949, -0.4976990520954132, -0.6190439462661743, 1.463377833366394, 0.13322250545024872, -1.5129235982894897, -2.2410435676574707, -0.2706083357334137, -0.7740975022315979, -0.14291949570178986, -0.6479172110557556, -1.0067217350006104, 1.4832820892333984, 0.415364533662796, -1.2848464250564575, -0.2756872773170471, -0.35127368569374084, -0.6469622254371643, 2.6054587364196777, -1.4480538368225098, -0.22889085114002228, -0.9308002591133118, -0.5854276418685913, 1.5587495565414429, -1.1708015203475952, -0.17540636658668518, -1.0216560363769531, -0.7535854578018188, -1.4161051511764526, -0.5291845798492432, 0.004065297544002533, -0.9411624670028687, 0.747168779373169, 0.10287894308567047, -1.0614547729492188, -0.19914153218269348, -0.8819864988327026, 0.9353756308555603, -0.17239253222942352, 0.3523617386817932, 1.8956263065338135, 0.43040910363197327, -0.4828075170516968, 0.5845242142677307, 1.1973164081573486, 0.7183567881584167, -0.6634050607681274, 0.18726269900798798, -0.7330197095870972, 0.3286043405532837, -1.374289631843567, 0.25876185297966003, -2.8904309272766113, 0.7243422865867615, -0.019973278045654297, -0.10525882244110107, 0.04927029460668564, -1.307257056236267, 0.9594457745552063, 2.613007068634033, -1.1980594396591187, 0.4216657876968384, 0.357139527797699, 1.1801193952560425, -1.6235791444778442, 0.2280334234237671, -0.40171194076538086, 2.1246871948242188, 0.08386516571044922, 1.0897009372711182, -0.45766228437423706, -2.112203359603882, 0.688180148601532, -1.3048648834228516, -1.2168904542922974, 0.8178210854530334, -0.835155189037323, 0.01016319077461958, -1.4616602659225464, -0.09229044616222382, -0.9935047030448914, -1.2242226600646973, 0.8906656503677368, 0.12811875343322754, 0.5423751473426819, -0.5445294380187988, 0.37541836500167847, -2.1031579971313477, -1.339274525642395, -0.18618939816951752, -0.9465517997741699, 0.4562491774559021, -0.22805491089820862, 0.6310134530067444, -0.21588529646396637, 0.11694809794425964, 0.3243323862552643, 1.329807996749878, 3.363445520401001, 0.24829061329364777, 0.4494662880897522, -0.04904370382428169, -0.9439210295677185, 1.3414267301559448, 0.9313304424285889, -0.1315629482269287, -0.5005285739898682, -0.9825191497802734, 1.3026829957962036, 1.9041062593460083, 1.0290361642837524, 0.1518692672252655, -0.8533461689949036, -0.638340413570404, 0.08916036784648895, 0.15251444280147552, 0.43434083461761475, 0.8374278545379639, -0.04112571105360985, 0.16505132615566254, 1.343658685684204, 1.299229383468628, -0.39367347955703735, 0.356424480676651, -0.8109352588653564, -0.4990704655647278, 0.5272563695907593, 0.3533155918121338, 0.05967440828680992, 0.28438854217529297, -0.9139412045478821, -0.17803283035755157, -0.366695761680603, -1.0366661548614502, -0.7042176723480225, -0.5074060559272766, -0.3963618278503418, 1.5256561040878296, 0.04547787085175514, -0.48871245980262756, -0.10539569705724716, -0.9154168963432312, -0.14734838902950287, -1.008223295211792, 0.15319181978702545, -0.11053306609392166, -0.13974332809448242, -0.207393079996109, 1.6839600801467896, -1.044080138206482, -2.132946252822876, 0.2603081166744232, 0.3035649061203003, -0.4228515625, 0.0871637612581253, 1.673819661140442, 0.5031586289405823, 1.4805504083633423, 1.3524699211120605, 0.9732775092124939, -0.610596776008606, -1.199680209159851, 0.6211873888969421, 0.8971655964851379, -1.4045363664627075, 0.9653725028038025, -0.028567340224981308, -0.541115939617157, 0.718285083770752, 1.2947614192962646, 0.36622855067253113, -1.8072336912155151, 0.788885772228241, -0.8661683201789856, 0.7417291402816772, 0.5861068367958069, 0.8222746253013611, 0.2678743302822113, 0.8991779685020447, -1.1774617433547974, -1.1508020162582397, -0.8610971570014954, -0.5285453200340271, 1.9733694791793823, -0.16393537819385529, 0.5398926138877869, -0.18421562016010284, -1.2555816173553467, -0.1002860739827156, 0.7459840178489685, 0.352483332157135, -0.37513843178749084, 0.7909471988677979, -0.6653328537940979, -1.010563611984253, -1.3979992866516113, -0.423372745513916, -0.9634034037590027, -0.805260181427002, 1.0703788995742798, 0.8220217227935791, 0.31027382612228394, 1.94972562789917, 0.4740763008594513, 0.2575526237487793, -2.7374157905578613, 0.8866161704063416, 0.2510252892971039, -0.09405743330717087, 0.921869158744812, 0.2773715853691101, 1.1216133832931519, -0.1155923530459404, 0.5024663209915161, -2.2020857334136963, 2.1907243728637695, -0.2586749792098999, 0.7172056436538696, -0.06336548924446106, -0.1013278216123581, 1.1717097759246826, 0.5149575471878052, 0.6061964631080627, -1.186078429222107, 0.7671673893928528, -0.5677535533905029, 1.1093496084213257, 1.02518630027771, -0.9232462048530579, 0.041997816413640976, 1.3086957931518555, 0.47486114501953125, -0.42327407002449036, -0.9347469806671143, -0.7670513987541199, 1.0153568983078003, 1.8196059465408325, 0.011240576393902302, -0.05815057083964348, 0.9228687882423401, 0.6925259828567505, -1.3126131296157837, 0.14571329951286316, -0.7316077947616577, -0.6868621110916138, 1.7053965330123901, 1.9420017004013062, -0.04035577178001404, -0.1141650602221489, -0.7418804168701172, -1.1655957698822021, 0.8456995487213135, 0.10952723771333694, 0.0838085263967514, 0.7136795520782471, -0.731928288936615, 1.2839787006378174, 0.8908019065856934, 0.9292461276054382, 0.032032158225774765, 0.3509858250617981, 0.4130060374736786, -0.2004740834236145, -1.1484092473983765, -0.25917327404022217, -1.040103554725647, -2.449155330657959, 0.500033974647522, -0.227369025349617, -1.3922488689422607, -0.02759522572159767, -0.9495276212692261, 0.9202854037284851, -0.47199419140815735, -1.1331945657730103, -1.556924819946289, 0.34148475527763367, -0.09152589738368988, 0.8798781633377075, -1.6178346872329712, 0.018035102635622025, 1.174720287322998, 0.8903452157974243, -0.6073952913284302, 1.0285223722457886, 0.2716773748397827, 1.0226670503616333, 0.8870112299919128, -0.5028703808784485, 0.4895212650299072, 0.11436956375837326, -1.3001023530960083, 0.35832786560058594, 1.037102222442627, 0.22973990440368652, 1.2985880374908447, -0.5963466763496399, 0.04463321343064308, 0.444273978471756, -0.556365966796875, -0.46019574999809265, -0.5944580435752869, 0.7975108027458191, 0.08649429678916931, -0.7853504419326782, -0.021359601989388466, -0.08802937716245651, -0.24910381436347961, 0.21065807342529297, -1.4961574077606201, -0.287693053483963, -0.3667405843734741, -0.5481091141700745, -1.2340232133865356, -0.030921727418899536, 1.4460365772247314, -0.8200700879096985, -0.15640290081501007, 0.6178271174430847, 0.33525145053863525, 0.4582229256629944, 0.5482429265975952, -0.6788557767868042, -0.3131222426891327, -0.3428857624530792, -0.3388333320617676, 0.18617159128189087, 1.3271827697753906, -0.21160796284675598, -0.9635303020477295, 0.7255365252494812, -0.36740708351135254, 0.05183565989136696, 1.9343812465667725, 0.05075478553771973, -0.8527068495750427, 0.4172949194908142, -0.7357161641120911, 1.9311567544937134, 1.7713156938552856, 1.3888057470321655, -0.1507708579301834, -0.909092128276825, 0.6083537340164185, -0.2035362422466278, -0.3153417408466339, 1.0129755735397339, 0.45145827531814575, -0.13829834759235382, -1.3924311399459839, 0.6125396490097046, 1.233471393585205, -0.8658137321472168, -0.6720904111862183, 0.08687741309404373, -0.8770376443862915, 1.043166160583496, 0.724995493888855, 0.5030154585838318, 0.24761919677257538, 1.620309829711914, 0.5700311064720154, -0.5219234824180603, 0.3813135325908661, 0.5002740025520325, -0.1335187554359436, -2.0728023052215576, -0.9915773272514343, 0.23348161578178406, -0.42519116401672363, -1.5404245853424072, 1.2833021879196167, -1.2379487752914429, -0.8303664326667786, 0.6319164633750916, 0.10412684828042984, 1.4583770036697388, 0.26930689811706543, 1.6950186491012573, 2.1738104820251465, 0.8686053156852722, 0.33246365189552307, 1.4413639307022095, -0.008058334700763226, -0.28433477878570557, 1.8500754833221436, -0.441546231508255, 0.6181906461715698, 1.0828014612197876, -0.42883196473121643, -0.9674780964851379, -0.7570925354957581, -1.1263920068740845, -0.6814005970954895, 1.1115878820419312, 0.16532295942306519, -1.1599665880203247, 0.19335468113422394, 1.6690071821212769, -0.017926214262843132, -0.25827252864837646, 0.5928418636322021, 0.5232313871383667, -0.6490838527679443, -0.05173478648066521, -0.8846933841705322, 0.5424984693527222, -0.25528672337532043, -0.30545392632484436, 0.3293842077255249, 0.38165658712387085, 1.2638722658157349, 0.029993899166584015, 0.11461199820041656, 1.2606874704360962, -1.4072831869125366, 1.4158649444580078, -0.6121101975440979, 0.2778709828853607, -2.531352996826172, 1.5126850605010986, -0.7274696826934814, 1.937243103981018, -2.6620686054229736, 0.42968040704727173, -0.6587302684783936, -0.42728960514068604, 0.3101779520511627, -0.37156715989112854, 0.05356917902827263, -0.1069054901599884, -0.9998082518577576, 0.0015676561743021011, -0.6485090255737305, 0.6273139715194702, 1.2445580959320068, 1.2769577503204346, -1.1591837406158447, -0.3104384243488312, -1.8278353214263916, -0.20514044165611267, -0.6002565622329712, 0.3504455089569092, -1.9594166278839111, -0.185631662607193, -1.9613317251205444, -2.499187469482422, -1.556209921836853, -0.6961154341697693, 1.0739827156066895, 0.11766362190246582, -1.0154863595962524, 1.1323883533477783, -0.44822394847869873, -1.7586729526519775, 1.1737239360809326, -2.208361864089966 ]
https://github.com/huggingface/datasets/issues/3162
`datasets-cli test` should work with datasets without scripts
Hi ! You can run the command if you download the repository ``` git clone https://huggingface.co/datasets/huggingface/DataMeasurementsTest ``` and run the command ``` datasets-cli test DataMeasurementsTest/DataMeasurementsTest.py ``` (though on my side it doesn't manage to download the data since the dataset is private ^^)
It would be really useful to be able to run `datasets-cli test`for datasets that don't have scripts attached to them (whether the datasets are private or not). I wasn't able to run the script for a private test dataset that I had created on the hub (https://huggingface.co/datasets/huggingface/DataMeasurementsTest/tree/main) -- although @lhoestq came to save the day!
1,146
43
`datasets-cli test` should work with datasets without scripts It would be really useful to be able to run `datasets-cli test`for datasets that don't have scripts attached to them (whether the datasets are private or not). I wasn't able to run the script for a private test dataset that I had created on the hub (https://huggingface.co/datasets/huggingface/DataMeasurementsTest/tree/main) -- although @lhoestq came to save the day! Hi ! You can run the command if you download the repository ``` git clone https://huggingface.co/datasets/huggingface/DataMeasurementsTest ``` and run the command ``` datasets-cli test DataMeasurementsTest/DataMeasurementsTest.py ``` (though on my side it doesn't manage to download the data since the dataset is private ^^)
[ -1.1792032718658447, -0.9796724915504456, -0.7932283282279968, 1.4510613679885864, -0.028500087559223175, -1.3242453336715698, -0.020790945738554, -1.11290442943573, 1.7967365980148315, -0.759889543056488, 0.3518850803375244, -1.741816520690918, 0.007011920213699341, -0.6176629662513733, -0.8098009824752808, -0.948633074760437, -0.3935639262199402, -0.7497693300247192, 0.8394935131072998, 2.4946095943450928, 1.0860185623168945, -1.3261752128601074, 2.684011220932007, 0.6569165587425232, -0.19017794728279114, -1.0398976802825928, 0.5923616886138916, 0.04595707356929779, -1.1869655847549438, -0.3780009150505066, -0.9893378615379333, -0.03780212253332138, -0.5814374685287476, -0.6985357999801636, 0.06340856105089188, 0.3668920397758484, -0.26756900548934937, -0.3370799422264099, -0.4799302816390991, -0.7480783462524414, 0.5079333782196045, -0.3265022933483124, 1.0544521808624268, -0.48068130016326904, 1.8978179693222046, -0.6015439629554749, 0.2921847403049469, 0.618548572063446, 1.4037542343139648, 0.18313489854335785, -0.02768664062023163, 0.28462937474250793, 0.39355626702308655, 0.07709482312202454, 0.41305816173553467, 1.0932767391204834, 0.5041660666465759, 0.6508551239967346, 0.6506626009941101, -2.2615058422088623, 1.2731977701187134, -1.0166137218475342, 0.2295941859483719, 1.3596696853637695, -0.9659966826438904, 0.4513769745826721, -1.7296133041381836, 0.027151288464665413, 0.5789355635643005, -2.226017475128174, 0.09015136957168579, -1.1964179277420044, -0.449432909488678, 1.0500401258468628, 0.1642531305551529, -1.2269853353500366, 0.27132856845855713, -0.3708947002887726, 1.1251548528671265, 0.46906840801239014, 1.1900508403778076, -1.6803988218307495, 0.14383485913276672, -0.41129544377326965, 0.012391209602355957, -1.3555078506469727, -1.5268590450286865, 0.5362019538879395, 0.6581694483757019, 0.6393407583236694, -0.06935005635023117, 0.93837571144104, -0.8497517704963684, 0.8104475736618042, -0.9340810179710388, -1.720068335533142, -1.3224557638168335, -2.203948974609375, -2.3701415061950684, 0.7154180407524109, -0.4542198181152344, -0.4537578225135803, 2.0240797996520996, -1.062075138092041, -1.9161063432693481, 1.0322209596633911, 0.293646901845932, 0.03838016837835312, 2.3554913997650146, 0.06606561690568924, -0.6292464137077332, 0.43193554878234863, -0.6364067196846008, 0.7756823897361755, -0.3200109302997589, 1.4607813358306885, 0.6076502799987793, -1.1347655057907104, 1.68705153465271, -0.4884919226169586, 0.5697906613349915, -0.7196676731109619, -0.5526407361030579, -0.9122546911239624, 0.411819726228714, 1.881515383720398, -0.4460925757884979, 1.6872761249542236, -0.4004243314266205, -1.5428647994995117, -1.5364564657211304, 0.7561510801315308, 0.4973311722278595, -0.8971286416053772, 0.08934517949819565, -0.3869399428367615, 0.06918559223413467, -0.08071950078010559, 1.1488710641860962, 1.0660659074783325, 0.6598507761955261, -0.22706100344657898, -0.8086075782775879, 0.2712203562259674, 0.04305105656385422, -0.6629448533058167, -1.804060935974121, -0.4141615331172943, 0.15080833435058594, 0.6484349370002747, -1.1099886894226074, 1.7353286743164062, 0.8215321898460388, 1.9322118759155273, 1.0673023462295532, -0.21115469932556152, 1.4375156164169312, -0.027420658618211746, 1.9288960695266724, -0.5072007775306702, 0.7074134945869446, -0.3165607154369354, -1.2571519613265991, 0.7584474086761475, -0.427883118391037, -2.0798614025115967, -0.8885582089424133, -0.8687029480934143, -0.09064359962940216, -0.7791893482208252, 0.9647696614265442, -0.29475367069244385, -1.4475444555282593, 0.15587235987186432, -0.5060209035873413, 0.1914316713809967, -1.3341379165649414, 0.25957804918289185, 0.7592746019363403, -0.7506011128425598, 0.018729684874415398, -0.3048431873321533, -1.3534061908721924, -0.5286818742752075, 0.3080993890762329, 1.9601227045059204, -0.7856884598731995, 0.96368408203125, 0.8896933197975159, -0.78899085521698, 0.04361475259065628, 0.4186115562915802, -0.23518063127994537, 0.8782292604446411, -1.1345717906951904, -0.36563098430633545, 1.144076943397522, -0.17346523702144623, -0.7411739230155945, 1.4687126874923706, 0.8404037356376648, -1.009205937385559, -0.08792513608932495, -0.3426169157028198, -0.797307550907135, -0.05442631244659424, -1.5614418983459473, -0.11958359181880951, 0.19956976175308228, -1.4132601022720337, -0.5012543797492981, -0.23686669766902924, 1.2967932224273682, -0.21579423546791077, 1.2776159048080444, -0.32696977257728577, -0.30073803663253784, -0.49501654505729675, -0.49942678213119507, 0.18760550022125244, -0.10084211826324463, -0.780340313911438, 0.27455973625183105, -0.7539080381393433, 0.38348913192749023, 1.3916680812835693, 0.41837576031684875, 0.0967123806476593, 0.6309539079666138, 1.1726462841033936, 0.2317800223827362, -0.09546328336000443, -0.961946427822113, -1.6522836685180664, 1.9885330200195312, -1.4476196765899658, 1.8832281827926636, 0.6686921119689941, -0.06481733173131943, -1.7713966369628906, -1.7760754823684692, 1.5069698095321655, 1.1499075889587402, 2.2677557468414307, 0.669752836227417, 0.3606763780117035, -0.8596495985984802, -0.6995342373847961, 0.45024529099464417, -1.060409426689148, -0.8195245265960693, 0.16655980050563812, 2.318040370941162, 1.732675552368164, -0.5708968043327332, -0.2715834081172943, -1.0013726949691772, 1.1605002880096436, -0.15953993797302246, 0.2174610197544098, 2.0215725898742676, -0.5320152044296265, -1.0870455503463745, 1.3185453414916992, -2.310319423675537, 0.12220867723226547, 2.0299601554870605, 0.2061130255460739, 0.0687757134437561, -1.4453459978103638, -0.6366458535194397, -0.1053810641169548, -0.42987632751464844, -1.350066900253296, 0.5588324666023254, -0.2886539697647095, -0.7634211778640747, -1.4905065298080444, 0.12506626546382904, -1.134454607963562, -1.5901854038238525, 0.3862253427505493, 1.8214375972747803, 1.9410096406936646, -0.7122395634651184, 1.5312902927398682, -0.1696470081806183, 0.30199453234672546, 1.3932820558547974, 1.2564408779144287, 3.1721031665802, 1.9090667963027954, -1.1750719547271729, 0.7824878096580505, -0.14651136100292206, -0.4916050434112549, 1.3552297353744507, -1.0977425575256348, 1.2347302436828613, -0.3738231360912323, -1.2354236841201782, -1.4139856100082397, 0.9368150234222412, 0.481507271528244, 0.04039532691240311, -0.5099365711212158, 1.2809373140335083, 0.07976333051919937, 1.2272619009017944, 0.38115429878234863, -0.5028343200683594, 0.5567708015441895, -0.47433969378471375, -0.5966771245002747, 1.4608041048049927, 0.16200138628482819, -1.4248155355453491, -2.2518112659454346, -0.2743038833141327, -0.7888370752334595, -0.16083696484565735, -0.6586220264434814, -0.9542794823646545, 1.6202688217163086, 0.46216562390327454, -1.3025140762329102, -0.2587028443813324, -0.33912262320518494, -0.660015881061554, 2.621225595474243, -1.363336205482483, -0.22009754180908203, -0.9909838438034058, -0.552294135093689, 1.6246232986450195, -1.1803568601608276, -0.15336298942565918, -1.051503300666809, -0.7324312925338745, -1.4757390022277832, -0.5434540510177612, 0.09376784414052963, -0.9018086194992065, 0.798668622970581, 0.10518791526556015, -1.1234104633331299, -0.2323705106973648, -0.8247306942939758, 0.9260278344154358, -0.10973329097032547, 0.3367982506752014, 1.9381520748138428, 0.47500911355018616, -0.4947530925273895, 0.5998903512954712, 1.1184756755828857, 0.751004695892334, -0.644040584564209, 0.2850027084350586, -0.6729259490966797, 0.29617494344711304, -1.4339807033538818, 0.28589245676994324, -2.869886875152588, 0.694290041923523, -0.029307516291737556, -0.1028771847486496, 0.020374253392219543, -1.3426755666732788, 0.9361472129821777, 2.561600685119629, -1.2028400897979736, 0.3593742549419403, 0.3513452112674713, 1.2188175916671753, -1.596914291381836, 0.25109243392944336, -0.49364906549453735, 2.0579404830932617, 0.04066045582294464, 1.110605001449585, -0.4153122901916504, -2.0356454849243164, 0.7017019987106323, -1.2293453216552734, -1.213057041168213, 0.8666280508041382, -0.8250725865364075, 0.006033424288034439, -1.3898985385894775, -0.0926186740398407, -1.0053863525390625, -1.2135429382324219, 0.9413250088691711, 0.13150300085544586, 0.5280821323394775, -0.6207152605056763, 0.3620641827583313, -2.033353090286255, -1.3594927787780762, -0.2924043536186218, -0.9636585712432861, 0.37663519382476807, -0.260448694229126, 0.567272424697876, -0.2216801643371582, 0.13381388783454895, 0.3396284580230713, 1.360086441040039, 3.362407922744751, 0.2768709063529968, 0.45520898699760437, 0.0298298466950655, -1.0042520761489868, 1.3988032341003418, 0.9465456604957581, -0.13193726539611816, -0.46476811170578003, -1.0008985996246338, 1.2609249353408813, 1.893029808998108, 1.0806877613067627, 0.13470667600631714, -0.8331749439239502, -0.7542684674263, 0.09526750445365906, 0.19028228521347046, 0.5202203989028931, 0.7979553937911987, 0.025324827060103416, 0.15294048190116882, 1.3560378551483154, 1.2565479278564453, -0.4108690023422241, 0.38809412717819214, -0.8688536286354065, -0.4929649829864502, 0.565128743648529, 0.35360509157180786, 0.08279465138912201, 0.2588610351085663, -0.9626072645187378, -0.2421913594007492, -0.3572230041027069, -1.0513324737548828, -0.7384650707244873, -0.49311527609825134, -0.43184149265289307, 1.5518933534622192, -0.04949676990509033, -0.4902004301548004, -0.12623728811740875, -0.9218791723251343, -0.1275947391986847, -1.003994107246399, 0.23255521059036255, -0.11156156659126282, -0.18686993420124054, -0.12121467292308807, 1.6648439168930054, -1.087052822113037, -2.084646701812744, 0.3108125627040863, 0.3233187794685364, -0.45388033986091614, 0.15365324914455414, 1.6374331712722778, 0.4702860713005066, 1.4512276649475098, 1.3463762998580933, 0.9960544109344482, -0.5682483315467834, -1.2270698547363281, 0.5477914810180664, 0.8810145258903503, -1.4108115434646606, 0.9397187232971191, 0.03341851383447647, -0.5552939772605896, 0.691815197467804, 1.2760059833526611, 0.3349853754043579, -1.7889705896377563, 0.7182339429855347, -0.7808194756507874, 0.7232380509376526, 0.6155229210853577, 0.8545712232589722, 0.20247091352939606, 0.8838316798210144, -1.136404275894165, -1.1847279071807861, -0.7810742259025574, -0.5667129755020142, 1.8541630506515503, -0.13203014433383942, 0.578633725643158, -0.19155526161193848, -1.28041410446167, -0.08712596446275711, 0.7796040177345276, 0.3781599998474121, -0.4755377471446991, 0.7805925607681274, -0.6015409231185913, -0.9483039379119873, -1.344411849975586, -0.45041051506996155, -0.9941987991333008, -0.851328432559967, 1.0094345808029175, 0.8602677583694458, 0.2572878897190094, 1.9781453609466553, 0.511978805065155, 0.24015504121780396, -2.7397618293762207, 0.8840104937553406, 0.27301663160324097, -0.0632668286561966, 0.8768840432167053, 0.2990306615829468, 1.0184428691864014, -0.11291450262069702, 0.5611990094184875, -2.2075321674346924, 2.291224956512451, -0.2527831792831421, 0.623789370059967, -0.04237120598554611, -0.20408695936203003, 1.1706852912902832, 0.474452406167984, 0.5516258478164673, -1.142188549041748, 0.7646620273590088, -0.6569386720657349, 1.189943790435791, 0.9801090955734253, -0.9193626642227173, 0.006238849833607674, 1.2800756692886353, 0.5594046115875244, -0.38448476791381836, -0.9342800974845886, -0.8869573473930359, 1.0804424285888672, 1.7216880321502686, 0.039106063544750214, -0.04592311382293701, 0.9810769557952881, 0.6702299118041992, -1.2661114931106567, 0.20216979086399078, -0.770256757736206, -0.6530308127403259, 1.6834532022476196, 1.9266997575759888, -0.06331700831651688, -0.12606079876422882, -0.8096323013305664, -1.032265305519104, 0.8104966282844543, 0.07104098796844482, 0.034748733043670654, 0.7477258443832397, -0.7170882225036621, 1.278741717338562, 0.8849994540214539, 0.9037235975265503, 0.08452268689870834, 0.43432435393333435, 0.3714107573032379, -0.2420242577791214, -1.1812868118286133, -0.21550549566745758, -0.9833805561065674, -2.5097856521606445, 0.5209472179412842, -0.2134813368320465, -1.3800967931747437, -0.006249498575925827, -1.0007866621017456, 0.8790349364280701, -0.5087680816650391, -1.2100470066070557, -1.507920742034912, 0.2930416464805603, -0.07601083070039749, 0.8616936206817627, -1.5811406373977661, 0.10681226849555969, 1.21428644657135, 0.8891307711601257, -0.6979023218154907, 0.9325191378593445, 0.2223672717809677, 1.0910955667495728, 0.9714497327804565, -0.44169870018959045, 0.4854913651943207, 0.10522590577602386, -1.3095813989639282, 0.37864288687705994, 1.0243958234786987, 0.19783976674079895, 1.3691459894180298, -0.5425791144371033, 0.057640619575977325, 0.4439837634563446, -0.5361281633377075, -0.5326135754585266, -0.7374134063720703, 0.7771747708320618, 0.09828969836235046, -0.7789714932441711, 0.1573350727558136, -0.03969813883304596, -0.16419129073619843, 0.2141207605600357, -1.5057671070098877, -0.3219192326068878, -0.2729688584804535, -0.6504363417625427, -1.2442795038223267, 0.042504988610744476, 1.3932726383209229, -0.7431573271751404, -0.1606907993555069, 0.5896605849266052, 0.24638979136943817, 0.42896515130996704, 0.4989154040813446, -0.6946380138397217, -0.35664886236190796, -0.37629371881484985, -0.3217068910598755, 0.25722137093544006, 1.3230398893356323, -0.1622469574213028, -0.9719838500022888, 0.733279824256897, -0.3790433406829834, 0.007455974817276001, 1.9542628526687622, 0.05628065764904022, -0.8446342945098877, 0.3689483404159546, -0.7228069305419922, 1.901916742324829, 1.789116382598877, 1.366562008857727, -0.14982494711875916, -0.8575845956802368, 0.5699445009231567, -0.2531300187110901, -0.3697003126144409, 1.0631380081176758, 0.4181494116783142, -0.0772097110748291, -1.3051953315734863, 0.661071240901947, 1.3089845180511475, -0.8814014196395874, -0.7078732848167419, 0.11441957950592041, -0.8443753719329834, 1.0506877899169922, 0.7213265895843506, 0.4529821574687958, 0.30063170194625854, 1.5756269693374634, 0.6254072785377502, -0.36290067434310913, 0.4328736364841461, 0.4687584340572357, -0.09523453563451767, -2.1051666736602783, -1.056484580039978, 0.251290500164032, -0.49011969566345215, -1.5587272644042969, 1.3328317403793335, -1.3228355646133423, -0.8527724146842957, 0.6298375725746155, 0.13927625119686127, 1.542702078819275, 0.2545492351055145, 1.648756980895996, 2.1351048946380615, 0.8482680916786194, 0.33957797288894653, 1.422968864440918, 0.03263210505247116, -0.30581483244895935, 1.8566854000091553, -0.5000760555267334, 0.5675791501998901, 1.0562667846679688, -0.3604882061481476, -1.0141360759735107, -0.7768946886062622, -1.227382779121399, -0.6540424227714539, 1.1767971515655518, 0.1815655380487442, -1.2038418054580688, 0.26976507902145386, 1.5556174516677856, -0.05714498460292816, -0.1916654407978058, 0.5907506942749023, 0.4343080520629883, -0.7302319407463074, -0.0327935591340065, -0.8465756773948669, 0.5774402022361755, -0.22288954257965088, -0.2660488486289978, 0.3557693362236023, 0.41940340399742126, 1.2655317783355713, 0.08686115592718124, 0.10818037390708923, 1.2511447668075562, -1.3971130847930908, 1.4960838556289673, -0.5980476140975952, 0.27898868918418884, -2.5596084594726562, 1.502598762512207, -0.7596510648727417, 1.861598014831543, -2.7090888023376465, 0.3953741490840912, -0.5475975275039673, -0.41521668434143066, 0.37645208835601807, -0.40685585141181946, 0.010977402329444885, -0.19712649285793304, -1.0305659770965576, 0.001862579956650734, -0.7028648853302002, 0.6623463034629822, 1.1983758211135864, 1.3225586414337158, -1.1447690725326538, -0.35435354709625244, -1.8758506774902344, -0.1718081384897232, -0.528186023235321, 0.4317837655544281, -1.9598859548568726, -0.1460065394639969, -1.9901220798492432, -2.5101306438446045, -1.4486397504806519, -0.7216399908065796, 1.0747332572937012, 0.14956946671009064, -0.9673734903335571, 1.0819307565689087, -0.4618816375732422, -1.7502995729446411, 1.125496506690979, -2.22241473197937 ]
https://github.com/huggingface/datasets/issues/3162
`datasets-cli test` should work with datasets without scripts
> Hi ! You can run the command if you download the repository > > ``` > git clone https://huggingface.co/datasets/huggingface/DataMeasurementsTest > ``` > > and run the command > > ``` > datasets-cli test DataMeasurementsTest/DataMeasurementsTest.py > ``` > > (though on my side it doesn't manage to download the data since the dataset is private ^^) Hi! Thanks for the info. git cannot find the repository. Do you know if they have depreciated these tests and created a new one?
It would be really useful to be able to run `datasets-cli test`for datasets that don't have scripts attached to them (whether the datasets are private or not). I wasn't able to run the script for a private test dataset that I had created on the hub (https://huggingface.co/datasets/huggingface/DataMeasurementsTest/tree/main) -- although @lhoestq came to save the day!
1,146
80
`datasets-cli test` should work with datasets without scripts It would be really useful to be able to run `datasets-cli test`for datasets that don't have scripts attached to them (whether the datasets are private or not). I wasn't able to run the script for a private test dataset that I had created on the hub (https://huggingface.co/datasets/huggingface/DataMeasurementsTest/tree/main) -- although @lhoestq came to save the day! > Hi ! You can run the command if you download the repository > > ``` > git clone https://huggingface.co/datasets/huggingface/DataMeasurementsTest > ``` > > and run the command > > ``` > datasets-cli test DataMeasurementsTest/DataMeasurementsTest.py > ``` > > (though on my side it doesn't manage to download the data since the dataset is private ^^) Hi! Thanks for the info. git cannot find the repository. Do you know if they have depreciated these tests and created a new one?
[ -1.1593290567398071, -0.9312940835952759, -0.7875716090202332, 1.4619579315185547, -0.07452331483364105, -1.3411223888397217, -0.0540878102183342, -1.1503340005874634, 1.7490304708480835, -0.7590304613113403, 0.33235985040664673, -1.7311354875564575, 0.004972237162292004, -0.618553876876831, -0.8393149971961975, -1.015511393547058, -0.4006900489330292, -0.7946338653564453, 0.8477864861488342, 2.5041754245758057, 1.1203720569610596, -1.3273872137069702, 2.659607172012329, 0.6810547113418579, -0.22839903831481934, -1.030111312866211, 0.6027260422706604, 0.020449470728635788, -1.2071565389633179, -0.37948402762413025, -0.9438261985778809, -0.05548369884490967, -0.6479693651199341, -0.6965839862823486, 0.07344689965248108, 0.3132815957069397, -0.24082081019878387, -0.3050554394721985, -0.5091345906257629, -0.7458147406578064, 0.48807957768440247, -0.3575274348258972, 1.0459425449371338, -0.46134406328201294, 1.8448973894119263, -0.5966015458106995, 0.3401998281478882, 0.6402052044868469, 1.384672999382019, 0.2502894997596741, -0.05200141668319702, 0.2558402121067047, 0.3998119533061981, 0.012756580486893654, 0.3898172378540039, 1.0521001815795898, 0.5504868626594543, 0.6413200497627258, 0.6833319067955017, -2.232994556427002, 1.298271894454956, -0.9742375016212463, 0.22548677027225494, 1.3229217529296875, -0.9186431169509888, 0.4684518873691559, -1.750057578086853, 0.01693713106215, 0.6097109317779541, -2.2825639247894287, 0.1254444271326065, -1.2650067806243896, -0.4477713108062744, 0.9785394668579102, 0.1680750995874405, -1.217896580696106, 0.24562586843967438, -0.3994474709033966, 1.1121639013290405, 0.5442988276481628, 1.1619130373001099, -1.7990564107894897, 0.08816680312156677, -0.3785858154296875, 0.0576726458966732, -1.315130352973938, -1.5412782430648804, 0.5821558833122253, 0.6981290578842163, 0.5756098031997681, -0.01258415449410677, 0.8898422122001648, -0.8148213624954224, 0.8016965389251709, -0.8492637872695923, -1.6882156133651733, -1.3386495113372803, -2.156153917312622, -2.369363307952881, 0.6881416440010071, -0.5572738647460938, -0.49350181221961975, 2.0158607959747314, -1.0773375034332275, -1.9178708791732788, 1.0466638803482056, 0.2983946204185486, 0.05569292977452278, 2.3959057331085205, 0.09663230180740356, -0.6141443252563477, 0.4226450026035309, -0.6146978139877319, 0.7732842564582825, -0.34050866961479187, 1.4428123235702515, 0.562522292137146, -1.0701696872711182, 1.699105978012085, -0.5387002825737, 0.5567692518234253, -0.7124157547950745, -0.5511810183525085, -0.871368408203125, 0.39682313799858093, 1.8962441682815552, -0.4412430226802826, 1.689711570739746, -0.3443623483181, -1.543648362159729, -1.5936763286590576, 0.7675879001617432, 0.4338531494140625, -0.961878776550293, 0.13472303748130798, -0.402006596326828, 0.09361986815929413, -0.039546117186546326, 1.0975189208984375, 1.1573067903518677, 0.6864327788352966, -0.21738995611667633, -0.8547458052635193, 0.28239452838897705, 0.01768108457326889, -0.6831591725349426, -1.814278244972229, -0.3772411048412323, 0.16174662113189697, 0.6998481154441833, -1.0899873971939087, 1.6707333326339722, 0.8166204690933228, 1.921360731124878, 1.0531681776046753, -0.2700945734977722, 1.4294142723083496, 0.0015730969607830048, 1.9078096151351929, -0.5995639562606812, 0.7125319242477417, -0.39010265469551086, -1.2180838584899902, 0.7364661693572998, -0.4079541862010956, -2.0127310752868652, -0.7935816049575806, -0.8781204223632812, -0.13304951786994934, -0.7823652029037476, 0.9317806959152222, -0.27318912744522095, -1.3809535503387451, 0.2650623619556427, -0.5865157842636108, 0.16955457627773285, -1.3305690288543701, 0.35031458735466003, 0.7657355070114136, -0.6867322325706482, -0.017862897366285324, -0.3263442814350128, -1.3786062002182007, -0.5311422944068909, 0.23571689426898956, 1.9833619594573975, -0.7418773174285889, 0.9737110137939453, 0.8340070247650146, -0.7860451340675354, -0.01421939767897129, 0.4191773533821106, -0.24439415335655212, 0.8597517609596252, -1.1486705541610718, -0.27942347526550293, 1.184863805770874, -0.2099504917860031, -0.6842725276947021, 1.438681721687317, 0.8049096465110779, -1.0161314010620117, -0.1052779108285904, -0.3330237865447998, -0.7678977251052856, -0.04210793226957321, -1.6176000833511353, -0.10737015306949615, 0.23965984582901, -1.4463809728622437, -0.5378482937812805, -0.20938222110271454, 1.2859750986099243, -0.17860999703407288, 1.3065849542617798, -0.32235583662986755, -0.23245929181575775, -0.514858603477478, -0.471985399723053, 0.17624296247959137, -0.18022841215133667, -0.7003868818283081, 0.2205093950033188, -0.8054375052452087, 0.32967662811279297, 1.4055899381637573, 0.3622334599494934, 0.07527367770671844, 0.5250992774963379, 1.1462764739990234, 0.2332926094532013, -0.12238256633281708, -0.9759082198143005, -1.62391197681427, 2.0577406883239746, -1.479633092880249, 1.911084532737732, 0.6419506669044495, -0.10079522430896759, -1.721705675125122, -1.8461252450942993, 1.4438331127166748, 1.14402437210083, 2.262923240661621, 0.671919584274292, 0.3686980903148651, -0.8324136137962341, -0.6666843295097351, 0.41038721799850464, -1.0348231792449951, -0.86788010597229, 0.13476833701133728, 2.342879295349121, 1.7053508758544922, -0.6092658042907715, -0.24316833913326263, -0.9687924981117249, 1.2212594747543335, -0.15632379055023193, 0.21606643497943878, 1.9984498023986816, -0.47383132576942444, -1.1155829429626465, 1.3097751140594482, -2.285338878631592, 0.07293061912059784, 2.016742706298828, 0.18531057238578796, 0.11791479587554932, -1.4001600742340088, -0.6580168008804321, -0.16089792549610138, -0.41013556718826294, -1.336002230644226, 0.5379716753959656, -0.27733489871025085, -0.7675149440765381, -1.4793392419815063, 0.14264175295829773, -1.1142176389694214, -1.5932974815368652, 0.33320704102516174, 1.8602395057678223, 1.9624651670455933, -0.7523362636566162, 1.5594568252563477, -0.2813555896282196, 0.2463749498128891, 1.317331314086914, 1.2895534038543701, 3.2451672554016113, 1.9555766582489014, -1.182561993598938, 0.7201548218727112, -0.1516617387533188, -0.5015069842338562, 1.3561265468597412, -1.1127651929855347, 1.1846590042114258, -0.36603716015815735, -1.2635031938552856, -1.3705127239227295, 0.9410812854766846, 0.4637567400932312, 0.05581333860754967, -0.5273439288139343, 1.2783355712890625, 0.007743967697024345, 1.307160496711731, 0.3983805477619171, -0.4882664978504181, 0.5827068090438843, -0.5024089217185974, -0.5580278635025024, 1.493155837059021, 0.20315773785114288, -1.3767540454864502, -2.295680284500122, -0.265013724565506, -0.8186230659484863, -0.13251033425331116, -0.60514235496521, -1.0543209314346313, 1.593775749206543, 0.4624479413032532, -1.2547894716262817, -0.3255753517150879, -0.3644551634788513, -0.6083128452301025, 2.6255862712860107, -1.4013707637786865, -0.17278891801834106, -0.9611722230911255, -0.5557409524917603, 1.6184781789779663, -1.2491511106491089, -0.19881142675876617, -1.0632318258285522, -0.7053328156471252, -1.480909824371338, -0.5289775133132935, 0.03066188469529152, -0.9245968461036682, 0.7492203712463379, 0.2077944129705429, -1.1539254188537598, -0.21863609552383423, -0.8487118482589722, 0.8593479990959167, -0.16446353495121002, 0.36726757884025574, 1.9629745483398438, 0.42896077036857605, -0.4454553723335266, 0.5561960935592651, 1.1398355960845947, 0.7098833918571472, -0.6809598207473755, 0.1938597708940506, -0.6733204126358032, 0.2945534288883209, -1.4282175302505493, 0.22092868387699127, -2.8444409370422363, 0.7343162894248962, -0.01023789495229721, -0.07563918828964233, 0.05165008455514908, -1.3578641414642334, 0.9850218296051025, 2.6330318450927734, -1.1899646520614624, 0.3847420811653137, 0.3170852065086365, 1.2336602210998535, -1.6351014375686646, 0.2510577440261841, -0.42476534843444824, 2.1735432147979736, 0.0842927098274231, 1.1695870161056519, -0.37851130962371826, -2.1845719814300537, 0.6565203070640564, -1.186733365058899, -1.222208023071289, 0.8453620672225952, -0.8138395547866821, -0.08150321245193481, -1.4422451257705688, -0.05272016301751137, -1.0196201801300049, -1.2113847732543945, 0.9658495783805847, 0.053910691291093826, 0.535968542098999, -0.6317398548126221, 0.32879647612571716, -2.0316779613494873, -1.3255720138549805, -0.2427409291267395, -0.9663568735122681, 0.37782910466194153, -0.24307623505592346, 0.6406164765357971, -0.22155553102493286, 0.11751018464565277, 0.3966495990753174, 1.3484253883361816, 3.3895745277404785, 0.2774985432624817, 0.41975709795951843, -0.0216524600982666, -0.9623356461524963, 1.3672276735305786, 0.9292359352111816, -0.16286727786064148, -0.4345037341117859, -0.9649821519851685, 1.300142526626587, 1.903922438621521, 0.9894053936004639, 0.13807816803455353, -0.8635573983192444, -0.6803041100502014, 0.09236124157905579, 0.2167614996433258, 0.5039181113243103, 0.8089590668678284, 0.04432731494307518, 0.1528894454240799, 1.3008801937103271, 1.2509442567825317, -0.3783164918422699, 0.42492711544036865, -0.8387728929519653, -0.4972330927848816, 0.5888587236404419, 0.3532036244869232, 0.053184207528829575, 0.24418868124485016, -0.8966398239135742, -0.23705792427062988, -0.361564964056015, -0.9874908924102783, -0.7000356912612915, -0.4982459247112274, -0.3354231119155884, 1.58412504196167, -0.0458998903632164, -0.5018571019172668, -0.06613099575042725, -0.9120423197746277, -0.11307922005653381, -1.0272915363311768, 0.22238050401210785, -0.16020579636096954, -0.16494570672512054, -0.07621309161186218, 1.6244240999221802, -1.0007765293121338, -2.0687215328216553, 0.3024504482746124, 0.37374669313430786, -0.5210506916046143, 0.15093380212783813, 1.689530372619629, 0.46911919116973877, 1.484929084777832, 1.3541227579116821, 1.0279264450073242, -0.6035088896751404, -1.1699879169464111, 0.5719850659370422, 0.8498711585998535, -1.407258152961731, 0.9857450723648071, 0.021059270948171616, -0.5873546004295349, 0.6114329099655151, 1.2561888694763184, 0.3627287745475769, -1.813271403312683, 0.773209273815155, -0.7841107249259949, 0.731873631477356, 0.6019852161407471, 0.8908034563064575, 0.2221643179655075, 0.8870254755020142, -1.1617101430892944, -1.1276912689208984, -0.793280839920044, -0.5388674736022949, 1.819456934928894, -0.12995418906211853, 0.5228410959243774, -0.2018274962902069, -1.247058629989624, -0.10806269943714142, 0.7723796367645264, 0.37805286049842834, -0.4351467192173004, 0.8348076939582825, -0.6037231087684631, -1.0183669328689575, -1.3223296403884888, -0.4784772992134094, -0.9830271005630493, -0.8932104110717773, 1.0249693393707275, 0.8611388206481934, 0.2946343719959259, 1.9689042568206787, 0.4868726432323456, 0.2009098082780838, -2.7100918292999268, 0.9263843297958374, 0.255615234375, -0.14422567188739777, 0.9022479057312012, 0.32741835713386536, 1.052450180053711, -0.12162934243679047, 0.5324205160140991, -2.2380006313323975, 2.2829606533050537, -0.2605990171432495, 0.626532256603241, -0.00936911441385746, -0.17012430727481842, 1.1054267883300781, 0.47260716557502747, 0.5558500289916992, -1.1185983419418335, 0.8145609498023987, -0.6473440527915955, 1.1724709272384644, 0.9742058515548706, -0.9173025488853455, 0.022409290075302124, 1.2865893840789795, 0.5476483106613159, -0.46042686700820923, -0.9590352177619934, -0.8076976537704468, 1.0236560106277466, 1.7363133430480957, 0.0389641672372818, -0.07439975440502167, 0.8748528361320496, 0.6991127729415894, -1.2665456533432007, 0.22805620729923248, -0.7281125783920288, -0.7139477133750916, 1.6869542598724365, 1.9017565250396729, -0.04481397196650505, -0.12722137570381165, -0.7879601716995239, -1.1019097566604614, 0.8534964323043823, 0.09886015951633453, 0.08647860586643219, 0.6972394585609436, -0.6940169334411621, 1.28593111038208, 0.8853437304496765, 0.9352399706840515, 0.11044551432132721, 0.4424580931663513, 0.43988314270973206, -0.25401976704597473, -1.1306943893432617, -0.22329460084438324, -1.0829836130142212, -2.464993476867676, 0.582668125629425, -0.24249109625816345, -1.3281646966934204, -0.05892705172300339, -0.9676903486251831, 0.898622989654541, -0.5654754638671875, -1.1172579526901245, -1.4804960489273071, 0.24948547780513763, -0.09889446198940277, 0.8993300795555115, -1.5928561687469482, 0.09759116172790527, 1.2121410369873047, 0.870896577835083, -0.7171050310134888, 0.9722939133644104, 0.2727477550506592, 1.083150029182434, 0.9908981919288635, -0.4582451581954956, 0.4772443175315857, 0.12487374246120453, -1.3214142322540283, 0.42736032605171204, 1.0697007179260254, 0.25001031160354614, 1.3304775953292847, -0.5521224141120911, -0.0012817108072340488, 0.414075642824173, -0.47725600004196167, -0.46635445952415466, -0.719524085521698, 0.7426080703735352, 0.1509520709514618, -0.8347081542015076, 0.09569910168647766, -0.11408348381519318, -0.1653948277235031, 0.2228318154811859, -1.5010943412780762, -0.275869220495224, -0.29837387800216675, -0.5804114937782288, -1.2132197618484497, -0.046839967370033264, 1.4719611406326294, -0.7465663552284241, -0.13249428570270538, 0.581606388092041, 0.24169917404651642, 0.43740394711494446, 0.4892492890357971, -0.6546832919120789, -0.3627395033836365, -0.39622002840042114, -0.34932732582092285, 0.23276612162590027, 1.2635538578033447, -0.15530136227607727, -0.9651430249214172, 0.7072615623474121, -0.35173317790031433, 0.0162076186388731, 1.9254543781280518, 0.07915778458118439, -0.867243766784668, 0.32491573691368103, -0.6247590184211731, 1.9054609537124634, 1.814778447151184, 1.3523298501968384, -0.18648140132427216, -0.9247499108314514, 0.5882246494293213, -0.2572350800037384, -0.3678433895111084, 0.9731534719467163, 0.45739462971687317, -0.11751599609851837, -1.3671776056289673, 0.6356195211410522, 1.2482889890670776, -0.9252716898918152, -0.7257879376411438, 0.09560482203960419, -0.7899943590164185, 1.0112090110778809, 0.771794319152832, 0.4615934491157532, 0.2877363860607147, 1.6526625156402588, 0.6269902586936951, -0.4189400374889374, 0.46625271439552307, 0.4676540493965149, -0.14892815053462982, -2.0886616706848145, -1.0779674053192139, 0.2478991001844406, -0.43378183245658875, -1.5405628681182861, 1.3358118534088135, -1.3388012647628784, -0.8963102698326111, 0.6000357866287231, 0.14910531044006348, 1.558873176574707, 0.24429737031459808, 1.696844458580017, 2.1240923404693604, 0.8335143327713013, 0.32451996207237244, 1.4113363027572632, 0.02641923725605011, -0.3058912754058838, 1.8441416025161743, -0.5052491426467896, 0.5872579216957092, 1.1025041341781616, -0.42491477727890015, -0.9943844676017761, -0.8086233139038086, -1.2371257543563843, -0.7020105719566345, 1.1679012775421143, 0.12994089722633362, -1.1743589639663696, 0.2909906804561615, 1.6751161813735962, -0.06976310163736343, -0.29835399985313416, 0.6158087253570557, 0.4754510521888733, -0.702201783657074, -0.03259149193763733, -0.9379023909568787, 0.600134015083313, -0.19933569431304932, -0.2930884063243866, 0.3699927031993866, 0.36631855368614197, 1.2543747425079346, 0.1275211125612259, 0.12019068002700806, 1.2516732215881348, -1.3159871101379395, 1.4589475393295288, -0.6024541258811951, 0.24385996162891388, -2.510179281234741, 1.5386207103729248, -0.7490073442459106, 1.8918545246124268, -2.6338114738464355, 0.4234197735786438, -0.5626482367515564, -0.3868016004562378, 0.39211830496788025, -0.3853904604911804, 0.08927924931049347, -0.20715883374214172, -1.0092107057571411, -0.019393108785152435, -0.6937678456306458, 0.6770087480545044, 1.1682226657867432, 1.351420283317566, -1.1692709922790527, -0.28810402750968933, -1.8846808671951294, -0.16393016278743744, -0.5389232635498047, 0.37180647253990173, -1.9263561964035034, -0.1266767978668213, -1.9879014492034912, -2.476531505584717, -1.4785395860671997, -0.6938180923461914, 1.0382784605026245, 0.12714742124080658, -0.934981107711792, 1.1144871711730957, -0.44872036576271057, -1.772647500038147, 1.1554272174835205, -2.1439030170440674 ]
https://github.com/huggingface/datasets/issues/3162
`datasets-cli test` should work with datasets without scripts
I think it's become private, but feel free to try with any other dataset like `lhoestq/test` for example at `https://huggingface.co/datasets/lhoestq/test`
It would be really useful to be able to run `datasets-cli test`for datasets that don't have scripts attached to them (whether the datasets are private or not). I wasn't able to run the script for a private test dataset that I had created on the hub (https://huggingface.co/datasets/huggingface/DataMeasurementsTest/tree/main) -- although @lhoestq came to save the day!
1,146
20
`datasets-cli test` should work with datasets without scripts It would be really useful to be able to run `datasets-cli test`for datasets that don't have scripts attached to them (whether the datasets are private or not). I wasn't able to run the script for a private test dataset that I had created on the hub (https://huggingface.co/datasets/huggingface/DataMeasurementsTest/tree/main) -- although @lhoestq came to save the day! I think it's become private, but feel free to try with any other dataset like `lhoestq/test` for example at `https://huggingface.co/datasets/lhoestq/test`
[ -1.163761019706726, -0.9376861453056335, -0.8577979207038879, 1.4665597677230835, -0.026305940002202988, -1.2699612379074097, -0.01042240485548973, -1.0722997188568115, 1.6806116104125977, -0.7854085564613342, 0.338885635137558, -1.763633131980896, -0.03214478865265846, -0.5888956785202026, -0.7446228265762329, -0.8816575407981873, -0.4286297857761383, -0.7618444561958313, 0.8924193382263184, 2.5220022201538086, 1.032942771911621, -1.3309017419815063, 2.7814996242523193, 0.6003381609916687, -0.23148521780967712, -1.0389026403427124, 0.5742571353912354, 0.09688074141740799, -1.1593637466430664, -0.36185184121131897, -0.9836024641990662, 0.01527260709553957, -0.6616035103797913, -0.5986922383308411, 0.11163343489170074, 0.4196527898311615, -0.17494988441467285, -0.30728375911712646, -0.5673449039459229, -0.7007043361663818, 0.5384168028831482, -0.3169052302837372, 1.047742486000061, -0.45351818203926086, 1.8154537677764893, -0.5105369091033936, 0.2587151825428009, 0.6465685367584229, 1.4892070293426514, 0.14830945432186127, -0.016130095347762108, 0.26570039987564087, 0.4022170305252075, 0.03014994040131569, 0.41236886382102966, 1.1317845582962036, 0.5036405324935913, 0.6317822933197021, 0.6167469024658203, -2.2091848850250244, 1.3396985530853271, -0.9894285202026367, 0.32203230261802673, 1.3809783458709717, -0.9633331894874573, 0.4504636228084564, -1.775826334953308, -0.01966220512986183, 0.5346657633781433, -2.272669792175293, 0.06595690548419952, -1.1605126857757568, -0.45449942350387573, 1.0067787170410156, 0.2092904895544052, -1.2710553407669067, 0.27611595392227173, -0.45971444249153137, 1.078661561012268, 0.5274718403816223, 1.1715903282165527, -1.7105002403259277, 0.2653833329677582, -0.36741337180137634, -0.036622028797864914, -1.3833750486373901, -1.4705591201782227, 0.6023092865943909, 0.651028573513031, 0.718660295009613, -0.04395131766796112, 0.8575814962387085, -0.899979829788208, 0.7780365943908691, -0.8693718314170837, -1.5936099290847778, -1.2724745273590088, -2.2179079055786133, -2.409121036529541, 0.8130646347999573, -0.40795132517814636, -0.4935433566570282, 1.9280195236206055, -1.0009480714797974, -1.9450786113739014, 1.1063154935836792, 0.3065986633300781, 0.06457684189081192, 2.43066668510437, 0.1781761348247528, -0.6525625586509705, 0.4776307940483093, -0.6638220548629761, 0.8712028861045837, -0.3123018741607666, 1.4538544416427612, 0.6099217534065247, -1.1006317138671875, 1.7126057147979736, -0.41832417249679565, 0.5640624165534973, -0.6154617071151733, -0.5786576867103577, -0.916461169719696, 0.3442690074443817, 1.9159687757492065, -0.459062397480011, 1.6406375169754028, -0.4192839562892914, -1.5695263147354126, -1.5140650272369385, 0.7878903746604919, 0.5050318837165833, -0.8582067489624023, 0.07948609441518784, -0.4627453088760376, 0.12410590797662735, -0.01930549554526806, 1.103710412979126, 1.0617669820785522, 0.6677336096763611, -0.1938302218914032, -0.8755025863647461, 0.28292223811149597, 0.0214310921728611, -0.5963530540466309, -1.8575093746185303, -0.4061225354671478, 0.16683848202228546, 0.6238617897033691, -1.1659003496170044, 1.7299208641052246, 0.8956482410430908, 1.8901666402816772, 1.0057309865951538, -0.19241046905517578, 1.4588687419891357, -0.11191698163747787, 1.938515067100525, -0.46173879504203796, 0.6312456727027893, -0.303288996219635, -1.215947151184082, 0.812509298324585, -0.3542090356349945, -2.040515184402466, -0.9076069593429565, -0.9237930774688721, -0.1527310311794281, -0.8258495926856995, 0.9029669165611267, -0.3472612798213959, -1.4267555475234985, 0.12780843675136566, -0.5241314172744751, 0.23212440311908722, -1.3108614683151245, 0.26627856492996216, 0.7855725884437561, -0.7988602519035339, 0.018074359744787216, -0.2800639569759369, -1.4070228338241577, -0.5318511724472046, 0.2829452157020569, 2.0207080841064453, -0.7397987842559814, 0.9676622152328491, 0.8591418266296387, -0.8356894850730896, -0.00671521108597517, 0.3700191378593445, -0.2631109058856964, 0.8173933625221252, -1.0770094394683838, -0.39785173535346985, 1.1789661645889282, -0.2190731316804886, -0.7336121797561646, 1.4860477447509766, 0.8460562825202942, -1.0563465356826782, -0.18890701234340668, -0.3982526659965515, -0.8029278516769409, -0.043318022042512894, -1.523537039756775, -0.15718711912631989, 0.198808953166008, -1.390898585319519, -0.5174660086631775, -0.1975390911102295, 1.2151687145233154, -0.1856572926044464, 1.2530006170272827, -0.2777455449104309, -0.26870614290237427, -0.46673399209976196, -0.5440078377723694, 0.20018385350704193, -0.09880822896957397, -0.7628776431083679, 0.2493923306465149, -0.8546719551086426, 0.41558948159217834, 1.4614455699920654, 0.4410940110683441, 0.09605450183153152, 0.627048909664154, 1.0937838554382324, 0.2749409079551697, -0.10635049641132355, -0.9300270080566406, -1.569280982017517, 2.032984972000122, -1.4563536643981934, 1.8223037719726562, 0.6816686987876892, -0.11263291537761688, -1.7727982997894287, -1.7425473928451538, 1.5143134593963623, 1.2639634609222412, 2.2825276851654053, 0.6134977340698242, 0.37596404552459717, -0.8451239466667175, -0.8051707148551941, 0.3730051815509796, -1.0492722988128662, -0.8327387571334839, 0.12666672468185425, 2.3152379989624023, 1.7950718402862549, -0.5745515823364258, -0.26762548089027405, -1.086474895477295, 1.1407212018966675, -0.17417700588703156, 0.2426774501800537, 2.017284631729126, -0.5958763957023621, -1.0463807582855225, 1.3080952167510986, -2.37384033203125, 0.17123840749263763, 1.9614763259887695, 0.25225895643234253, 0.11734882742166519, -1.4661104679107666, -0.6352137327194214, -0.15717025101184845, -0.382856160402298, -1.3454164266586304, 0.5912549495697021, -0.25036555528640747, -0.8652642965316772, -1.437765121459961, 0.13808462023735046, -1.2259849309921265, -1.585571050643921, 0.4928864538669586, 1.8536995649337769, 2.118302583694458, -0.7572022676467896, 1.4637022018432617, -0.19443921744823456, 0.28595519065856934, 1.2888596057891846, 1.2761951684951782, 3.1095993518829346, 1.8944486379623413, -1.1394203901290894, 0.7841745018959045, -0.1928064376115799, -0.5449788570404053, 1.2576738595962524, -1.0163034200668335, 1.1986732482910156, -0.3368995785713196, -1.193023443222046, -1.4110733270645142, 0.9611796736717224, 0.48787611722946167, -0.05005466192960739, -0.4549015462398529, 1.2714579105377197, 0.049616698175668716, 1.2584915161132812, 0.4641741216182709, -0.4709145128726959, 0.5525687336921692, -0.45080333948135376, -0.5332328677177429, 1.5205111503601074, 0.1282612383365631, -1.5158836841583252, -2.2645537853240967, -0.2583005428314209, -0.7858632802963257, -0.17696234583854675, -0.6358844041824341, -0.9911264181137085, 1.506974458694458, 0.4707706868648529, -1.2819716930389404, -0.22429978847503662, -0.3174252212047577, -0.6562029719352722, 2.5930862426757812, -1.4137699604034424, -0.2117331326007843, -0.876745879650116, -0.552643358707428, 1.6956303119659424, -1.1678273677825928, -0.167939230799675, -1.0151069164276123, -0.7109692692756653, -1.4536644220352173, -0.5390222668647766, 0.013439689762890339, -0.9702905416488647, 0.737370491027832, 0.06751890480518341, -1.0339581966400146, -0.21355141699314117, -0.8378115296363831, 0.9581384658813477, -0.19320809841156006, 0.32124629616737366, 1.8595038652420044, 0.4504951238632202, -0.43749868869781494, 0.6280431747436523, 1.2078611850738525, 0.6869089603424072, -0.659415602684021, 0.23187528550624847, -0.7481212019920349, 0.28648698329925537, -1.3703516721725464, 0.23442286252975464, -2.930044651031494, 0.6807510256767273, -0.11896564811468124, -0.08915383368730545, -0.010065115988254547, -1.2956514358520508, 1.009418249130249, 2.505537509918213, -1.203742265701294, 0.4173796772956848, 0.3634074330329895, 1.1710166931152344, -1.4876328706741333, 0.1715712994337082, -0.4380292296409607, 2.106553554534912, 0.0802915096282959, 1.1239269971847534, -0.4984976649284363, -2.0442306995391846, 0.6777365803718567, -1.314709186553955, -1.185694932937622, 0.802520215511322, -0.7831822037696838, 0.07163852453231812, -1.4513362646102905, -0.12234549224376678, -1.004775881767273, -1.2236796617507935, 0.9391249418258667, 0.16391894221305847, 0.5578349828720093, -0.5997087955474854, 0.37495118379592896, -2.0876047611236572, -1.3762136697769165, -0.26314777135849, -0.9771726131439209, 0.4491260051727295, -0.22834132611751556, 0.5979262590408325, -0.18743644654750824, 0.08725455403327942, 0.3166337013244629, 1.3221596479415894, 3.3969318866729736, 0.2536175847053528, 0.4401201009750366, -0.06406554579734802, -0.9570311903953552, 1.416395664215088, 1.0235035419464111, -0.07246224582195282, -0.439340740442276, -0.9969979524612427, 1.2787219285964966, 1.8929334878921509, 1.070837140083313, 0.10475220531225204, -0.8638282418251038, -0.6933891177177429, 0.02511860430240631, 0.18727879226207733, 0.46084433794021606, 0.8096504807472229, -0.07188677042722702, 0.17378392815589905, 1.352829933166504, 1.281380534172058, -0.4281077980995178, 0.3725823163986206, -0.8893435597419739, -0.4465234577655792, 0.5203782916069031, 0.32202181220054626, 0.04453006386756897, 0.2968178987503052, -0.9445375204086304, -0.23734734952449799, -0.272865891456604, -1.0305160284042358, -0.7499368190765381, -0.4633370637893677, -0.3998551070690155, 1.560196042060852, -0.01253450382500887, -0.555621862411499, -0.05564848333597183, -0.938166618347168, -0.20370617508888245, -1.0245052576065063, 0.15189576148986816, -0.1691177785396576, -0.1132424846291542, -0.21087901294231415, 1.6983095407485962, -1.0757132768630981, -2.200514793395996, 0.26659250259399414, 0.31815746426582336, -0.3976910710334778, 0.1474243551492691, 1.6771057844161987, 0.498853474855423, 1.478297472000122, 1.3796099424362183, 0.9896758794784546, -0.5969488620758057, -1.2228598594665527, 0.6105524301528931, 0.9258735179901123, -1.3659592866897583, 0.880034327507019, -0.04404515027999878, -0.49762576818466187, 0.7257858514785767, 1.224950909614563, 0.375730037689209, -1.8831477165222168, 0.7453212141990662, -0.8480826616287231, 0.721319854259491, 0.6917208433151245, 0.8844910860061646, 0.3274947702884674, 0.897081732749939, -1.1360702514648438, -1.1943672895431519, -0.8457496762275696, -0.5192835330963135, 1.9499475955963135, -0.20945289731025696, 0.5868408679962158, -0.14872193336486816, -1.228521466255188, -0.14954741299152374, 0.8155438303947449, 0.38145461678504944, -0.4675023555755615, 0.7492024302482605, -0.624858558177948, -0.9731943607330322, -1.3854436874389648, -0.47366586327552795, -1.0281685590744019, -0.864126980304718, 1.0227769613265991, 0.8101339340209961, 0.3787376880645752, 1.9356192350387573, 0.5297056436538696, 0.3039209544658661, -2.7193946838378906, 0.8889931440353394, 0.3097631633281708, -0.0515182763338089, 0.8735930919647217, 0.321045458316803, 1.1137152910232544, -0.1131911650300026, 0.5338934659957886, -2.1684987545013428, 2.1884219646453857, -0.19640401005744934, 0.6034115552902222, -0.007519153878092766, -0.13026267290115356, 1.187217116355896, 0.48924070596694946, 0.5785959959030151, -1.1859233379364014, 0.76054847240448, -0.6374625563621521, 1.1687953472137451, 1.0121314525604248, -0.9007938504219055, 0.03999270498752594, 1.317155361175537, 0.5371727347373962, -0.33277979493141174, -0.9614169597625732, -0.7896211743354797, 1.080732822418213, 1.7594062089920044, -0.03419192507863045, -0.05592576786875725, 0.8975468277931213, 0.6487619280815125, -1.2517584562301636, 0.07141947001218796, -0.729929506778717, -0.6172575354576111, 1.7417641878128052, 1.9296627044677734, -0.10111965984106064, -0.1283709555864334, -0.8141158819198608, -1.1340322494506836, 0.7849907875061035, 0.09185488522052765, 0.004827110096812248, 0.7409473061561584, -0.7856399416923523, 1.3037644624710083, 0.8447584509849548, 0.886040985584259, 0.037312932312488556, 0.3825542628765106, 0.35709166526794434, -0.21829098463058472, -1.1714788675308228, -0.2820538580417633, -1.0733070373535156, -2.5255959033966064, 0.4368100166320801, -0.2563251256942749, -1.303728461265564, -0.06075407192111015, -1.044277548789978, 0.964837908744812, -0.5154903531074524, -1.112898349761963, -1.5510659217834473, 0.31401753425598145, -0.08065175265073776, 0.8442100286483765, -1.6497689485549927, 0.03379373997449875, 1.1992164850234985, 0.9279760718345642, -0.698472261428833, 1.0424559116363525, 0.2908325493335724, 1.0187172889709473, 0.8258586525917053, -0.46858546137809753, 0.5473530888557434, 0.08349863439798355, -1.3090277910232544, 0.3696534335613251, 1.0395702123641968, 0.17518705129623413, 1.2801234722137451, -0.6071167588233948, 0.06748304516077042, 0.5100783109664917, -0.5046934485435486, -0.5025299787521362, -0.648703932762146, 0.7989780306816101, 0.05164097622036934, -0.8611391186714172, 0.06597891449928284, -0.04746289178729057, -0.21788306534290314, 0.24967965483665466, -1.4599069356918335, -0.36945101618766785, -0.33028697967529297, -0.5379686951637268, -1.3048748970031738, 0.05953401327133179, 1.3620771169662476, -0.7628007531166077, -0.2110014408826828, 0.6110321879386902, 0.2977801263332367, 0.4371543824672699, 0.535283088684082, -0.7099029421806335, -0.2961522042751312, -0.3394794166088104, -0.23885022103786469, 0.26330429315567017, 1.3012076616287231, -0.20803874731063843, -0.9932562708854675, 0.7728936076164246, -0.425594687461853, 0.05290287360548973, 1.9600111246109009, -0.002297616098076105, -0.8739140033721924, 0.4154670238494873, -0.7977171540260315, 1.9437501430511475, 1.7225191593170166, 1.347764492034912, -0.1447819322347641, -0.8109644651412964, 0.6310339570045471, -0.18481886386871338, -0.2889150083065033, 1.0174281597137451, 0.40088507533073425, -0.1446206122636795, -1.4319300651550293, 0.599484384059906, 1.3328617811203003, -0.7847824096679688, -0.7629887461662292, 0.12674617767333984, -0.8883199691772461, 1.06161630153656, 0.7656267285346985, 0.4647769629955292, 0.21407194435596466, 1.560267448425293, 0.5980567932128906, -0.44840285181999207, 0.4456993639469147, 0.4863094091415405, -0.08460351079702377, -2.0603291988372803, -1.0236258506774902, 0.2539205849170685, -0.4155900478363037, -1.5064164400100708, 1.3079279661178589, -1.2045403718948364, -0.8226481676101685, 0.6640740036964417, 0.12559211254119873, 1.514350414276123, 0.2511554956436157, 1.6564586162567139, 2.073694944381714, 0.8906683325767517, 0.3182316720485687, 1.42998468875885, -0.08168081194162369, -0.28411203622817993, 1.8753409385681152, -0.5060078501701355, 0.5391518473625183, 1.0417511463165283, -0.4030838906764984, -0.9476919770240784, -0.7430105209350586, -1.146139144897461, -0.6743025183677673, 1.1315187215805054, 0.19257275760173798, -1.2128678560256958, 0.1811676025390625, 1.5592217445373535, 0.005620988085865974, -0.2269524335861206, 0.6143263578414917, 0.5092504024505615, -0.7371647953987122, -0.016336984932422638, -0.8919497728347778, 0.57635498046875, -0.2369963824748993, -0.27735039591789246, 0.2983112037181854, 0.37845903635025024, 1.2344858646392822, 0.001570836640894413, 0.15787634253501892, 1.1816411018371582, -1.3679351806640625, 1.4548113346099854, -0.6244266033172607, 0.2590096592903137, -2.5432519912719727, 1.4914511442184448, -0.7686505913734436, 1.913171648979187, -2.660700798034668, 0.4180070757865906, -0.6065179109573364, -0.38152366876602173, 0.3083442747592926, -0.4035189151763916, 0.030330058187246323, -0.11415286362171173, -0.9959138631820679, 0.006591037847101688, -0.6721106767654419, 0.636941134929657, 1.2000800371170044, 1.2812999486923218, -1.1518309116363525, -0.3118974566459656, -1.8253107070922852, -0.17178185284137726, -0.5661587119102478, 0.3511750400066376, -2.0219030380249023, -0.1950695514678955, -1.9489909410476685, -2.444791555404663, -1.4900786876678467, -0.6677292585372925, 1.1015456914901733, 0.17035289108753204, -0.9723052978515625, 1.1773600578308105, -0.42908015847206116, -1.7435777187347412, 1.1531016826629639, -2.2547378540039062 ]
https://github.com/huggingface/datasets/issues/3162
`datasets-cli test` should work with datasets without scripts
> I think it's become private, but feel free to try with any other dataset like `lhoestq/test` for example at `https://huggingface.co/datasets/lhoestq/test` your example repo and this page `https://huggingface.co/docs/datasets/add_dataset.html` helped me to solve.. thanks a lot
It would be really useful to be able to run `datasets-cli test`for datasets that don't have scripts attached to them (whether the datasets are private or not). I wasn't able to run the script for a private test dataset that I had created on the hub (https://huggingface.co/datasets/huggingface/DataMeasurementsTest/tree/main) -- although @lhoestq came to save the day!
1,146
35
`datasets-cli test` should work with datasets without scripts It would be really useful to be able to run `datasets-cli test`for datasets that don't have scripts attached to them (whether the datasets are private or not). I wasn't able to run the script for a private test dataset that I had created on the hub (https://huggingface.co/datasets/huggingface/DataMeasurementsTest/tree/main) -- although @lhoestq came to save the day! > I think it's become private, but feel free to try with any other dataset like `lhoestq/test` for example at `https://huggingface.co/datasets/lhoestq/test` your example repo and this page `https://huggingface.co/docs/datasets/add_dataset.html` helped me to solve.. thanks a lot
[ -1.150272250175476, -0.9474900960922241, -0.8543606996536255, 1.4536614418029785, -0.03737078979611397, -1.2567919492721558, -0.007090888451784849, -1.0671882629394531, 1.7060550451278687, -0.7607552409172058, 0.3495774567127228, -1.7745420932769775, -0.05551745370030403, -0.5921940803527832, -0.7680795788764954, -0.8866550326347351, -0.40491628646850586, -0.7558256983757019, 0.87795090675354, 2.546067953109741, 1.0654186010360718, -1.3336613178253174, 2.7357065677642822, 0.6167789697647095, -0.2222084105014801, -1.02080237865448, 0.5693650245666504, 0.07354363054037094, -1.2144421339035034, -0.374470055103302, -0.961098313331604, 0.017557326704263687, -0.617371141910553, -0.5960039496421814, 0.08050035685300827, 0.4285944700241089, -0.19443750381469727, -0.28438007831573486, -0.5512846112251282, -0.7366083860397339, 0.4660356938838959, -0.3253535330295563, 1.0203959941864014, -0.44936755299568176, 1.8390345573425293, -0.5280337333679199, 0.30898040533065796, 0.6413099765777588, 1.4141004085540771, 0.15310195088386536, 0.005642072297632694, 0.2382057011127472, 0.43018606305122375, 0.03741101548075676, 0.385952889919281, 1.135377287864685, 0.47961756587028503, 0.621910035610199, 0.6228354573249817, -2.274559259414673, 1.3561954498291016, -0.953910768032074, 0.3119746446609497, 1.380378246307373, -0.9521508812904358, 0.3797212243080139, -1.7696397304534912, -0.026283346116542816, 0.5876283049583435, -2.251002073287964, 0.034017398953437805, -1.184017539024353, -0.4921204447746277, 1.001459002494812, 0.2346101999282837, -1.2562602758407593, 0.25137895345687866, -0.4142688512802124, 1.0585678815841675, 0.5424641966819763, 1.1678773164749146, -1.7767935991287231, 0.18748053908348083, -0.3554184138774872, 0.012506590224802494, -1.3805850744247437, -1.5299739837646484, 0.6020128130912781, 0.6543533802032471, 0.6841856241226196, -0.06775534152984619, 0.873495876789093, -0.9054007530212402, 0.7831268906593323, -0.9189183115959167, -1.636497974395752, -1.3121908903121948, -2.246643543243408, -2.3961164951324463, 0.7745557427406311, -0.42614781856536865, -0.4681786000728607, 1.8929568529129028, -1.0169885158538818, -1.901174783706665, 1.077345371246338, 0.2986978590488434, 0.10717698931694031, 2.4037976264953613, 0.1863202601671219, -0.6576758623123169, 0.4462953805923462, -0.6548351645469666, 0.8203400373458862, -0.3018213212490082, 1.4710193872451782, 0.6301755905151367, -1.0736502408981323, 1.6699042320251465, -0.4585038721561432, 0.5443103909492493, -0.6649738550186157, -0.5554178953170776, -0.8651652336120605, 0.3307770788669586, 1.8824809789657593, -0.4238281846046448, 1.6404708623886108, -0.4131595492362976, -1.596091389656067, -1.5637364387512207, 0.771733283996582, 0.47991374135017395, -0.8547677993774414, 0.08588355779647827, -0.4575909376144409, 0.14502090215682983, -0.05224191024899483, 1.1419031620025635, 1.1062835454940796, 0.6523625254631042, -0.23999249935150146, -0.8462252020835876, 0.2758375406265259, -0.011463029310107231, -0.5988285541534424, -1.8424994945526123, -0.406747043132782, 0.19813446700572968, 0.6178516745567322, -1.141543984413147, 1.7551419734954834, 0.8497491478919983, 1.9061106443405151, 1.014555811882019, -0.19931858777999878, 1.4760406017303467, -0.08975289016962051, 1.9275751113891602, -0.5324441194534302, 0.6152767539024353, -0.29556527733802795, -1.165637731552124, 0.843701183795929, -0.36747559905052185, -2.022449016571045, -0.869386613368988, -0.8903760313987732, -0.18108132481575012, -0.8047993183135986, 0.8940321207046509, -0.32566356658935547, -1.4309808015823364, 0.18132978677749634, -0.5754052996635437, 0.16300110518932343, -1.2451187372207642, 0.24317388236522675, 0.8068397045135498, -0.7716292142868042, 0.0029734745621681213, -0.267778605222702, -1.389431357383728, -0.5352484583854675, 0.3036506474018097, 2.036378860473633, -0.6873157620429993, 0.9320580363273621, 0.8847025632858276, -0.7763647437095642, 0.05277020484209061, 0.37800294160842896, -0.26549863815307617, 0.8030405640602112, -1.0741171836853027, -0.33810940384864807, 1.1740046739578247, -0.21155288815498352, -0.7728320956230164, 1.5039499998092651, 0.8507301211357117, -1.026379942893982, -0.17010875046253204, -0.33710286021232605, -0.7853368520736694, -0.022560611367225647, -1.5794756412506104, -0.13831640779972076, 0.1579248011112213, -1.3900588750839233, -0.5166200995445251, -0.22818204760551453, 1.2408521175384521, -0.20281299948692322, 1.2556487321853638, -0.29772818088531494, -0.2765714228153229, -0.44233769178390503, -0.5196298956871033, 0.1676979809999466, -0.15443283319473267, -0.7234818339347839, 0.29785487055778503, -0.8702036142349243, 0.41713374853134155, 1.4709502458572388, 0.4153609573841095, 0.10468508303165436, 0.6014050841331482, 1.078047752380371, 0.2464083880186081, -0.056196339428424835, -0.9115927219390869, -1.625630259513855, 2.0481455326080322, -1.42269766330719, 1.872638463973999, 0.6998123526573181, -0.08592026680707932, -1.783174753189087, -1.7636665105819702, 1.4942289590835571, 1.20854651927948, 2.3322441577911377, 0.6255186796188354, 0.3421195447444916, -0.8021451234817505, -0.7680314183235168, 0.42092594504356384, -1.015133261680603, -0.8176266551017761, 0.15583467483520508, 2.310072183609009, 1.7812175750732422, -0.5743058919906616, -0.2671099901199341, -1.064466118812561, 1.1780225038528442, -0.1665608137845993, 0.23233720660209656, 2.03147292137146, -0.5316442251205444, -1.0461444854736328, 1.3482049703598022, -2.342576265335083, 0.15882445871829987, 1.9876595735549927, 0.2504769563674927, 0.1366257518529892, -1.4541480541229248, -0.6746170520782471, -0.2109268754720688, -0.41116538643836975, -1.3240516185760498, 0.5758585333824158, -0.2799851596355438, -0.8576231002807617, -1.4521255493164062, 0.12753598392009735, -1.2100311517715454, -1.5977859497070312, 0.43819841742515564, 1.8187382221221924, 2.05654239654541, -0.7200067639350891, 1.4614969491958618, -0.19676360487937927, 0.22087512910366058, 1.3392645120620728, 1.2848204374313354, 3.1197400093078613, 1.8861886262893677, -1.1312503814697266, 0.836074709892273, -0.2032892405986786, -0.5285071730613708, 1.253488540649414, -1.0175176858901978, 1.1767534017562866, -0.30166515707969666, -1.1928337812423706, -1.402695655822754, 0.9815497994422913, 0.47356271743774414, -0.03824349865317345, -0.5596563816070557, 1.275458574295044, 0.04365181922912598, 1.245948076248169, 0.47141215205192566, -0.4841771721839905, 0.5422592163085938, -0.4621318578720093, -0.5522449612617493, 1.561592698097229, 0.19079123437404633, -1.4882183074951172, -2.270158290863037, -0.22467023134231567, -0.8278644680976868, -0.20637235045433044, -0.6174643635749817, -1.02682363986969, 1.5694595575332642, 0.49601736664772034, -1.3200680017471313, -0.2085452824831009, -0.32590872049331665, -0.658578634262085, 2.6088151931762695, -1.380486011505127, -0.19767403602600098, -0.9186449646949768, -0.545789361000061, 1.658532738685608, -1.1983288526535034, -0.14452360570430756, -1.0289783477783203, -0.7057247757911682, -1.426376223564148, -0.516907811164856, 0.07762707769870758, -0.9064801335334778, 0.7656116485595703, 0.054956208914518356, -1.0777363777160645, -0.22473885118961334, -0.8665890097618103, 0.9881175756454468, -0.1579623520374298, 0.3343496024608612, 1.8819652795791626, 0.4903113842010498, -0.47505536675453186, 0.5811932682991028, 1.2106263637542725, 0.6914239525794983, -0.6803488731384277, 0.24312599003314972, -0.7358543276786804, 0.2887415587902069, -1.3884806632995605, 0.23166194558143616, -2.9164488315582275, 0.7254387140274048, -0.0783306285738945, -0.13321994245052338, 0.015761848539114, -1.2722715139389038, 1.037238597869873, 2.5441620349884033, -1.2361719608306885, 0.4098931550979614, 0.33971524238586426, 1.1419061422348022, -1.4868333339691162, 0.23668581247329712, -0.43634042143821716, 2.096449613571167, 0.11738365143537521, 1.1331557035446167, -0.48985743522644043, -2.0604069232940674, 0.6655369400978088, -1.295941710472107, -1.1403288841247559, 0.7954909801483154, -0.7838255167007446, 0.07023819535970688, -1.457884669303894, -0.10593586415052414, -1.002732753753662, -1.2216523885726929, 0.961448609828949, 0.16030259430408478, 0.5335813760757446, -0.596885085105896, 0.3996073305606842, -2.070521354675293, -1.3782103061676025, -0.2449311912059784, -0.9491494297981262, 0.46534520387649536, -0.22269877791404724, 0.6050161123275757, -0.15677714347839355, 0.08986896276473999, 0.3539528250694275, 1.3169323205947876, 3.4241769313812256, 0.23306666314601898, 0.40294474363327026, -0.05108514800667763, -0.9903514981269836, 1.4049512147903442, 0.9847010374069214, -0.03677685558795929, -0.4577866494655609, -1.0331828594207764, 1.280842661857605, 1.9280389547348022, 1.100063443183899, 0.14137133955955505, -0.8533419370651245, -0.7058737874031067, 0.03505219519138336, 0.17452958226203918, 0.42900538444519043, 0.8116855025291443, -0.05492466315627098, 0.1532312035560608, 1.3965822458267212, 1.2751710414886475, -0.3748567998409271, 0.41717007756233215, -0.9174566864967346, -0.42179960012435913, 0.5225176811218262, 0.3151471018791199, 0.06445858627557755, 0.35538479685783386, -0.9746493697166443, -0.22475841641426086, -0.29417458176612854, -1.0270648002624512, -0.7165390849113464, -0.543013334274292, -0.38007310032844543, 1.5779324769973755, -0.0009552193805575371, -0.48901620507240295, -0.04451795667409897, -0.9204363226890564, -0.1953689604997635, -1.0450152158737183, 0.20120769739151, -0.14914225041866302, -0.10276574641466141, -0.19842146337032318, 1.7383272647857666, -1.0549544095993042, -2.186819553375244, 0.2631913423538208, 0.32649803161621094, -0.4571801722049713, 0.16240021586418152, 1.638654351234436, 0.5143606066703796, 1.4369938373565674, 1.3291840553283691, 1.0272190570831299, -0.5820097923278809, -1.2290107011795044, 0.6290950775146484, 0.868812620639801, -1.3400880098342896, 0.956308126449585, -0.05043438822031021, -0.5007578134536743, 0.7530295848846436, 1.2426854372024536, 0.3628411889076233, -1.83285391330719, 0.7166855335235596, -0.803345799446106, 0.7158612012863159, 0.6645311117172241, 0.8964036703109741, 0.25723996758461, 0.9173754453659058, -1.186323881149292, -1.1937557458877563, -0.8289307355880737, -0.5331491827964783, 1.9203087091445923, -0.14510400593280792, 0.5704612135887146, -0.18915186822414398, -1.2518233060836792, -0.12023407220840454, 0.8235242366790771, 0.3827078938484192, -0.48416590690612793, 0.8055543899536133, -0.6238423585891724, -0.9581131339073181, -1.3492084741592407, -0.462047278881073, -1.0092270374298096, -0.8685268759727478, 1.0308504104614258, 0.7816808819770813, 0.4313489496707916, 1.944218635559082, 0.4937901198863983, 0.33344921469688416, -2.7142179012298584, 0.8689085841178894, 0.2449505478143692, -0.015558487735688686, 0.9051777124404907, 0.2835761308670044, 1.147549033164978, -0.13048896193504333, 0.5679478645324707, -2.170386552810669, 2.206897735595703, -0.2348746657371521, 0.6217417120933533, -0.05548935383558273, -0.15512345731258392, 1.1369187831878662, 0.5039946436882019, 0.5835005640983582, -1.1874960660934448, 0.7611491084098816, -0.6548556685447693, 1.1256920099258423, 1.0074704885482788, -0.9095933437347412, 0.024536453187465668, 1.3001049757003784, 0.5044687986373901, -0.3958323895931244, -0.9051680564880371, -0.7777708172798157, 1.047885537147522, 1.731469750404358, -0.02292904630303383, -0.06740831583738327, 0.9350002408027649, 0.637384295463562, -1.2734272480010986, 0.10362406820058823, -0.7217879295349121, -0.6082671880722046, 1.7329154014587402, 1.9472397565841675, -0.08650948852300644, -0.12746945023536682, -0.7800804972648621, -1.097452998161316, 0.75201815366745, 0.11423645168542862, 0.0016054073348641396, 0.7429580092430115, -0.7149224281311035, 1.2582612037658691, 0.8167378306388855, 0.9735792875289917, 0.04295201227068901, 0.43890896439552307, 0.38180238008499146, -0.2843153178691864, -1.210081696510315, -0.3334464728832245, -1.0974739789962769, -2.549701690673828, 0.4794124364852905, -0.25611355900764465, -1.3321266174316406, -0.042476437985897064, -1.0557351112365723, 0.9521676898002625, -0.5119248628616333, -1.134124994277954, -1.5161586999893188, 0.30323851108551025, -0.14023461937904358, 0.8632050156593323, -1.6487585306167603, 0.036174483597278595, 1.226639747619629, 0.8860689401626587, -0.6451929211616516, 0.9986743927001953, 0.253167986869812, 1.0168821811676025, 0.862865149974823, -0.44964343309402466, 0.5149029493331909, 0.11056380718946457, -1.3145843744277954, 0.3416546881198883, 1.0379172563552856, 0.21389824151992798, 1.2644684314727783, -0.5611924529075623, 0.09447789192199707, 0.4610029458999634, -0.5312415957450867, -0.5166433453559875, -0.6015315055847168, 0.806155800819397, 0.11158590763807297, -0.8566995859146118, 0.037652645260095596, -0.029993176460266113, -0.1830211728811264, 0.1985514760017395, -1.4731792211532593, -0.33789336681365967, -0.30758732557296753, -0.5071393251419067, -1.3164288997650146, -0.0025456571020185947, 1.3491411209106445, -0.7849380970001221, -0.1777908205986023, 0.5616618990898132, 0.3145410120487213, 0.5091592073440552, 0.5410884022712708, -0.6851838827133179, -0.3220769762992859, -0.35838568210601807, -0.28307434916496277, 0.23467838764190674, 1.269665241241455, -0.18750214576721191, -1.0026185512542725, 0.7687697410583496, -0.4296663999557495, 0.07096394151449203, 1.9679185152053833, -0.01080551277846098, -0.8633655309677124, 0.353149950504303, -0.7390000224113464, 1.8921633958816528, 1.7361661195755005, 1.350433588027954, -0.13591493666172028, -0.8594242930412292, 0.5642910003662109, -0.21769869327545166, -0.3501279056072235, 0.9955248832702637, 0.3862692713737488, -0.15077227354049683, -1.3725883960723877, 0.5672329664230347, 1.345715880393982, -0.8468427658081055, -0.7638770341873169, 0.1471707969903946, -0.919248104095459, 1.045395851135254, 0.7353081107139587, 0.45725569128990173, 0.25469258427619934, 1.5332103967666626, 0.596007227897644, -0.46215546131134033, 0.443162202835083, 0.47632452845573425, -0.11866869777441025, -2.029829263687134, -1.036767601966858, 0.26825833320617676, -0.4273059368133545, -1.503225564956665, 1.27913498878479, -1.2322500944137573, -0.8640530705451965, 0.6434532403945923, 0.14734569191932678, 1.5001012086868286, 0.23375800251960754, 1.667406678199768, 2.1142683029174805, 0.7860622406005859, 0.333232581615448, 1.421437382698059, -0.04725242778658867, -0.33025676012039185, 1.8500977754592896, -0.4644465744495392, 0.5904294848442078, 1.0186790227890015, -0.34674400091171265, -0.9853858947753906, -0.7864413261413574, -1.131144404411316, -0.6576423048973083, 1.1530710458755493, 0.1686403751373291, -1.2665040493011475, 0.18356753885746002, 1.6056394577026367, 0.007630358450114727, -0.23172765970230103, 0.6274058818817139, 0.5105913877487183, -0.7107614278793335, -0.02607845515012741, -0.9529353380203247, 0.5559568405151367, -0.19731560349464417, -0.27956679463386536, 0.2786509096622467, 0.40493831038475037, 1.2567485570907593, -0.014467194676399231, 0.15307824313640594, 1.258238434791565, -1.3533544540405273, 1.4639416933059692, -0.5968359112739563, 0.26816046237945557, -2.5579397678375244, 1.5174367427825928, -0.7734038233757019, 1.8965051174163818, -2.6612489223480225, 0.39951401948928833, -0.564724326133728, -0.41687068343162537, 0.31200525164604187, -0.3930484354496002, 0.04560443386435509, -0.13140003383159637, -0.9646052718162537, -0.028237782418727875, -0.6792120337486267, 0.606740415096283, 1.2050551176071167, 1.3163596391677856, -1.137846827507019, -0.3372114300727844, -1.8574059009552002, -0.1583249717950821, -0.6211685538291931, 0.3539998233318329, -2.024358034133911, -0.15147548913955688, -1.9405118227005005, -2.488312244415283, -1.49576997756958, -0.7313709855079651, 1.047922968864441, 0.1656578630208969, -0.9503858685493469, 1.112722396850586, -0.4079846441745758, -1.7890995740890503, 1.1016716957092285, -2.240079879760742 ]
https://github.com/huggingface/datasets/issues/3155
Illegal instruction (core dumped) at datasets import
It seems to be an issue with how conda-forge is building the binaries. It works on some machines, but not a machine with AMD Opteron 8384 processors.
## Describe the bug I install datasets using conda and when I import datasets I get: "Illegal instruction (core dumped)" ## Steps to reproduce the bug ``` conda create --prefix path/to/env conda activate path/to/env conda install -c huggingface -c conda-forge datasets # exits with output "Illegal instruction (core dumped)" python -m datasets ``` ## Environment info When I run "datasets-cli env", I also get "Illegal instruction (core dumped)" If I run the following commands: ``` conda create --prefix path/to/another/new/env conda activate path/to/another/new/env conda install -c huggingface transformers transformers-cli env ``` Then I get: - `transformers` version: 4.11.3 - Platform: Linux-5.4.0-67-generic-x86_64-with-glibc2.17 - Python version: 3.8.12 - PyTorch version (GPU?): not installed (NA) - Tensorflow version (GPU?): not installed (NA) - Flax version (CPU?/GPU?/TPU?): not installed (NA) - Jax version: not installed - JaxLib version: not installed - Using GPU in script?: No - Using distributed or parallel set-up in script?: No Let me know what additional information you need in order to debug this issue. Thanks in advance!
1,147
27
Illegal instruction (core dumped) at datasets import ## Describe the bug I install datasets using conda and when I import datasets I get: "Illegal instruction (core dumped)" ## Steps to reproduce the bug ``` conda create --prefix path/to/env conda activate path/to/env conda install -c huggingface -c conda-forge datasets # exits with output "Illegal instruction (core dumped)" python -m datasets ``` ## Environment info When I run "datasets-cli env", I also get "Illegal instruction (core dumped)" If I run the following commands: ``` conda create --prefix path/to/another/new/env conda activate path/to/another/new/env conda install -c huggingface transformers transformers-cli env ``` Then I get: - `transformers` version: 4.11.3 - Platform: Linux-5.4.0-67-generic-x86_64-with-glibc2.17 - Python version: 3.8.12 - PyTorch version (GPU?): not installed (NA) - Tensorflow version (GPU?): not installed (NA) - Flax version (CPU?/GPU?/TPU?): not installed (NA) - Jax version: not installed - JaxLib version: not installed - Using GPU in script?: No - Using distributed or parallel set-up in script?: No Let me know what additional information you need in order to debug this issue. Thanks in advance! It seems to be an issue with how conda-forge is building the binaries. It works on some machines, but not a machine with AMD Opteron 8384 processors.
[ -1.1604241132736206, -0.8478537201881409, -0.8028604388237, 1.4558141231536865, -0.07892651855945587, -1.3258373737335205, 0.08724900335073471, -1.0436246395111084, 1.664594292640686, -0.7512722611427307, 0.3415481746196747, -1.734424352645874, 0.10133332014083862, -0.5856462717056274, -0.8197451233863831, -0.776850163936615, -0.38313645124435425, -0.7858338356018066, 1.0810465812683105, 2.5682735443115234, 1.2345409393310547, -1.4170624017715454, 2.7531423568725586, 0.6637507081031799, -0.1821872591972351, -0.8740435838699341, 0.4760863184928894, -0.08400297164916992, -1.2819775342941284, -0.46060076355934143, -0.8869306445121765, -0.11912570148706436, -0.502903163433075, -0.5757649540901184, 0.03158154338598251, 0.4032864272594452, -0.2410636693239212, -0.45371705293655396, -0.48579391837120056, -0.8167573809623718, 0.5621322393417358, -0.2939647138118744, 0.9014776349067688, -0.3701535165309906, 1.8285436630249023, -0.6066879630088806, 0.47354909777641296, 0.7032758593559265, 1.4065724611282349, 0.27100852131843567, -0.13063885271549225, 0.4180050790309906, 0.2473122775554657, -0.03707733377814293, 0.5795179009437561, 1.1991738080978394, 0.6366592049598694, 0.46599408984184265, 0.7163572907447815, -2.161530017852783, 1.3021990060806274, -1.0549259185791016, 0.32902517914772034, 1.289267897605896, -0.9237182140350342, 0.35861408710479736, -1.8325093984603882, -0.11014969646930695, 0.4629843235015869, -2.1930296421051025, 0.28977757692337036, -1.2405375242233276, -0.5189126133918762, 1.1631730794906616, 0.37057867646217346, -1.27939772605896, -0.004503738600760698, -0.4070095419883728, 0.9735402464866638, 0.4206959009170532, 1.290536642074585, -1.6346588134765625, 0.06393107026815414, -0.35186782479286194, 0.1393137127161026, -1.2589137554168701, -1.5340428352355957, 0.5330569744110107, 0.643570065498352, 0.5495370626449585, -0.15963274240493774, 0.9103667140007019, -0.9475882649421692, 0.8170928359031677, -0.8948593139648438, -1.6967008113861084, -1.4604657888412476, -2.2943153381347656, -2.300373077392578, 0.8317716121673584, -0.5042250752449036, -0.48443686962127686, 2.071592330932617, -1.087590217590332, -1.7979203462600708, 1.1136196851730347, 0.344389408826828, -0.03144301101565361, 2.2869153022766113, 0.2547900378704071, -0.7870286107063293, 0.6190987825393677, -0.7121326923370361, 0.6528980135917664, -0.4394359588623047, 1.3732972145080566, 0.4826219975948334, -1.0894320011138916, 1.5695935487747192, -0.4424572288990021, 0.5562100410461426, -0.6826000809669495, -0.3975744843482971, -0.7235672473907471, 0.30423685908317566, 1.931486964225769, -0.3346218764781952, 1.5562158823013306, -0.282404363155365, -1.5788575410842896, -1.4121521711349487, 0.8310173153877258, 0.49464064836502075, -0.7008465528488159, 0.2288007289171219, -0.43537676334381104, 0.09087707102298737, 0.0761367529630661, 1.0387678146362305, 1.197062611579895, 0.7367297410964966, -0.21482053399085999, -0.9014536738395691, 0.27719029784202576, 0.025115426629781723, -0.6239206194877625, -1.7161222696304321, -0.33037424087524414, 0.16491305828094482, 0.6238160729408264, -1.2401986122131348, 1.8765227794647217, 0.8967105746269226, 1.9993600845336914, 1.0231112241744995, -0.22910644114017487, 1.5701053142547607, 0.026009421795606613, 1.9347538948059082, -0.2547856867313385, 0.6920101642608643, -0.3005644679069519, -1.2465214729309082, 0.8205314874649048, -0.3751678466796875, -2.147576093673706, -0.698059618473053, -0.9027130007743835, -0.0661894902586937, -0.8269538879394531, 0.9698265790939331, -0.2411378026008606, -1.3147305250167847, 0.2177535593509674, -0.7651720643043518, 0.14756500720977783, -1.4188225269317627, 0.3117349147796631, 0.6949663758277893, -0.6467655301094055, 0.05375077202916145, -0.2976180613040924, -1.3421257734298706, -0.494590699672699, 0.2758069336414337, 1.9299458265304565, -0.802659273147583, 1.0458290576934814, 1.1454095840454102, -0.7274847030639648, 0.014802818186581135, 0.4648035764694214, -0.4565269947052002, 0.9642421007156372, -1.0365862846374512, -0.3699173331260681, 1.2856885194778442, -0.1616850048303604, -0.5544337034225464, 1.4260777235031128, 0.654065728187561, -1.0409513711929321, -0.18012864887714386, -0.17934675514698029, -0.9000750780105591, 0.05196445435285568, -1.5736678838729858, -0.13715499639511108, 0.2546570301055908, -1.492193341255188, -0.4843407869338989, -0.10145649313926697, 1.278032660484314, -0.08714926242828369, 1.458042025566101, -0.4535328149795532, -0.011562786065042019, -0.425764262676239, -0.4484398365020752, 0.18710839748382568, -0.16381670534610748, -0.7026687860488892, 0.360095739364624, -0.7262314558029175, 0.25932279229164124, 1.305645227432251, 0.37865149974823, 0.012072007171809673, 0.581641435623169, 1.0334744453430176, 0.3371374309062958, -0.16884899139404297, -0.7884611487388611, -1.6983180046081543, 2.0961697101593018, -1.495192289352417, 1.9787546396255493, 0.7799424529075623, -0.04834553971886635, -1.7849421501159668, -1.8845305442810059, 1.4026753902435303, 1.1632455587387085, 2.3849527835845947, 0.5450142621994019, 0.4810301661491394, -0.7674119472503662, -0.6888558864593506, 0.3578871190547943, -0.9900943636894226, -0.8302401900291443, 0.07188151776790619, 2.374516725540161, 1.7466485500335693, -0.45768579840660095, -0.15512394905090332, -0.9063326716423035, 1.3020769357681274, -0.2595059275627136, 0.15414108335971832, 1.9687144756317139, -0.24602465331554413, -1.032950520515442, 1.304399013519287, -2.3133091926574707, 0.2581333518028259, 1.9727147817611694, 0.29497990012168884, 0.10010635107755661, -1.3316730260849, -0.5967208743095398, -0.1533731073141098, -0.51027512550354, -1.1528241634368896, 0.6317486763000488, -0.1881813406944275, -0.8080819845199585, -1.3202356100082397, 0.1129235327243805, -1.1362427473068237, -1.6845561265945435, 0.3485574424266815, 1.7822773456573486, 2.166518449783325, -0.7967210412025452, 1.4966737031936646, -0.30493852496147156, 0.21402621269226074, 1.19937264919281, 1.1497915983200073, 3.166313648223877, 1.8594872951507568, -1.3633687496185303, 0.6550865173339844, -0.08378992229700089, -0.4993445873260498, 1.24452805519104, -1.1214946508407593, 1.2229408025741577, -0.2517257332801819, -1.2392446994781494, -1.1840168237686157, 0.9249948263168335, 0.5232197642326355, -0.04217540845274925, -0.40212616324424744, 1.1255608797073364, 0.0873507559299469, 1.2596125602722168, 0.49669575691223145, -0.3489457368850708, 0.5706055164337158, -0.3723911643028259, -0.4672435522079468, 1.5005154609680176, 0.15521761775016785, -1.454005241394043, -2.25687575340271, -0.14150071144104004, -0.9677773118019104, 0.017578743398189545, -0.7440964579582214, -0.8738101720809937, 1.5405632257461548, 0.49958205223083496, -1.1322011947631836, -0.3250909745693207, -0.31050336360931396, -0.5994296669960022, 2.662407875061035, -1.508833885192871, -0.2567170262336731, -0.9695448875427246, -0.6119880080223083, 1.636000156402588, -1.2190816402435303, -0.34174013137817383, -0.9518770575523376, -0.6221123933792114, -1.235904335975647, -0.6494446992874146, -0.035202506929636, -0.9230201244354248, 0.8396981358528137, 0.08156037330627441, -1.2133315801620483, -0.30133581161499023, -1.0098559856414795, 0.8917447924613953, -0.11927210539579391, 0.19090858101844788, 1.7350594997406006, 0.40336230397224426, -0.3821166455745697, 0.6531139612197876, 1.2286148071289062, 0.5725737810134888, -0.532512903213501, 0.26436370611190796, -0.7135252356529236, 0.4226304590702057, -1.3572808504104614, 0.3009709417819977, -2.8757436275482178, 0.6450309157371521, 0.024298377335071564, -0.035136301070451736, -0.1797332912683487, -1.3332338333129883, 1.042149543762207, 2.547560691833496, -1.1701911687850952, 0.4897860884666443, 0.33754783868789673, 1.180995225906372, -1.643402099609375, 0.16721490025520325, -0.4744788706302643, 2.127981424331665, 0.08824047446250916, 1.1701343059539795, -0.3661007881164551, -2.205883741378784, 0.6877375841140747, -1.2606229782104492, -1.039655089378357, 0.7147394418716431, -0.8418281674385071, 0.04897813871502876, -1.246034860610962, -0.1996535360813141, -0.7854703068733215, -1.131097435951233, 0.7343009114265442, 0.1043957993388176, 0.5531512498855591, -0.5740125775337219, 0.28152552247047424, -2.210090398788452, -1.3549761772155762, -0.21946202218532562, -0.9573275446891785, 0.4137692451477051, -0.2962736189365387, 0.7397956848144531, -0.13171148300170898, 0.045999206602573395, 0.42827409505844116, 1.3471705913543701, 3.370100975036621, 0.11154723912477493, 0.42277494072914124, -0.17539052665233612, -1.0194202661514282, 1.4039249420166016, 0.8766669631004333, -0.24052296578884125, -0.6492514610290527, -1.0090519189834595, 1.2267158031463623, 1.9366154670715332, 1.0631693601608276, 0.08106505870819092, -0.9397891163825989, -0.7822579741477966, 0.042311426252126694, 0.17973408102989197, 0.540584921836853, 0.9370453953742981, 0.00223667174577713, 0.0755944550037384, 1.388634443283081, 1.0882660150527954, -0.39713871479034424, 0.42302557826042175, -0.8065699934959412, -0.3679128885269165, 0.46556180715560913, 0.3357152044773102, 0.048334043473005295, 0.334623247385025, -0.9712695479393005, -0.3084530830383301, -0.2579401433467865, -0.913129985332489, -0.7851797938346863, -0.4575182795524597, -0.36172083020210266, 1.6855134963989258, 0.01904742419719696, -0.5139841437339783, -0.00532123725861311, -0.9098640084266663, -0.01748015731573105, -1.0450518131256104, 0.18413709104061127, -0.18239571154117584, -0.0384666733443737, -0.19139975309371948, 1.6794248819351196, -1.0335254669189453, -2.170156478881836, 0.24217572808265686, 0.2364213913679123, -0.3953703045845032, 0.02177445963025093, 1.7016416788101196, 0.6284953951835632, 1.3288910388946533, 1.4119527339935303, 1.0088517665863037, -0.6627086400985718, -1.246872901916504, 0.6677368879318237, 1.0305982828140259, -1.4024282693862915, 0.781819224357605, -0.03955680504441261, -0.5272692441940308, 0.567103922367096, 1.3305867910385132, 0.5146768093109131, -1.9253144264221191, 0.8478623628616333, -0.9544156789779663, 0.7865282893180847, 0.5998291373252869, 0.7464696168899536, 0.16606293618679047, 0.7912980318069458, -1.279208779335022, -1.0901621580123901, -0.6548910737037659, -0.746519148349762, 1.8739646673202515, -0.24203169345855713, 0.45781880617141724, -0.13876119256019592, -1.4116750955581665, -0.004139855038374662, 0.6653711199760437, 0.2443675398826599, -0.43235713243484497, 0.7701646089553833, -0.6923394203186035, -1.137760877609253, -1.3781116008758545, -0.3612535893917084, -0.9998221397399902, -0.8108345866203308, 1.0406814813613892, 0.786359429359436, 0.3483087122440338, 1.8785312175750732, 0.7848111391067505, 0.21340936422348022, -2.5976803302764893, 0.8485373258590698, 0.3485509753227234, -0.054567281156778336, 0.7833343744277954, 0.2760549783706665, 1.0030940771102905, -0.04169364273548126, 0.5183106660842896, -2.361009359359741, 2.205216646194458, -0.22070498764514923, 0.6470889449119568, 0.12225479632616043, -0.10691796988248825, 1.052859902381897, 0.6365699768066406, 0.5893746018409729, -1.2021583318710327, 0.7849169969558716, -0.7245524525642395, 1.1870932579040527, 0.8459771275520325, -0.897697925567627, 0.049073923379182816, 1.2818983793258667, 0.40734928846359253, -0.49850156903266907, -1.0324031114578247, -0.9365938901901245, 1.0551142692565918, 1.8139134645462036, -0.029087834060192108, 0.08341626822948456, 0.8754543662071228, 0.7153148055076599, -1.3157373666763306, 0.04760625585913658, -0.75483638048172, -0.7848970890045166, 1.6839489936828613, 2.083197832107544, -0.09854735434055328, -0.26037082076072693, -0.732283890247345, -1.327351450920105, 0.8940718770027161, -0.0231890007853508, 0.031141776591539383, 0.6973875164985657, -0.7319462299346924, 1.2226543426513672, 0.9779265522956848, 0.9182798266410828, 0.22157835960388184, 0.07685989886522293, 0.2902529835700989, -0.20922192931175232, -1.1072697639465332, -0.2650499939918518, -0.984163761138916, -2.592531442642212, 0.4087837338447571, -0.22558552026748657, -1.384653091430664, 0.022193312644958496, -0.9793904423713684, 0.8379510641098022, -0.4523317515850067, -1.0518882274627686, -1.4490776062011719, 0.24525704979896545, -0.12693218886852264, 0.8097492456436157, -1.5682008266448975, -0.17969340085983276, 1.235384464263916, 0.9382521510124207, -0.6701408624649048, 0.9034240245819092, 0.2324906885623932, 0.8900452852249146, 0.9257821440696716, -0.4276118576526642, 0.5082770586013794, 0.23380792140960693, -1.3116145133972168, 0.4643017053604126, 1.3865854740142822, 0.1573992520570755, 1.4117792844772339, -0.5277515053749084, 0.06795349717140198, 0.30305734276771545, -0.4354420602321625, -0.5569753050804138, -0.7284912467002869, 0.7166473865509033, -0.073774553835392, -1.019653558731079, 0.00007432326674461365, -0.06993765383958817, -0.2046205699443817, 0.20115816593170166, -1.6541807651519775, -0.1422799974679947, -0.27942052483558655, -0.6079276204109192, -1.3234436511993408, -0.14707089960575104, 1.3805347681045532, -0.9382937550544739, -0.1412874460220337, 0.49656742811203003, 0.3470246195793152, 0.6108730435371399, 0.5908007621765137, -0.6575488448143005, -0.344558984041214, -0.22927828133106232, -0.32980599999427795, 0.21615666151046753, 1.30532968044281, -0.03234558552503586, -0.9342261552810669, 0.6957459449768066, -0.3104749321937561, 0.10200180113315582, 1.903097152709961, 0.1452798694372177, -0.859154999256134, 0.40552690625190735, -0.788960874080658, 1.9314407110214233, 1.7056721448898315, 1.3050295114517212, -0.04831482097506523, -1.0182384252548218, 0.6189823746681213, -0.2940356433391571, -0.3918112814426422, 0.9397780895233154, 0.40105918049812317, -0.3217583894729614, -1.433109998703003, 0.5925577282905579, 1.2456035614013672, -0.8062769770622253, -0.884147047996521, 0.023233506828546524, -0.888251543045044, 1.142737865447998, 0.7111271023750305, 0.360065221786499, 0.3165322244167328, 1.5597683191299438, 0.7623938918113708, -0.5566019415855408, 0.43410584330558777, 0.5413382649421692, -0.09582019597291946, -2.01731276512146, -1.003121018409729, 0.3723072409629822, -0.4278269112110138, -1.5027333498001099, 1.332993507385254, -1.2074254751205444, -0.9330638647079468, 0.6074249744415283, 0.11184687912464142, 1.440192461013794, 0.2794119715690613, 1.6669554710388184, 2.0484538078308105, 0.9602134823799133, 0.3614139258861542, 1.1842974424362183, -0.2268557846546173, -0.2845384478569031, 1.732814908027649, -0.4404871463775635, 0.5377087593078613, 1.0285719633102417, -0.4537728726863861, -1.1776388883590698, -0.8231594562530518, -1.1428221464157104, -0.8695328235626221, 1.1361048221588135, 0.07178939878940582, -1.0603728294372559, 0.2660393714904785, 1.7306132316589355, 0.18257473409175873, -0.23530235886573792, 0.5953639149665833, 0.33406007289886475, -0.7642855644226074, -0.08647412806749344, -1.0521526336669922, 0.5113850831985474, -0.16584478318691254, -0.4378150999546051, 0.24447205662727356, 0.5319145917892456, 1.2688452005386353, 0.037912242114543915, 0.04691259562969208, 1.2317644357681274, -1.462306261062622, 1.470328688621521, -0.8327792286872864, 0.307285875082016, -2.3657760620117188, 1.4349935054779053, -0.8579359650611877, 1.9376585483551025, -2.625563383102417, 0.45280614495277405, -0.5062568783760071, -0.5231874585151672, 0.22593386471271515, -0.30808335542678833, 0.11997278779745102, -0.08647379279136658, -1.1389665603637695, -0.19366462528705597, -0.6949835419654846, 0.5968818664550781, 1.2439194917678833, 1.357103705406189, -0.9557995200157166, -0.31578579545021057, -1.6995309591293335, -0.17993903160095215, -0.5344217419624329, 0.2587181329727173, -1.7868006229400635, -0.20255784690380096, -1.9892406463623047, -2.3692495822906494, -1.3378283977508545, -0.9064266681671143, 1.2157869338989258, 0.193429633975029, -0.9124466180801392, 1.074897289276123, -0.5289577841758728, -1.7917314767837524, 1.155849814414978, -2.2304818630218506 ]
https://github.com/huggingface/datasets/issues/3154
Sacrebleu unexpected behaviour/requirement for data format
Hi @BramVanroy! Good question. This project relies on PyArrow (tables) to store data too big to fit in RAM. In the case of metrics, this means that the number of predictions and references has to match to form a table. That's why your example throws an error even though it matches the schema: ```python refs = [ ['The dog bit the man.', 'It was not unexpected.', 'The man bit him first.'], ['The dog had bit the man.', 'No one was surprised.', 'The man had bitten the dog.'], ] # len(refs) = 2 hyps = ['The dog bit the man.', "It wasn't surprising.", 'The man had just bitten him.'] # len(hyps) = 3 ``` Instead, it should be: ```python refs = [ ['The dog bit the man.', 'The dog had bit the man.'], ['It was not unexpected.', 'No one was surprised.'], ['The man bit him first.', 'The man had bitten the dog.'], ] # len(refs) = 3 hyps = ['The dog bit the man.', "It wasn't surprising.", 'The man had just bitten him.'] # len(hyps) = 3 ``` However, `sacreblue` works with the format that's described in your example, hence this part: https://github.com/huggingface/datasets/blob/87c71b9c29a40958973004910f97e4892559dfed/metrics/sacrebleu/sacrebleu.py#L94-L99 Hope you get an idea!
## Describe the bug When comparing with the original `sacrebleu` implementation, the `datasets` implementation does some strange things that I do not quite understand. This issue was triggered when I was trying to implement TER and found the datasets implementation of BLEU [here](https://github.com/huggingface/datasets/pull/3153). In the below snippet, the original sacrebleu snippet works just fine whereas the datasets implementation throws an error. ## Steps to reproduce the bug ```python import sacrebleu import datasets refs = [ ['The dog bit the man.', 'It was not unexpected.', 'The man bit him first.'], ['The dog had bit the man.', 'No one was surprised.', 'The man had bitten the dog.'], ] hyps = ['The dog bit the man.', "It wasn't surprising.", 'The man had just bitten him.'] expected_bleu = 48.530827 ds_bleu = datasets.load_metric("sacrebleu") bleu_score_sb = sacrebleu.corpus_bleu(hyps, refs).score print(bleu_score_sb, expected_bleu) # works: 48.5308... bleu_score_ds = ds_bleu.compute(predictions=hyps, references=refs)["score"] print(bleu_score_ds, expected_bleu) # ValueError: Predictions and/or references don't match the expected format. ``` This seems to be related to how datasets forces the features format here: https://github.com/huggingface/datasets/blob/87c71b9c29a40958973004910f97e4892559dfed/metrics/sacrebleu/sacrebleu.py#L94-L99 and then manipulates the references during the compute stage here https://github.com/huggingface/datasets/blob/87c71b9c29a40958973004910f97e4892559dfed/metrics/sacrebleu/sacrebleu.py#L119-L122 I do not quite understand why that is required since sacrebleu handles argument parsing quite well [by itself](https://github.com/mjpost/sacrebleu/blob/2787185dd0f8d224c72ee5a831d163c2ac711a47/sacrebleu/metrics/base.py#L229). ## Actual results Traceback (most recent call last): File "C:\Users\bramv\AppData\Roaming\JetBrains\PyCharm2020.3\scratches\scratch_23.py", line 23, in <module> bleu_score_ds = ds_bleu.compute(predictions=hyps, references=refs)["score"] File "C:\dev\python\datasets\src\datasets\metric.py", line 392, in compute self.add_batch(predictions=predictions, references=references) File "C:\dev\python\datasets\src\datasets\metric.py", line 439, in add_batch raise ValueError( ValueError: Predictions and/or references don't match the expected format. Expected format: {'predictions': Value(dtype='string', id='sequence'), 'references': Sequence(feature=Value(dtype='string', id='sequence'), length=-1, id='references')}, Input predictions: ['The dog bit the man.', "It wasn't surprising.", 'The man had just bitten him.'], Input references: [['The dog bit the man.', 'It was not unexpected.', 'The man bit him first.'], ['The dog had bit the man.', 'No one was surprised.', 'The man had bitten the dog.']] ## Environment info - `datasets` version: 1.14.1.dev0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.9.2 - PyArrow version: 4.0.1
1,148
197
Sacrebleu unexpected behaviour/requirement for data format ## Describe the bug When comparing with the original `sacrebleu` implementation, the `datasets` implementation does some strange things that I do not quite understand. This issue was triggered when I was trying to implement TER and found the datasets implementation of BLEU [here](https://github.com/huggingface/datasets/pull/3153). In the below snippet, the original sacrebleu snippet works just fine whereas the datasets implementation throws an error. ## Steps to reproduce the bug ```python import sacrebleu import datasets refs = [ ['The dog bit the man.', 'It was not unexpected.', 'The man bit him first.'], ['The dog had bit the man.', 'No one was surprised.', 'The man had bitten the dog.'], ] hyps = ['The dog bit the man.', "It wasn't surprising.", 'The man had just bitten him.'] expected_bleu = 48.530827 ds_bleu = datasets.load_metric("sacrebleu") bleu_score_sb = sacrebleu.corpus_bleu(hyps, refs).score print(bleu_score_sb, expected_bleu) # works: 48.5308... bleu_score_ds = ds_bleu.compute(predictions=hyps, references=refs)["score"] print(bleu_score_ds, expected_bleu) # ValueError: Predictions and/or references don't match the expected format. ``` This seems to be related to how datasets forces the features format here: https://github.com/huggingface/datasets/blob/87c71b9c29a40958973004910f97e4892559dfed/metrics/sacrebleu/sacrebleu.py#L94-L99 and then manipulates the references during the compute stage here https://github.com/huggingface/datasets/blob/87c71b9c29a40958973004910f97e4892559dfed/metrics/sacrebleu/sacrebleu.py#L119-L122 I do not quite understand why that is required since sacrebleu handles argument parsing quite well [by itself](https://github.com/mjpost/sacrebleu/blob/2787185dd0f8d224c72ee5a831d163c2ac711a47/sacrebleu/metrics/base.py#L229). ## Actual results Traceback (most recent call last): File "C:\Users\bramv\AppData\Roaming\JetBrains\PyCharm2020.3\scratches\scratch_23.py", line 23, in <module> bleu_score_ds = ds_bleu.compute(predictions=hyps, references=refs)["score"] File "C:\dev\python\datasets\src\datasets\metric.py", line 392, in compute self.add_batch(predictions=predictions, references=references) File "C:\dev\python\datasets\src\datasets\metric.py", line 439, in add_batch raise ValueError( ValueError: Predictions and/or references don't match the expected format. Expected format: {'predictions': Value(dtype='string', id='sequence'), 'references': Sequence(feature=Value(dtype='string', id='sequence'), length=-1, id='references')}, Input predictions: ['The dog bit the man.', "It wasn't surprising.", 'The man had just bitten him.'], Input references: [['The dog bit the man.', 'It was not unexpected.', 'The man bit him first.'], ['The dog had bit the man.', 'No one was surprised.', 'The man had bitten the dog.']] ## Environment info - `datasets` version: 1.14.1.dev0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.9.2 - PyArrow version: 4.0.1 Hi @BramVanroy! Good question. This project relies on PyArrow (tables) to store data too big to fit in RAM. In the case of metrics, this means that the number of predictions and references has to match to form a table. That's why your example throws an error even though it matches the schema: ```python refs = [ ['The dog bit the man.', 'It was not unexpected.', 'The man bit him first.'], ['The dog had bit the man.', 'No one was surprised.', 'The man had bitten the dog.'], ] # len(refs) = 2 hyps = ['The dog bit the man.', "It wasn't surprising.", 'The man had just bitten him.'] # len(hyps) = 3 ``` Instead, it should be: ```python refs = [ ['The dog bit the man.', 'The dog had bit the man.'], ['It was not unexpected.', 'No one was surprised.'], ['The man bit him first.', 'The man had bitten the dog.'], ] # len(refs) = 3 hyps = ['The dog bit the man.', "It wasn't surprising.", 'The man had just bitten him.'] # len(hyps) = 3 ``` However, `sacreblue` works with the format that's described in your example, hence this part: https://github.com/huggingface/datasets/blob/87c71b9c29a40958973004910f97e4892559dfed/metrics/sacrebleu/sacrebleu.py#L94-L99 Hope you get an idea!
[ -1.2714515924453735, -0.9646323919296265, -0.7397177219390869, 1.4438555240631104, -0.17027974128723145, -1.267376184463501, 0.14462564885616302, -1.0257219076156616, 1.7350375652313232, -0.7997449040412903, 0.21138471364974976, -1.6854413747787476, -0.037718966603279114, -0.5768308639526367, -0.8174542784690857, -0.8657176494598389, -0.282969206571579, -0.8422777056694031, 1.0130698680877686, 2.512695789337158, 1.1460293531417847, -1.3791838884353638, 2.718714475631714, 0.6490375995635986, -0.21385003626346588, -1.0594640970230103, 0.5965076684951782, -0.12279970943927765, -1.2496145963668823, -0.501547634601593, -1.0102124214172363, 0.016862239688634872, -0.5198265314102173, -0.5201299786567688, 0.03186514973640442, 0.31645306944847107, -0.2953875958919525, -0.37884071469306946, -0.5401403903961182, -0.718269944190979, 0.39107632637023926, -0.35904279351234436, 0.918335497379303, -0.28893211483955383, 1.877816081047058, -0.5339985489845276, 0.41995611786842346, 0.649239718914032, 1.3975170850753784, 0.21006722748279572, 0.03359917923808098, 0.32609573006629944, 0.3726973831653595, 0.027076195925474167, 0.49469491839408875, 1.2153162956237793, 0.6401446461677551, 0.41322413086891174, 0.7435106039047241, -2.205658435821533, 1.3366719484329224, -1.0262640714645386, 0.220600888133049, 1.3560746908187866, -0.8959303498268127, 0.35420724749565125, -1.781994104385376, -0.03807196393609047, 0.544644832611084, -2.3211538791656494, 0.21383030712604523, -1.3479870557785034, -0.5572165846824646, 1.057839274406433, 0.3802201747894287, -1.2802462577819824, 0.20334045588970184, -0.4577527940273285, 1.0977895259857178, 0.45686453580856323, 1.1387770175933838, -1.6262588500976562, -0.08203253149986267, -0.2653246223926544, 0.11108574271202087, -1.2591944932937622, -1.6229625940322876, 0.574009895324707, 0.5998253226280212, 0.6794045567512512, -0.08500275015830994, 1.0857727527618408, -0.9694769382476807, 0.8006274104118347, -0.9333926439285278, -1.8093119859695435, -1.404098629951477, -2.2462170124053955, -2.2260971069335938, 0.7933164834976196, -0.44277411699295044, -0.5389816164970398, 2.085646152496338, -0.9908638596534729, -1.752097487449646, 1.164907455444336, 0.2702420949935913, 0.03171361982822418, 2.4505128860473633, 0.21956969797611237, -0.7178682684898376, 0.4323139786720276, -0.6712468862533569, 0.7428763508796692, -0.32894060015678406, 1.3652726411819458, 0.5750970840454102, -0.9845131039619446, 1.5967243909835815, -0.3259027600288391, 0.496163934469223, -0.6302559971809387, -0.5076000690460205, -0.7174267172813416, 0.3600330054759979, 1.9324089288711548, -0.4321378767490387, 1.568669319152832, -0.29490405321121216, -1.5348893404006958, -1.5978574752807617, 0.9640534520149231, 0.432940810918808, -0.8124126195907593, 0.11888013780117035, -0.4026104807853699, 0.14664721488952637, -0.11266113817691803, 1.1307735443115234, 1.3262954950332642, 0.6408141255378723, -0.31447964906692505, -0.842088520526886, 0.1868893951177597, -0.1425265371799469, -0.691832423210144, -1.7777273654937744, -0.37102821469306946, 0.1474766582250595, 0.6735436320304871, -1.2980304956436157, 1.647895097732544, 0.8450799584388733, 1.8858585357666016, 1.147710919380188, -0.45645034313201904, 1.4922500848770142, 0.021122561767697334, 1.8448349237442017, -0.5517470240592957, 0.5845953822135925, -0.28312817215919495, -1.1548329591751099, 0.8958085775375366, -0.3602791428565979, -1.9749162197113037, -0.783503532409668, -0.8312748670578003, -0.21554963290691376, -0.788417398929596, 0.8541843295097351, -0.41267654299736023, -1.4593504667282104, 0.17872484028339386, -0.7439771294593811, 0.08221925795078278, -1.179460883140564, 0.1962287724018097, 0.8058664798736572, -0.5710079073905945, 0.05077784135937691, -0.21620416641235352, -1.2649558782577515, -0.4374050796031952, 0.41496387124061584, 1.9183552265167236, -0.6919435262680054, 0.9101244211196899, 1.0536020994186401, -0.7769200801849365, 0.04971613734960556, 0.32336315512657166, -0.29376062750816345, 0.8583293557167053, -1.0282378196716309, -0.5448352694511414, 1.1409103870391846, -0.1907842606306076, -0.686231255531311, 1.38724946975708, 0.743350625038147, -1.063462734222412, -0.2248268723487854, -0.09894850850105286, -0.7533002495765686, 0.05284612625837326, -1.594506025314331, -0.19092735648155212, 0.3816303014755249, -1.5580328702926636, -0.46374619007110596, -0.22682324051856995, 1.3579200506210327, -0.20375223457813263, 1.3541626930236816, -0.25410735607147217, -0.1464320719242096, -0.3149586617946625, -0.4490186274051666, 0.14731143414974213, -0.21995559334754944, -0.6152111887931824, 0.2239653468132019, -0.8394640684127808, 0.39063823223114014, 1.4435006380081177, 0.4190503656864166, 0.02107570320367813, 0.5612893104553223, 1.1288273334503174, 0.45703360438346863, -0.04606856778264046, -0.855099618434906, -1.5901485681533813, 2.027980327606201, -1.4678761959075928, 2.014005661010742, 0.721036434173584, -0.16712164878845215, -1.7660748958587646, -1.878339409828186, 1.3214815855026245, 1.155945897102356, 2.3638916015625, 0.5285991430282593, 0.3819405734539032, -0.6966170072555542, -0.7297149300575256, 0.3982063829898834, -0.9647291302680969, -0.6607576012611389, 0.09757809340953827, 2.331894636154175, 1.7991907596588135, -0.34110984206199646, -0.2196880429983139, -0.8801890015602112, 1.326731562614441, -0.16960375010967255, 0.29346969723701477, 1.9496784210205078, -0.2687501907348633, -1.075282096862793, 1.366611123085022, -2.3580732345581055, 0.21613414585590363, 2.0401556491851807, 0.22862957417964935, -0.018232103437185287, -1.4580174684524536, -0.6369447112083435, -0.3103734254837036, -0.4323922097682953, -1.2361544370651245, 0.5308660864830017, -0.31211361289024353, -0.8313431143760681, -1.3964753150939941, 0.13821539282798767, -1.1387243270874023, -1.711287498474121, 0.2672751843929291, 2.056339740753174, 2.0245189666748047, -0.7093367576599121, 1.6088007688522339, -0.17455078661441803, 0.15173806250095367, 1.2495276927947998, 1.1891263723373413, 3.098623514175415, 1.840657353401184, -1.2082476615905762, 0.6709970831871033, -0.16236701607704163, -0.47461774945259094, 1.09738028049469, -1.1614854335784912, 1.2382228374481201, -0.12442652881145477, -1.2892749309539795, -1.1250277757644653, 1.0511298179626465, 0.4297959506511688, -0.055672962218523026, -0.4864760935306549, 1.1767311096191406, 0.03272650018334389, 1.30343759059906, 0.4745277166366577, -0.4017799198627472, 0.5334856510162354, -0.35234785079956055, -0.6320117712020874, 1.5632896423339844, 0.14157958328723907, -1.3953675031661987, -2.2188329696655273, -0.22017790377140045, -0.7783688306808472, 0.018237430602312088, -0.7168295383453369, -1.0141236782073975, 1.618330717086792, 0.36285141110420227, -1.233006477355957, -0.31360480189323425, -0.39887621998786926, -0.6218199729919434, 2.6571919918060303, -1.4171472787857056, -0.18718723952770233, -1.0194671154022217, -0.580108106136322, 1.5945490598678589, -1.1791486740112305, -0.22422559559345245, -1.0210232734680176, -0.6560446619987488, -1.289176344871521, -0.47737783193588257, 0.020041240379214287, -0.9717455506324768, 0.7784909605979919, 0.13810929656028748, -1.040712594985962, -0.31401827931404114, -0.8573058843612671, 0.9617562890052795, -0.11177381873130798, 0.20818157494068146, 1.9476444721221924, 0.4067308008670807, -0.4368835687637329, 0.6863192915916443, 1.1358696222305298, 0.6800742149353027, -0.6388161182403564, 0.2168871909379959, -0.6845873594284058, 0.30717208981513977, -1.3611085414886475, 0.35751956701278687, -2.8467319011688232, 0.642878532409668, -0.09624959528446198, -0.08201053738594055, -0.01753588393330574, -1.251452088356018, 1.1173726320266724, 2.6251533031463623, -1.191055178642273, 0.46762895584106445, 0.3784642219543457, 1.2137447595596313, -1.5792524814605713, 0.34185823798179626, -0.47054487466812134, 2.1019158363342285, 0.17261956632137299, 1.253774642944336, -0.5081709623336792, -2.3058741092681885, 0.6896449327468872, -1.2126684188842773, -1.1089873313903809, 0.8008109927177429, -0.8655766844749451, 0.1667550951242447, -1.4578526020050049, -0.16200323402881622, -0.869147002696991, -1.1641162633895874, 0.733570396900177, 0.14072978496551514, 0.4166700541973114, -0.5765904784202576, 0.3926072120666504, -2.135728597640991, -1.3934314250946045, -0.10748039186000824, -0.9532857537269592, 0.5693304538726807, -0.3498438000679016, 0.5805416107177734, -0.16758163273334503, 0.010441582649946213, 0.35638612508773804, 1.4122501611709595, 3.422008514404297, 0.19801820814609528, 0.33828309178352356, -0.11208711564540863, -0.9692947268486023, 1.4726202487945557, 0.9288958311080933, -0.12046529352664948, -0.611318826675415, -1.0322566032409668, 1.274783730506897, 1.9704418182373047, 1.0695892572402954, 0.1029539555311203, -0.8607184886932373, -0.7204511165618896, 0.025161810219287872, 0.24928554892539978, 0.4921071231365204, 0.9318459033966064, 0.052399251610040665, 0.10189960896968842, 1.421617031097412, 1.2103791236877441, -0.4720931649208069, 0.40352731943130493, -0.9301795363426208, -0.43956154584884644, 0.39068010449409485, 0.24866819381713867, -0.08242645859718323, 0.4008287191390991, -1.057940125465393, -0.18413707613945007, -0.439253568649292, -0.8786128163337708, -0.7269312143325806, -0.2908393144607544, -0.4074583351612091, 1.6078646183013916, 0.15431396663188934, -0.5455595850944519, -0.03848583251237869, -0.7731660008430481, -0.13522610068321228, -1.0205740928649902, 0.17728006839752197, -0.1656673699617386, -0.15549710392951965, -0.09497636556625366, 1.6487300395965576, -0.9379301071166992, -2.0169246196746826, 0.133933424949646, 0.24054835736751556, -0.2945984899997711, 0.2144877016544342, 1.641772985458374, 0.5197995901107788, 1.433458685874939, 1.3258862495422363, 0.8988595604896545, -0.6053958535194397, -1.3095663785934448, 0.6941191554069519, 0.9623679518699646, -1.3838212490081787, 0.895439088344574, -0.10147225856781006, -0.4735884666442871, 0.6103144884109497, 1.3694709539413452, 0.44492101669311523, -2.083392381668091, 0.893025815486908, -0.9280945658683777, 0.7942310571670532, 0.5954166650772095, 0.6979601383209229, 0.25261956453323364, 0.884856104850769, -1.1960272789001465, -1.1376081705093384, -0.7528102397918701, -0.6737810969352722, 2.018789768218994, -0.15659500658512115, 0.5759907364845276, -0.11545546352863312, -1.2771270275115967, -0.1735430508852005, 0.5465534925460815, 0.4582322835922241, -0.5066438317298889, 0.8392559289932251, -0.7861551642417908, -1.128100037574768, -1.3818285465240479, -0.5009915232658386, -0.9509899616241455, -0.9540225267410278, 1.0460861921310425, 0.8253002166748047, 0.29903924465179443, 1.8552508354187012, 0.49387070536613464, 0.28172245621681213, -2.6245534420013428, 0.8820239305496216, 0.3668688237667084, -0.11500251293182373, 0.8324117660522461, 0.29326480627059937, 1.155246615409851, 0.01734594628214836, 0.4803488552570343, -2.3012161254882812, 2.2408440113067627, -0.25346776843070984, 0.7704223990440369, -0.08948969841003418, -0.1345052868127823, 1.1470977067947388, 0.5434820652008057, 0.6606729030609131, -1.0828968286514282, 0.7147514820098877, -0.5646887421607971, 1.2912129163742065, 1.035799264907837, -0.7635406255722046, 0.08018079400062561, 1.4083640575408936, 0.5397595763206482, -0.5554304718971252, -0.914068877696991, -0.9558255672454834, 0.911896288394928, 1.7694867849349976, -0.05907880887389183, 0.009285733103752136, 0.8421947956085205, 0.6761244535446167, -1.2999423742294312, 0.1321386843919754, -0.6604743599891663, -0.8057151436805725, 1.6652953624725342, 2.169922113418579, -0.20204000174999237, -0.18663866817951202, -0.6920458078384399, -1.1963330507278442, 0.7016961574554443, -0.05352543294429779, 0.06236745044589043, 0.673531174659729, -0.6272076964378357, 1.1603899002075195, 0.7867412567138672, 0.9977842569351196, 0.05638715252280235, 0.3286825120449066, 0.32602500915527344, -0.3673137426376343, -1.1548793315887451, -0.3345949351787567, -1.0466768741607666, -2.605748176574707, 0.3970194458961487, -0.23662172257900238, -1.420349359512329, 0.053732480853796005, -1.011630654335022, 0.9695972204208374, -0.6528226137161255, -1.054544448852539, -1.414648175239563, 0.3081737756729126, -0.06442426145076752, 0.8871769309043884, -1.7772029638290405, -0.1963621973991394, 1.2969417572021484, 0.9441100358963013, -0.5552083849906921, 0.9664999842643738, 0.24664664268493652, 1.0067839622497559, 0.782048225402832, -0.3708289861679077, 0.45813921093940735, 0.09644986689090729, -1.3355120420455933, 0.513907790184021, 1.1455013751983643, 0.17776313424110413, 1.5212888717651367, -0.5251303315162659, 0.10667818784713745, 0.3995373547077179, -0.5904386639595032, -0.5178422331809998, -0.5655347108840942, 0.7170861959457397, -0.09093005955219269, -0.9213579297065735, 0.0028981370851397514, -0.11976933479309082, -0.22026628255844116, 0.22713905572891235, -1.5644457340240479, -0.24570976197719574, -0.33295655250549316, -0.6046150326728821, -1.258874773979187, 0.017426947131752968, 1.3118083477020264, -0.8508769273757935, -0.2905493378639221, 0.42067912220954895, 0.43661877512931824, 0.5192818641662598, 0.6454112529754639, -0.772965669631958, -0.3738633394241333, -0.30140456557273865, -0.3785562813282013, 0.26371872425079346, 1.3609663248062134, -0.20340773463249207, -1.0083577632904053, 0.6338384747505188, -0.39114904403686523, -0.007221417501568794, 1.9088443517684937, -0.018997035920619965, -0.7291898131370544, 0.24773883819580078, -0.6493604183197021, 1.8782422542572021, 1.637102484703064, 1.383615493774414, -0.18060636520385742, -0.85960453748703, 0.6441750526428223, -0.29351699352264404, -0.374563604593277, 0.904141902923584, 0.46642088890075684, -0.25104397535324097, -1.3849163055419922, 0.6400983333587646, 1.2661397457122803, -1.0040009021759033, -0.7499213814735413, 0.05721718445420265, -0.7888134717941284, 1.129602313041687, 0.6324708461761475, 0.27272358536720276, 0.23337192833423615, 1.6139765977859497, 0.7669447660446167, -0.5758857727050781, 0.47511398792266846, 0.48795753717422485, -0.2096419334411621, -2.168057441711426, -0.9928126335144043, 0.24818000197410583, -0.4480118155479431, -1.5916556119918823, 1.3630460500717163, -1.024745225906372, -0.8791666030883789, 0.49159929156303406, 0.1388358324766159, 1.3494353294372559, 0.358334481716156, 1.5996239185333252, 2.0787477493286133, 0.7949695587158203, 0.31060361862182617, 1.2564680576324463, -0.10626576840877533, -0.41338276863098145, 1.773826003074646, -0.49826663732528687, 0.4863942861557007, 1.0677460432052612, -0.3245505690574646, -1.0970513820648193, -0.8291476964950562, -1.2230950593948364, -0.5946696996688843, 1.159085988998413, 0.047440823167562485, -1.0871344804763794, 0.2459869086742401, 1.4969143867492676, 0.11693231761455536, -0.22430306673049927, 0.6771407127380371, 0.5119764804840088, -0.6780241131782532, -0.18678180873394012, -0.8081423044204712, 0.5400713682174683, -0.11512653529644012, -0.3055174648761749, 0.30661919713020325, 0.38524308800697327, 1.349017858505249, -0.09309554100036621, 0.15401802957057953, 1.2000030279159546, -1.4264556169509888, 1.561034083366394, -0.6681148409843445, 0.29882097244262695, -2.419156789779663, 1.379804015159607, -0.7578471899032593, 1.9496309757232666, -2.5219130516052246, 0.48017480969429016, -0.6167554259300232, -0.3952771723270416, 0.3109588027000427, -0.36579272150993347, 0.10285523533821106, -0.1252231001853943, -1.0495916604995728, -0.12579257786273956, -0.7176199555397034, 0.5986287593841553, 1.1906163692474365, 1.3402314186096191, -1.0877145528793335, -0.20121914148330688, -1.8284868001937866, -0.239440456032753, -0.7132056355476379, 0.3566930592060089, -1.9545400142669678, -0.25489574670791626, -2.038137912750244, -2.3717939853668213, -1.2465260028839111, -0.8090566992759705, 0.9981375932693481, 0.1346520632505417, -0.9384300112724304, 1.2524065971374512, -0.28605249524116516, -1.7771399021148682, 1.0296427011489868, -2.1423110961914062 ]
https://github.com/huggingface/datasets/issues/3154
Sacrebleu unexpected behaviour/requirement for data format
Thanks, that makes sense. It is a bit unfortunate because it may be confusing to users since the input format is suddenly different than what they may expect from the underlying library/metric. But it is understandable due to how `datasets` works!
## Describe the bug When comparing with the original `sacrebleu` implementation, the `datasets` implementation does some strange things that I do not quite understand. This issue was triggered when I was trying to implement TER and found the datasets implementation of BLEU [here](https://github.com/huggingface/datasets/pull/3153). In the below snippet, the original sacrebleu snippet works just fine whereas the datasets implementation throws an error. ## Steps to reproduce the bug ```python import sacrebleu import datasets refs = [ ['The dog bit the man.', 'It was not unexpected.', 'The man bit him first.'], ['The dog had bit the man.', 'No one was surprised.', 'The man had bitten the dog.'], ] hyps = ['The dog bit the man.', "It wasn't surprising.", 'The man had just bitten him.'] expected_bleu = 48.530827 ds_bleu = datasets.load_metric("sacrebleu") bleu_score_sb = sacrebleu.corpus_bleu(hyps, refs).score print(bleu_score_sb, expected_bleu) # works: 48.5308... bleu_score_ds = ds_bleu.compute(predictions=hyps, references=refs)["score"] print(bleu_score_ds, expected_bleu) # ValueError: Predictions and/or references don't match the expected format. ``` This seems to be related to how datasets forces the features format here: https://github.com/huggingface/datasets/blob/87c71b9c29a40958973004910f97e4892559dfed/metrics/sacrebleu/sacrebleu.py#L94-L99 and then manipulates the references during the compute stage here https://github.com/huggingface/datasets/blob/87c71b9c29a40958973004910f97e4892559dfed/metrics/sacrebleu/sacrebleu.py#L119-L122 I do not quite understand why that is required since sacrebleu handles argument parsing quite well [by itself](https://github.com/mjpost/sacrebleu/blob/2787185dd0f8d224c72ee5a831d163c2ac711a47/sacrebleu/metrics/base.py#L229). ## Actual results Traceback (most recent call last): File "C:\Users\bramv\AppData\Roaming\JetBrains\PyCharm2020.3\scratches\scratch_23.py", line 23, in <module> bleu_score_ds = ds_bleu.compute(predictions=hyps, references=refs)["score"] File "C:\dev\python\datasets\src\datasets\metric.py", line 392, in compute self.add_batch(predictions=predictions, references=references) File "C:\dev\python\datasets\src\datasets\metric.py", line 439, in add_batch raise ValueError( ValueError: Predictions and/or references don't match the expected format. Expected format: {'predictions': Value(dtype='string', id='sequence'), 'references': Sequence(feature=Value(dtype='string', id='sequence'), length=-1, id='references')}, Input predictions: ['The dog bit the man.', "It wasn't surprising.", 'The man had just bitten him.'], Input references: [['The dog bit the man.', 'It was not unexpected.', 'The man bit him first.'], ['The dog had bit the man.', 'No one was surprised.', 'The man had bitten the dog.']] ## Environment info - `datasets` version: 1.14.1.dev0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.9.2 - PyArrow version: 4.0.1
1,148
41
Sacrebleu unexpected behaviour/requirement for data format ## Describe the bug When comparing with the original `sacrebleu` implementation, the `datasets` implementation does some strange things that I do not quite understand. This issue was triggered when I was trying to implement TER and found the datasets implementation of BLEU [here](https://github.com/huggingface/datasets/pull/3153). In the below snippet, the original sacrebleu snippet works just fine whereas the datasets implementation throws an error. ## Steps to reproduce the bug ```python import sacrebleu import datasets refs = [ ['The dog bit the man.', 'It was not unexpected.', 'The man bit him first.'], ['The dog had bit the man.', 'No one was surprised.', 'The man had bitten the dog.'], ] hyps = ['The dog bit the man.', "It wasn't surprising.", 'The man had just bitten him.'] expected_bleu = 48.530827 ds_bleu = datasets.load_metric("sacrebleu") bleu_score_sb = sacrebleu.corpus_bleu(hyps, refs).score print(bleu_score_sb, expected_bleu) # works: 48.5308... bleu_score_ds = ds_bleu.compute(predictions=hyps, references=refs)["score"] print(bleu_score_ds, expected_bleu) # ValueError: Predictions and/or references don't match the expected format. ``` This seems to be related to how datasets forces the features format here: https://github.com/huggingface/datasets/blob/87c71b9c29a40958973004910f97e4892559dfed/metrics/sacrebleu/sacrebleu.py#L94-L99 and then manipulates the references during the compute stage here https://github.com/huggingface/datasets/blob/87c71b9c29a40958973004910f97e4892559dfed/metrics/sacrebleu/sacrebleu.py#L119-L122 I do not quite understand why that is required since sacrebleu handles argument parsing quite well [by itself](https://github.com/mjpost/sacrebleu/blob/2787185dd0f8d224c72ee5a831d163c2ac711a47/sacrebleu/metrics/base.py#L229). ## Actual results Traceback (most recent call last): File "C:\Users\bramv\AppData\Roaming\JetBrains\PyCharm2020.3\scratches\scratch_23.py", line 23, in <module> bleu_score_ds = ds_bleu.compute(predictions=hyps, references=refs)["score"] File "C:\dev\python\datasets\src\datasets\metric.py", line 392, in compute self.add_batch(predictions=predictions, references=references) File "C:\dev\python\datasets\src\datasets\metric.py", line 439, in add_batch raise ValueError( ValueError: Predictions and/or references don't match the expected format. Expected format: {'predictions': Value(dtype='string', id='sequence'), 'references': Sequence(feature=Value(dtype='string', id='sequence'), length=-1, id='references')}, Input predictions: ['The dog bit the man.', "It wasn't surprising.", 'The man had just bitten him.'], Input references: [['The dog bit the man.', 'It was not unexpected.', 'The man bit him first.'], ['The dog had bit the man.', 'No one was surprised.', 'The man had bitten the dog.']] ## Environment info - `datasets` version: 1.14.1.dev0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.9.2 - PyArrow version: 4.0.1 Thanks, that makes sense. It is a bit unfortunate because it may be confusing to users since the input format is suddenly different than what they may expect from the underlying library/metric. But it is understandable due to how `datasets` works!
[ -1.2714515924453735, -0.9646323919296265, -0.7397177219390869, 1.4438555240631104, -0.17027974128723145, -1.267376184463501, 0.14462564885616302, -1.0257219076156616, 1.7350375652313232, -0.7997449040412903, 0.21138471364974976, -1.6854413747787476, -0.037718966603279114, -0.5768308639526367, -0.8174542784690857, -0.8657176494598389, -0.282969206571579, -0.8422777056694031, 1.0130698680877686, 2.512695789337158, 1.1460293531417847, -1.3791838884353638, 2.718714475631714, 0.6490375995635986, -0.21385003626346588, -1.0594640970230103, 0.5965076684951782, -0.12279970943927765, -1.2496145963668823, -0.501547634601593, -1.0102124214172363, 0.016862239688634872, -0.5198265314102173, -0.5201299786567688, 0.03186514973640442, 0.31645306944847107, -0.2953875958919525, -0.37884071469306946, -0.5401403903961182, -0.718269944190979, 0.39107632637023926, -0.35904279351234436, 0.918335497379303, -0.28893211483955383, 1.877816081047058, -0.5339985489845276, 0.41995611786842346, 0.649239718914032, 1.3975170850753784, 0.21006722748279572, 0.03359917923808098, 0.32609573006629944, 0.3726973831653595, 0.027076195925474167, 0.49469491839408875, 1.2153162956237793, 0.6401446461677551, 0.41322413086891174, 0.7435106039047241, -2.205658435821533, 1.3366719484329224, -1.0262640714645386, 0.220600888133049, 1.3560746908187866, -0.8959303498268127, 0.35420724749565125, -1.781994104385376, -0.03807196393609047, 0.544644832611084, -2.3211538791656494, 0.21383030712604523, -1.3479870557785034, -0.5572165846824646, 1.057839274406433, 0.3802201747894287, -1.2802462577819824, 0.20334045588970184, -0.4577527940273285, 1.0977895259857178, 0.45686453580856323, 1.1387770175933838, -1.6262588500976562, -0.08203253149986267, -0.2653246223926544, 0.11108574271202087, -1.2591944932937622, -1.6229625940322876, 0.574009895324707, 0.5998253226280212, 0.6794045567512512, -0.08500275015830994, 1.0857727527618408, -0.9694769382476807, 0.8006274104118347, -0.9333926439285278, -1.8093119859695435, -1.404098629951477, -2.2462170124053955, -2.2260971069335938, 0.7933164834976196, -0.44277411699295044, -0.5389816164970398, 2.085646152496338, -0.9908638596534729, -1.752097487449646, 1.164907455444336, 0.2702420949935913, 0.03171361982822418, 2.4505128860473633, 0.21956969797611237, -0.7178682684898376, 0.4323139786720276, -0.6712468862533569, 0.7428763508796692, -0.32894060015678406, 1.3652726411819458, 0.5750970840454102, -0.9845131039619446, 1.5967243909835815, -0.3259027600288391, 0.496163934469223, -0.6302559971809387, -0.5076000690460205, -0.7174267172813416, 0.3600330054759979, 1.9324089288711548, -0.4321378767490387, 1.568669319152832, -0.29490405321121216, -1.5348893404006958, -1.5978574752807617, 0.9640534520149231, 0.432940810918808, -0.8124126195907593, 0.11888013780117035, -0.4026104807853699, 0.14664721488952637, -0.11266113817691803, 1.1307735443115234, 1.3262954950332642, 0.6408141255378723, -0.31447964906692505, -0.842088520526886, 0.1868893951177597, -0.1425265371799469, -0.691832423210144, -1.7777273654937744, -0.37102821469306946, 0.1474766582250595, 0.6735436320304871, -1.2980304956436157, 1.647895097732544, 0.8450799584388733, 1.8858585357666016, 1.147710919380188, -0.45645034313201904, 1.4922500848770142, 0.021122561767697334, 1.8448349237442017, -0.5517470240592957, 0.5845953822135925, -0.28312817215919495, -1.1548329591751099, 0.8958085775375366, -0.3602791428565979, -1.9749162197113037, -0.783503532409668, -0.8312748670578003, -0.21554963290691376, -0.788417398929596, 0.8541843295097351, -0.41267654299736023, -1.4593504667282104, 0.17872484028339386, -0.7439771294593811, 0.08221925795078278, -1.179460883140564, 0.1962287724018097, 0.8058664798736572, -0.5710079073905945, 0.05077784135937691, -0.21620416641235352, -1.2649558782577515, -0.4374050796031952, 0.41496387124061584, 1.9183552265167236, -0.6919435262680054, 0.9101244211196899, 1.0536020994186401, -0.7769200801849365, 0.04971613734960556, 0.32336315512657166, -0.29376062750816345, 0.8583293557167053, -1.0282378196716309, -0.5448352694511414, 1.1409103870391846, -0.1907842606306076, -0.686231255531311, 1.38724946975708, 0.743350625038147, -1.063462734222412, -0.2248268723487854, -0.09894850850105286, -0.7533002495765686, 0.05284612625837326, -1.594506025314331, -0.19092735648155212, 0.3816303014755249, -1.5580328702926636, -0.46374619007110596, -0.22682324051856995, 1.3579200506210327, -0.20375223457813263, 1.3541626930236816, -0.25410735607147217, -0.1464320719242096, -0.3149586617946625, -0.4490186274051666, 0.14731143414974213, -0.21995559334754944, -0.6152111887931824, 0.2239653468132019, -0.8394640684127808, 0.39063823223114014, 1.4435006380081177, 0.4190503656864166, 0.02107570320367813, 0.5612893104553223, 1.1288273334503174, 0.45703360438346863, -0.04606856778264046, -0.855099618434906, -1.5901485681533813, 2.027980327606201, -1.4678761959075928, 2.014005661010742, 0.721036434173584, -0.16712164878845215, -1.7660748958587646, -1.878339409828186, 1.3214815855026245, 1.155945897102356, 2.3638916015625, 0.5285991430282593, 0.3819405734539032, -0.6966170072555542, -0.7297149300575256, 0.3982063829898834, -0.9647291302680969, -0.6607576012611389, 0.09757809340953827, 2.331894636154175, 1.7991907596588135, -0.34110984206199646, -0.2196880429983139, -0.8801890015602112, 1.326731562614441, -0.16960375010967255, 0.29346969723701477, 1.9496784210205078, -0.2687501907348633, -1.075282096862793, 1.366611123085022, -2.3580732345581055, 0.21613414585590363, 2.0401556491851807, 0.22862957417964935, -0.018232103437185287, -1.4580174684524536, -0.6369447112083435, -0.3103734254837036, -0.4323922097682953, -1.2361544370651245, 0.5308660864830017, -0.31211361289024353, -0.8313431143760681, -1.3964753150939941, 0.13821539282798767, -1.1387243270874023, -1.711287498474121, 0.2672751843929291, 2.056339740753174, 2.0245189666748047, -0.7093367576599121, 1.6088007688522339, -0.17455078661441803, 0.15173806250095367, 1.2495276927947998, 1.1891263723373413, 3.098623514175415, 1.840657353401184, -1.2082476615905762, 0.6709970831871033, -0.16236701607704163, -0.47461774945259094, 1.09738028049469, -1.1614854335784912, 1.2382228374481201, -0.12442652881145477, -1.2892749309539795, -1.1250277757644653, 1.0511298179626465, 0.4297959506511688, -0.055672962218523026, -0.4864760935306549, 1.1767311096191406, 0.03272650018334389, 1.30343759059906, 0.4745277166366577, -0.4017799198627472, 0.5334856510162354, -0.35234785079956055, -0.6320117712020874, 1.5632896423339844, 0.14157958328723907, -1.3953675031661987, -2.2188329696655273, -0.22017790377140045, -0.7783688306808472, 0.018237430602312088, -0.7168295383453369, -1.0141236782073975, 1.618330717086792, 0.36285141110420227, -1.233006477355957, -0.31360480189323425, -0.39887621998786926, -0.6218199729919434, 2.6571919918060303, -1.4171472787857056, -0.18718723952770233, -1.0194671154022217, -0.580108106136322, 1.5945490598678589, -1.1791486740112305, -0.22422559559345245, -1.0210232734680176, -0.6560446619987488, -1.289176344871521, -0.47737783193588257, 0.020041240379214287, -0.9717455506324768, 0.7784909605979919, 0.13810929656028748, -1.040712594985962, -0.31401827931404114, -0.8573058843612671, 0.9617562890052795, -0.11177381873130798, 0.20818157494068146, 1.9476444721221924, 0.4067308008670807, -0.4368835687637329, 0.6863192915916443, 1.1358696222305298, 0.6800742149353027, -0.6388161182403564, 0.2168871909379959, -0.6845873594284058, 0.30717208981513977, -1.3611085414886475, 0.35751956701278687, -2.8467319011688232, 0.642878532409668, -0.09624959528446198, -0.08201053738594055, -0.01753588393330574, -1.251452088356018, 1.1173726320266724, 2.6251533031463623, -1.191055178642273, 0.46762895584106445, 0.3784642219543457, 1.2137447595596313, -1.5792524814605713, 0.34185823798179626, -0.47054487466812134, 2.1019158363342285, 0.17261956632137299, 1.253774642944336, -0.5081709623336792, -2.3058741092681885, 0.6896449327468872, -1.2126684188842773, -1.1089873313903809, 0.8008109927177429, -0.8655766844749451, 0.1667550951242447, -1.4578526020050049, -0.16200323402881622, -0.869147002696991, -1.1641162633895874, 0.733570396900177, 0.14072978496551514, 0.4166700541973114, -0.5765904784202576, 0.3926072120666504, -2.135728597640991, -1.3934314250946045, -0.10748039186000824, -0.9532857537269592, 0.5693304538726807, -0.3498438000679016, 0.5805416107177734, -0.16758163273334503, 0.010441582649946213, 0.35638612508773804, 1.4122501611709595, 3.422008514404297, 0.19801820814609528, 0.33828309178352356, -0.11208711564540863, -0.9692947268486023, 1.4726202487945557, 0.9288958311080933, -0.12046529352664948, -0.611318826675415, -1.0322566032409668, 1.274783730506897, 1.9704418182373047, 1.0695892572402954, 0.1029539555311203, -0.8607184886932373, -0.7204511165618896, 0.025161810219287872, 0.24928554892539978, 0.4921071231365204, 0.9318459033966064, 0.052399251610040665, 0.10189960896968842, 1.421617031097412, 1.2103791236877441, -0.4720931649208069, 0.40352731943130493, -0.9301795363426208, -0.43956154584884644, 0.39068010449409485, 0.24866819381713867, -0.08242645859718323, 0.4008287191390991, -1.057940125465393, -0.18413707613945007, -0.439253568649292, -0.8786128163337708, -0.7269312143325806, -0.2908393144607544, -0.4074583351612091, 1.6078646183013916, 0.15431396663188934, -0.5455595850944519, -0.03848583251237869, -0.7731660008430481, -0.13522610068321228, -1.0205740928649902, 0.17728006839752197, -0.1656673699617386, -0.15549710392951965, -0.09497636556625366, 1.6487300395965576, -0.9379301071166992, -2.0169246196746826, 0.133933424949646, 0.24054835736751556, -0.2945984899997711, 0.2144877016544342, 1.641772985458374, 0.5197995901107788, 1.433458685874939, 1.3258862495422363, 0.8988595604896545, -0.6053958535194397, -1.3095663785934448, 0.6941191554069519, 0.9623679518699646, -1.3838212490081787, 0.895439088344574, -0.10147225856781006, -0.4735884666442871, 0.6103144884109497, 1.3694709539413452, 0.44492101669311523, -2.083392381668091, 0.893025815486908, -0.9280945658683777, 0.7942310571670532, 0.5954166650772095, 0.6979601383209229, 0.25261956453323364, 0.884856104850769, -1.1960272789001465, -1.1376081705093384, -0.7528102397918701, -0.6737810969352722, 2.018789768218994, -0.15659500658512115, 0.5759907364845276, -0.11545546352863312, -1.2771270275115967, -0.1735430508852005, 0.5465534925460815, 0.4582322835922241, -0.5066438317298889, 0.8392559289932251, -0.7861551642417908, -1.128100037574768, -1.3818285465240479, -0.5009915232658386, -0.9509899616241455, -0.9540225267410278, 1.0460861921310425, 0.8253002166748047, 0.29903924465179443, 1.8552508354187012, 0.49387070536613464, 0.28172245621681213, -2.6245534420013428, 0.8820239305496216, 0.3668688237667084, -0.11500251293182373, 0.8324117660522461, 0.29326480627059937, 1.155246615409851, 0.01734594628214836, 0.4803488552570343, -2.3012161254882812, 2.2408440113067627, -0.25346776843070984, 0.7704223990440369, -0.08948969841003418, -0.1345052868127823, 1.1470977067947388, 0.5434820652008057, 0.6606729030609131, -1.0828968286514282, 0.7147514820098877, -0.5646887421607971, 1.2912129163742065, 1.035799264907837, -0.7635406255722046, 0.08018079400062561, 1.4083640575408936, 0.5397595763206482, -0.5554304718971252, -0.914068877696991, -0.9558255672454834, 0.911896288394928, 1.7694867849349976, -0.05907880887389183, 0.009285733103752136, 0.8421947956085205, 0.6761244535446167, -1.2999423742294312, 0.1321386843919754, -0.6604743599891663, -0.8057151436805725, 1.6652953624725342, 2.169922113418579, -0.20204000174999237, -0.18663866817951202, -0.6920458078384399, -1.1963330507278442, 0.7016961574554443, -0.05352543294429779, 0.06236745044589043, 0.673531174659729, -0.6272076964378357, 1.1603899002075195, 0.7867412567138672, 0.9977842569351196, 0.05638715252280235, 0.3286825120449066, 0.32602500915527344, -0.3673137426376343, -1.1548793315887451, -0.3345949351787567, -1.0466768741607666, -2.605748176574707, 0.3970194458961487, -0.23662172257900238, -1.420349359512329, 0.053732480853796005, -1.011630654335022, 0.9695972204208374, -0.6528226137161255, -1.054544448852539, -1.414648175239563, 0.3081737756729126, -0.06442426145076752, 0.8871769309043884, -1.7772029638290405, -0.1963621973991394, 1.2969417572021484, 0.9441100358963013, -0.5552083849906921, 0.9664999842643738, 0.24664664268493652, 1.0067839622497559, 0.782048225402832, -0.3708289861679077, 0.45813921093940735, 0.09644986689090729, -1.3355120420455933, 0.513907790184021, 1.1455013751983643, 0.17776313424110413, 1.5212888717651367, -0.5251303315162659, 0.10667818784713745, 0.3995373547077179, -0.5904386639595032, -0.5178422331809998, -0.5655347108840942, 0.7170861959457397, -0.09093005955219269, -0.9213579297065735, 0.0028981370851397514, -0.11976933479309082, -0.22026628255844116, 0.22713905572891235, -1.5644457340240479, -0.24570976197719574, -0.33295655250549316, -0.6046150326728821, -1.258874773979187, 0.017426947131752968, 1.3118083477020264, -0.8508769273757935, -0.2905493378639221, 0.42067912220954895, 0.43661877512931824, 0.5192818641662598, 0.6454112529754639, -0.772965669631958, -0.3738633394241333, -0.30140456557273865, -0.3785562813282013, 0.26371872425079346, 1.3609663248062134, -0.20340773463249207, -1.0083577632904053, 0.6338384747505188, -0.39114904403686523, -0.007221417501568794, 1.9088443517684937, -0.018997035920619965, -0.7291898131370544, 0.24773883819580078, -0.6493604183197021, 1.8782422542572021, 1.637102484703064, 1.383615493774414, -0.18060636520385742, -0.85960453748703, 0.6441750526428223, -0.29351699352264404, -0.374563604593277, 0.904141902923584, 0.46642088890075684, -0.25104397535324097, -1.3849163055419922, 0.6400983333587646, 1.2661397457122803, -1.0040009021759033, -0.7499213814735413, 0.05721718445420265, -0.7888134717941284, 1.129602313041687, 0.6324708461761475, 0.27272358536720276, 0.23337192833423615, 1.6139765977859497, 0.7669447660446167, -0.5758857727050781, 0.47511398792266846, 0.48795753717422485, -0.2096419334411621, -2.168057441711426, -0.9928126335144043, 0.24818000197410583, -0.4480118155479431, -1.5916556119918823, 1.3630460500717163, -1.024745225906372, -0.8791666030883789, 0.49159929156303406, 0.1388358324766159, 1.3494353294372559, 0.358334481716156, 1.5996239185333252, 2.0787477493286133, 0.7949695587158203, 0.31060361862182617, 1.2564680576324463, -0.10626576840877533, -0.41338276863098145, 1.773826003074646, -0.49826663732528687, 0.4863942861557007, 1.0677460432052612, -0.3245505690574646, -1.0970513820648193, -0.8291476964950562, -1.2230950593948364, -0.5946696996688843, 1.159085988998413, 0.047440823167562485, -1.0871344804763794, 0.2459869086742401, 1.4969143867492676, 0.11693231761455536, -0.22430306673049927, 0.6771407127380371, 0.5119764804840088, -0.6780241131782532, -0.18678180873394012, -0.8081423044204712, 0.5400713682174683, -0.11512653529644012, -0.3055174648761749, 0.30661919713020325, 0.38524308800697327, 1.349017858505249, -0.09309554100036621, 0.15401802957057953, 1.2000030279159546, -1.4264556169509888, 1.561034083366394, -0.6681148409843445, 0.29882097244262695, -2.419156789779663, 1.379804015159607, -0.7578471899032593, 1.9496309757232666, -2.5219130516052246, 0.48017480969429016, -0.6167554259300232, -0.3952771723270416, 0.3109588027000427, -0.36579272150993347, 0.10285523533821106, -0.1252231001853943, -1.0495916604995728, -0.12579257786273956, -0.7176199555397034, 0.5986287593841553, 1.1906163692474365, 1.3402314186096191, -1.0877145528793335, -0.20121914148330688, -1.8284868001937866, -0.239440456032753, -0.7132056355476379, 0.3566930592060089, -1.9545400142669678, -0.25489574670791626, -2.038137912750244, -2.3717939853668213, -1.2465260028839111, -0.8090566992759705, 0.9981375932693481, 0.1346520632505417, -0.9384300112724304, 1.2524065971374512, -0.28605249524116516, -1.7771399021148682, 1.0296427011489868, -2.1423110961914062 ]
https://github.com/huggingface/datasets/issues/3148
Streaming with num_workers != 0
I can confirm that I was able to reproduce the bug. This seems odd given that #3423 reports duplicate data retrieval when `num_workers` and `streaming` are used together, which is obviously different from what is reported here.
## Describe the bug When using dataset streaming with pytorch DataLoader, the setting num_workers to anything other than 0 causes the code to freeze forever before yielding the first batch. The code owner is likely @lhoestq ## Steps to reproduce the bug For your convenience, we've prepped a colab notebook that reproduces the bug https://colab.research.google.com/drive/1Mgl0oTZSNIE3UeGl_oX9wPCOIxRg19h1?usp=sharing ```python !pip install datasets==1.14.0 should_freeze_forever = True # ^-- set this to True in order to freeze forever, set to False in order to work normally import torch from datasets import load_dataset data = load_dataset("oscar", "unshuffled_deduplicated_bn", split="train", streaming=True) data = data.map(lambda x: {"text": x["text"], "orig": f"oscar[{x['id']}]"}, batched=True) data = data.shuffle(100, seed=1337) data = data.with_format("torch") loader = torch.utils.data.DataLoader(data, batch_size=2, num_workers=2 if should_freeze_forever else 0) # v-- the code should freeze forever at this line for i, row in enumerate(loader): print(row) if i > 10: break print("DONE!") ``` ## Expected results The code should not freeze forever with num_workers=2 ## Actual results The code freezes forever with num_workers=2 ## Environment info - `datasets` version: 1.14.0 (also found in previous versions) - Platform: google colab (also locally) - Python version: 3.7, (also 3.8) - PyArrow version: 3.0.0
1,150
37
Streaming with num_workers != 0 ## Describe the bug When using dataset streaming with pytorch DataLoader, the setting num_workers to anything other than 0 causes the code to freeze forever before yielding the first batch. The code owner is likely @lhoestq ## Steps to reproduce the bug For your convenience, we've prepped a colab notebook that reproduces the bug https://colab.research.google.com/drive/1Mgl0oTZSNIE3UeGl_oX9wPCOIxRg19h1?usp=sharing ```python !pip install datasets==1.14.0 should_freeze_forever = True # ^-- set this to True in order to freeze forever, set to False in order to work normally import torch from datasets import load_dataset data = load_dataset("oscar", "unshuffled_deduplicated_bn", split="train", streaming=True) data = data.map(lambda x: {"text": x["text"], "orig": f"oscar[{x['id']}]"}, batched=True) data = data.shuffle(100, seed=1337) data = data.with_format("torch") loader = torch.utils.data.DataLoader(data, batch_size=2, num_workers=2 if should_freeze_forever else 0) # v-- the code should freeze forever at this line for i, row in enumerate(loader): print(row) if i > 10: break print("DONE!") ``` ## Expected results The code should not freeze forever with num_workers=2 ## Actual results The code freezes forever with num_workers=2 ## Environment info - `datasets` version: 1.14.0 (also found in previous versions) - Platform: google colab (also locally) - Python version: 3.7, (also 3.8) - PyArrow version: 3.0.0 I can confirm that I was able to reproduce the bug. This seems odd given that #3423 reports duplicate data retrieval when `num_workers` and `streaming` are used together, which is obviously different from what is reported here.
[ -1.2899023294448853, -0.9265585541725159, -0.6499216556549072, 1.463195562362671, -0.19381313025951385, -1.187313437461853, 0.19972464442253113, -1.1369507312774658, 1.603285551071167, -0.8811686038970947, 0.27341601252555847, -1.6295222043991089, 0.015482775866985321, -0.5646023154258728, -0.6598725914955139, -0.8975927233695984, -0.4093221426010132, -0.7172465324401855, 1.1662276983261108, 2.4689950942993164, 1.2668790817260742, -1.431077003479004, 2.6999008655548096, 0.7715370059013367, -0.2255716770887375, -1.0061880350112915, 0.5423435568809509, -0.020121963694691658, -1.30239999294281, -0.41191723942756653, -0.9766309261322021, -0.12311362475156784, -0.5293011665344238, -0.459092378616333, -0.022699574008584023, 0.37277984619140625, -0.3158169090747833, -0.39520570635795593, -0.5954278707504272, -0.7384554743766785, 0.49351373314857483, -0.3306964635848999, 0.9434662461280823, -0.34229210019111633, 1.8058568239212036, -0.5819666981697083, 0.5122880339622498, 0.7609261870384216, 1.3516160249710083, 0.21328969299793243, 0.0004385095089673996, 0.38768354058265686, 0.3865240812301636, -0.08978882431983948, 0.529190719127655, 1.1569926738739014, 0.6643192172050476, 0.4909994304180145, 0.73794025182724, -2.20200514793396, 1.2527374029159546, -0.9608846306800842, 0.33048129081726074, 1.4219224452972412, -0.9954985976219177, 0.3656119406223297, -1.7368569374084473, -0.0819629356265068, 0.5705377459526062, -2.249117612838745, 0.3012772798538208, -1.2995359897613525, -0.5452980399131775, 0.9994702935218811, 0.37313392758369446, -1.2114912271499634, 0.0843358188867569, -0.42498376965522766, 1.0366735458374023, 0.3988358974456787, 1.1131666898727417, -1.659596562385559, -0.047225020825862885, -0.324319452047348, 0.10303346067667007, -1.3309992551803589, -1.5770556926727295, 0.545215904712677, 0.6120219230651855, 0.4963116943836212, -0.1583757996559143, 1.098669171333313, -1.057870626449585, 0.7686506509780884, -1.0212829113006592, -1.6847248077392578, -1.4310640096664429, -2.316484212875366, -2.2088608741760254, 0.6814984083175659, -0.4410925507545471, -0.533665120601654, 2.076746702194214, -1.0910123586654663, -1.6999326944351196, 1.1702473163604736, 0.22441557049751282, -0.038854822516441345, 2.4007229804992676, 0.24331414699554443, -0.7079538106918335, 0.5051034688949585, -0.8001638054847717, 0.7354522347450256, -0.38319382071495056, 1.3253467082977295, 0.4162629246711731, -1.058977484703064, 1.590135931968689, -0.3348969519138336, 0.6252102255821228, -0.6169387698173523, -0.5067617893218994, -0.7246895432472229, 0.2739172577857971, 1.9168872833251953, -0.3279901444911957, 1.4858962297439575, -0.28328341245651245, -1.5018137693405151, -1.6035223007202148, 0.963191032409668, 0.48750069737434387, -0.7119384407997131, 0.20624534785747528, -0.3990228474140167, 0.11173328757286072, -0.09856167435646057, 1.110929012298584, 1.3341327905654907, 0.7329623103141785, -0.36124274134635925, -0.9055325984954834, 0.11983425170183182, -0.11733999103307724, -0.7122387886047363, -1.7336692810058594, -0.31295546889305115, 0.06789478659629822, 0.6084527969360352, -1.170438289642334, 1.7882057428359985, 0.9430038332939148, 1.8495243787765503, 0.9970480799674988, -0.3409017026424408, 1.490787148475647, 0.11392057687044144, 1.7933540344238281, -0.455875962972641, 0.657063364982605, -0.37622955441474915, -1.185708999633789, 0.8264273405075073, -0.33531227707862854, -2.0329010486602783, -0.7033348679542542, -0.7438042759895325, -0.20092616975307465, -0.8417251706123352, 0.9460809826850891, -0.29006338119506836, -1.4308655261993408, 0.26991957426071167, -0.7074678540229797, 0.15705940127372742, -1.2843189239501953, 0.430173397064209, 0.6817241907119751, -0.6191242337226868, 0.04769471287727356, -0.25051355361938477, -1.2274926900863647, -0.47847995162010193, 0.2500123679637909, 1.8502585887908936, -0.7743087410926819, 0.9280387759208679, 1.0711067914962769, -0.729816734790802, 0.008970016613602638, 0.32089126110076904, -0.3436056673526764, 0.8451985120773315, -1.0216002464294434, -0.45011231303215027, 1.1575459241867065, -0.20677320659160614, -0.5600020885467529, 1.4827985763549805, 0.7001039385795593, -0.9836723208427429, -0.23478278517723083, -0.14165669679641724, -0.8176468014717102, 0.02547360025346279, -1.5811772346496582, -0.14377723634243011, 0.44312331080436707, -1.5059998035430908, -0.4876132011413574, -0.1617927998304367, 1.3483259677886963, -0.15124063193798065, 1.4637384414672852, -0.32148972153663635, -0.13891716301441193, -0.32910603284835815, -0.3683965504169464, 0.16343502700328827, -0.18458956480026245, -0.6534335017204285, 0.1835848093032837, -0.778303861618042, 0.27745717763900757, 1.4609606266021729, 0.32038483023643494, 0.029093949124217033, 0.4955848157405853, 1.0714080333709717, 0.35740336775779724, -0.11333439499139786, -0.8678843975067139, -1.4988962411880493, 1.9346044063568115, -1.4497137069702148, 2.0435009002685547, 0.8102048635482788, -0.04362686723470688, -1.776706576347351, -1.8665567636489868, 1.3891721963882446, 1.1505508422851562, 2.3322019577026367, 0.5033449530601501, 0.42538559436798096, -0.8503670692443848, -0.7134225964546204, 0.2689262628555298, -0.9726932644844055, -0.665070652961731, 0.14667172729969025, 2.3986713886260986, 1.7486540079116821, -0.47457754611968994, -0.14642807841300964, -1.0362190008163452, 1.3549864292144775, -0.16830527782440186, 0.23065713047981262, 1.9576460123062134, -0.22364985942840576, -1.0394846200942993, 1.3075153827667236, -2.3783185482025146, 0.13080939650535583, 2.031129837036133, 0.26941266655921936, 0.08217312395572662, -1.2584075927734375, -0.6637161374092102, -0.2968288064002991, -0.46806150674819946, -1.230505108833313, 0.4947374165058136, -0.2783835232257843, -0.7287377119064331, -1.3852027654647827, 0.17846205830574036, -1.1184618473052979, -1.6169967651367188, 0.19421729445457458, 1.86128568649292, 2.0907673835754395, -0.7863476872444153, 1.5439642667770386, -0.3472084403038025, 0.16928787529468536, 1.187526822090149, 1.2749807834625244, 3.159123420715332, 1.919845700263977, -1.3764326572418213, 0.6401382088661194, -0.15035605430603027, -0.4880286157131195, 1.1440595388412476, -1.1657893657684326, 1.3523029088974, -0.12541024386882782, -1.1960941553115845, -1.2177588939666748, 0.9661861062049866, 0.5097993612289429, 0.09175252169370651, -0.486858069896698, 1.1720457077026367, 0.13392938673496246, 1.3733326196670532, 0.5124579071998596, -0.26912710070610046, 0.6344329714775085, -0.3583933711051941, -0.4682118594646454, 1.6062263250350952, 0.1849411427974701, -1.4461332559585571, -2.3119208812713623, -0.22075098752975464, -0.9008053541183472, 0.0825330838561058, -0.6473647356033325, -1.009560465812683, 1.6215691566467285, 0.3386591374874115, -1.2157480716705322, -0.29058966040611267, -0.35629788041114807, -0.575039803981781, 2.661548376083374, -1.3914986848831177, -0.2591724991798401, -0.9813500642776489, -0.6779465079307556, 1.633915662765503, -1.2319209575653076, -0.21486157178878784, -1.0303689241409302, -0.5384072065353394, -1.2487238645553589, -0.5272237062454224, 0.010414540767669678, -1.0047539472579956, 0.8850048184394836, 0.20601487159729004, -1.2033648490905762, -0.3388439118862152, -0.8407562375068665, 0.937454342842102, -0.10925059765577316, 0.16895818710327148, 1.7755305767059326, 0.3412321209907532, -0.4205392003059387, 0.787056028842926, 1.1750445365905762, 0.6178932785987854, -0.6748459339141846, 0.1861051768064499, -0.6785150766372681, 0.3281324505805969, -1.2486379146575928, 0.23705844581127167, -2.880913019180298, 0.6178118586540222, -0.05824432522058487, -0.06007032096385956, -0.007599329575896263, -1.302624225616455, 1.0608705282211304, 2.553391218185425, -1.143743634223938, 0.5302605032920837, 0.3329136371612549, 1.2109577655792236, -1.5982102155685425, 0.1963660717010498, -0.44853371381759644, 2.0419676303863525, 0.2088748961687088, 1.2140270471572876, -0.4630142152309418, -2.350407600402832, 0.6023801565170288, -1.2460960149765015, -1.180332064628601, 0.8215692639350891, -0.8189168572425842, 0.12784117460250854, -1.3793271780014038, -0.2662425637245178, -0.842581033706665, -1.1041889190673828, 0.647964596748352, 0.10847767442464828, 0.45641136169433594, -0.6550020575523376, 0.3296363055706024, -2.267385721206665, -1.3110774755477905, -0.18792952597141266, -0.9059401750564575, 0.44838470220565796, -0.4447910487651825, 0.7796754240989685, -0.22153519093990326, -0.006929926574230194, 0.3170543909072876, 1.4400705099105835, 3.3077232837677, 0.13283705711364746, 0.3398077189922333, -0.22241583466529846, -0.9243341684341431, 1.5196123123168945, 0.9031685590744019, -0.1396629512310028, -0.5487729907035828, -1.055415153503418, 1.2069225311279297, 1.8380115032196045, 0.9449569582939148, -0.024879399687051773, -0.8611166477203369, -0.6835216283798218, -0.07299497723579407, 0.17951330542564392, 0.43155911564826965, 0.959588348865509, 0.021167322993278503, 0.08680428564548492, 1.426451563835144, 1.1836216449737549, -0.47184765338897705, 0.3170512020587921, -0.8340384364128113, -0.47593429684638977, 0.5391145348548889, 0.27639055252075195, 0.03914774954319, 0.34120264649391174, -0.9773267507553101, -0.2741403877735138, -0.37758100032806396, -0.8825073838233948, -0.71848064661026, -0.4420047402381897, -0.3471318483352661, 1.6040890216827393, 0.11755254119634628, -0.47300902009010315, -0.03128610551357269, -0.8223038911819458, -0.11158718168735504, -1.176492691040039, 0.26294881105422974, -0.08654917031526566, -0.09806261211633682, -0.14743520319461823, 1.7686845064163208, -0.9403085708618164, -2.053889274597168, 0.21523302793502808, 0.26018500328063965, -0.2427033632993698, 0.21393412351608276, 1.7092794179916382, 0.5764249563217163, 1.4621164798736572, 1.3184221982955933, 0.9635604023933411, -0.6099088191986084, -1.260974407196045, 0.7584555745124817, 0.9676546454429626, -1.4443076848983765, 0.7820857763290405, 0.0256821159273386, -0.57723069190979, 0.6360160112380981, 1.207114338874817, 0.5030543208122253, -2.031846046447754, 0.8573868870735168, -1.010751724243164, 0.7920246720314026, 0.7627933621406555, 0.6943190097808838, 0.19149306416511536, 0.8396432399749756, -1.1786205768585205, -1.1473667621612549, -0.7255113124847412, -0.6743007898330688, 2.039203405380249, -0.33368948101997375, 0.5869594216346741, -0.24934303760528564, -1.3316643238067627, -0.004959747660905123, 0.6604689955711365, 0.314027339220047, -0.39430639147758484, 0.8311969637870789, -0.7095431089401245, -1.1787785291671753, -1.3553297519683838, -0.3819102644920349, -1.0985718965530396, -0.929625391960144, 1.097360372543335, 0.7430066466331482, 0.3061197102069855, 1.855999231338501, 0.6666930913925171, 0.2744227349758148, -2.5649735927581787, 0.9437974691390991, 0.2615770399570465, -0.08470726758241653, 0.8805046677589417, 0.3280944526195526, 1.063032627105713, -0.013484623283147812, 0.4791387617588043, -2.4964599609375, 2.3039298057556152, -0.18767069280147552, 0.6942929625511169, -0.03765619546175003, -0.11275019496679306, 1.1039098501205444, 0.6522911190986633, 0.5134984850883484, -1.05218505859375, 0.622169017791748, -0.5796821713447571, 1.2495832443237305, 0.8435274958610535, -0.8207488059997559, -0.033694587647914886, 1.363672137260437, 0.45310330390930176, -0.47406360507011414, -0.9018354415893555, -0.976740837097168, 0.9652257561683655, 1.6899105310440063, -0.041775837540626526, 0.07510938495397568, 0.7738854885101318, 0.7224940657615662, -1.355482816696167, 0.06222064048051834, -0.6870062947273254, -0.6792562007904053, 1.6757539510726929, 2.0922794342041016, -0.14234192669391632, -0.1607276201248169, -0.6759056448936462, -1.355940341949463, 0.8077573180198669, -0.09561499208211899, 0.20655280351638794, 0.6202534437179565, -0.6421676874160767, 1.0044554471969604, 0.8627399206161499, 0.9016222357749939, 0.256242960691452, 0.16488204896450043, 0.41113391518592834, -0.32220447063446045, -1.0781798362731934, -0.17984241247177124, -1.0512752532958984, -2.5654354095458984, 0.44261494278907776, -0.19826024770736694, -1.416846513748169, 0.0352836474776268, -1.0443623065948486, 0.9420329332351685, -0.6057637333869934, -1.0871756076812744, -1.560004472732544, 0.16547797620296478, -0.033207617700099945, 0.9689798951148987, -1.6126039028167725, -0.12013962119817734, 1.2222203016281128, 0.9365311861038208, -0.6162062287330627, 1.0499545335769653, 0.28411996364593506, 1.0117303133010864, 0.796902596950531, -0.4279741644859314, 0.5498878359794617, 0.009111596271395683, -1.3563086986541748, 0.449605256319046, 1.251656413078308, 0.22634191811084747, 1.4749013185501099, -0.5243750810623169, -0.00495785241946578, 0.3518502414226532, -0.5670958161354065, -0.49763038754463196, -0.5150212049484253, 0.6190683245658875, 0.030893029645085335, -0.9530436396598816, -0.04809987545013428, -0.09640088677406311, -0.2698087990283966, 0.16809938848018646, -1.4842987060546875, -0.11970070004463196, -0.436138391494751, -0.6692975759506226, -1.2946337461471558, 0.017712462693452835, 1.4268198013305664, -0.825539767742157, -0.144134059548378, 0.42209288477897644, 0.35052263736724854, 0.48905348777770996, 0.6656783819198608, -0.6718171238899231, -0.2664300501346588, -0.23621702194213867, -0.3516944646835327, 0.320495069026947, 1.404589056968689, -0.16421811282634735, -1.0059516429901123, 0.6513975262641907, -0.3706315755844116, 0.08918394148349762, 1.922503113746643, 0.058380126953125, -0.7878585457801819, 0.3060678243637085, -0.7455703616142273, 1.9424619674682617, 1.7098954916000366, 1.4287256002426147, -0.18909111618995667, -0.899161696434021, 0.6235995888710022, -0.3933573067188263, -0.35844534635543823, 0.8919612169265747, 0.389210969209671, -0.24686063826084137, -1.4376087188720703, 0.7114932537078857, 1.291446566581726, -0.8384324908256531, -0.811474084854126, 0.16802191734313965, -0.7904150485992432, 1.1099287271499634, 0.708322286605835, 0.39433178305625916, 0.2775230407714844, 1.613186001777649, 0.8369561433792114, -0.5361555814743042, 0.5414155721664429, 0.5477156043052673, -0.09028244763612747, -2.0929625034332275, -1.103852391242981, 0.3438985049724579, -0.5250247716903687, -1.5743697881698608, 1.4411823749542236, -1.1199697256088257, -1.0297236442565918, 0.5525200366973877, 0.07500175386667252, 1.346229076385498, 0.415973961353302, 1.5415866374969482, 2.0756747722625732, 0.8549606204032898, 0.4384678900241852, 1.2165926694869995, -0.18522554636001587, -0.4007578194141388, 1.7885339260101318, -0.4569548964500427, 0.4337739646434784, 1.1236381530761719, -0.280540406703949, -1.116174578666687, -0.7924647331237793, -1.239682674407959, -0.7413893938064575, 1.1843973398208618, 0.08138776570558548, -1.034885048866272, 0.26277750730514526, 1.5818696022033691, 0.08640462905168533, -0.3333931565284729, 0.7143643498420715, 0.4202836751937866, -0.8203061819076538, -0.0457010343670845, -0.9032577872276306, 0.5635018944740295, -0.2638263702392578, -0.3423141837120056, 0.3634807765483856, 0.5186144709587097, 1.3300738334655762, -0.06772938370704651, 0.11342421174049377, 1.1532617807388306, -1.4490365982055664, 1.4784984588623047, -0.7090814709663391, 0.22046150267124176, -2.35583758354187, 1.4105103015899658, -0.745542585849762, 1.9472359418869019, -2.7457261085510254, 0.4760235846042633, -0.6121336221694946, -0.4800507724285126, 0.26712125539779663, -0.3956126570701599, 0.08634397387504578, -0.1425618976354599, -1.1865688562393188, -0.07766217738389969, -0.6661636829376221, 0.5590727925300598, 1.1082936525344849, 1.3367516994476318, -1.1128289699554443, -0.24121588468551636, -1.6907057762145996, -0.12755291163921356, -0.7548891305923462, 0.3464275300502777, -1.997016191482544, -0.25894102454185486, -1.9359110593795776, -2.3501524925231934, -1.226862907409668, -0.7915821075439453, 1.158594012260437, 0.12904271483421326, -0.8851838111877441, 1.2681670188903809, -0.4142553210258484, -1.8120522499084473, 1.0975260734558105, -2.178271770477295 ]
https://github.com/huggingface/datasets/issues/3148
Streaming with num_workers != 0
Any update? A possible solution is to have multiple arrow files as shards, and handle them like what webdatasets does. ![image](https://user-images.githubusercontent.com/11533479/148176637-72746b2c-c122-47aa-bbfe-224b13ee9a71.png) Pytorch's new dataset RFC is supporting sharding now, which may helps avoid duplicate data under streaming mode. (https://github.com/pytorch/pytorch/blob/master/torch/utils/data/datapipes/iter/grouping.py#L13)
## Describe the bug When using dataset streaming with pytorch DataLoader, the setting num_workers to anything other than 0 causes the code to freeze forever before yielding the first batch. The code owner is likely @lhoestq ## Steps to reproduce the bug For your convenience, we've prepped a colab notebook that reproduces the bug https://colab.research.google.com/drive/1Mgl0oTZSNIE3UeGl_oX9wPCOIxRg19h1?usp=sharing ```python !pip install datasets==1.14.0 should_freeze_forever = True # ^-- set this to True in order to freeze forever, set to False in order to work normally import torch from datasets import load_dataset data = load_dataset("oscar", "unshuffled_deduplicated_bn", split="train", streaming=True) data = data.map(lambda x: {"text": x["text"], "orig": f"oscar[{x['id']}]"}, batched=True) data = data.shuffle(100, seed=1337) data = data.with_format("torch") loader = torch.utils.data.DataLoader(data, batch_size=2, num_workers=2 if should_freeze_forever else 0) # v-- the code should freeze forever at this line for i, row in enumerate(loader): print(row) if i > 10: break print("DONE!") ``` ## Expected results The code should not freeze forever with num_workers=2 ## Actual results The code freezes forever with num_workers=2 ## Environment info - `datasets` version: 1.14.0 (also found in previous versions) - Platform: google colab (also locally) - Python version: 3.7, (also 3.8) - PyArrow version: 3.0.0
1,150
39
Streaming with num_workers != 0 ## Describe the bug When using dataset streaming with pytorch DataLoader, the setting num_workers to anything other than 0 causes the code to freeze forever before yielding the first batch. The code owner is likely @lhoestq ## Steps to reproduce the bug For your convenience, we've prepped a colab notebook that reproduces the bug https://colab.research.google.com/drive/1Mgl0oTZSNIE3UeGl_oX9wPCOIxRg19h1?usp=sharing ```python !pip install datasets==1.14.0 should_freeze_forever = True # ^-- set this to True in order to freeze forever, set to False in order to work normally import torch from datasets import load_dataset data = load_dataset("oscar", "unshuffled_deduplicated_bn", split="train", streaming=True) data = data.map(lambda x: {"text": x["text"], "orig": f"oscar[{x['id']}]"}, batched=True) data = data.shuffle(100, seed=1337) data = data.with_format("torch") loader = torch.utils.data.DataLoader(data, batch_size=2, num_workers=2 if should_freeze_forever else 0) # v-- the code should freeze forever at this line for i, row in enumerate(loader): print(row) if i > 10: break print("DONE!") ``` ## Expected results The code should not freeze forever with num_workers=2 ## Actual results The code freezes forever with num_workers=2 ## Environment info - `datasets` version: 1.14.0 (also found in previous versions) - Platform: google colab (also locally) - Python version: 3.7, (also 3.8) - PyArrow version: 3.0.0 Any update? A possible solution is to have multiple arrow files as shards, and handle them like what webdatasets does. ![image](https://user-images.githubusercontent.com/11533479/148176637-72746b2c-c122-47aa-bbfe-224b13ee9a71.png) Pytorch's new dataset RFC is supporting sharding now, which may helps avoid duplicate data under streaming mode. (https://github.com/pytorch/pytorch/blob/master/torch/utils/data/datapipes/iter/grouping.py#L13)
[ -1.2767499685287476, -0.9275940656661987, -0.6532034873962402, 1.4667311906814575, -0.18468055129051208, -1.1943587064743042, 0.18698257207870483, -1.1339880228042603, 1.6053779125213623, -0.8631937503814697, 0.2601699233055115, -1.6242579221725464, 0.015748506411910057, -0.5624552965164185, -0.660775899887085, -0.9085753560066223, -0.4203038811683655, -0.7197617292404175, 1.1516506671905518, 2.4873688220977783, 1.2663229703903198, -1.423169493675232, 2.697997808456421, 0.7873435020446777, -0.2315463125705719, -0.981731116771698, 0.551409900188446, -0.0020124162547290325, -1.2985633611679077, -0.401417076587677, -0.9782333374023438, -0.11114179342985153, -0.5502520203590393, -0.45448386669158936, -0.0328640416264534, 0.35300660133361816, -0.29907703399658203, -0.39249444007873535, -0.6150280833244324, -0.7534592747688293, 0.49891096353530884, -0.33368104696273804, 0.9406895637512207, -0.32549309730529785, 1.810425043106079, -0.5965362787246704, 0.5145939588546753, 0.7641696333885193, 1.3508412837982178, 0.20504899322986603, 0.0015194565057754517, 0.3986150026321411, 0.38955140113830566, -0.08896063268184662, 0.5244267582893372, 1.1687648296356201, 0.686759889125824, 0.5096211433410645, 0.7331256866455078, -2.2037863731384277, 1.2651557922363281, -0.9713691473007202, 0.34000086784362793, 1.4002183675765991, -0.9854807257652283, 0.37558645009994507, -1.7357523441314697, -0.09048457443714142, 0.5672613382339478, -2.2527763843536377, 0.3239264488220215, -1.3148075342178345, -0.5476794838905334, 0.9790196418762207, 0.367652952671051, -1.1979055404663086, 0.10528749972581863, -0.4358970522880554, 1.042026400566101, 0.4068920612335205, 1.1031631231307983, -1.6579115390777588, -0.0564221516251564, -0.3095399737358093, 0.1107541173696518, -1.3139324188232422, -1.5780616998672485, 0.5334901809692383, 0.6097703576087952, 0.5085639953613281, -0.13885097205638885, 1.0765619277954102, -1.0557206869125366, 0.7904744744300842, -1.019425630569458, -1.68168044090271, -1.432823657989502, -2.321959972381592, -2.215855360031128, 0.6847506761550903, -0.4548822045326233, -0.5423181653022766, 2.0686511993408203, -1.093775987625122, -1.7039170265197754, 1.1748051643371582, 0.22056736052036285, -0.043764159083366394, 2.4239628314971924, 0.2351512461900711, -0.7227401733398438, 0.5201634764671326, -0.8098872900009155, 0.7619218230247498, -0.38315725326538086, 1.3206993341445923, 0.4262958765029907, -1.0595834255218506, 1.5887492895126343, -0.359147846698761, 0.5993456244468689, -0.6119253039360046, -0.5222011208534241, -0.7359569072723389, 0.26639270782470703, 1.9159437417984009, -0.327802836894989, 1.4802347421646118, -0.2806888818740845, -1.5070966482162476, -1.5998684167861938, 0.9535107016563416, 0.5001420378684998, -0.731063723564148, 0.18870653212070465, -0.3835543990135193, 0.12059231102466583, -0.08632177114486694, 1.1005443334579468, 1.3336927890777588, 0.730055034160614, -0.37974005937576294, -0.9171998500823975, 0.10089404881000519, -0.12191450595855713, -0.7007302641868591, -1.7483433485031128, -0.3165935277938843, 0.07784483581781387, 0.61368727684021, -1.1849344968795776, 1.776788353919983, 0.9525651335716248, 1.8443093299865723, 0.9953343868255615, -0.3423982858657837, 1.492964744567871, 0.08386489748954773, 1.7859927415847778, -0.47373270988464355, 0.6718716621398926, -0.3750920295715332, -1.1923909187316895, 0.8119672536849976, -0.32385337352752686, -2.0376319885253906, -0.711766242980957, -0.7461417317390442, -0.21126826107501984, -0.8337659239768982, 0.9389657378196716, -0.3126477003097534, -1.4254579544067383, 0.26567333936691284, -0.712586522102356, 0.15687206387519836, -1.300686240196228, 0.40635424852371216, 0.6837129592895508, -0.6106690168380737, 0.04810817167162895, -0.22801212966442108, -1.2290483713150024, -0.49692100286483765, 0.23164688050746918, 1.8540161848068237, -0.7737721800804138, 0.9182944297790527, 1.0824501514434814, -0.7252317070960999, 0.005657488480210304, 0.3424132466316223, -0.32845717668533325, 0.8545427322387695, -1.0219531059265137, -0.4415857791900635, 1.1641021966934204, -0.2020147144794464, -0.5556586384773254, 1.4910014867782593, 0.7080215215682983, -0.973086416721344, -0.24419724941253662, -0.12482178956270218, -0.8182609677314758, 0.018985796719789505, -1.5700654983520508, -0.1365385502576828, 0.4290320873260498, -1.4966511726379395, -0.4831322431564331, -0.1878136247396469, 1.3562895059585571, -0.14792940020561218, 1.4648104906082153, -0.3420789837837219, -0.13657572865486145, -0.3430256247520447, -0.3712526559829712, 0.16809087991714478, -0.19145895540714264, -0.6346590518951416, 0.19572046399116516, -0.7846924066543579, 0.28109681606292725, 1.481595516204834, 0.3285999298095703, 0.0557602196931839, 0.4785364270210266, 1.062041997909546, 0.3607776165008545, -0.12567543983459473, -0.8696354627609253, -1.497915267944336, 1.9521363973617554, -1.449846625328064, 2.043272018432617, 0.8290462493896484, -0.03024768829345703, -1.7772817611694336, -1.8730872869491577, 1.3691725730895996, 1.1562042236328125, 2.3530681133270264, 0.5143930912017822, 0.4253804087638855, -0.8670516014099121, -0.6921678781509399, 0.2612888216972351, -1.0003565549850464, -0.6874603629112244, 0.14149829745292664, 2.402827262878418, 1.7450531721115112, -0.46624332666397095, -0.14658817648887634, -1.0551468133926392, 1.3616641759872437, -0.14643210172653198, 0.2384740114212036, 1.9492557048797607, -0.23345127701759338, -1.0383001565933228, 1.3082280158996582, -2.3803367614746094, 0.13086330890655518, 2.0282652378082275, 0.27865391969680786, 0.07867146283388138, -1.2699495553970337, -0.6583423614501953, -0.3085956573486328, -0.482917845249176, -1.2188729047775269, 0.5084449648857117, -0.28021037578582764, -0.7453495860099792, -1.390527367591858, 0.16230517625808716, -1.115201711654663, -1.6316386461257935, 0.22344182431697845, 1.845487356185913, 2.0957581996917725, -0.7824492454528809, 1.552584171295166, -0.3507596254348755, 0.1807553917169571, 1.1844252347946167, 1.2933706045150757, 3.1575000286102295, 1.914218544960022, -1.3696147203445435, 0.6455076932907104, -0.16292184591293335, -0.47674626111984253, 1.1311498880386353, -1.1757618188858032, 1.3509204387664795, -0.11270702630281448, -1.2034605741500854, -1.2146645784378052, 0.9747581481933594, 0.4924723505973816, 0.08484569936990738, -0.4858698844909668, 1.1693766117095947, 0.12196360528469086, 1.3708633184432983, 0.507330060005188, -0.2754204273223877, 0.6052235960960388, -0.34578651189804077, -0.46840089559555054, 1.6171410083770752, 0.17718736827373505, -1.4520758390426636, -2.327819347381592, -0.22919318079948425, -0.915203869342804, 0.06927113234996796, -0.6373253464698792, -1.008628010749817, 1.6444158554077148, 0.33636945486068726, -1.225275993347168, -0.27784448862075806, -0.35112911462783813, -0.5585724115371704, 2.6594436168670654, -1.4074480533599854, -0.25458183884620667, -0.9767667651176453, -0.6630504727363586, 1.6302287578582764, -1.2286949157714844, -0.2118963897228241, -1.0236445665359497, -0.541024386882782, -1.2516095638275146, -0.523846447467804, -0.015955453738570213, -1.0096365213394165, 0.8493860960006714, 0.1962614506483078, -1.1797469854354858, -0.34553974866867065, -0.8488370776176453, 0.9516892433166504, -0.1005064845085144, 0.18168112635612488, 1.805153727531433, 0.3410158157348633, -0.39804404973983765, 0.7870967984199524, 1.1840131282806396, 0.6126081943511963, -0.6873250007629395, 0.16112175583839417, -0.6811602711677551, 0.32945162057876587, -1.2416070699691772, 0.2395995855331421, -2.886249303817749, 0.6382585167884827, -0.06009425222873688, -0.06609679758548737, -0.005491513758897781, -1.295088291168213, 1.083998441696167, 2.562053680419922, -1.133301854133606, 0.5281286239624023, 0.33207857608795166, 1.2004008293151855, -1.590944766998291, 0.19741134345531464, -0.4508931040763855, 2.054780960083008, 0.21616323292255402, 1.2155758142471313, -0.464205801486969, -2.3505795001983643, 0.6099576354026794, -1.24196195602417, -1.1690071821212769, 0.8156440258026123, -0.8272100687026978, 0.1235048770904541, -1.3666859865188599, -0.2561134994029999, -0.8636935353279114, -1.114742398262024, 0.6334782242774963, 0.11175233870744705, 0.4575847387313843, -0.6448782086372375, 0.3226372003555298, -2.2637176513671875, -1.30398690700531, -0.17940160632133484, -0.8975982069969177, 0.47714167833328247, -0.4311283230781555, 0.7818025946617126, -0.2173580527305603, 0.0029937149956822395, 0.3267211318016052, 1.4344441890716553, 3.311387300491333, 0.14842256903648376, 0.3329075574874878, -0.19847840070724487, -0.9296699166297913, 1.5086580514907837, 0.9167268872261047, -0.14774274826049805, -0.5571926832199097, -1.0551974773406982, 1.2242985963821411, 1.84587824344635, 0.9411248564720154, -0.03129515051841736, -0.8515741229057312, -0.6759292483329773, -0.041979365050792694, 0.1813773512840271, 0.4174157381057739, 0.9578142762184143, 0.01174074038863182, 0.080980084836483, 1.4480092525482178, 1.2031638622283936, -0.47697216272354126, 0.32284289598464966, -0.8380593657493591, -0.4728727340698242, 0.5363922119140625, 0.25797098875045776, 0.03510194271802902, 0.3500354290008545, -0.9839043021202087, -0.25578537583351135, -0.3743581175804138, -0.8790497779846191, -0.7181860208511353, -0.4569604992866516, -0.35959315299987793, 1.5944832563400269, 0.12579664587974548, -0.46747666597366333, -0.019674081355333328, -0.8195048570632935, -0.11930956691503525, -1.172433614730835, 0.28069448471069336, -0.09392444044351578, -0.09073567390441895, -0.16113583743572235, 1.7893201112747192, -0.9298781156539917, -2.0532820224761963, 0.22098304331302643, 0.2514238953590393, -0.260296106338501, 0.21638627350330353, 1.7117546796798706, 0.5681285858154297, 1.4544049501419067, 1.3132641315460205, 0.9499461650848389, -0.6073547601699829, -1.2454551458358765, 0.7536985874176025, 0.9700755476951599, -1.4390058517456055, 0.7822069525718689, 0.0007553966715931892, -0.5749489665031433, 0.6522457003593445, 1.2084565162658691, 0.48488831520080566, -2.0225870609283447, 0.8705216646194458, -1.0087172985076904, 0.8097947239875793, 0.7639292478561401, 0.6739376187324524, 0.17238125205039978, 0.8268778324127197, -1.1955370903015137, -1.1432822942733765, -0.7181491851806641, -0.6772546768188477, 2.00614070892334, -0.3204493522644043, 0.5873429775238037, -0.24451972544193268, -1.3097620010375977, -0.013559349812567234, 0.6667304039001465, 0.3098202347755432, -0.4001582860946655, 0.8345093727111816, -0.6917431950569153, -1.1808362007141113, -1.3414545059204102, -0.38609403371810913, -1.0828700065612793, -0.9165125489234924, 1.0793440341949463, 0.7431803941726685, 0.3087345361709595, 1.8744878768920898, 0.6685788035392761, 0.27018481492996216, -2.5774741172790527, 0.9331695437431335, 0.25308549404144287, -0.06807245314121246, 0.8955724835395813, 0.32451486587524414, 1.0540242195129395, -0.008009853772819042, 0.4655243754386902, -2.480079174041748, 2.3034894466400146, -0.18250931799411774, 0.6962385773658752, -0.021519728004932404, -0.08466170728206635, 1.1063222885131836, 0.640605092048645, 0.5232768058776855, -1.0607563257217407, 0.5951202511787415, -0.5827488303184509, 1.2467174530029297, 0.8172722458839417, -0.8268387913703918, -0.03306715190410614, 1.3439115285873413, 0.44991499185562134, -0.4604346752166748, -0.8989541530609131, -0.9698989391326904, 0.9612312912940979, 1.7029662132263184, -0.04956180229783058, 0.08245610445737839, 0.7731821537017822, 0.7067601084709167, -1.3506553173065186, 0.047594260424375534, -0.6852568984031677, -0.6713907122612, 1.6640182733535767, 2.0663461685180664, -0.13665401935577393, -0.1602514386177063, -0.6539681553840637, -1.3727630376815796, 0.8323607444763184, -0.10801638662815094, 0.209447979927063, 0.6299045085906982, -0.6439486742019653, 0.993094801902771, 0.861696720123291, 0.9076659679412842, 0.26974278688430786, 0.16993699967861176, 0.3992385268211365, -0.3271043300628662, -1.082584261894226, -0.1774832159280777, -1.0626928806304932, -2.5534048080444336, 0.4241564869880676, -0.1999921202659607, -1.4208816289901733, 0.03198501095175743, -1.0410200357437134, 0.9417914748191833, -0.5928681492805481, -1.075777292251587, -1.5387998819351196, 0.18206456303596497, -0.03635278716683388, 0.9688815474510193, -1.5968267917633057, -0.12496808171272278, 1.212934970855713, 0.9332810640335083, -0.6214734315872192, 1.0708742141723633, 0.29575008153915405, 1.008231282234192, 0.8036568760871887, -0.4258551001548767, 0.5459938645362854, 0.016863210126757622, -1.3611564636230469, 0.43818575143814087, 1.2473161220550537, 0.2275197058916092, 1.4754371643066406, -0.530502200126648, -0.00726687628775835, 0.35286104679107666, -0.5840470790863037, -0.4885683059692383, -0.5200198292732239, 0.605754554271698, 0.02296910434961319, -0.9703065156936646, -0.04169248417019844, -0.09293001890182495, -0.2684997320175171, 0.1727040410041809, -1.4703174829483032, -0.13134965300559998, -0.4457017779350281, -0.6508924961090088, -1.2996723651885986, 0.010424766689538956, 1.4316073656082153, -0.8268765211105347, -0.15140101313591003, 0.4249259829521179, 0.35804784297943115, 0.4984825849533081, 0.6922370791435242, -0.6507894992828369, -0.2724291682243347, -0.23669196665287018, -0.33784228563308716, 0.32876336574554443, 1.3862435817718506, -0.16884341835975647, -0.9921130537986755, 0.6613816618919373, -0.35756224393844604, 0.10296113789081573, 1.9144177436828613, 0.06340500712394714, -0.774160623550415, 0.30576467514038086, -0.7513537406921387, 1.951033115386963, 1.71524178981781, 1.4023984670639038, -0.19942042231559753, -0.8878892064094543, 0.609866201877594, -0.38496559858322144, -0.3431246280670166, 0.896623969078064, 0.3911275267601013, -0.2520905137062073, -1.4304933547973633, 0.6926517486572266, 1.2857686281204224, -0.8343756198883057, -0.798323929309845, 0.17497941851615906, -0.7855018377304077, 1.1099669933319092, 0.7105740904808044, 0.3996044397354126, 0.2766212224960327, 1.6243873834609985, 0.8470003604888916, -0.5403739809989929, 0.5221901535987854, 0.5565419793128967, -0.09109392017126083, -2.115807056427002, -1.099170446395874, 0.3181529641151428, -0.5183404088020325, -1.5763946771621704, 1.4284627437591553, -1.120107889175415, -1.025766372680664, 0.5658389329910278, 0.08546405285596848, 1.3392055034637451, 0.40933138132095337, 1.5479278564453125, 2.0838873386383057, 0.8457075953483582, 0.43041467666625977, 1.2250269651412964, -0.17643287777900696, -0.40778809785842896, 1.7933954000473022, -0.44825708866119385, 0.44028639793395996, 1.109100341796875, -0.3039973974227905, -1.0973925590515137, -0.787714421749115, -1.2322311401367188, -0.74847811460495, 1.1708018779754639, 0.08238601684570312, -1.0280895233154297, 0.25213342905044556, 1.5707569122314453, 0.06876423954963684, -0.32331979274749756, 0.6981066465377808, 0.4020630717277527, -0.8017415404319763, -0.0587204284965992, -0.900854766368866, 0.5624317526817322, -0.2495819479227066, -0.3595995306968689, 0.33740830421447754, 0.4914698600769043, 1.2995831966400146, -0.06376108527183533, 0.11731232702732086, 1.1578500270843506, -1.4425207376480103, 1.4919203519821167, -0.7051552534103394, 0.23222346603870392, -2.359370708465576, 1.4079642295837402, -0.739144504070282, 1.939761996269226, -2.741647958755493, 0.4699283242225647, -0.5965092182159424, -0.4963564872741699, 0.2578420042991638, -0.3918304443359375, 0.08989313989877701, -0.1538071632385254, -1.1692166328430176, -0.08373934030532837, -0.6576328277587891, 0.5392593741416931, 1.1060919761657715, 1.3370652198791504, -1.1087108850479126, -0.24560339748859406, -1.699991226196289, -0.12716928124427795, -0.7623394727706909, 0.3358144164085388, -1.9934179782867432, -0.25035059452056885, -1.9264572858810425, -2.3447556495666504, -1.2704482078552246, -0.7958118915557861, 1.166689395904541, 0.1435469388961792, -0.8923367857933044, 1.2588039636611938, -0.4221417307853699, -1.8304094076156616, 1.1088300943374634, -2.2028844356536865 ]
https://github.com/huggingface/datasets/issues/3148
Streaming with num_workers != 0
Hi ! Thanks for the insights :) Note that in streaming mode there're usually no arrow files. The data are streamed from TAR, ZIP, text, etc. files directly from the web. Though for sharded datasets we can definitely adopt a similar strategy !
## Describe the bug When using dataset streaming with pytorch DataLoader, the setting num_workers to anything other than 0 causes the code to freeze forever before yielding the first batch. The code owner is likely @lhoestq ## Steps to reproduce the bug For your convenience, we've prepped a colab notebook that reproduces the bug https://colab.research.google.com/drive/1Mgl0oTZSNIE3UeGl_oX9wPCOIxRg19h1?usp=sharing ```python !pip install datasets==1.14.0 should_freeze_forever = True # ^-- set this to True in order to freeze forever, set to False in order to work normally import torch from datasets import load_dataset data = load_dataset("oscar", "unshuffled_deduplicated_bn", split="train", streaming=True) data = data.map(lambda x: {"text": x["text"], "orig": f"oscar[{x['id']}]"}, batched=True) data = data.shuffle(100, seed=1337) data = data.with_format("torch") loader = torch.utils.data.DataLoader(data, batch_size=2, num_workers=2 if should_freeze_forever else 0) # v-- the code should freeze forever at this line for i, row in enumerate(loader): print(row) if i > 10: break print("DONE!") ``` ## Expected results The code should not freeze forever with num_workers=2 ## Actual results The code freezes forever with num_workers=2 ## Environment info - `datasets` version: 1.14.0 (also found in previous versions) - Platform: google colab (also locally) - Python version: 3.7, (also 3.8) - PyArrow version: 3.0.0
1,150
43
Streaming with num_workers != 0 ## Describe the bug When using dataset streaming with pytorch DataLoader, the setting num_workers to anything other than 0 causes the code to freeze forever before yielding the first batch. The code owner is likely @lhoestq ## Steps to reproduce the bug For your convenience, we've prepped a colab notebook that reproduces the bug https://colab.research.google.com/drive/1Mgl0oTZSNIE3UeGl_oX9wPCOIxRg19h1?usp=sharing ```python !pip install datasets==1.14.0 should_freeze_forever = True # ^-- set this to True in order to freeze forever, set to False in order to work normally import torch from datasets import load_dataset data = load_dataset("oscar", "unshuffled_deduplicated_bn", split="train", streaming=True) data = data.map(lambda x: {"text": x["text"], "orig": f"oscar[{x['id']}]"}, batched=True) data = data.shuffle(100, seed=1337) data = data.with_format("torch") loader = torch.utils.data.DataLoader(data, batch_size=2, num_workers=2 if should_freeze_forever else 0) # v-- the code should freeze forever at this line for i, row in enumerate(loader): print(row) if i > 10: break print("DONE!") ``` ## Expected results The code should not freeze forever with num_workers=2 ## Actual results The code freezes forever with num_workers=2 ## Environment info - `datasets` version: 1.14.0 (also found in previous versions) - Platform: google colab (also locally) - Python version: 3.7, (also 3.8) - PyArrow version: 3.0.0 Hi ! Thanks for the insights :) Note that in streaming mode there're usually no arrow files. The data are streamed from TAR, ZIP, text, etc. files directly from the web. Though for sharded datasets we can definitely adopt a similar strategy !
[ -1.2976053953170776, -0.933087170124054, -0.6422877311706543, 1.4641423225402832, -0.21196408569812775, -1.1920058727264404, 0.18144986033439636, -1.1504863500595093, 1.600388765335083, -0.8708008527755737, 0.25362494587898254, -1.630141258239746, 0.03506500646471977, -0.5512242317199707, -0.6587425470352173, -0.9142419099807739, -0.4247545003890991, -0.7176846861839294, 1.1524888277053833, 2.4704999923706055, 1.2705918550491333, -1.42747962474823, 2.688007116317749, 0.8019472360610962, -0.23146329820156097, -1.0085115432739258, 0.556572437286377, -0.005020256154239178, -1.3005722761154175, -0.4083818197250366, -1.0033950805664062, -0.1259586215019226, -0.5545060038566589, -0.44823428988456726, -0.01585281640291214, 0.3539024591445923, -0.3021896183490753, -0.3815430700778961, -0.6039856672286987, -0.7406216859817505, 0.49480530619621277, -0.3365127146244049, 0.9518688321113586, -0.3451293706893921, 1.8094327449798584, -0.594565749168396, 0.5156711935997009, 0.7645004987716675, 1.3547865152359009, 0.20966197550296783, -0.00564031396061182, 0.3904462158679962, 0.4016789495944977, -0.07700749486684799, 0.5140302777290344, 1.1300932168960571, 0.6723247766494751, 0.49343690276145935, 0.7191177010536194, -2.2003345489501953, 1.2583386898040771, -0.9881565570831299, 0.3290424048900604, 1.4338456392288208, -0.9948523044586182, 0.39602941274642944, -1.7511729001998901, -0.08840589970350266, 0.5745603442192078, -2.253462553024292, 0.31178903579711914, -1.311287760734558, -0.5590739846229553, 1.0123517513275146, 0.35961949825286865, -1.2109758853912354, 0.1076345294713974, -0.4431096911430359, 1.0413981676101685, 0.4152684211730957, 1.1030272245407104, -1.6607931852340698, -0.043547119945287704, -0.33024075627326965, 0.09868568181991577, -1.3319047689437866, -1.5749222040176392, 0.5606504678726196, 0.6030402779579163, 0.49069538712501526, -0.13657796382904053, 1.085363745689392, -1.0699036121368408, 0.8008046746253967, -1.0207980871200562, -1.6951608657836914, -1.4369062185287476, -2.3388350009918213, -2.2207353115081787, 0.6842172145843506, -0.46118372678756714, -0.5369843244552612, 2.0827605724334717, -1.0892674922943115, -1.681480050086975, 1.1785657405853271, 0.2124921977519989, -0.049338363111019135, 2.423731803894043, 0.2212679386138916, -0.7113555669784546, 0.5007863640785217, -0.8058480024337769, 0.759094774723053, -0.3793991208076477, 1.325181245803833, 0.42200547456741333, -1.0511994361877441, 1.597357153892517, -0.36964744329452515, 0.5845078229904175, -0.5978477597236633, -0.5213462114334106, -0.742912232875824, 0.27564793825149536, 1.933606505393982, -0.3217923939228058, 1.49245285987854, -0.28508734703063965, -1.4872647523880005, -1.5754985809326172, 0.972201943397522, 0.493631511926651, -0.7477482557296753, 0.1935638040304184, -0.36446908116340637, 0.11578173190355301, -0.09415296465158463, 1.1076685190200806, 1.333916187286377, 0.7379118800163269, -0.39697372913360596, -0.9222142696380615, 0.10071813315153122, -0.12860405445098877, -0.7211440801620483, -1.7434611320495605, -0.3284803032875061, 0.06705977767705917, 0.6317377686500549, -1.163547158241272, 1.7865350246429443, 0.9496701955795288, 1.842408299446106, 0.9924768209457397, -0.35127389430999756, 1.4902786016464233, 0.09380783885717392, 1.7925584316253662, -0.47597137093544006, 0.6789576411247253, -0.39143693447113037, -1.2087061405181885, 0.8138824701309204, -0.31609347462654114, -2.03216290473938, -0.720768392086029, -0.7478497624397278, -0.22364147007465363, -0.8307706713676453, 0.9389294981956482, -0.2958058714866638, -1.435269832611084, 0.27758505940437317, -0.6750633716583252, 0.16232602298259735, -1.2995103597640991, 0.42626169323921204, 0.6806102395057678, -0.5958514213562012, 0.052151914685964584, -0.25236356258392334, -1.2263867855072021, -0.499123752117157, 0.2220853567123413, 1.8281830549240112, -0.7624568343162537, 0.9233345985412598, 1.0604726076126099, -0.7266771197319031, -0.017265204340219498, 0.3254378139972687, -0.33645257353782654, 0.8480859994888306, -1.015278697013855, -0.46796515583992004, 1.1652908325195312, -0.20209740102291107, -0.5526991486549377, 1.473018765449524, 0.699944019317627, -0.967000424861908, -0.24933107197284698, -0.14643682539463043, -0.8061371445655823, 0.04074671491980553, -1.5789073705673218, -0.13794302940368652, 0.4410264492034912, -1.5037002563476562, -0.4832785725593567, -0.1663128137588501, 1.3438191413879395, -0.15554820001125336, 1.4660454988479614, -0.34086185693740845, -0.1479875147342682, -0.35706186294555664, -0.37656790018081665, 0.1736627072095871, -0.17574787139892578, -0.6234118342399597, 0.19306860864162445, -0.7919664978981018, 0.2873782515525818, 1.4717422723770142, 0.31386178731918335, 0.03544354811310768, 0.490500271320343, 1.0515395402908325, 0.3598538339138031, -0.12373402714729309, -0.8900062441825867, -1.4984666109085083, 1.9419193267822266, -1.4681042432785034, 2.031787395477295, 0.8117924928665161, -0.04049275815486908, -1.789768099784851, -1.8559327125549316, 1.3650542497634888, 1.1592336893081665, 2.318916082382202, 0.5064079165458679, 0.4202222526073456, -0.8571925163269043, -0.6985588669776917, 0.2683994174003601, -0.9880925416946411, -0.6801164746284485, 0.16103693842887878, 2.3982348442077637, 1.757287859916687, -0.4725583493709564, -0.16324780881404877, -1.030848741531372, 1.3476791381835938, -0.14705350995063782, 0.23728665709495544, 1.945957899093628, -0.2512151896953583, -1.0486960411071777, 1.295542597770691, -2.3830299377441406, 0.13460512459278107, 2.0482261180877686, 0.2963411808013916, 0.08948203921318054, -1.2692688703536987, -0.6600081324577332, -0.2933158874511719, -0.48968884348869324, -1.2150256633758545, 0.49703922867774963, -0.28873205184936523, -0.7382100820541382, -1.4012110233306885, 0.17672674357891083, -1.1336493492126465, -1.6354750394821167, 0.20818154513835907, 1.8478124141693115, 2.095266342163086, -0.7737508416175842, 1.5392786264419556, -0.34947097301483154, 0.18422701954841614, 1.1866883039474487, 1.2815815210342407, 3.147603988647461, 1.931907057762146, -1.3677698373794556, 0.6539511680603027, -0.1590534895658493, -0.46657833456993103, 1.135011076927185, -1.1702325344085693, 1.3679795265197754, -0.10052318125963211, -1.2000195980072021, -1.220301628112793, 0.9702306389808655, 0.4880262017250061, 0.07570858299732208, -0.47962403297424316, 1.1616352796554565, 0.13640135526657104, 1.368514060974121, 0.502932071685791, -0.28372713923454285, 0.606779932975769, -0.36735886335372925, -0.46967121958732605, 1.6121481657028198, 0.18019884824752808, -1.438140869140625, -2.304283380508423, -0.24498893320560455, -0.8958187103271484, 0.0684945210814476, -0.6521506905555725, -1.0000520944595337, 1.6390711069107056, 0.33393609523773193, -1.2211198806762695, -0.27159425616264343, -0.35625508427619934, -0.5604876279830933, 2.654182195663452, -1.3994393348693848, -0.24217355251312256, -0.969113826751709, -0.6938405632972717, 1.6297171115875244, -1.2203075885772705, -0.20500244200229645, -1.021255373954773, -0.5465338230133057, -1.2645732164382935, -0.5141741633415222, 0.004284141585230827, -1.00827956199646, 0.8691072463989258, 0.21285831928253174, -1.184143304824829, -0.3550935983657837, -0.8234255313873291, 0.9455325603485107, -0.07825495302677155, 0.1739683598279953, 1.8050897121429443, 0.3290233314037323, -0.40421998500823975, 0.7762843370437622, 1.1733406782150269, 0.6258677244186401, -0.6831247210502625, 0.1742682307958603, -0.6795869469642639, 0.3424610495567322, -1.2338067293167114, 0.22733594477176666, -2.8715310096740723, 0.6231663227081299, -0.0758080706000328, -0.07275348156690598, -0.000841677188873291, -1.3041666746139526, 1.0662442445755005, 2.5492606163024902, -1.1279305219650269, 0.5269801616668701, 0.33274713158607483, 1.1968138217926025, -1.5983641147613525, 0.21130850911140442, -0.45878279209136963, 2.0597500801086426, 0.2024737298488617, 1.2119094133377075, -0.47543177008628845, -2.357280731201172, 0.6136109828948975, -1.2295796871185303, -1.1860922574996948, 0.8097161054611206, -0.8279933333396912, 0.12762251496315002, -1.3894232511520386, -0.2683756947517395, -0.8661158680915833, -1.1310696601867676, 0.6525667309761047, 0.11173548549413681, 0.46411168575286865, -0.649383008480072, 0.32030928134918213, -2.256974935531616, -1.2952066659927368, -0.18275292217731476, -0.8975741863250732, 0.45881563425064087, -0.43298327922821045, 0.7722368240356445, -0.20214398205280304, 0.011899144388735294, 0.32012152671813965, 1.4320697784423828, 3.3241305351257324, 0.12566356360912323, 0.3354668617248535, -0.21077397465705872, -0.9247872233390808, 1.5066746473312378, 0.9247696995735168, -0.13667358458042145, -0.5637203454971313, -1.050473690032959, 1.2081019878387451, 1.833297848701477, 0.9324461221694946, -0.018138540908694267, -0.8333553075790405, -0.659781813621521, -0.03984701633453369, 0.1669933795928955, 0.4245210289955139, 0.952709972858429, 0.01437340583652258, 0.09021559357643127, 1.4474323987960815, 1.1985423564910889, -0.462924063205719, 0.292477011680603, -0.8322077989578247, -0.4886132776737213, 0.5522514581680298, 0.27188169956207275, 0.035153720527887344, 0.3448149859905243, -0.9769030809402466, -0.26757246255874634, -0.3802393972873688, -0.8949856162071228, -0.699378490447998, -0.43728378415107727, -0.36714068055152893, 1.6045304536819458, 0.12334214895963669, -0.4679397940635681, -0.02110767737030983, -0.8391023278236389, -0.12428644299507141, -1.1847163438796997, 0.2673673629760742, -0.09245571494102478, -0.09287665039300919, -0.1679811179637909, 1.800607681274414, -0.9435640573501587, -2.062340021133423, 0.20276473462581635, 0.24310289323329926, -0.23654520511627197, 0.21710160374641418, 1.7162691354751587, 0.5448728799819946, 1.4674270153045654, 1.314003586769104, 0.9541858434677124, -0.6167557239532471, -1.2708977460861206, 0.7444669008255005, 0.9713634252548218, -1.453873634338379, 0.7900334000587463, 0.022734932601451874, -0.5756798386573792, 0.6371009349822998, 1.1883200407028198, 0.4709204435348511, -2.03024959564209, 0.8824535608291626, -1.0227433443069458, 0.7853294610977173, 0.7637069821357727, 0.6974095702171326, 0.17047244310379028, 0.8378801941871643, -1.165513038635254, -1.1311551332473755, -0.7172462940216064, -0.6627055406570435, 2.0392684936523438, -0.32138511538505554, 0.5963056087493896, -0.24827538430690765, -1.3143738508224487, -0.000364694744348526, 0.6602075099945068, 0.314887136220932, -0.3911009132862091, 0.8515881299972534, -0.7058030366897583, -1.1783984899520874, -1.356562852859497, -0.39044705033302307, -1.0933831930160522, -0.918101966381073, 1.108476996421814, 0.743024468421936, 0.2991059422492981, 1.8832379579544067, 0.6535231471061707, 0.2759841978549957, -2.5892233848571777, 0.9292110204696655, 0.2342241406440735, -0.07069081813097, 0.8863057494163513, 0.32066023349761963, 1.0515185594558716, -0.024417605251073837, 0.46399205923080444, -2.466179609298706, 2.297621011734009, -0.1878582090139389, 0.701065719127655, -0.02780045196413994, -0.08227609843015671, 1.1012300252914429, 0.6604519486427307, 0.5227680206298828, -1.0451734066009521, 0.6128353476524353, -0.5724828243255615, 1.2606754302978516, 0.8516845107078552, -0.8227816820144653, -0.04380816966295242, 1.3436055183410645, 0.45997488498687744, -0.4707874655723572, -0.9124749302864075, -0.9487144947052002, 0.965055525302887, 1.6954165697097778, -0.04891643300652504, 0.06295989453792572, 0.7666988372802734, 0.7068145871162415, -1.3425148725509644, 0.06534119695425034, -0.7041123509407043, -0.6733868718147278, 1.6517332792282104, 2.0713210105895996, -0.13147778809070587, -0.15578775107860565, -0.6627638339996338, -1.3601092100143433, 0.8045609593391418, -0.105336032807827, 0.22263769805431366, 0.6056082844734192, -0.647455632686615, 0.9808712005615234, 0.8673627972602844, 0.9105868935585022, 0.26492875814437866, 0.18772731721401215, 0.39045530557632446, -0.3152008056640625, -1.0815684795379639, -0.15895071625709534, -1.03435480594635, -2.57267427444458, 0.4476301074028015, -0.20599809288978577, -1.4249382019042969, 0.03929273784160614, -1.0307425260543823, 0.9474263191223145, -0.5960356593132019, -1.093569040298462, -1.5503181219100952, 0.17280027270317078, -0.03207866847515106, 0.9781176447868347, -1.626900315284729, -0.10749107599258423, 1.2256014347076416, 0.9384046792984009, -0.6092302203178406, 1.078696370124817, 0.3069297671318054, 1.0315241813659668, 0.8143628835678101, -0.41457074880599976, 0.5377446413040161, 0.023736022412776947, -1.3624043464660645, 0.4444369375705719, 1.2316023111343384, 0.23244290053844452, 1.4595640897750854, -0.5260476469993591, -0.0027602799236774445, 0.3484923243522644, -0.5722886919975281, -0.4708034098148346, -0.4909921884536743, 0.6298016905784607, 0.029586810618638992, -0.9508236050605774, -0.04332307353615761, -0.10870497673749924, -0.2675005793571472, 0.16155435144901276, -1.4562128782272339, -0.14220507442951202, -0.45418649911880493, -0.6416071653366089, -1.3084467649459839, 0.0007658787071704865, 1.4292031526565552, -0.8103291988372803, -0.13909949362277985, 0.43414175510406494, 0.3567899465560913, 0.4936065971851349, 0.6780646443367004, -0.6481324434280396, -0.26907122135162354, -0.23143130540847778, -0.3503723442554474, 0.3195788860321045, 1.3931235074996948, -0.16773438453674316, -0.9969476461410522, 0.647919774055481, -0.3323070704936981, 0.09751798957586288, 1.9214179515838623, 0.06789135187864304, -0.7740432620048523, 0.3081054091453552, -0.7367751002311707, 1.9312273263931274, 1.70326828956604, 1.4030578136444092, -0.21313486993312836, -0.8902617692947388, 0.6200883984565735, -0.38773277401924133, -0.34363096952438354, 0.8763679265975952, 0.4038185477256775, -0.2267475426197052, -1.44028902053833, 0.6943455934524536, 1.2779392004013062, -0.8404887914657593, -0.7674433588981628, 0.18319357931613922, -0.7603187561035156, 1.107891321182251, 0.7168179750442505, 0.4015485942363739, 0.28194910287857056, 1.6408371925354004, 0.8437383770942688, -0.5325381755828857, 0.5428473949432373, 0.5526390671730042, -0.09870252013206482, -2.119046688079834, -1.1042752265930176, 0.3394351303577423, -0.540250301361084, -1.5709047317504883, 1.4333468675613403, -1.1213258504867554, -1.02085280418396, 0.552440881729126, 0.09020919352769852, 1.361782431602478, 0.4240528345108032, 1.541554570198059, 2.080230951309204, 0.852252185344696, 0.43532484769821167, 1.2417277097702026, -0.16204607486724854, -0.40668752789497375, 1.7974172830581665, -0.46537452936172485, 0.4353591203689575, 1.13228178024292, -0.28884178400039673, -1.0904960632324219, -0.7761762142181396, -1.2299095392227173, -0.73142009973526, 1.177172303199768, 0.07247763872146606, -1.0122531652450562, 0.25615227222442627, 1.5765185356140137, 0.06402785331010818, -0.33672839403152466, 0.7043574452400208, 0.41085487604141235, -0.8114069104194641, -0.060826484113931656, -0.8786143660545349, 0.5469688773155212, -0.2639540135860443, -0.34881728887557983, 0.3530696928501129, 0.48983338475227356, 1.3173500299453735, -0.06464403122663498, 0.12327951937913895, 1.1487618684768677, -1.459083080291748, 1.4820078611373901, -0.7108559012413025, 0.2157512903213501, -2.349525213241577, 1.4117850065231323, -0.7604265809059143, 1.9325323104858398, -2.740691900253296, 0.47223222255706787, -0.599863588809967, -0.48797711730003357, 0.2599075436592102, -0.40045422315597534, 0.08611207455396652, -0.1444256454706192, -1.1679412126541138, -0.05518938601016998, -0.6478862762451172, 0.559424877166748, 1.085534930229187, 1.3297879695892334, -1.1294002532958984, -0.251238077878952, -1.7080886363983154, -0.12827078998088837, -0.7582114934921265, 0.3466864824295044, -1.9899719953536987, -0.2391493171453476, -1.9171186685562134, -2.355350971221924, -1.2671486139297485, -0.7976714968681335, 1.165663480758667, 0.13304995000362396, -0.8873848915100098, 1.262148141860962, -0.40028464794158936, -1.8280372619628906, 1.1020156145095825, -2.1766397953033447 ]
https://github.com/huggingface/datasets/issues/3145
[when Image type will exist] provide a way to get the data as binary + filename
@severo I'll keep that in mind. You can track progress on the Image feature in #3163 (still in the early stage).
**Is your feature request related to a problem? Please describe.** When a dataset cell contains a value of type Image (be it from a remote URL, an Array2D/3D, or any other way to represent images), I want to be able to write the image to the disk, with the correct filename, and optionally to know its mimetype, in order to serve it on the web. Note: this issue would apply exactly the same for the `Audio` type. **Describe the solution you'd like** If a "cell" has the type `Image`, provide a way to get the binary content of the file, and the filename, eg as: ```python filename: str data: bytes ``` **Describe alternatives you've considered** A way to write the cell to the disk (passing a local directory), and then return the pathname, filename, and mimetype.
1,151
21
[when Image type will exist] provide a way to get the data as binary + filename **Is your feature request related to a problem? Please describe.** When a dataset cell contains a value of type Image (be it from a remote URL, an Array2D/3D, or any other way to represent images), I want to be able to write the image to the disk, with the correct filename, and optionally to know its mimetype, in order to serve it on the web. Note: this issue would apply exactly the same for the `Audio` type. **Describe the solution you'd like** If a "cell" has the type `Image`, provide a way to get the binary content of the file, and the filename, eg as: ```python filename: str data: bytes ``` **Describe alternatives you've considered** A way to write the cell to the disk (passing a local directory), and then return the pathname, filename, and mimetype. @severo I'll keep that in mind. You can track progress on the Image feature in #3163 (still in the early stage).
[ -1.2407487630844116, -0.9941307902336121, -0.9032617211341858, 1.4533718824386597, -0.3362070322036743, -1.4420992136001587, 0.009026211686432362, -1.0757169723510742, 1.786736011505127, -0.8713910579681396, 0.34379836916923523, -1.7232316732406616, 0.15062753856182098, -0.7187554836273193, -0.9202445149421692, -0.8634607791900635, -0.49898117780685425, -0.8945741653442383, 0.8704228401184082, 2.439080238342285, 1.1277836561203003, -1.5230852365493774, 2.59586238861084, 0.7258418202400208, -0.175172820687294, -0.9891688227653503, 0.47853609919548035, 0.025845397263765335, -1.158219337463379, -0.6008350253105164, -0.9478027820587158, -0.11055696755647659, -0.5866953134536743, -0.5790539979934692, -0.006866783369332552, 0.3734820485115051, -0.24649515748023987, -0.334555059671402, -0.5208933353424072, -0.77926105260849, 0.4928419589996338, -0.41570281982421875, 1.0207974910736084, -0.42422565817832947, 1.8608728647232056, -0.5488128662109375, 0.28239285945892334, 0.7630956768989563, 1.5275260210037231, 0.2031526416540146, -0.00899732019752264, 0.2559150159358978, 0.37810930609703064, -0.055067937821149826, 0.3570249378681183, 1.1221129894256592, 0.5670645833015442, 0.5776281952857971, 0.8312335014343262, -2.2146692276000977, 1.422234058380127, -1.183941125869751, 0.3326883614063263, 1.3601573705673218, -0.9371476769447327, 0.34657901525497437, -1.7597094774246216, -0.08340926468372345, 0.5642422437667847, -2.2694125175476074, 0.2858455181121826, -1.242382526397705, -0.5860128402709961, 0.9763513803482056, 0.2528027296066284, -1.2558108568191528, 0.2476595789194107, -0.4834829270839691, 0.9020550847053528, 0.3735921382904053, 1.0717670917510986, -1.7939990758895874, 0.04275621101260185, -0.2812102437019348, 0.08993276953697205, -1.3775246143341064, -1.449813961982727, 0.7189050316810608, 0.5500625371932983, 0.5174317359924316, -0.0990823358297348, 0.9609422087669373, -0.9515657424926758, 0.887061357498169, -0.9576303362846375, -1.588247299194336, -1.361539363861084, -2.075321912765503, -2.267897605895996, 0.8444049954414368, -0.5833346843719482, -0.4841170012950897, 2.0296711921691895, -1.0143262147903442, -1.6534079313278198, 1.2054014205932617, 0.2549608647823334, 0.02781153842806816, 2.407149076461792, 0.08852522820234299, -0.605741024017334, 0.3634187579154968, -0.6153947710990906, 0.9893511533737183, -0.6031272411346436, 1.377695083618164, 0.43342673778533936, -1.1011875867843628, 1.6717723608016968, -0.47677338123321533, 0.5019057393074036, -0.6771559119224548, -0.5069106817245483, -0.8940300941467285, 0.5463000535964966, 1.7841800451278687, -0.2954232096672058, 1.5058408975601196, -0.32923954725265503, -1.575751543045044, -1.6367683410644531, 1.0278836488723755, 0.5559263825416565, -0.8887678384780884, 0.16421270370483398, -0.3059206008911133, 0.2099561095237732, -0.12275630235671997, 1.1543514728546143, 1.2589552402496338, 0.6410736441612244, -0.235504150390625, -0.8454729318618774, 0.16231711208820343, -0.21649031341075897, -0.7339526414871216, -1.8048917055130005, -0.42823028564453125, 0.21452945470809937, 0.6588107347488403, -1.2047573328018188, 1.7264717817306519, 0.9517080187797546, 1.9246693849563599, 0.9792015552520752, -0.32218965888023376, 1.4677300453186035, 0.03155810385942459, 1.8833293914794922, -0.5978065729141235, 0.764403760433197, -0.4043256342411041, -1.0519267320632935, 0.959891140460968, -0.39000722765922546, -2.0025014877319336, -0.6968342065811157, -0.7487338781356812, -0.35098353028297424, -0.6757692098617554, 0.9656871557235718, -0.3721586763858795, -1.3037596940994263, 0.34719523787498474, -0.6161497831344604, 0.05994294211268425, -1.1079676151275635, 0.2885080873966217, 0.7292712330818176, -0.5886008739471436, -0.05596882849931717, -0.2602953016757965, -1.2845216989517212, -0.5111701488494873, 0.22692400217056274, 1.9455604553222656, -0.79034823179245, 1.0610384941101074, 0.8593495488166809, -0.6957348585128784, -0.14958173036575317, 0.4387606084346771, -0.2420700341463089, 0.8678155541419983, -1.1392066478729248, -0.3928716480731964, 1.041479229927063, -0.22085821628570557, -0.528565526008606, 1.452247977256775, 0.6501806974411011, -0.9603009223937988, -0.0629669651389122, -0.2999938428401947, -0.8693982362747192, 0.1132771298289299, -1.543370008468628, -0.07753080129623413, 0.3363814353942871, -1.465031385421753, -0.46762052178382874, -0.11095759272575378, 1.1718194484710693, -0.16018815338611603, 1.324040412902832, -0.46223071217536926, -0.4899844825267792, -0.375172883272171, -0.3826819062232971, 0.15266025066375732, -0.1857229322195053, -0.5252216458320618, 0.15265868604183197, -0.7489665746688843, 0.39098164439201355, 1.3561382293701172, 0.4317615032196045, 0.03136293590068817, 0.5006439685821533, 1.1121970415115356, 0.3079349100589752, 0.12743093073368073, -0.971317708492279, -1.3997960090637207, 1.9934382438659668, -1.5565760135650635, 2.030733823776245, 0.8036158680915833, 0.05049256235361099, -1.7483292818069458, -1.7306077480316162, 1.4092336893081665, 1.268822431564331, 2.242539882659912, 0.643946647644043, 0.30375486612319946, -0.8665275573730469, -0.6293403506278992, 0.38829317688941956, -1.1211391687393188, -0.7808209657669067, 0.05579410865902901, 2.3107492923736572, 1.8237636089324951, -0.478710412979126, -0.26005443930625916, -1.092721700668335, 1.4300973415374756, -0.10018230229616165, 0.204822838306427, 1.9241018295288086, -0.3651507794857025, -1.162747859954834, 1.1612087488174438, -2.295961856842041, -0.07253138720989227, 1.9729505777359009, 0.29738086462020874, 0.07106360048055649, -1.3581916093826294, -0.6386503577232361, -0.16100281476974487, -0.42328622937202454, -1.329703450202942, 0.5774791240692139, -0.4066435694694519, -0.6350787281990051, -1.418330192565918, 0.2637525200843811, -1.1623461246490479, -1.5754019021987915, 0.260230153799057, 1.9254618883132935, 2.1039066314697266, -0.6455273628234863, 1.6317310333251953, -0.27595874667167664, 0.20879755914211273, 1.2401983737945557, 1.172702670097351, 3.1109769344329834, 1.9234867095947266, -1.1678495407104492, 0.4795544743537903, -0.1477494090795517, -0.5216002464294434, 1.1552636623382568, -1.0696208477020264, 1.2562041282653809, -0.06325046718120575, -1.1106836795806885, -1.1915154457092285, 0.9226117134094238, 0.4680310785770416, 0.11650308966636658, -0.5271100997924805, 1.1882833242416382, 0.029311373829841614, 1.1722979545593262, 0.5199918746948242, -0.4208158254623413, 0.5772200226783752, -0.5019362568855286, -0.6473027467727661, 1.6784721612930298, 0.20069068670272827, -1.284615159034729, -2.3535454273223877, -0.21542981266975403, -0.8004990816116333, 0.16875271499156952, -0.6263439059257507, -0.953039824962616, 1.7487744092941284, 0.3163571059703827, -1.3217843770980835, -0.27201956510543823, -0.4295315146446228, -0.7236396074295044, 2.6299571990966797, -1.4702662229537964, -0.2746177911758423, -0.8812448978424072, -0.6416571140289307, 1.591225504875183, -1.2461917400360107, -0.19789297878742218, -0.9993335604667664, -0.48968619108200073, -1.311585545539856, -0.5762329697608948, -0.1320125311613083, -0.8117484450340271, 0.9258695244789124, 0.12863481044769287, -1.1858841180801392, -0.3478449881076813, -0.8431806564331055, 0.6562860012054443, -0.058999598026275635, 0.4001120626926422, 1.9969301223754883, 0.47464239597320557, -0.37114283442497253, 0.6687441468238831, 1.1255719661712646, 0.6026454567909241, -0.5750992298126221, 0.24175162613391876, -0.5482994914054871, 0.3457302451133728, -1.2252055406570435, 0.3119162619113922, -2.8124444484710693, 0.6925118565559387, 0.014437179081141949, -0.12533223628997803, 0.04685162380337715, -1.2318991422653198, 1.0635727643966675, 2.7426204681396484, -1.1689618825912476, 0.3022301495075226, 0.23531733453273773, 1.295612096786499, -1.6600884199142456, 0.4049108028411865, -0.31723108887672424, 2.18558931350708, 0.1802724301815033, 1.1241891384124756, -0.5624110698699951, -2.3452560901641846, 0.44953563809394836, -1.2367804050445557, -1.2445471286773682, 0.658429741859436, -0.6837211847305298, -0.062115442007780075, -1.569348931312561, -0.2004254013299942, -0.8614366054534912, -1.286453366279602, 0.8240637183189392, 0.13453556597232819, 0.48808249831199646, -0.6162862777709961, 0.2761865556240082, -2.1070780754089355, -1.4134387969970703, -0.2907347083091736, -0.764087975025177, 0.5329943299293518, -0.2803308665752411, 0.7810778021812439, -0.238849937915802, 0.17522385716438293, 0.3591821491718292, 1.4840657711029053, 3.462644100189209, 0.18900340795516968, 0.46865546703338623, -0.21310023963451385, -0.7507367134094238, 1.3980929851531982, 1.0256401300430298, 0.00958570558577776, -0.6019462943077087, -1.118585467338562, 1.31473970413208, 1.9595268964767456, 0.9144343733787537, 0.16721297800540924, -0.711977481842041, -0.5628589391708374, -0.09432602673768997, 0.1441860795021057, 0.4795255661010742, 0.8233951926231384, 0.05382440239191055, 0.03459097817540169, 1.4187815189361572, 1.279336929321289, -0.398681640625, 0.36101993918418884, -0.707258403301239, -0.39813241362571716, 0.4735347032546997, 0.426616907119751, -0.010250972583889961, 0.2753164768218994, -0.8923335671424866, -0.3060269057750702, -0.4644118845462799, -1.0918490886688232, -0.6145239472389221, -0.4983854293823242, -0.4148125946521759, 1.7005690336227417, 0.2048216015100479, -0.5016510486602783, -0.1257622241973877, -0.7410166263580322, -0.08592116087675095, -1.0581732988357544, 0.23985950648784637, -0.0927395299077034, -0.18935801088809967, -0.12645165622234344, 1.8730835914611816, -0.9035316109657288, -2.0464909076690674, 0.30976223945617676, 0.27470049262046814, -0.3893706798553467, 0.2864237129688263, 1.5016486644744873, 0.5416772961616516, 1.501465082168579, 1.4402936697006226, 0.9029248356819153, -0.7113927602767944, -1.289687991142273, 0.6963813304901123, 0.9342092871665955, -1.5337674617767334, 0.7761845588684082, 0.06285502761602402, -0.5222622156143188, 0.7933103442192078, 1.2852673530578613, 0.4393405616283417, -2.0829732418060303, 0.7639923095703125, -0.8555483818054199, 0.7997321486473083, 0.7024160027503967, 0.5277825593948364, 0.3423601984977722, 0.8871474862098694, -1.1794112920761108, -1.183510661125183, -0.8443928956985474, -0.7018647789955139, 2.0402393341064453, -0.2822974622249603, 0.6620261073112488, -0.12709110975265503, -1.3604055643081665, -0.12756390869617462, 0.6635268926620483, 0.46448516845703125, -0.29170021414756775, 0.7725619673728943, -0.6650452613830566, -1.1514520645141602, -1.4493271112442017, -0.47778862714767456, -0.9761348962783813, -0.9575656652450562, 0.9939118027687073, 0.975734531879425, 0.2270577847957611, 1.849031925201416, 0.6630285382270813, 0.08830004930496216, -2.48612380027771, 0.8111838698387146, 0.32136884331703186, -0.06517504900693893, 0.9862703084945679, 0.3310077488422394, 0.9788734316825867, 0.022906173020601273, 0.4763771593570709, -2.387269973754883, 2.242929220199585, -0.3510046899318695, 0.7317714691162109, -0.08092495054006577, -0.24220502376556396, 1.2001467943191528, 0.44296160340309143, 0.5036937594413757, -1.050431251525879, 0.6235749125480652, -0.5421392321586609, 1.2533725500106812, 0.9885933995246887, -0.7435016632080078, -0.0841044932603836, 1.3288604021072388, 0.45523926615715027, -0.4783596098423004, -0.9137166738510132, -0.9010941386222839, 0.8799154758453369, 1.8996244668960571, -0.051099058240652084, 0.007155455648899078, 0.7522923946380615, 0.6924787163734436, -1.1568597555160522, 0.1742815524339676, -0.8303773999214172, -0.8707825541496277, 1.643526554107666, 2.0162148475646973, -0.07790477573871613, -0.08741751313209534, -0.7327733635902405, -1.1895726919174194, 0.8643099665641785, 0.027258016169071198, 0.11358187347650528, 0.5565797686576843, -0.6409508585929871, 1.0728648900985718, 0.9980836510658264, 0.9885091781616211, 0.1586410105228424, 0.3688645362854004, 0.48355063796043396, -0.41051119565963745, -1.071837306022644, -0.2692526876926422, -1.1320160627365112, -2.476924180984497, 0.522641122341156, -0.28727638721466064, -1.4841303825378418, -0.11281657218933105, -1.004144310951233, 0.913927435874939, -0.43666768074035645, -1.1561530828475952, -1.6057361364364624, 0.1607651710510254, -0.0984049066901207, 1.0192265510559082, -1.6098285913467407, -0.03185698762536049, 1.1696133613586426, 0.8037373423576355, -0.7023276686668396, 0.9771163463592529, 0.1031026542186737, 1.0244734287261963, 0.8251180052757263, -0.4365754723548889, 0.358236700296402, 0.013432960025966167, -1.364030122756958, 0.5117599964141846, 0.9706176519393921, 0.03631358593702316, 1.4265064001083374, -0.5267422795295715, 0.0478878989815712, 0.3112894296646118, -0.44661200046539307, -0.36380645632743835, -0.6434119343757629, 0.7353988289833069, 0.08919631689786911, -0.7904567718505859, 0.16048994660377502, 0.06443517655134201, -0.29407334327697754, 0.1456531137228012, -1.518487572669983, -0.24016138911247253, -0.3788914680480957, -0.5032155513763428, -1.1864386796951294, -0.09436559677124023, 1.3410853147506714, -0.5625900030136108, -0.1697578728199005, 0.6507107615470886, 0.47903603315353394, 0.49174949526786804, 0.6006729602813721, -0.5884297490119934, -0.44841641187667847, -0.24802732467651367, -0.4259381592273712, 0.3194483518600464, 1.250694990158081, -0.1854666918516159, -0.8839343786239624, 0.7413583397865295, -0.3249424993991852, -0.05560087785124779, 1.9140633344650269, 0.10213188827037811, -0.6911440491676331, 0.37143343687057495, -0.7283966541290283, 1.8827372789382935, 1.7011845111846924, 1.1689332723617554, -0.07955016940832138, -1.047099232673645, 0.6632864475250244, -0.25262686610221863, -0.3834628164768219, 0.9105090498924255, 0.4211291968822479, -0.07781917601823807, -1.4948656558990479, 0.6358511447906494, 1.2195287942886353, -0.8503890633583069, -0.9448394775390625, -0.006145413964986801, -0.7054876089096069, 0.9172517657279968, 0.6074750423431396, 0.522883951663971, 0.2908170819282532, 1.6819227933883667, 0.7148435711860657, -0.4698185622692108, 0.5190266966819763, 0.563525915145874, -0.18596482276916504, -2.1777591705322266, -1.3137987852096558, 0.25355881452560425, -0.45063504576683044, -1.6549701690673828, 1.2523078918457031, -1.088254690170288, -0.9006692171096802, 0.6055499315261841, 0.10045170783996582, 1.4828898906707764, 0.26585352420806885, 1.5438232421875, 2.132093906402588, 0.8145772814750671, 0.33961185812950134, 1.4022536277770996, -0.058849357068538666, -0.5504160523414612, 1.916978120803833, -0.4620357155799866, 0.38080185651779175, 1.137190341949463, -0.278806209564209, -1.0836939811706543, -0.7072585821151733, -1.1450543403625488, -0.6670820116996765, 1.1807398796081543, 0.04597276449203491, -1.091973066329956, 0.15878994762897491, 1.6530150175094604, 0.1172332912683487, -0.4201376736164093, 0.4608546197414398, 0.48574426770210266, -0.8672205209732056, -0.08124451339244843, -0.8664959073066711, 0.527019739151001, -0.13343700766563416, -0.3528037369251251, 0.4754170775413513, 0.5073480606079102, 1.364558219909668, -0.1360640674829483, 0.08515627682209015, 1.1346280574798584, -1.4721635580062866, 1.4445291757583618, -0.5483050346374512, 0.20788346230983734, -2.393415927886963, 1.44266676902771, -0.6749321818351746, 2.002162456512451, -2.66534686088562, 0.3613874614238739, -0.6325392723083496, -0.4914464056491852, 0.4706007242202759, -0.29429635405540466, 0.23379269242286682, -0.18355834484100342, -1.021820068359375, 0.015305531211197376, -0.6273655295372009, 0.5344017744064331, 1.1871306896209717, 1.4134202003479004, -1.1136488914489746, -0.2305677980184555, -1.8232522010803223, -0.16595272719860077, -0.5829253196716309, 0.301056444644928, -2.107698917388916, -0.11758400499820709, -1.8878676891326904, -2.2383627891540527, -1.5530146360397339, -0.8576305508613586, 1.048471450805664, 0.1261524111032486, -0.8685980439186096, 1.1229925155639648, -0.39253106713294983, -1.8284915685653687, 1.0580416917800903, -2.106785297393799 ]
https://github.com/huggingface/datasets/issues/3145
[when Image type will exist] provide a way to get the data as binary + filename
Hi ! As discussed with @severo offline it looks like the dataset viewer already supports reading PIL images, so maybe the dataset viewer doesn't need to disable decoding after all
**Is your feature request related to a problem? Please describe.** When a dataset cell contains a value of type Image (be it from a remote URL, an Array2D/3D, or any other way to represent images), I want to be able to write the image to the disk, with the correct filename, and optionally to know its mimetype, in order to serve it on the web. Note: this issue would apply exactly the same for the `Audio` type. **Describe the solution you'd like** If a "cell" has the type `Image`, provide a way to get the binary content of the file, and the filename, eg as: ```python filename: str data: bytes ``` **Describe alternatives you've considered** A way to write the cell to the disk (passing a local directory), and then return the pathname, filename, and mimetype.
1,151
30
[when Image type will exist] provide a way to get the data as binary + filename **Is your feature request related to a problem? Please describe.** When a dataset cell contains a value of type Image (be it from a remote URL, an Array2D/3D, or any other way to represent images), I want to be able to write the image to the disk, with the correct filename, and optionally to know its mimetype, in order to serve it on the web. Note: this issue would apply exactly the same for the `Audio` type. **Describe the solution you'd like** If a "cell" has the type `Image`, provide a way to get the binary content of the file, and the filename, eg as: ```python filename: str data: bytes ``` **Describe alternatives you've considered** A way to write the cell to the disk (passing a local directory), and then return the pathname, filename, and mimetype. Hi ! As discussed with @severo offline it looks like the dataset viewer already supports reading PIL images, so maybe the dataset viewer doesn't need to disable decoding after all
[ -1.234841227531433, -0.9671058654785156, -0.9124277830123901, 1.425289273262024, -0.36845913529396057, -1.4150644540786743, 0.019938111305236816, -1.0685452222824097, 1.762600302696228, -0.884365975856781, 0.37013500928878784, -1.719658613204956, 0.14607559144496918, -0.738448441028595, -0.9292099475860596, -0.8893218040466309, -0.5074051022529602, -0.8924724459648132, 0.8618766069412231, 2.4245097637176514, 1.093044400215149, -1.4999765157699585, 2.6115965843200684, 0.7418702840805054, -0.17560286819934845, -0.9600288271903992, 0.49829113483428955, 0.0287567637860775, -1.1380079984664917, -0.5943853855133057, -0.9340868592262268, -0.11588263511657715, -0.5753762125968933, -0.5620237588882446, 0.022566091269254684, 0.3538092374801636, -0.2360469102859497, -0.33784186840057373, -0.5571152567863464, -0.779046356678009, 0.49477487802505493, -0.4313662350177765, 1.0210070610046387, -0.45416584610939026, 1.9167284965515137, -0.5745999217033386, 0.23404379189014435, 0.7642087340354919, 1.5210602283477783, 0.19561751186847687, 0.01694006845355034, 0.24798725545406342, 0.40001049637794495, -0.05134747177362442, 0.3470918536186218, 1.09050452709198, 0.580449104309082, 0.6126729249954224, 0.8406071066856384, -2.178346633911133, 1.4046063423156738, -1.1891990900039673, 0.3142562508583069, 1.3737318515777588, -0.8859841227531433, 0.3759707510471344, -1.7950669527053833, -0.047296855598688126, 0.5489833354949951, -2.312392473220825, 0.25504258275032043, -1.2308413982391357, -0.565416693687439, 0.9719399809837341, 0.24546204507350922, -1.2662324905395508, 0.2718774974346161, -0.49120426177978516, 0.9354053735733032, 0.37815943360328674, 1.0668736696243286, -1.80221688747406, 0.029060661792755127, -0.30133044719696045, 0.10139703005552292, -1.409571647644043, -1.432724118232727, 0.706247091293335, 0.5531753897666931, 0.5285065174102783, -0.06371983140707016, 0.9781023263931274, -0.8969161510467529, 0.908149003982544, -0.9944490790367126, -1.5713297128677368, -1.4024865627288818, -2.051863193511963, -2.2742841243743896, 0.8770926594734192, -0.5961389541625977, -0.5173566937446594, 2.0010993480682373, -0.9955365061759949, -1.6626415252685547, 1.2029569149017334, 0.24507279694080353, 0.04866868257522583, 2.4250872135162354, 0.06537562608718872, -0.5928731560707092, 0.3895827829837799, -0.6257709860801697, 1.003048062324524, -0.5871561765670776, 1.3823860883712769, 0.4554900825023651, -1.0945591926574707, 1.7012255191802979, -0.5041962265968323, 0.5226540565490723, -0.6759300231933594, -0.5623637437820435, -0.9190192222595215, 0.5031014084815979, 1.792539119720459, -0.2823560833930969, 1.5323470830917358, -0.3945561647415161, -1.5539829730987549, -1.641921043395996, 1.0488172769546509, 0.5574454069137573, -0.9300879836082458, 0.10702446103096008, -0.2987014353275299, 0.1901462972164154, -0.16122400760650635, 1.1382254362106323, 1.2084237337112427, 0.6468185186386108, -0.2552313208580017, -0.8141494989395142, 0.15370458364486694, -0.18622466921806335, -0.7706228494644165, -1.8018183708190918, -0.4336928129196167, 0.18749208748340607, 0.6418660879135132, -1.2070101499557495, 1.7293782234191895, 0.953778862953186, 1.9000812768936157, 0.9730138182640076, -0.3305220901966095, 1.4118058681488037, 0.009832612238824368, 1.8596183061599731, -0.6396012902259827, 0.7371669411659241, -0.40656429529190063, -1.050400733947754, 0.9114751219749451, -0.35477569699287415, -2.0110673904418945, -0.721754252910614, -0.7362656593322754, -0.3449658751487732, -0.6808999180793762, 0.9728936553001404, -0.40978726744651794, -1.3340706825256348, 0.31623464822769165, -0.6036662459373474, 0.07757986336946487, -1.1271806955337524, 0.3186326324939728, 0.7249835729598999, -0.6126089096069336, -0.034996528178453445, -0.25200319290161133, -1.2929534912109375, -0.5075139403343201, 0.19962437450885773, 1.9601670503616333, -0.7896616458892822, 1.0499638319015503, 0.8394740223884583, -0.6827218532562256, -0.17933818697929382, 0.420263409614563, -0.2426045835018158, 0.8395860195159912, -1.121752381324768, -0.42229583859443665, 1.0329056978225708, -0.17179779708385468, -0.5142543315887451, 1.4769636392593384, 0.6597755551338196, -0.966135561466217, -0.11179888993501663, -0.3254581689834595, -0.8639777898788452, 0.07705339789390564, -1.5620876550674438, -0.08149973303079605, 0.309723824262619, -1.4666755199432373, -0.4459637403488159, -0.12158899009227753, 1.121058464050293, -0.21224072575569153, 1.3176651000976562, -0.4777943789958954, -0.4906631410121918, -0.3775923252105713, -0.3947453498840332, 0.16258081793785095, -0.1551264524459839, -0.559641420841217, 0.14502233266830444, -0.7413134574890137, 0.42037349939346313, 1.3588459491729736, 0.4571326971054077, 0.030565813183784485, 0.4775589108467102, 1.0948246717453003, 0.30971869826316833, 0.1820855587720871, -0.9810190796852112, -1.3944215774536133, 1.9858269691467285, -1.590978980064392, 2.0013322830200195, 0.7821670770645142, 0.04921898618340492, -1.769065499305725, -1.711512565612793, 1.4077649116516113, 1.30755615234375, 2.221663236618042, 0.6368681192398071, 0.2744908034801483, -0.8642678260803223, -0.6402881741523743, 0.37195712327957153, -1.1233599185943604, -0.7871203422546387, 0.06416502594947815, 2.310809850692749, 1.7766417264938354, -0.5064761638641357, -0.23906192183494568, -1.092462182044983, 1.4067628383636475, -0.11290733516216278, 0.23214967548847198, 1.9284125566482544, -0.3709009289741516, -1.1655998229980469, 1.1577551364898682, -2.308725357055664, -0.01981007121503353, 1.9655119180679321, 0.2886248826980591, 0.11199746280908585, -1.3371957540512085, -0.6289401054382324, -0.18988850712776184, -0.4034862518310547, -1.359865427017212, 0.567126452922821, -0.40952828526496887, -0.6126903295516968, -1.414755940437317, 0.25386205315589905, -1.1748502254486084, -1.5516690015792847, 0.3032785952091217, 1.939980387687683, 2.085689067840576, -0.6091949939727783, 1.5878527164459229, -0.2992352247238159, 0.21276693046092987, 1.2582088708877563, 1.202754020690918, 3.1296181678771973, 1.894215703010559, -1.1417415142059326, 0.4633984863758087, -0.2064266949892044, -0.5241699814796448, 1.1665886640548706, -1.0821973085403442, 1.2720565795898438, -0.05119815096259117, -1.0772548913955688, -1.2192226648330688, 0.8836979269981384, 0.4418761134147644, 0.12073633819818497, -0.5177504420280457, 1.236728549003601, 0.013445899821817875, 1.196934700012207, 0.5272268056869507, -0.4399518370628357, 0.5483831763267517, -0.4668712019920349, -0.647810697555542, 1.6823869943618774, 0.17443089187145233, -1.3067110776901245, -2.360095739364624, -0.19793491065502167, -0.7959468960762024, 0.17080876231193542, -0.6007200479507446, -1.0226333141326904, 1.7797125577926636, 0.30320048332214355, -1.3175675868988037, -0.23832711577415466, -0.44017910957336426, -0.7062986493110657, 2.6297895908355713, -1.477674126625061, -0.2629311680793762, -0.8705196976661682, -0.6180380582809448, 1.630644679069519, -1.258291244506836, -0.20276311039924622, -0.9791418313980103, -0.5134149789810181, -1.3596704006195068, -0.5410401225090027, -0.12611429393291473, -0.8363420367240906, 0.9236055016517639, 0.16789975762367249, -1.1597578525543213, -0.3696158826351166, -0.8324081301689148, 0.6545586585998535, -0.060111336410045624, 0.4099607467651367, 2.0081191062927246, 0.47647881507873535, -0.3385171592235565, 0.668462336063385, 1.1440479755401611, 0.6243274211883545, -0.6181036829948425, 0.22992534935474396, -0.5406531691551208, 0.35433831810951233, -1.2290648221969604, 0.3075537383556366, -2.814739227294922, 0.7103264331817627, 0.015672150999307632, -0.13626937568187714, 0.02966102585196495, -1.2380242347717285, 1.0555590391159058, 2.726315975189209, -1.1881320476531982, 0.2748223841190338, 0.2352776825428009, 1.2672972679138184, -1.6140758991241455, 0.40183791518211365, -0.310344934463501, 2.198171377182007, 0.22724919021129608, 1.1306452751159668, -0.5721306800842285, -2.364287853240967, 0.44973838329315186, -1.241189956665039, -1.2439613342285156, 0.6721590161323547, -0.6603380441665649, -0.06812829524278641, -1.5714532136917114, -0.19703789055347443, -0.9375849962234497, -1.322629451751709, 0.8345839977264404, 0.13207809627056122, 0.4664831757545471, -0.6207088828086853, 0.2797946333885193, -2.1213316917419434, -1.443481206893921, -0.30572664737701416, -0.7699187397956848, 0.5740188956260681, -0.2595539391040802, 0.7893553376197815, -0.21580396592617035, 0.18784931302070618, 0.37336257100105286, 1.4905345439910889, 3.4641482830047607, 0.26008865237236023, 0.46330025792121887, -0.24907727539539337, -0.7512810826301575, 1.3940483331680298, 1.02306067943573, 0.03566242754459381, -0.5667638778686523, -1.0699107646942139, 1.317883014678955, 1.9621983766555786, 0.9246535897254944, 0.10793748497962952, -0.6911278367042542, -0.5226328372955322, -0.0670209750533104, 0.17262974381446838, 0.44883787631988525, 0.8162685036659241, 0.04807464778423309, 0.08960819989442825, 1.4322861433029175, 1.2652513980865479, -0.40358200669288635, 0.3355081379413605, -0.6868460178375244, -0.4155132472515106, 0.5152646899223328, 0.4152320921421051, -0.04231049492955208, 0.31311067938804626, -0.8391416072845459, -0.2974781095981598, -0.4590323567390442, -1.105045199394226, -0.604042112827301, -0.5107041597366333, -0.42998644709587097, 1.6420055627822876, 0.2014158070087433, -0.4783548414707184, -0.09267594665288925, -0.7410402297973633, -0.12797868251800537, -1.0764179229736328, 0.23902259767055511, -0.09945021569728851, -0.17505066096782684, -0.12140249460935593, 1.8901257514953613, -0.9000187516212463, -2.004566192626953, 0.28892815113067627, 0.31179654598236084, -0.40370938181877136, 0.2884397506713867, 1.4878042936325073, 0.4900074005126953, 1.5056195259094238, 1.4553223848342896, 0.8478950262069702, -0.6927556395530701, -1.3010472059249878, 0.6897643208503723, 0.9353074431419373, -1.5386266708374023, 0.7981794476509094, 0.049788303673267365, -0.5293228626251221, 0.8022533059120178, 1.3217087984085083, 0.44644874334335327, -2.0414602756500244, 0.7210187315940857, -0.8409268856048584, 0.7967725992202759, 0.7298645377159119, 0.5515315532684326, 0.3555564284324646, 0.8928614258766174, -1.1861454248428345, -1.1809433698654175, -0.811073899269104, -0.6487967371940613, 2.035435676574707, -0.2535058856010437, 0.6765325665473938, -0.11731326580047607, -1.31648588180542, -0.12339893728494644, 0.6604912877082825, 0.49640512466430664, -0.3207298517227173, 0.771065890789032, -0.6612901091575623, -1.130889654159546, -1.442461609840393, -0.4702896773815155, -0.981245756149292, -0.9265204668045044, 1.0020769834518433, 0.9925079345703125, 0.198629230260849, 1.8608808517456055, 0.6584270596504211, 0.09848029166460037, -2.514307975769043, 0.8214738965034485, 0.2780781090259552, -0.07024629414081573, 0.9678717255592346, 0.3328089714050293, 0.9866924285888672, 0.037146344780921936, 0.5159958600997925, -2.3840558528900146, 2.2700889110565186, -0.3405665457248688, 0.7332947254180908, -0.09026139974594116, -0.2345779687166214, 1.2107136249542236, 0.48841050267219543, 0.4657575786113739, -1.0523252487182617, 0.5921894907951355, -0.5492319464683533, 1.2655136585235596, 0.9687845706939697, -0.7513519525527954, -0.08705383539199829, 1.3389534950256348, 0.45775681734085083, -0.4698469936847687, -0.9120351672172546, -0.8464165329933167, 0.8748008608818054, 1.8568342924118042, -0.07620573788881302, -0.050626832991838455, 0.7594050765037537, 0.6900847554206848, -1.1489343643188477, 0.21446403861045837, -0.8029575347900391, -0.9090290665626526, 1.6214988231658936, 2.013864040374756, -0.06757359951734543, -0.05448230355978012, -0.7280433177947998, -1.1654967069625854, 0.8607568144798279, 0.044775333255529404, 0.1304503083229065, 0.5340811610221863, -0.6426380276679993, 1.1105051040649414, 0.9807716012001038, 0.9915697574615479, 0.1253005713224411, 0.39899709820747375, 0.4778212904930115, -0.4121386706829071, -1.0769213438034058, -0.26735764741897583, -1.174008846282959, -2.473426580429077, 0.519356906414032, -0.31057971715927124, -1.475623607635498, -0.07383410632610321, -0.998150646686554, 0.8968749642372131, -0.4995265603065491, -1.1635921001434326, -1.5870187282562256, 0.155585378408432, -0.0659845694899559, 1.0277600288391113, -1.618038296699524, 0.0031644273549318314, 1.1686394214630127, 0.8110830783843994, -0.6797438859939575, 0.9674454927444458, 0.14187400043010712, 0.9965649843215942, 0.8207584619522095, -0.42295458912849426, 0.3782883286476135, 0.0472165122628212, -1.3611470460891724, 0.5009996891021729, 0.9714404344558716, 0.08029865473508835, 1.4192520380020142, -0.49997514486312866, 0.06743759661912918, 0.31787604093551636, -0.48148229718208313, -0.3628349006175995, -0.6194528341293335, 0.7119163274765015, 0.14332173764705658, -0.8085657358169556, 0.16621769964694977, 0.06543529778718948, -0.2822301685810089, 0.15829607844352722, -1.4979255199432373, -0.29255571961402893, -0.427391916513443, -0.5340797901153564, -1.203020691871643, -0.11241486668586731, 1.3660787343978882, -0.598426878452301, -0.1458912044763565, 0.6169893145561218, 0.518180251121521, 0.47741273045539856, 0.605754554271698, -0.5934228897094727, -0.488435834646225, -0.2566159665584564, -0.4051111340522766, 0.28109368681907654, 1.2255871295928955, -0.20337772369384766, -0.9041392803192139, 0.7469730973243713, -0.3308672308921814, -0.07004478573799133, 1.898018479347229, 0.10445704311132431, -0.704496443271637, 0.39700978994369507, -0.7356339693069458, 1.8761214017868042, 1.7052834033966064, 1.183200478553772, -0.09486478567123413, -1.0237208604812622, 0.6573038697242737, -0.26286581158638, -0.3757999837398529, 0.9326449036598206, 0.42189106345176697, -0.06528808176517487, -1.490844488143921, 0.6674928069114685, 1.2280937433242798, -0.827082633972168, -0.9363116025924683, 0.015840541571378708, -0.7368085384368896, 0.8994787335395813, 0.5887855291366577, 0.5166397094726562, 0.31279027462005615, 1.6848961114883423, 0.6946890354156494, -0.47286301851272583, 0.5347381234169006, 0.5590720772743225, -0.19922776520252228, -2.193324089050293, -1.2945486307144165, 0.24524588882923126, -0.438358873128891, -1.6183280944824219, 1.2859153747558594, -1.0638401508331299, -0.8737595081329346, 0.6237823963165283, 0.11032861471176147, 1.479489803314209, 0.2933691740036011, 1.537703037261963, 2.12156343460083, 0.7873977422714233, 0.3269924521446228, 1.4018440246582031, -0.043410446494817734, -0.5421581864356995, 1.9131803512573242, -0.43178513646125793, 0.4341280162334442, 1.1294468641281128, -0.2482837289571762, -1.0653568506240845, -0.6973659992218018, -1.1605124473571777, -0.6729457378387451, 1.1516743898391724, 0.05988249182701111, -1.1141935586929321, 0.15582242608070374, 1.694199800491333, 0.10451965034008026, -0.41005080938339233, 0.478627473115921, 0.49017995595932007, -0.8639484643936157, -0.09995707124471664, -0.9204837083816528, 0.5230216383934021, -0.11152976006269455, -0.3311299681663513, 0.42194753885269165, 0.5051133632659912, 1.3395458459854126, -0.12412597239017487, 0.07291779667139053, 1.1140140295028687, -1.4511406421661377, 1.4253435134887695, -0.5420339703559875, 0.21813195943832397, -2.4415950775146484, 1.4504048824310303, -0.6298611164093018, 1.9852406978607178, -2.6433136463165283, 0.37871915102005005, -0.6776922345161438, -0.5062060952186584, 0.5020804405212402, -0.285723477602005, 0.23331867158412933, -0.19419953227043152, -0.9916875958442688, 0.04796268045902252, -0.6343399286270142, 0.5331116914749146, 1.178989291191101, 1.4228934049606323, -1.1219145059585571, -0.25999915599823, -1.8256218433380127, -0.1778474599123001, -0.5783511996269226, 0.291653037071228, -2.1391053199768066, -0.10351947695016861, -1.8835843801498413, -2.2570629119873047, -1.5849863290786743, -0.8518596291542053, 1.0763206481933594, 0.1232350692152977, -0.8638638854026794, 1.1423081159591675, -0.3604736030101776, -1.8323863744735718, 1.0751558542251587, -2.101139783859253 ]
https://github.com/huggingface/datasets/issues/3142
Provide a way to write a streamed dataset to the disk
Yes, I agree this feature is much needed. We could do something similar to what TF does (https://www.tensorflow.org/api_docs/python/tf/data/Dataset#cache). Ideally, if the entire streamed dataset is consumed/cached, the generated cache should be reusable for the Arrow dataset.
**Is your feature request related to a problem? Please describe.** The streaming mode allows to get the 100 first rows of a dataset very quickly. But it does not cache the answer, so a posterior call to get the same 100 rows will send a request to the server again and again. **Describe the solution you'd like** Provide a way to write the streamed rows of a dataset on the disk, and to load from it later. **Describe alternatives you've considered** Provide a third mode: `lazy`, which would use the local cache for the data that have already been fetched previously, and use streaming to get the rest of the requested data.
1,154
36
Provide a way to write a streamed dataset to the disk **Is your feature request related to a problem? Please describe.** The streaming mode allows to get the 100 first rows of a dataset very quickly. But it does not cache the answer, so a posterior call to get the same 100 rows will send a request to the server again and again. **Describe the solution you'd like** Provide a way to write the streamed rows of a dataset on the disk, and to load from it later. **Describe alternatives you've considered** Provide a third mode: `lazy`, which would use the local cache for the data that have already been fetched previously, and use streaming to get the rest of the requested data. Yes, I agree this feature is much needed. We could do something similar to what TF does (https://www.tensorflow.org/api_docs/python/tf/data/Dataset#cache). Ideally, if the entire streamed dataset is consumed/cached, the generated cache should be reusable for the Arrow dataset.
[ -1.2595843076705933, -1.0525587797164917, -0.7570509910583496, 1.4276875257492065, -0.25027838349342346, -1.3187587261199951, 0.002333391457796097, -1.0846755504608154, 1.7662547826766968, -0.7390720248222351, 0.18316933512687683, -1.7214207649230957, 0.115323506295681, -0.5730663537979126, -0.8572446703910828, -0.8414278626441956, -0.43088096380233765, -0.865699827671051, 0.8015857934951782, 2.496001958847046, 1.095786213874817, -1.4346964359283447, 2.6928558349609375, 0.7369934320449829, -0.13985082507133484, -1.032467246055603, 0.5127880573272705, 0.10294250398874283, -1.230268120765686, -0.5244436860084534, -1.0291986465454102, -0.07338256388902664, -0.5350593328475952, -0.5964838862419128, 0.040066398680210114, 0.30405792593955994, -0.22664692997932434, -0.2773045003414154, -0.5693607926368713, -0.722660481929779, 0.46340832114219666, -0.436189740896225, 0.9086703062057495, -0.5088478922843933, 1.8545417785644531, -0.5571836233139038, 0.31278637051582336, 0.6809967160224915, 1.4154744148254395, 0.1383802592754364, -0.11170565336942673, 0.28377753496170044, 0.48736757040023804, 0.004282464273273945, 0.28515157103538513, 1.109846830368042, 0.47453826665878296, 0.5784100294113159, 0.7316104769706726, -2.2427592277526855, 1.414754033088684, -1.1119869947433472, 0.3506237268447876, 1.4690264463424683, -0.9687835574150085, 0.39640215039253235, -1.7697738409042358, -0.0491984598338604, 0.539031982421875, -2.3323566913604736, 0.18151560425758362, -1.2469366788864136, -0.6740548610687256, 0.9289485216140747, 0.30357733368873596, -1.2493895292282104, 0.24391674995422363, -0.5717798471450806, 1.0071910619735718, 0.5866827964782715, 1.1213092803955078, -1.7648059129714966, -0.12648828327655792, -0.30352702736854553, 0.023025833070278168, -1.4602664709091187, -1.5546817779541016, 0.6297796964645386, 0.6544705033302307, 0.5699030756950378, -0.08383802324533463, 0.9727842211723328, -0.9381632208824158, 0.8767803907394409, -0.9852198362350464, -1.53609037399292, -1.38577139377594, -2.195896863937378, -2.2328269481658936, 0.8155577778816223, -0.5118252635002136, -0.5698903203010559, 1.9896174669265747, -1.0725597143173218, -1.725124478340149, 1.2230989933013916, 0.22524097561836243, 0.08084309101104736, 2.4198124408721924, 0.1402330994606018, -0.5867799520492554, 0.3958691656589508, -0.6368422508239746, 0.9450516700744629, -0.5176128149032593, 1.4361541271209717, 0.5016128420829773, -0.9956899881362915, 1.6594393253326416, -0.42594221234321594, 0.48064491152763367, -0.6287304759025574, -0.5798616409301758, -0.9056512713432312, 0.4644767642021179, 1.8405475616455078, -0.3655674457550049, 1.588382601737976, -0.37137675285339355, -1.477670669555664, -1.6256028413772583, 1.0020356178283691, 0.44696229696273804, -0.8386187553405762, 0.05780899524688721, -0.2693360149860382, 0.11908092349767685, -0.1625489592552185, 1.148663878440857, 1.2297749519348145, 0.6931983828544617, -0.33462071418762207, -0.9006856679916382, 0.15841549634933472, -0.14072537422180176, -0.7095704078674316, -1.864659309387207, -0.38256368041038513, 0.19415155053138733, 0.6801671385765076, -1.1741738319396973, 1.6122868061065674, 0.9197670817375183, 1.8991546630859375, 1.0311647653579712, -0.25575146079063416, 1.3497501611709595, 0.06283106654882431, 1.8834837675094604, -0.6803823113441467, 0.7134484052658081, -0.255334734916687, -0.971650242805481, 0.8342435956001282, -0.39669540524482727, -2.0090150833129883, -0.6748245358467102, -0.9282248020172119, -0.33109182119369507, -0.7291026711463928, 0.9556918740272522, -0.3421671986579895, -1.326249599456787, 0.2831801474094391, -0.6572328805923462, 0.1507532298564911, -1.1469981670379639, 0.3013995587825775, 0.8178247213363647, -0.5637499690055847, -0.05515376478433609, -0.2171294391155243, -1.3442307710647583, -0.5423709154129028, 0.2847752869129181, 1.8739980459213257, -0.7119576334953308, 0.8846426606178284, 0.8957183361053467, -0.6811826825141907, -0.048124875873327255, 0.4275982081890106, -0.1992991864681244, 0.8551000356674194, -1.0850342512130737, -0.29963067173957825, 1.108510971069336, -0.20093217492103577, -0.6235207319259644, 1.5448609590530396, 0.7197458148002625, -0.9586625695228577, -0.09300051629543304, -0.2795242667198181, -0.8170484304428101, -0.05238061770796776, -1.566202163696289, -0.1264234185218811, 0.20494809746742249, -1.4875844717025757, -0.47741782665252686, -0.10304635763168335, 1.284745693206787, -0.08238987624645233, 1.2875474691390991, -0.38592374324798584, -0.3869240880012512, -0.4293961226940155, -0.39353588223457336, 0.12480729073286057, -0.2457243800163269, -0.561953604221344, 0.2485179901123047, -0.8318734169006348, 0.38062864542007446, 1.4154553413391113, 0.4664922058582306, 0.07478353381156921, 0.6212273240089417, 1.0319489240646362, 0.24556639790534973, -0.030231477692723274, -0.8643609285354614, -1.5641615390777588, 1.9298633337020874, -1.4647762775421143, 1.9208451509475708, 0.7787430882453918, -0.03649020195007324, -1.8576483726501465, -1.8042244911193848, 1.310488224029541, 1.193982481956482, 2.250922679901123, 0.5888400077819824, 0.3280714154243469, -0.8118709325790405, -0.646800696849823, 0.3661919832229614, -1.1031465530395508, -0.6934311985969543, -0.04238932952284813, 2.3079028129577637, 1.8783791065216064, -0.5311310291290283, -0.17504003643989563, -1.1374366283416748, 1.3154394626617432, -0.04817664995789528, 0.2063174545764923, 1.9871493577957153, -0.3619541823863983, -1.0662920475006104, 1.2288882732391357, -2.2947237491607666, 0.07480102777481079, 1.9738187789916992, 0.3250546455383301, 0.10535567998886108, -1.4241197109222412, -0.622861921787262, -0.17358189821243286, -0.39775827527046204, -1.3143349885940552, 0.5389803647994995, -0.507362961769104, -0.7297998666763306, -1.5473606586456299, 0.14436769485473633, -1.1404259204864502, -1.5785058736801147, 0.3836243748664856, 1.8335516452789307, 2.0755691528320312, -0.5320379734039307, 1.514497995376587, -0.1913958489894867, 0.18195664882659912, 1.295251727104187, 1.1826006174087524, 3.106276273727417, 2.0167455673217773, -1.2588703632354736, 0.6306575536727905, -0.15204644203186035, -0.35604068636894226, 1.158911943435669, -1.1598056554794312, 1.3250601291656494, -0.16936084628105164, -1.1465193033218384, -1.2056920528411865, 1.0283664464950562, 0.4837724268436432, 0.07304598391056061, -0.5471834540367126, 1.2613904476165771, -0.042958978563547134, 1.1763056516647339, 0.48554062843322754, -0.44523242115974426, 0.577066957950592, -0.49731066823005676, -0.6527804136276245, 1.633241891860962, 0.27232953906059265, -1.4054421186447144, -2.326996326446533, -0.23619455099105835, -0.7818920612335205, 0.030642997473478317, -0.5812476873397827, -0.9801797866821289, 1.7663828134536743, 0.415153831243515, -1.2566843032836914, -0.24603664875030518, -0.3845628499984741, -0.7485728859901428, 2.710296154022217, -1.414637804031372, -0.2917771637439728, -0.9480831027030945, -0.5025018453598022, 1.596842885017395, -1.3545440435409546, -0.133596271276474, -1.0523958206176758, -0.6476396322250366, -1.2947860956192017, -0.45910054445266724, -0.09434632956981659, -0.84369957447052, 0.9064905643463135, 0.10653354227542877, -1.0118204355239868, -0.31687238812446594, -0.8191462755203247, 0.7573801875114441, -0.07422726601362228, 0.2700815498828888, 1.9698694944381714, 0.4511016309261322, -0.4766105115413666, 0.5706406831741333, 1.2069828510284424, 0.607569694519043, -0.6727985739707947, 0.20523610711097717, -0.6049456000328064, 0.2243231236934662, -1.3219724893569946, 0.32238462567329407, -2.9370129108428955, 0.641433835029602, -0.00792185589671135, -0.08701428771018982, 0.03745061904191971, -1.2338863611221313, 1.028570532798767, 2.582301139831543, -1.2337884902954102, 0.3818337321281433, 0.2539878189563751, 1.2086234092712402, -1.5855400562286377, 0.505975604057312, -0.45088130235671997, 2.1314711570739746, 0.23065689206123352, 0.9945625066757202, -0.597576379776001, -2.2433359622955322, 0.5837880373001099, -1.1331799030303955, -1.1357742547988892, 0.5456334948539734, -0.7853005528450012, 0.10726862400770187, -1.5887677669525146, -0.12231206893920898, -0.9340646862983704, -1.2768468856811523, 0.8726226091384888, 0.1645233929157257, 0.446891188621521, -0.6156768202781677, 0.2928340435028076, -2.0406391620635986, -1.3331226110458374, -0.3486899733543396, -0.7950352430343628, 0.5356786251068115, -0.30195507407188416, 0.70556640625, -0.166212797164917, 0.20024797320365906, 0.29481440782546997, 1.412054181098938, 3.408470869064331, 0.16706600785255432, 0.4834854304790497, -0.17651811242103577, -0.9136486053466797, 1.302473783493042, 1.0346635580062866, 0.12221754342317581, -0.6486195921897888, -1.0117806196212769, 1.2901476621627808, 1.9451276063919067, 0.9456902742385864, 0.23580360412597656, -0.7830987572669983, -0.5993513464927673, -0.00030034221708774567, 0.26202791929244995, 0.5129797458648682, 0.9029501676559448, 0.006173606030642986, 0.0967651978135109, 1.4967436790466309, 1.3127555847167969, -0.3596727252006531, 0.31462785601615906, -0.7849957942962646, -0.4189601242542267, 0.48290762305259705, 0.4640830159187317, -0.00007053744047880173, 0.3098447322845459, -0.9587826728820801, -0.27278125286102295, -0.38418373465538025, -1.1167709827423096, -0.5720428824424744, -0.5383068919181824, -0.44348689913749695, 1.7196440696716309, 0.20979520678520203, -0.41602200269699097, -0.146176278591156, -0.8196952939033508, -0.11845164746046066, -1.1801618337631226, 0.38130542635917664, -0.0761026069521904, -0.08423525840044022, -0.05938999354839325, 1.8221601247787476, -0.8230264782905579, -2.145120620727539, 0.2991965115070343, 0.27577725052833557, -0.5086131691932678, 0.1824301779270172, 1.5445011854171753, 0.493103951215744, 1.4706796407699585, 1.3814623355865479, 0.9426079988479614, -0.602461576461792, -1.2806576490402222, 0.6486713886260986, 0.860565721988678, -1.5443289279937744, 0.9073905944824219, 0.09186720103025436, -0.6393554210662842, 0.9364395141601562, 1.3429317474365234, 0.36335518956184387, -2.0415031909942627, 0.7346084713935852, -0.8351019620895386, 0.8730360865592957, 0.7341637015342712, 0.6933823227882385, 0.27898991107940674, 0.8823828101158142, -1.290228009223938, -1.2452267408370972, -0.9030039310455322, -0.5725105404853821, 2.02836275100708, -0.17601004242897034, 0.6214907169342041, -0.18074050545692444, -1.3048564195632935, -0.09547210484743118, 0.7631856203079224, 0.42955881357192993, -0.307232528924942, 0.8471003770828247, -0.6960387825965881, -1.125477910041809, -1.4243091344833374, -0.4466620087623596, -0.9538351893424988, -0.8844997882843018, 1.1123511791229248, 0.9488576054573059, 0.1828472912311554, 1.9598448276519775, 0.5540754199028015, 0.2362174093723297, -2.6208817958831787, 0.7755131125450134, 0.30724331736564636, 0.0739203691482544, 0.8987910747528076, 0.22380828857421875, 0.9377734065055847, 0.06445182114839554, 0.5181663036346436, -2.380573272705078, 2.199849843978882, -0.35187721252441406, 0.7593467831611633, -0.07844837754964828, -0.13736474514007568, 1.194731593132019, 0.5896860957145691, 0.546101987361908, -1.0506658554077148, 0.7045369744300842, -0.5792461037635803, 1.2239969968795776, 1.0414077043533325, -0.7091368436813354, -0.02923017181456089, 1.3107478618621826, 0.5546102523803711, -0.47515782713890076, -0.9262838959693909, -0.8823865652084351, 0.857259213924408, 1.8400321006774902, -0.054711680859327316, -0.045649655163288116, 0.8539873361587524, 0.7211152911186218, -1.1899151802062988, 0.297037273645401, -0.7925781607627869, -0.8003787398338318, 1.5550148487091064, 2.047670841217041, -0.10853247344493866, -0.027971642091870308, -0.6045438647270203, -1.1866230964660645, 0.6792910099029541, -0.0008454630151391029, 0.13061872124671936, 0.6251285672187805, -0.5748728513717651, 0.997943639755249, 0.8917035460472107, 0.966447651386261, 0.03553687036037445, 0.48473531007766724, 0.4553442597389221, -0.3779519498348236, -1.1919025182724, -0.2835647761821747, -1.0860565900802612, -2.4836740493774414, 0.5176311135292053, -0.30330049991607666, -1.5202209949493408, 0.01622144877910614, -1.1084849834442139, 0.9753509163856506, -0.46563082933425903, -1.1494717597961426, -1.6128679513931274, 0.10442781448364258, -0.07820932567119598, 0.9547197818756104, -1.5443346500396729, 0.0049150679260492325, 1.14338219165802, 0.7897700667381287, -0.5877353549003601, 1.0253677368164062, 0.26665860414505005, 1.1110271215438843, 0.8051071166992188, -0.5219211578369141, 0.3093454837799072, 0.1781640648841858, -1.3204092979431152, 0.5347363948822021, 1.048237681388855, 0.18175172805786133, 1.3642244338989258, -0.47165971994400024, 0.11693940311670303, 0.3922097980976105, -0.5380102396011353, -0.38479146361351013, -0.5021194815635681, 0.7413325905799866, 0.0733836367726326, -0.8259783387184143, 0.12430579215288162, -0.08620567619800568, -0.317436158657074, 0.1328934133052826, -1.436119556427002, -0.23237797617912292, -0.540337860584259, -0.5078052282333374, -1.2607890367507935, -0.028620384633541107, 1.3545092344284058, -0.670718252658844, -0.16628068685531616, 0.5887195467948914, 0.5427955389022827, 0.5268470644950867, 0.6110517382621765, -0.5596954226493835, -0.3457370102405548, -0.21584203839302063, -0.4429924786090851, 0.28237631916999817, 1.1899285316467285, -0.2453525960445404, -0.9405213594436646, 0.75486159324646, -0.364962637424469, 0.001127791590988636, 1.931053876876831, 0.08549583703279495, -0.7461880445480347, 0.3466673195362091, -0.6894629597663879, 1.8497769832611084, 1.683938980102539, 1.2913709878921509, -0.13453155755996704, -0.8967129588127136, 0.5327207446098328, -0.18942010402679443, -0.4344679117202759, 0.9229460954666138, 0.5851230621337891, -0.11265093833208084, -1.3905144929885864, 0.5315046906471252, 1.1299505233764648, -0.8996248245239258, -0.7653146982192993, 0.025845475494861603, -0.7169116139411926, 1.0187788009643555, 0.6216219663619995, 0.5339038372039795, 0.33024683594703674, 1.6794259548187256, 0.612408459186554, -0.5860713124275208, 0.4752289950847626, 0.545084536075592, -0.19019052386283875, -2.202770709991455, -1.126997947692871, 0.26810407638549805, -0.46473222970962524, -1.5940871238708496, 1.2887294292449951, -1.1819216012954712, -0.8615059852600098, 0.49889084696769714, 0.2007962465286255, 1.5212428569793701, 0.2867956757545471, 1.6388967037200928, 2.135657787322998, 0.8380083441734314, 0.36845341324806213, 1.4790185689926147, 0.05288102850317955, -0.43045997619628906, 1.9568216800689697, -0.4455659091472626, 0.5121747255325317, 1.126325011253357, -0.2938299775123596, -1.1364465951919556, -0.6559267044067383, -1.0723280906677246, -0.5229635834693909, 1.0656124353408813, 0.08787911385297775, -1.1256687641143799, 0.1391109824180603, 1.4699193239212036, 0.14156609773635864, -0.2916841208934784, 0.4153047204017639, 0.4048907160758972, -0.7148096561431885, -0.08212822675704956, -0.9473874568939209, 0.5212317109107971, -0.23329809308052063, -0.34020572900772095, 0.32194381952285767, 0.5033321976661682, 1.1815414428710938, -0.12047257274389267, 0.10291765630245209, 1.2475446462631226, -1.485777735710144, 1.4429277181625366, -0.4717255234718323, 0.1795717477798462, -2.448603868484497, 1.4868494272232056, -0.7001700401306152, 1.8705124855041504, -2.663818597793579, 0.3309228718280792, -0.6659302711486816, -0.5004505515098572, 0.4530402421951294, -0.34840354323387146, 0.12271397560834885, -0.16950547695159912, -1.0925689935684204, 0.14613455533981323, -0.7029456496238708, 0.47718092799186707, 1.2453057765960693, 1.339374303817749, -1.183014154434204, -0.27810877561569214, -1.8243539333343506, -0.2385062277317047, -0.7780657410621643, 0.36271506547927856, -2.0876147747039795, -0.11865202337503433, -1.8601826429367065, -2.3322534561157227, -1.498901605606079, -0.9371811151504517, 1.016638159751892, 0.17339396476745605, -0.9679907560348511, 1.058098554611206, -0.36377623677253723, -1.773295521736145, 1.0056072473526, -2.171294689178467 ]
https://github.com/huggingface/datasets/issues/3135
Make inspect.get_dataset_config_names always return a non-empty list of configs
Hi @severo, I guess this issue requests not only to be able to access the configuration name (by using `inspect.get_dataset_config_names`), but the configuration itself as well (I mean you use the name to get the configuration afterwards, maybe using `builder_cls.builder_configs`), is this right?
**Is your feature request related to a problem? Please describe.** Currently, some datasets have a configuration, while others don't. It would be simpler for the user to always have configuration names to refer to **Describe the solution you'd like** In that sense inspect.get_dataset_config_names should always return at least one configuration name, be it `default` or `Check___region_1` (for community datasets like `Check/region_1`). https://github.com/huggingface/datasets/blob/c5747a5e1dde2670b7f2ca6e79e2ffd99dff85af/src/datasets/inspect.py#L161
1,156
43
Make inspect.get_dataset_config_names always return a non-empty list of configs **Is your feature request related to a problem? Please describe.** Currently, some datasets have a configuration, while others don't. It would be simpler for the user to always have configuration names to refer to **Describe the solution you'd like** In that sense inspect.get_dataset_config_names should always return at least one configuration name, be it `default` or `Check___region_1` (for community datasets like `Check/region_1`). https://github.com/huggingface/datasets/blob/c5747a5e1dde2670b7f2ca6e79e2ffd99dff85af/src/datasets/inspect.py#L161 Hi @severo, I guess this issue requests not only to be able to access the configuration name (by using `inspect.get_dataset_config_names`), but the configuration itself as well (I mean you use the name to get the configuration afterwards, maybe using `builder_cls.builder_configs`), is this right?
[ -1.2288191318511963, -0.933009922504425, -0.8180731534957886, 1.3975074291229248, -0.17639899253845215, -1.2961366176605225, 0.09655627608299255, -1.157646894454956, 1.6987895965576172, -0.761380672454834, 0.24706926941871643, -1.6541571617126465, 0.024677693843841553, -0.6145434975624084, -0.8712587952613831, -0.8431246280670166, -0.3880477249622345, -0.8835765719413757, 0.9574583172798157, 2.4719674587249756, 1.201340675354004, -1.3835453987121582, 2.7155144214630127, 0.6766881942749023, -0.17772381007671356, -1.0467712879180908, 0.5165596604347229, 0.015283318236470222, -1.1727197170257568, -0.5102298855781555, -0.9130258560180664, -0.08247639983892441, -0.6445671916007996, -0.5717707276344299, -0.003457143437117338, 0.35157811641693115, -0.27137160301208496, -0.30331844091415405, -0.5662763118743896, -0.827373206615448, 0.5271776914596558, -0.4411747455596924, 0.9674007892608643, -0.4088961184024811, 1.8433597087860107, -0.5779330730438232, 0.3869309425354004, 0.7231895923614502, 1.363865852355957, 0.165638729929924, 0.021770242601633072, 0.27122417092323303, 0.37215831875801086, 0.00265597365796566, 0.4934605360031128, 1.1095330715179443, 0.6660391092300415, 0.513323187828064, 0.7526451945304871, -2.1685965061187744, 1.4206645488739014, -1.0729146003723145, 0.17534390091896057, 1.3728537559509277, -0.9141457080841064, 0.3300679922103882, -1.8199999332427979, -0.07922723144292831, 0.6680193543434143, -2.2711873054504395, 0.23282034695148468, -1.3495452404022217, -0.5857722163200378, 0.9814736843109131, 0.280505895614624, -1.3337185382843018, 0.18660041689872742, -0.4894411563873291, 1.0403668880462646, 0.5037438869476318, 1.1018664836883545, -1.8175768852233887, -0.027484240010380745, -0.25881361961364746, 0.02397295832633972, -1.3962244987487793, -1.505197525024414, 0.5991525650024414, 0.5951203107833862, 0.5907319784164429, -0.10638909786939621, 1.0435433387756348, -1.0440115928649902, 0.8009809851646423, -1.0053155422210693, -1.6054627895355225, -1.4065289497375488, -2.291308879852295, -2.2909095287323, 0.8420352339744568, -0.4787297546863556, -0.5743012428283691, 1.987508773803711, -1.0765149593353271, -1.7346911430358887, 1.0791099071502686, 0.27162912487983704, 0.12630225718021393, 2.357860803604126, 0.21847903728485107, -0.6646300554275513, 0.40739721059799194, -0.6700034141540527, 0.8731507062911987, -0.3584078550338745, 1.3841395378112793, 0.5823928713798523, -1.0104615688323975, 1.6291568279266357, -0.49615076184272766, 0.5719293355941772, -0.6579185128211975, -0.502922773361206, -0.8404102921485901, 0.34569939970970154, 1.8995342254638672, -0.2655216455459595, 1.5776948928833008, -0.37945711612701416, -1.5769410133361816, -1.5384256839752197, 0.8987672328948975, 0.4599955379962921, -0.8762048482894897, 0.07472290843725204, -0.38609111309051514, 0.16845685243606567, -0.06080334261059761, 1.1248719692230225, 1.2255198955535889, 0.6682962775230408, -0.3989643156528473, -0.876718282699585, 0.18960168957710266, -0.1278672218322754, -0.7651020884513855, -1.8554108142852783, -0.29453444480895996, 0.13210821151733398, 0.7292015552520752, -1.1634891033172607, 1.7787823677062988, 0.8912813663482666, 1.8694641590118408, 1.0267202854156494, -0.23769164085388184, 1.450904369354248, -0.03134407103061676, 1.8740639686584473, -0.6118251085281372, 0.7102208137512207, -0.348361611366272, -1.0347812175750732, 0.8830298781394958, -0.33641770482063293, -2.0706729888916016, -0.7983837723731995, -0.7443272471427917, -0.25548800826072693, -0.734483003616333, 0.872675359249115, -0.2749831974506378, -1.3462693691253662, 0.21390856802463531, -0.6373180150985718, 0.1419701725244522, -1.2441697120666504, 0.23874719440937042, 0.6825991868972778, -0.6597203612327576, -0.024488871917128563, -0.2789188027381897, -1.3161990642547607, -0.4743027687072754, 0.21268272399902344, 2.004180431365967, -0.7126774787902832, 0.9215961694717407, 0.9568296074867249, -0.7119565606117249, 0.00018265191465616226, 0.3165079653263092, -0.18954287469387054, 0.7638428807258606, -1.0960907936096191, -0.3929269015789032, 1.2038500308990479, -0.22935746610164642, -0.5533288717269897, 1.4899191856384277, 0.7749061584472656, -0.9915041327476501, -0.12291093915700912, -0.2421293556690216, -0.854807436466217, -0.016475703567266464, -1.5176098346710205, -0.13741201162338257, 0.33790481090545654, -1.3998162746429443, -0.3511669635772705, -0.1144794449210167, 1.292060136795044, -0.19201251864433289, 1.4049367904663086, -0.37000787258148193, -0.28028446435928345, -0.32408639788627625, -0.4250791668891907, 0.08684328198432922, -0.11484353989362717, -0.5225357413291931, 0.18048696219921112, -0.813630998134613, 0.3524150550365448, 1.4342930316925049, 0.4318641424179077, 0.038871943950653076, 0.4677305519580841, 1.0827956199645996, 0.2755189538002014, -0.006332268472760916, -0.7585412859916687, -1.5354430675506592, 2.060596227645874, -1.4099717140197754, 1.991208791732788, 0.7507215738296509, -0.04207213222980499, -1.7005677223205566, -1.7377896308898926, 1.3311548233032227, 1.1951043605804443, 2.3244149684906006, 0.5232138633728027, 0.28035151958465576, -0.8462243676185608, -0.6906866431236267, 0.41694939136505127, -1.0797560214996338, -0.6608470678329468, 0.03050440177321434, 2.3669028282165527, 1.7984464168548584, -0.5372189283370972, -0.21768763661384583, -0.9760878682136536, 1.3949310779571533, -0.21374672651290894, 0.25709086656570435, 2.054006576538086, -0.33593493700027466, -1.1200799942016602, 1.2361419200897217, -2.348149061203003, 0.15720263123512268, 2.0155436992645264, 0.32110482454299927, 0.17136773467063904, -1.4686715602874756, -0.6057887077331543, -0.3193470239639282, -0.407901406288147, -1.2858076095581055, 0.6588979959487915, -0.40069952607154846, -0.8375589847564697, -1.4207754135131836, 0.15214519202709198, -1.1414265632629395, -1.6666560173034668, 0.42851006984710693, 1.8309385776519775, 2.0511927604675293, -0.6843700408935547, 1.5257229804992676, -0.20299102365970612, 0.1597151756286621, 1.278407096862793, 1.2588977813720703, 3.1259548664093018, 1.9117977619171143, -1.238215684890747, 0.6749748587608337, -0.1618078351020813, -0.4801846444606781, 1.1262993812561035, -1.0774528980255127, 1.2844326496124268, -0.16015391051769257, -1.1508278846740723, -1.3025774955749512, 0.9720090627670288, 0.49026283621788025, 0.014058008790016174, -0.5049999952316284, 1.333667516708374, 0.016810188069939613, 1.236466407775879, 0.5751839876174927, -0.44343847036361694, 0.5938425064086914, -0.44955116510391235, -0.6444692611694336, 1.6137135028839111, 0.28235992789268494, -1.4873425960540771, -2.2805559635162354, -0.16758982837200165, -0.7316718101501465, -0.015770072117447853, -0.6153978109359741, -0.9478294253349304, 1.7205836772918701, 0.40461650490760803, -1.3986444473266602, -0.2595866024494171, -0.3825237452983856, -0.6438421607017517, 2.6489479541778564, -1.4022455215454102, -0.17680934071540833, -0.9633275866508484, -0.607306182384491, 1.6477229595184326, -1.2415452003479004, -0.21958845853805542, -1.0097732543945312, -0.6555884480476379, -1.3309078216552734, -0.4913216531276703, -0.08213476091623306, -0.8963532447814941, 0.7729199528694153, 0.1651664674282074, -1.1110131740570068, -0.3693851828575134, -0.8611453771591187, 0.7827887535095215, -0.10316883027553558, 0.21975263953208923, 1.8366048336029053, 0.35173773765563965, -0.3894537687301636, 0.6790776252746582, 1.1347565650939941, 0.594062089920044, -0.6693836450576782, 0.13142527639865875, -0.6206612586975098, 0.3953252136707306, -1.2942702770233154, 0.33859461545944214, -2.9278249740600586, 0.6481097936630249, -0.15043804049491882, -0.1308496743440628, 0.0008087949827313423, -1.3322784900665283, 1.0817952156066895, 2.5915932655334473, -1.2131073474884033, 0.4950782060623169, 0.2483016848564148, 1.1155281066894531, -1.6488547325134277, 0.37393733859062195, -0.322983056306839, 2.1079320907592773, 0.16500669717788696, 1.2189862728118896, -0.5050495862960815, -2.1803057193756104, 0.6500177979469299, -1.1433444023132324, -1.2047946453094482, 0.6721872687339783, -0.8560588359832764, 0.1574561446905136, -1.4805445671081543, -0.2527886629104614, -0.9878408908843994, -1.2885124683380127, 0.8553024530410767, 0.22450102865695953, 0.48218777775764465, -0.5858098268508911, 0.2774277627468109, -2.158742666244507, -1.3222589492797852, -0.21839921176433563, -0.9210062623023987, 0.5366034507751465, -0.3673240542411804, 0.5619350075721741, -0.09367449581623077, 0.13285957276821136, 0.40454521775245667, 1.4131100177764893, 3.422879219055176, 0.1679946780204773, 0.40893417596817017, -0.17007914185523987, -0.8633652925491333, 1.379857063293457, 0.8836700320243835, -0.1183476448059082, -0.563204288482666, -1.0471301078796387, 1.307358980178833, 1.9775331020355225, 0.9267572164535522, 0.03127298131585121, -0.8091709613800049, -0.5882735848426819, -0.04561253637075424, 0.1481761932373047, 0.45603734254837036, 0.9446572065353394, 0.003482137806713581, 0.0429740771651268, 1.4330973625183105, 1.1966910362243652, -0.4312037229537964, 0.3747532069683075, -0.8720846176147461, -0.4178076386451721, 0.45227691531181335, 0.3224576413631439, 0.004276269115507603, 0.3698497712612152, -0.9581069350242615, -0.2060362547636032, -0.3410523533821106, -0.9917961955070496, -0.7321832180023193, -0.5427570343017578, -0.4324253499507904, 1.626126766204834, 0.10120407491922379, -0.4998968243598938, -0.024804817512631416, -0.7989488244056702, -0.15049533545970917, -1.030613660812378, 0.19662079215049744, -0.049104318022727966, -0.15987099707126617, -0.09417224675416946, 1.745459794998169, -0.9595832228660583, -2.092564105987549, 0.3006902039051056, 0.2844415009021759, -0.3673636019229889, 0.23689204454421997, 1.637181282043457, 0.4890606999397278, 1.4620115756988525, 1.330073356628418, 0.9300314784049988, -0.6891372799873352, -1.322220802307129, 0.6898047924041748, 0.9273552298545837, -1.522639513015747, 0.8912524580955505, -0.02658996731042862, -0.49336954951286316, 0.7546943426132202, 1.2138807773590088, 0.4003855586051941, -1.9633574485778809, 0.7634803652763367, -0.9333483576774597, 0.7502700090408325, 0.6576207280158997, 0.7056798338890076, 0.30518820881843567, 0.9550925493240356, -1.1952471733093262, -1.1024093627929688, -0.8292745351791382, -0.60992032289505, 1.98722243309021, -0.26948660612106323, 0.5783015489578247, -0.16002251207828522, -1.2172205448150635, -0.15959285199642181, 0.7597870826721191, 0.4076588749885559, -0.38563480973243713, 0.7514576315879822, -0.6615417003631592, -1.066784143447876, -1.363682746887207, -0.4290890395641327, -1.05134916305542, -0.8973677158355713, 1.0548930168151855, 0.8376458883285522, 0.3137865662574768, 1.9052674770355225, 0.6111920475959778, 0.25734764337539673, -2.6438188552856445, 0.845702052116394, 0.327328622341156, -0.04118354991078377, 0.9363350868225098, 0.35278621315956116, 1.0442514419555664, 0.0007721129804849625, 0.5271039605140686, -2.4002606868743896, 2.240676164627075, -0.33882588148117065, 0.6480246782302856, -0.04339150711894035, -0.21404492855072021, 1.1921226978302002, 0.5678934454917908, 0.5461302399635315, -1.1208224296569824, 0.6994450092315674, -0.516647219657898, 1.1713011264801025, 1.029876708984375, -0.8187744617462158, 0.06704764813184738, 1.3745410442352295, 0.4757375121116638, -0.5756436586380005, -0.8987807035446167, -0.8335862159729004, 0.8633049726486206, 1.739603042602539, -0.10873367637395859, -0.11081482470035553, 0.7603273391723633, 0.6744445562362671, -1.2142372131347656, 0.2221037745475769, -0.7645811438560486, -0.8333259224891663, 1.6421661376953125, 2.099255084991455, -0.1071985587477684, -0.10395830124616623, -0.6702984571456909, -1.2724103927612305, 0.798981785774231, 0.06154968589544296, 0.022370412945747375, 0.5609882473945618, -0.6606767177581787, 1.1330416202545166, 0.8588744401931763, 0.9508204460144043, 0.09087572246789932, 0.3576033115386963, 0.4618241488933563, -0.25822508335113525, -1.0854008197784424, -0.3670625686645508, -1.2525300979614258, -2.5239148139953613, 0.48014920949935913, -0.24038876593112946, -1.4117190837860107, -0.00510749313980341, -1.0267338752746582, 0.886025607585907, -0.5170849561691284, -1.1152420043945312, -1.5546395778656006, 0.24610641598701477, -0.041920144110918045, 0.8824443817138672, -1.6583621501922607, -0.08887089788913727, 1.214796543121338, 0.8441758751869202, -0.5919508337974548, 1.000669240951538, 0.2843843698501587, 0.9870209097862244, 0.827244222164154, -0.4408836364746094, 0.5302136540412903, 0.11533775180578232, -1.3941562175750732, 0.5654477477073669, 1.2103965282440186, 0.12467129528522491, 1.4813408851623535, -0.4707610011100769, 0.14110158383846283, 0.34079134464263916, -0.6095978021621704, -0.38675984740257263, -0.4876214563846588, 0.7580461502075195, 0.1618845909833908, -0.8724823594093323, 0.01598035730421543, -0.16307611763477325, -0.23439419269561768, 0.2150130420923233, -1.4619345664978027, -0.2704571783542633, -0.37622326612472534, -0.3821271061897278, -1.210874080657959, -0.09662123769521713, 1.3630366325378418, -0.7074544429779053, -0.2217140793800354, 0.552976667881012, 0.5157591104507446, 0.5727077722549438, 0.618274450302124, -0.6983528137207031, -0.35368111729621887, -0.32750263810157776, -0.3342149257659912, 0.22734588384628296, 1.2365391254425049, -0.06724953651428223, -0.9681975245475769, 0.7825565934181213, -0.37191420793533325, 0.0571582093834877, 1.8746669292449951, 0.06748826801776886, -0.7098112106323242, 0.43327972292900085, -0.7333554029464722, 1.901611089706421, 1.7143073081970215, 1.2732741832733154, -0.07231072336435318, -0.9409859776496887, 0.5941882729530334, -0.2808723747730255, -0.4199572503566742, 0.949455201625824, 0.5053707361221313, -0.2277030497789383, -1.3766751289367676, 0.6284080147743225, 1.2127726078033447, -0.8660476207733154, -0.7869542241096497, -0.0073883188888430595, -0.8427894115447998, 1.075382947921753, 0.5640159845352173, 0.46665534377098083, 0.2470247447490692, 1.676802158355713, 0.6398252844810486, -0.44043847918510437, 0.5631675124168396, 0.4880650043487549, -0.12213308364152908, -2.166820526123047, -1.1388263702392578, 0.36650529503822327, -0.38182148337364197, -1.4985928535461426, 1.2418694496154785, -1.1145048141479492, -0.9334051609039307, 0.5454597473144531, 0.11440060287714005, 1.4766972064971924, 0.347820520401001, 1.6229066848754883, 2.1173932552337646, 0.8698996305465698, 0.36183130741119385, 1.29665207862854, -0.0729978084564209, -0.47956812381744385, 1.8709399700164795, -0.4342494308948517, 0.5487526059150696, 1.047865390777588, -0.3370779752731323, -1.095294713973999, -0.8307855129241943, -1.1294395923614502, -0.6252744793891907, 1.1645143032073975, 0.05090952292084694, -1.095057487487793, 0.17879076302051544, 1.6446590423583984, 0.155442014336586, -0.27506160736083984, 0.5639517307281494, 0.4274129271507263, -0.6923501491546631, -0.06010381132364273, -0.9148339629173279, 0.5368213057518005, -0.256183922290802, -0.3875587284564972, 0.29886457324028015, 0.5357573628425598, 1.274766445159912, -0.09477514773607254, 0.09353844076395035, 1.1701507568359375, -1.4642179012298584, 1.4634406566619873, -0.5267522931098938, 0.24033501744270325, -2.400101661682129, 1.3721699714660645, -0.6763095259666443, 1.956852674484253, -2.663376808166504, 0.31736108660697937, -0.6214764714241028, -0.5732971429824829, 0.3545694947242737, -0.348564088344574, 0.1980549693107605, -0.1389044225215912, -1.0841586589813232, 0.05218043923377991, -0.7186770439147949, 0.5894954204559326, 1.1402664184570312, 1.4433434009552002, -1.117370843887329, -0.2534938156604767, -1.8284897804260254, -0.16031521558761597, -0.707601010799408, 0.3175658881664276, -2.0484681129455566, -0.07809429615736008, -1.9391045570373535, -2.329284191131592, -1.4230434894561768, -0.8674959540367126, 1.0194737911224365, 0.13955539464950562, -0.8987004160881042, 1.138035535812378, -0.31880635023117065, -1.876680850982666, 1.0617287158966064, -2.086118698120117 ]
https://github.com/huggingface/datasets/issues/3135
Make inspect.get_dataset_config_names always return a non-empty list of configs
Yes, maybe the issue could be reformulated. As a user, I want to avoid having to manage special cases: - I want to be able to get the names of a dataset's configs, and use them in the rest of the API (get the data, get the split names, etc). - I don't want to have to manage datasets with named configs (`glue`) differently from datasets without named configs (`acronym_identification`, `Check/region_1`)
**Is your feature request related to a problem? Please describe.** Currently, some datasets have a configuration, while others don't. It would be simpler for the user to always have configuration names to refer to **Describe the solution you'd like** In that sense inspect.get_dataset_config_names should always return at least one configuration name, be it `default` or `Check___region_1` (for community datasets like `Check/region_1`). https://github.com/huggingface/datasets/blob/c5747a5e1dde2670b7f2ca6e79e2ffd99dff85af/src/datasets/inspect.py#L161
1,156
71
Make inspect.get_dataset_config_names always return a non-empty list of configs **Is your feature request related to a problem? Please describe.** Currently, some datasets have a configuration, while others don't. It would be simpler for the user to always have configuration names to refer to **Describe the solution you'd like** In that sense inspect.get_dataset_config_names should always return at least one configuration name, be it `default` or `Check___region_1` (for community datasets like `Check/region_1`). https://github.com/huggingface/datasets/blob/c5747a5e1dde2670b7f2ca6e79e2ffd99dff85af/src/datasets/inspect.py#L161 Yes, maybe the issue could be reformulated. As a user, I want to avoid having to manage special cases: - I want to be able to get the names of a dataset's configs, and use them in the rest of the API (get the data, get the split names, etc). - I don't want to have to manage datasets with named configs (`glue`) differently from datasets without named configs (`acronym_identification`, `Check/region_1`)
[ -1.225027322769165, -0.9524728655815125, -0.8186730146408081, 1.3867769241333008, -0.17411354184150696, -1.2927366495132446, 0.09044144302606583, -1.1496926546096802, 1.718186616897583, -0.7655543684959412, 0.2778894603252411, -1.6834838390350342, 0.004978185519576073, -0.6372475624084473, -0.8373148441314697, -0.8515954613685608, -0.41316619515419006, -0.8399161696434021, 0.9510977864265442, 2.4966495037078857, 1.2092459201812744, -1.4204431772232056, 2.741112470626831, 0.6880712509155273, -0.150932177901268, -1.0177993774414062, 0.5287964344024658, 0.05581509694457054, -1.1562976837158203, -0.4907124638557434, -0.9179909825325012, -0.031934093683958054, -0.6568569540977478, -0.5896442532539368, -0.016373464837670326, 0.3377607464790344, -0.2963111400604248, -0.3706931173801422, -0.5135068893432617, -0.8215723633766174, 0.4773893654346466, -0.4220927953720093, 0.9855256676673889, -0.39005038142204285, 1.8286489248275757, -0.5351876616477966, 0.3737104833126068, 0.7156060934066772, 1.3801164627075195, 0.16903015971183777, 0.05012693628668785, 0.30285701155662537, 0.4073196053504944, 0.011370920576155186, 0.49833905696868896, 1.1700454950332642, 0.6797351837158203, 0.5204249024391174, 0.7529890537261963, -2.18642520904541, 1.3943979740142822, -1.1047186851501465, 0.2334265410900116, 1.3705698251724243, -0.9279998540878296, 0.41456687450408936, -1.746065378189087, -0.06605623662471771, 0.6519098281860352, -2.303379774093628, 0.20372503995895386, -1.3001776933670044, -0.5788206458091736, 1.0013545751571655, 0.2876092195510864, -1.2937771081924438, 0.21078163385391235, -0.4939579963684082, 1.030955195426941, 0.5045177340507507, 1.1323519945144653, -1.7849829196929932, 0.017498362809419632, -0.2780730128288269, 0.027404777705669403, -1.3846936225891113, -1.483807921409607, 0.5693060159683228, 0.6222586035728455, 0.5823423266410828, -0.08026809245347977, 0.9949480891227722, -1.035233974456787, 0.7552706599235535, -0.9836087822914124, -1.5809170007705688, -1.3803387880325317, -2.2585668563842773, -2.2977685928344727, 0.8341459631919861, -0.4538511335849762, -0.5542148351669312, 1.9660956859588623, -1.023091197013855, -1.7558610439300537, 1.0963326692581177, 0.35230952501296997, 0.05897369608283043, 2.385133981704712, 0.21464574337005615, -0.6918385624885559, 0.42729729413986206, -0.6976496577262878, 0.91264808177948, -0.3840457499027252, 1.3951916694641113, 0.5850946307182312, -1.0155556201934814, 1.6329470872879028, -0.5211521983146667, 0.5699000954627991, -0.695380449295044, -0.4714798331260681, -0.8551719784736633, 0.3710571229457855, 1.901602864265442, -0.27756690979003906, 1.5811372995376587, -0.3633815050125122, -1.5514073371887207, -1.5786792039871216, 0.8769360780715942, 0.4244793653488159, -0.8640379905700684, 0.09849276393651962, -0.3791276514530182, 0.15180960297584534, -0.0658532977104187, 1.1059578657150269, 1.1897921562194824, 0.6613782644271851, -0.40551871061325073, -0.9143735766410828, 0.18282200396060944, -0.11439027637243271, -0.7435094118118286, -1.8765310049057007, -0.29891207814216614, 0.15444934368133545, 0.6641129851341248, -1.1965609788894653, 1.7571979761123657, 0.8925274610519409, 1.8941872119903564, 0.9893789291381836, -0.2722837030887604, 1.5119907855987549, 0.00004498474299907684, 1.8911936283111572, -0.5744507908821106, 0.7287819385528564, -0.289264053106308, -1.059104561805725, 0.8472670316696167, -0.4156525433063507, -2.0857582092285156, -0.8223461508750916, -0.7789998650550842, -0.2577473819255829, -0.7249582409858704, 0.9013378024101257, -0.27609482407569885, -1.363613486289978, 0.22043073177337646, -0.594598114490509, 0.12919723987579346, -1.2473781108856201, 0.24399350583553314, 0.7170776128768921, -0.6696250438690186, -0.006487403996288776, -0.29232725501060486, -1.3285568952560425, -0.4474417567253113, 0.22288383543491364, 1.9849077463150024, -0.7522270679473877, 0.9073709845542908, 0.9677191972732544, -0.7330741882324219, -0.054083243012428284, 0.33537620306015015, -0.18603390455245972, 0.8051734566688538, -1.122359037399292, -0.3800506591796875, 1.2349509000778198, -0.2139386385679245, -0.5795733332633972, 1.5083413124084473, 0.7622775435447693, -0.9973909258842468, -0.11017654836177826, -0.20831896364688873, -0.8213521242141724, 0.004445632919669151, -1.5372921228408813, -0.10965943336486816, 0.327489972114563, -1.3758747577667236, -0.42466893792152405, -0.18372151255607605, 1.2835952043533325, -0.1890888512134552, 1.4144388437271118, -0.3951368033885956, -0.2867940664291382, -0.3462687134742737, -0.4105859696865082, 0.11497742682695389, -0.13573412597179413, -0.5409823060035706, 0.15931583940982819, -0.8347840905189514, 0.3958218991756439, 1.4467859268188477, 0.4422038197517395, 0.04671315476298332, 0.5007098913192749, 1.089794635772705, 0.3043466806411743, -0.024614721536636353, -0.7521415948867798, -1.531635046005249, 2.061396360397339, -1.3898793458938599, 1.9281481504440308, 0.755589485168457, -0.029997099190950394, -1.7194288969039917, -1.7383382320404053, 1.33905029296875, 1.2081565856933594, 2.3444020748138428, 0.5320627093315125, 0.26620757579803467, -0.9028977751731873, -0.7189622521400452, 0.3660188913345337, -1.057167410850525, -0.6544566750526428, 0.07848400622606277, 2.374338388442993, 1.8157340288162231, -0.5144564509391785, -0.21112506091594696, -1.030112385749817, 1.3681652545928955, -0.24587126076221466, 0.2764235734939575, 2.062122106552124, -0.4102608263492584, -1.1173956394195557, 1.2253954410552979, -2.362210750579834, 0.11049339920282364, 1.9270678758621216, 0.2698812484741211, 0.14757703244686127, -1.4541511535644531, -0.6212815046310425, -0.2737938165664673, -0.379369854927063, -1.2615916728973389, 0.5980764031410217, -0.3485400676727295, -0.8302816152572632, -1.4482779502868652, 0.13606059551239014, -1.1256020069122314, -1.67178475856781, 0.3893618881702423, 1.7913646697998047, 2.016157865524292, -0.7247480154037476, 1.523851752281189, -0.2099011093378067, 0.1410731077194214, 1.2610037326812744, 1.2170921564102173, 3.1400539875030518, 1.9139193296432495, -1.2362799644470215, 0.6728298664093018, -0.13890288770198822, -0.49981987476348877, 1.1469409465789795, -1.0934947729110718, 1.2938227653503418, -0.1645675152540207, -1.12847101688385, -1.3084545135498047, 0.9504042267799377, 0.4714531898498535, 0.06039402261376381, -0.5474244952201843, 1.3024711608886719, 0.005605871789157391, 1.2780808210372925, 0.5657432675361633, -0.4368840456008911, 0.6146306991577148, -0.4380646347999573, -0.6210438013076782, 1.591524600982666, 0.2392561137676239, -1.4561922550201416, -2.2579996585845947, -0.21575209498405457, -0.7635218501091003, -0.009926632978022099, -0.6445199251174927, -0.95758455991745, 1.6949553489685059, 0.4226394593715668, -1.3254436254501343, -0.31748735904693604, -0.35390976071357727, -0.6043704152107239, 2.633390426635742, -1.3673595190048218, -0.2489953339099884, -0.9638180732727051, -0.573942244052887, 1.6000128984451294, -1.1739373207092285, -0.19167432188987732, -1.0358928442001343, -0.6639763116836548, -1.3516204357147217, -0.4966494143009186, -0.05414169281721115, -0.9042066931724548, 0.8015452027320862, 0.11893942207098007, -1.103811502456665, -0.33294662833213806, -0.8737615942955017, 0.8003593683242798, -0.11167207360267639, 0.30589407682418823, 1.8673263788223267, 0.38494184613227844, -0.4046989977359772, 0.6994785666465759, 1.1813263893127441, 0.6339724063873291, -0.681972324848175, 0.13005313277244568, -0.7034233808517456, 0.3560619056224823, -1.3061250448226929, 0.27739793062210083, -2.9199604988098145, 0.6265085935592651, -0.14104166626930237, -0.1001364141702652, 0.005323070101439953, -1.336484432220459, 1.0660197734832764, 2.5819833278656006, -1.2199454307556152, 0.5073195099830627, 0.27420222759246826, 1.2125964164733887, -1.6108800172805786, 0.38665255904197693, -0.3343086540699005, 2.12445330619812, 0.17689046263694763, 1.1874244213104248, -0.49060025811195374, -2.1577858924865723, 0.6587433218955994, -1.185826301574707, -1.1973106861114502, 0.7159239053726196, -0.8854257464408875, 0.08982447534799576, -1.5051738023757935, -0.22285687923431396, -0.9010288715362549, -1.2914841175079346, 0.8454002737998962, 0.21063794195652008, 0.5167399644851685, -0.6239899396896362, 0.32364386320114136, -2.139683485031128, -1.2961734533309937, -0.24373853206634521, -0.8824819922447205, 0.5111057758331299, -0.3362293243408203, 0.5503450036048889, -0.09771997481584549, 0.09868788719177246, 0.3585061728954315, 1.4156298637390137, 3.3685617446899414, 0.19575022161006927, 0.39715301990509033, -0.12427899241447449, -0.9025962352752686, 1.3747680187225342, 0.8524770736694336, -0.13200055062770844, -0.5293805003166199, -1.0626251697540283, 1.3443317413330078, 1.9723541736602783, 0.9704944491386414, 0.04414304718375206, -0.828725278377533, -0.57705157995224, -0.08848505467176437, 0.1232992634177208, 0.42373257875442505, 0.8833545446395874, 0.023700818419456482, 0.07248708605766296, 1.43191659450531, 1.2580584287643433, -0.43155911564826965, 0.43657034635543823, -0.8835181593894958, -0.4296848773956299, 0.5276341438293457, 0.3108968138694763, -0.015334231778979301, 0.3438434600830078, -0.9929697513580322, -0.2121947854757309, -0.3933110237121582, -0.9796100854873657, -0.6969485282897949, -0.5604006052017212, -0.3862229585647583, 1.6371902227401733, 0.08692824095487595, -0.5528411865234375, -0.05498814210295677, -0.8120800852775574, -0.15694423019886017, -1.0361734628677368, 0.20700928568840027, -0.10723254084587097, -0.14167329668998718, -0.1338592916727066, 1.7519707679748535, -0.9655280709266663, -2.0673885345458984, 0.2296198457479477, 0.33189329504966736, -0.382544606924057, 0.21157939732074738, 1.630007028579712, 0.49920034408569336, 1.4657087326049805, 1.3058860301971436, 0.9789745211601257, -0.6326456069946289, -1.2780548334121704, 0.7003703713417053, 0.9211973547935486, -1.4487817287445068, 0.8649299740791321, 0.05153285339474678, -0.5230017304420471, 0.8102052807807922, 1.1963984966278076, 0.366131991147995, -1.9782018661499023, 0.752646267414093, -0.9336201548576355, 0.7584972977638245, 0.6427537202835083, 0.7110694646835327, 0.27716538310050964, 0.8823797106742859, -1.187552571296692, -1.1405606269836426, -0.837571918964386, -0.6122283339500427, 2.0292999744415283, -0.22307735681533813, 0.5729085206985474, -0.15213695168495178, -1.2464098930358887, -0.119476318359375, 0.807591438293457, 0.3889927566051483, -0.4042794108390808, 0.7802189588546753, -0.6727061867713928, -1.0727806091308594, -1.4330581426620483, -0.420974999666214, -1.0634287595748901, -0.9012661576271057, 1.0482635498046875, 0.7749660611152649, 0.29810062050819397, 1.9135409593582153, 0.6244953274726868, 0.24984942376613617, -2.6227762699127197, 0.860104501247406, 0.32141128182411194, -0.03517037257552147, 0.903331995010376, 0.3678734600543976, 1.0068937540054321, 0.011807040311396122, 0.46878451108932495, -2.3614754676818848, 2.181976556777954, -0.31636229157447815, 0.6380026936531067, -0.05108294263482094, -0.21068745851516724, 1.1641172170639038, 0.5226942300796509, 0.5648409128189087, -1.1611199378967285, 0.6997866630554199, -0.5311865210533142, 1.167472243309021, 1.017026662826538, -0.834583044052124, -0.013329187408089638, 1.3650656938552856, 0.5103252530097961, -0.4972713887691498, -0.91063392162323, -0.861608624458313, 0.937491238117218, 1.762117624282837, -0.1296406090259552, -0.06274008005857468, 0.7461614608764648, 0.6729696989059448, -1.2413177490234375, 0.1786430925130844, -0.7868219017982483, -0.793515682220459, 1.6608574390411377, 2.070361852645874, -0.1289941966533661, -0.11856050044298172, -0.6924238801002502, -1.2821247577667236, 0.8089083433151245, 0.08593875914812088, 0.03703309968113899, 0.6236994862556458, -0.6793159246444702, 1.1446284055709839, 0.8546314835548401, 0.8589631915092468, 0.11061158031225204, 0.3178223967552185, 0.4386172890663147, -0.26350319385528564, -1.1154812574386597, -0.3099239766597748, -1.1892260313034058, -2.5333330631256104, 0.46422094106674194, -0.2409830242395401, -1.4607723951339722, -0.025790493935346603, -1.006435751914978, 0.9525930285453796, -0.5042142271995544, -1.1086517572402954, -1.582885503768921, 0.3072090148925781, -0.02873719111084938, 0.8957473635673523, -1.6380553245544434, -0.05047537386417389, 1.237025260925293, 0.8503599762916565, -0.5891139507293701, 0.9966420531272888, 0.30632832646369934, 1.0164899826049805, 0.8507105708122253, -0.42116600275039673, 0.5099269151687622, 0.10830014199018478, -1.417611837387085, 0.5034942626953125, 1.2049412727355957, 0.18193498253822327, 1.460402250289917, -0.4853619635105133, 0.09499510377645493, 0.3458963930606842, -0.5764919519424438, -0.4263210594654083, -0.4576457142829895, 0.736790657043457, 0.1164620891213417, -0.8824014663696289, 0.016838163137435913, -0.11672957986593246, -0.2573389410972595, 0.23469220101833344, -1.4330426454544067, -0.23917511105537415, -0.3724076747894287, -0.42720338702201843, -1.212963581085205, -0.06278537213802338, 1.376388430595398, -0.6990407109260559, -0.2436547726392746, 0.6099877953529358, 0.49968427419662476, 0.5332674384117126, 0.6078830361366272, -0.682781457901001, -0.3402877449989319, -0.32349997758865356, -0.3299415111541748, 0.25093406438827515, 1.2394908666610718, -0.10656709223985672, -0.9813489317893982, 0.7940636277198792, -0.39625638723373413, 0.06424017250537872, 1.8841170072555542, 0.11661972850561142, -0.7641200423240662, 0.42234402894973755, -0.7556480169296265, 1.8874431848526, 1.7722350358963013, 1.2640002965927124, -0.05883685499429703, -0.9514046907424927, 0.5722659230232239, -0.32108888030052185, -0.43165114521980286, 0.9918134808540344, 0.4804532527923584, -0.1661328375339508, -1.4061570167541504, 0.5953155159950256, 1.235152244567871, -0.8553400635719299, -0.7843922972679138, 0.03855758160352707, -0.875767707824707, 1.0568900108337402, 0.6410118937492371, 0.505191445350647, 0.23620575666427612, 1.6647535562515259, 0.6684207916259766, -0.4348078966140747, 0.5463672280311584, 0.5026150941848755, -0.12467696517705917, -2.1324336528778076, -1.1604090929031372, 0.2988017797470093, -0.4353483021259308, -1.4722623825073242, 1.2287414073944092, -1.1093146800994873, -0.920949399471283, 0.5263198018074036, 0.1390749216079712, 1.48458993434906, 0.34433215856552124, 1.5945106744766235, 2.140599489212036, 0.8676969408988953, 0.3411644995212555, 1.3204425573349, -0.08325983583927155, -0.4747835099697113, 1.8584314584732056, -0.4094403386116028, 0.5046318769454956, 1.0644887685775757, -0.3528926968574524, -1.0831115245819092, -0.7875251770019531, -1.1587018966674805, -0.6272470355033875, 1.1326197385787964, 0.08934817463159561, -1.0871034860610962, 0.1884809136390686, 1.6139707565307617, 0.1575845330953598, -0.2839936912059784, 0.5659765601158142, 0.48059526085853577, -0.692581832408905, -0.008158223703503609, -0.9111852645874023, 0.5191987752914429, -0.24512530863285065, -0.3341538608074188, 0.30314895510673523, 0.5174286961555481, 1.295706033706665, -0.02470364421606064, 0.13233564794063568, 1.1569803953170776, -1.4455747604370117, 1.4698408842086792, -0.5934135913848877, 0.24417923390865326, -2.397787094116211, 1.386147141456604, -0.7478867769241333, 1.9150954484939575, -2.663459539413452, 0.39004188776016235, -0.5967016816139221, -0.5377901792526245, 0.3751225173473358, -0.3938530683517456, 0.16715796291828156, -0.10389839857816696, -1.140866756439209, 0.043271504342556, -0.6824700236320496, 0.5924940705299377, 1.1585688591003418, 1.4110229015350342, -1.167325735092163, -0.3307904601097107, -1.8294870853424072, -0.15289874374866486, -0.7092873454093933, 0.3492484986782074, -2.03542160987854, -0.13354618847370148, -1.888724446296692, -2.3590996265411377, -1.4549362659454346, -0.8779853582382202, 1.0656445026397705, 0.11338473111391068, -0.8848592638969421, 1.120426058769226, -0.37732774019241333, -1.8860722780227661, 1.1015063524246216, -2.1232292652130127 ]
https://github.com/huggingface/datasets/issues/3134
Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/rouge/rouge.py
Hi, Did you try to run the code multiple times (GitHub URLs can be down sometimes for various reasons)? I can access `https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/rouge/rouge.py`, so this code is working without an error on my side. Additionally, can you please run the `datasets-cli env` command because it seems to me that you are using the `datasets` version different from `1.12.1`?
datasets version: 1.12.1 `metric = datasets.load_metric('rouge')` The error: > ConnectionError Traceback (most recent call last) > <ipython-input-3-dd10a0c5212f> in <module> > ----> 1 metric = datasets.load_metric('rouge') > > /usr/local/lib/python3.6/dist-packages/datasets/load.py in load_metric(path, config_name, process_id, num_process, cache_dir, experiment_id, keep_in_memory, download_config, download_mode, script_version, **metric_init_kwargs) > 613 download_config=download_config, > 614 download_mode=download_mode, > --> 615 dataset=False, > 616 ) > 617 metric_cls = import_main_class(module_path, dataset=False) > > /usr/local/lib/python3.6/dist-packages/datasets/load.py in prepare_module(path, script_version, download_config, download_mode, dataset, force_local_path, dynamic_modules_path, return_resolved_file_path, **download_kwargs) > 328 file_path = hf_github_url(path=path, name=name, dataset=dataset, version=script_version) > 329 try: > --> 330 local_path = cached_path(file_path, download_config=download_config) > 331 except FileNotFoundError: > 332 if script_version is not None: > > /usr/local/lib/python3.6/dist-packages/datasets/utils/file_utils.py in cached_path(url_or_filename, download_config, **download_kwargs) > 296 use_etag=download_config.use_etag, > 297 max_retries=download_config.max_retries, > --> 298 use_auth_token=download_config.use_auth_token, > 299 ) > 300 elif os.path.exists(url_or_filename): > > /usr/local/lib/python3.6/dist-packages/datasets/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only, use_etag, max_retries, use_auth_token) > 603 raise FileNotFoundError("Couldn't find file at {}".format(url)) > 604 _raise_if_offline_mode_is_enabled(f"Tried to reach {url}") > --> 605 raise ConnectionError("Couldn't reach {}".format(url)) > 606 > 607 # Try a second time > > ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/rouge/rouge.py Is there any remedy to solve the connection issue ?
1,157
58
Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/rouge/rouge.py datasets version: 1.12.1 `metric = datasets.load_metric('rouge')` The error: > ConnectionError Traceback (most recent call last) > <ipython-input-3-dd10a0c5212f> in <module> > ----> 1 metric = datasets.load_metric('rouge') > > /usr/local/lib/python3.6/dist-packages/datasets/load.py in load_metric(path, config_name, process_id, num_process, cache_dir, experiment_id, keep_in_memory, download_config, download_mode, script_version, **metric_init_kwargs) > 613 download_config=download_config, > 614 download_mode=download_mode, > --> 615 dataset=False, > 616 ) > 617 metric_cls = import_main_class(module_path, dataset=False) > > /usr/local/lib/python3.6/dist-packages/datasets/load.py in prepare_module(path, script_version, download_config, download_mode, dataset, force_local_path, dynamic_modules_path, return_resolved_file_path, **download_kwargs) > 328 file_path = hf_github_url(path=path, name=name, dataset=dataset, version=script_version) > 329 try: > --> 330 local_path = cached_path(file_path, download_config=download_config) > 331 except FileNotFoundError: > 332 if script_version is not None: > > /usr/local/lib/python3.6/dist-packages/datasets/utils/file_utils.py in cached_path(url_or_filename, download_config, **download_kwargs) > 296 use_etag=download_config.use_etag, > 297 max_retries=download_config.max_retries, > --> 298 use_auth_token=download_config.use_auth_token, > 299 ) > 300 elif os.path.exists(url_or_filename): > > /usr/local/lib/python3.6/dist-packages/datasets/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only, use_etag, max_retries, use_auth_token) > 603 raise FileNotFoundError("Couldn't find file at {}".format(url)) > 604 _raise_if_offline_mode_is_enabled(f"Tried to reach {url}") > --> 605 raise ConnectionError("Couldn't reach {}".format(url)) > 606 > 607 # Try a second time > > ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/rouge/rouge.py Is there any remedy to solve the connection issue ? Hi, Did you try to run the code multiple times (GitHub URLs can be down sometimes for various reasons)? I can access `https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/rouge/rouge.py`, so this code is working without an error on my side. Additionally, can you please run the `datasets-cli env` command because it seems to me that you are using the `datasets` version different from `1.12.1`?
[ -1.2385988235473633, -0.9526150822639465, -0.5611421465873718, 1.4222878217697144, -0.14228807389736176, -1.1780242919921875, 0.18955332040786743, -1.0361979007720947, 1.493194341659546, -0.7912179827690125, 0.17293430864810944, -1.7060819864273071, -0.10105345398187637, -0.6302402019500732, -0.654166579246521, -0.8505915999412537, -0.3619289696216583, -0.8752279877662659, 1.0683754682540894, 2.4249215126037598, 1.3226521015167236, -1.3077716827392578, 2.747208595275879, 0.7443694472312927, -0.3157019019126892, -0.994219958782196, 0.5454591512680054, -0.0012148767709732056, -1.1811820268630981, -0.5296863317489624, -0.9043434262275696, 0.003515789285302162, -0.7428441643714905, -0.22756879031658173, 0.0027805641293525696, 0.3809433877468109, -0.2984720766544342, -0.13319529592990875, -0.6237860321998596, -0.7750001549720764, 0.45793282985687256, -0.37635600566864014, 0.9454586505889893, -0.29544201493263245, 1.5973516702651978, -0.583194375038147, 0.45409929752349854, 0.7690081596374512, 1.213789701461792, 0.18150722980499268, 0.030436499044299126, 0.24846330285072327, 0.3067198395729065, 0.016208220273256302, 0.5545066595077515, 1.1659818887710571, 0.6794145703315735, 0.4692133367061615, 0.5305047631263733, -2.266584873199463, 1.3535141944885254, -0.8834689259529114, 0.3535604178905487, 1.3498082160949707, -0.8321681022644043, 0.39705154299736023, -1.7990598678588867, -0.07693115621805191, 0.7046152353286743, -2.3203914165496826, 0.33416062593460083, -1.3629480600357056, -0.5049917697906494, 0.8682229518890381, 0.40814387798309326, -1.2377887964248657, 0.12894953787326813, -0.5188748240470886, 1.1445271968841553, 0.41082292795181274, 0.9674267768859863, -1.8034398555755615, -0.02531154826283455, -0.21372203528881073, 0.16340181231498718, -1.2358847856521606, -1.7013795375823975, 0.614728569984436, 0.5486032962799072, 0.748301088809967, -0.18867720663547516, 1.0566991567611694, -1.138363003730774, 0.7817400693893433, -1.0595710277557373, -1.5389552116394043, -1.391945242881775, -2.493556499481201, -2.297415256500244, 0.6818128228187561, -0.5486001968383789, -0.4698520004749298, 2.0945584774017334, -0.9799312353134155, -1.6810418367385864, 1.0942680835723877, 0.26491180062294006, 0.05303964018821716, 2.4041097164154053, 0.14587870240211487, -0.7010610103607178, 0.4435364007949829, -0.7994447946548462, 0.881793737411499, -0.23469802737236023, 1.3392831087112427, 0.526116132736206, -1.0409069061279297, 1.5776406526565552, -0.5226215720176697, 0.562451958656311, -0.5720336437225342, -0.5694044828414917, -0.766427218914032, 0.140333890914917, 1.8156278133392334, -0.22534850239753723, 1.5321298837661743, -0.2796522378921509, -1.5274121761322021, -1.5601835250854492, 0.9424736499786377, 0.4724579453468323, -0.9375827312469482, 0.17929063737392426, -0.6001538634300232, 0.2191995233297348, -0.005453748162835836, 1.1331981420516968, 1.3395577669143677, 0.6602417230606079, -0.39867740869522095, -0.8241177201271057, 0.09264857321977615, -0.2060827761888504, -0.6792790293693542, -1.9217958450317383, -0.23854242265224457, 0.08931740373373032, 0.743823766708374, -1.1182749271392822, 1.8111579418182373, 0.9933601021766663, 1.9600622653961182, 0.9427868723869324, -0.47296884655952454, 1.4279476404190063, -0.01393003761768341, 1.7741438150405884, -0.6674050092697144, 0.6555874943733215, -0.40754786133766174, -1.09506094455719, 0.9645794034004211, -0.2973769009113312, -1.9741997718811035, -0.7234858870506287, -0.6460930109024048, -0.24859899282455444, -0.9048237204551697, 0.8907379508018494, -0.2428315281867981, -1.487195372581482, 0.21532347798347473, -0.6971719264984131, 0.29060015082359314, -1.2319273948669434, 0.2859647870063782, 0.6712175011634827, -0.6274346709251404, -0.10895338654518127, -0.2359861433506012, -1.2486909627914429, -0.51095050573349, 0.4001857340335846, 1.8018932342529297, -0.4768683612346649, 0.9435641765594482, 1.0396219491958618, -0.6761583685874939, 0.08199948072433472, 0.23466114699840546, -0.17693576216697693, 0.7601435780525208, -1.0810189247131348, -0.46225622296333313, 1.2829071283340454, -0.4109170436859131, -0.5794131755828857, 1.4157246351242065, 0.7367731928825378, -1.1406290531158447, -0.24011161923408508, -0.21338729560375214, -0.8410165309906006, 0.08504673838615417, -1.5971156358718872, -0.16916298866271973, 0.5514019131660461, -1.530988097190857, -0.3123443126678467, -0.167256698012352, 1.4565898180007935, -0.1609201580286026, 1.4135764837265015, -0.30101293325424194, -0.02837614342570305, -0.3035952150821686, -0.44054463505744934, 0.2147076427936554, -0.12979468703269958, -0.4402768909931183, 0.13488218188285828, -0.8208993077278137, 0.251891165971756, 1.5459004640579224, 0.23652498424053192, 0.022687384858727455, 0.35030385851860046, 1.0391457080841064, 0.33844202756881714, -0.14175264537334442, -0.886877715587616, -1.4832555055618286, 1.9494050741195679, -1.519314169883728, 1.939813494682312, 0.7203803658485413, -0.10487891733646393, -1.7576382160186768, -1.784792423248291, 1.1950809955596924, 1.0926909446716309, 2.2928309440612793, 0.4615463614463806, 0.3564780056476593, -0.8053122162818909, -0.7705242037773132, 0.30195510387420654, -1.0141938924789429, -0.6907431483268738, 0.19081147015094757, 2.43583607673645, 1.7896530628204346, -0.49937179684638977, -0.2122994363307953, -0.866710901260376, 1.3448559045791626, -0.25773191452026367, 0.28388047218322754, 2.094129800796509, -0.34316572546958923, -1.098550796508789, 1.3446459770202637, -2.5155446529388428, 0.2768520414829254, 2.0840401649475098, 0.34747472405433655, 0.24730893969535828, -1.3805387020111084, -0.669528603553772, -0.3440808653831482, -0.5569425821304321, -1.2895967960357666, 0.5932184457778931, -0.2827644944190979, -0.7588661313056946, -1.3778058290481567, 0.15314018726348877, -1.0453077554702759, -1.8163319826126099, 0.29320386052131653, 1.9387022256851196, 2.1763598918914795, -0.7865312099456787, 1.3857437372207642, -0.37573713064193726, 0.022945160046219826, 1.214281678199768, 1.3879103660583496, 3.0822768211364746, 1.9182233810424805, -1.3777011632919312, 0.6835731863975525, -0.23187053203582764, -0.5115795731544495, 1.1424553394317627, -1.0985345840454102, 1.1684306859970093, -0.19097942113876343, -1.2610933780670166, -1.2645540237426758, 1.1085801124572754, 0.43256083130836487, -0.027141258120536804, -0.5600875616073608, 1.2084004878997803, 0.06285056471824646, 1.392720341682434, 0.642940878868103, -0.43251198530197144, 0.47793376445770264, -0.43199434876441956, -0.5872190594673157, 1.6301370859146118, 0.17806926369667053, -1.586281657218933, -2.353177547454834, -0.3168330788612366, -0.9360382556915283, 0.053886860609054565, -0.6566513776779175, -1.1226273775100708, 1.5434823036193848, 0.35105589032173157, -1.1787760257720947, -0.28289616107940674, -0.3066044747829437, -0.3992385268211365, 2.6076836585998535, -1.2590025663375854, -0.08781824260950089, -0.9028935432434082, -0.6287941336631775, 1.6040624380111694, -1.2662193775177002, -0.2790822982788086, -1.0761433839797974, -0.6519308686256409, -1.2546478509902954, -0.3739021420478821, 0.02091706357896328, -0.9875404238700867, 0.72214674949646, 0.2380553036928177, -1.2429670095443726, -0.35832124948501587, -0.823979914188385, 1.0656086206436157, -0.05848824977874756, 0.2247539460659027, 1.7491601705551147, 0.23873461782932281, -0.38974112272262573, 0.8743656277656555, 1.208867073059082, 0.6538397073745728, -0.6469954252243042, -0.04067828133702278, -0.6385217905044556, 0.5245446562767029, -1.2831765413284302, 0.20007286965847015, -3.0448596477508545, 0.7522304654121399, -0.1526452749967575, -0.10601454228162766, -0.14481940865516663, -1.4869245290756226, 1.0796908140182495, 2.556137800216675, -1.1945685148239136, 0.6045486330986023, 0.41370993852615356, 1.079325556755066, -1.6096913814544678, 0.17401865124702454, -0.5633049607276917, 2.180842638015747, 0.2611275315284729, 1.309194564819336, -0.46487995982170105, -2.411586046218872, 0.623799741268158, -1.1647229194641113, -1.0096160173416138, 0.8163486123085022, -0.8930970430374146, 0.26998040080070496, -1.439336895942688, -0.22757373750209808, -0.9569555521011353, -1.226830005645752, 0.710312008857727, 0.11595213413238525, 0.4792480170726776, -0.6004477739334106, 0.3012513816356659, -2.2284374237060547, -1.1954962015151978, -0.11378154903650284, -0.9788488745689392, 0.6150212287902832, -0.4527406096458435, 0.5280988216400146, 0.0011183349415659904, 0.03956686705350876, 0.38409462571144104, 1.5793259143829346, 3.381218194961548, 0.030080152675509453, 0.2092253863811493, -0.12977120280265808, -0.9814490675926208, 1.3860417604446411, 0.8250105977058411, -0.0560029074549675, -0.6177395582199097, -1.0409040451049805, 1.323132038116455, 1.9443190097808838, 0.9567057490348816, 0.08874940127134323, -0.8961378931999207, -0.5915935039520264, -0.01408478431403637, 0.2332991063594818, 0.5629374384880066, 0.9697431325912476, -0.07896505296230316, 0.03145050257444382, 1.344809651374817, 1.125692367553711, -0.21918591856956482, 0.36004361510276794, -0.9501329660415649, -0.3918033540248871, 0.45308253169059753, 0.12714548408985138, -0.10238423198461533, 0.5102664828300476, -0.9783234596252441, -0.21825286746025085, -0.2661322355270386, -0.7483519911766052, -0.7928835153579712, -0.3771488070487976, -0.46050119400024414, 1.581268310546875, 0.0804295688867569, -0.47325265407562256, 0.1239224374294281, -0.6755164861679077, -0.32480719685554504, -1.1790114641189575, 0.16886909306049347, -0.1084388867020607, -0.054607145488262177, -0.24666434526443481, 1.5898044109344482, -0.8785738348960876, -2.0198378562927246, 0.14434677362442017, 0.35037800669670105, -0.27593496441841125, 0.19747474789619446, 1.813539981842041, 0.4343368113040924, 1.419328212738037, 1.2245104312896729, 0.9898850321769714, -0.5819790363311768, -1.1927865743637085, 0.819847583770752, 0.9198905825614929, -1.3382238149642944, 1.0346461534500122, -0.25110623240470886, -0.5481001138687134, 0.6607315540313721, 1.2961294651031494, 0.47681814432144165, -2.01021409034729, 0.9715241193771362, -1.1334757804870605, 0.9011982679367065, 0.6836232542991638, 0.7812595367431641, 0.27361243963241577, 0.9174181222915649, -1.2587634325027466, -1.0446349382400513, -0.6065536737442017, -0.6903586983680725, 1.9579038619995117, -0.3346450626850128, 0.5795484185218811, -0.1597677320241928, -1.2224247455596924, -0.1104668602347374, 0.8596152067184448, 0.37536484003067017, -0.451668918132782, 0.8247681856155396, -0.6015287041664124, -1.0471407175064087, -1.2095731496810913, -0.3960028886795044, -1.0834003686904907, -0.8858926296234131, 1.0244159698486328, 0.7259065508842468, 0.4181724190711975, 1.921330451965332, 0.4875844717025757, 0.3283209800720215, -2.5620594024658203, 0.881645143032074, 0.2892472445964813, -0.12068318575620651, 0.9572427868843079, 0.33825117349624634, 1.1672251224517822, 0.07049428671598434, 0.6789748072624207, -2.4182634353637695, 2.2545981407165527, -0.22825987637043, 0.6924556493759155, 0.062305815517902374, -0.1237880289554596, 1.0877420902252197, 0.6229104399681091, 0.4382610321044922, -1.0332905054092407, 0.8139277696609497, -0.5053300857543945, 1.1136977672576904, 0.9573644995689392, -0.8869869112968445, 0.05996513366699219, 1.3938145637512207, 0.3682113587856293, -0.461487740278244, -0.9885165691375732, -0.8105468153953552, 0.949855387210846, 1.684875249862671, -0.05508239567279816, -0.04747697710990906, 0.6187223196029663, 0.7309437394142151, -1.1752318143844604, 0.11391480267047882, -0.6160240769386292, -0.6395725607872009, 1.6361336708068848, 1.9458379745483398, -0.14194786548614502, -0.12373419851064682, -0.7463493943214417, -1.34824538230896, 0.8180451989173889, -0.10450736433267593, -0.02686629630625248, 0.533810019493103, -0.6489008069038391, 0.9707371592521667, 0.5999520421028137, 0.9622630476951599, 0.0935068279504776, 0.3235294818878174, 0.5208742618560791, -0.36050859093666077, -1.0878854990005493, -0.39276495575904846, -1.2210960388183594, -2.714682102203369, 0.39731255173683167, -0.3221319615840912, -1.4191889762878418, -0.017512209713459015, -1.0352009534835815, 0.8802536129951477, -0.6223991513252258, -1.121619462966919, -1.446783185005188, 0.338982492685318, -0.14654232561588287, 0.9369388818740845, -1.648224949836731, -0.11797203868627548, 1.1672282218933105, 0.8184570074081421, -0.6228631138801575, 1.0035721063613892, 0.2865229845046997, 0.9919471144676208, 0.7560086250305176, -0.42139723896980286, 0.6806973814964294, 0.07274241000413895, -1.3123434782028198, 0.491364449262619, 1.2734788656234741, 0.23901072144508362, 1.3693997859954834, -0.45337316393852234, -0.009072239510715008, 0.4245452284812927, -0.685528576374054, -0.5417808890342712, -0.26418963074684143, 0.6905730366706848, 0.03190023452043533, -1.0428612232208252, -0.19243039190769196, -0.19042082130908966, -0.35591983795166016, 0.21249869465827942, -1.4095346927642822, -0.28476202487945557, -0.5122703313827515, -0.30292484164237976, -1.4596226215362549, -0.11374514549970627, 1.4541003704071045, -0.6720637679100037, -0.2927235960960388, 0.48387402296066284, 0.3853186070919037, 0.5390570163726807, 0.6871061325073242, -0.7195848822593689, -0.2740567922592163, -0.33272403478622437, -0.31163841485977173, 0.36619386076927185, 1.1683069467544556, -0.061915576457977295, -0.9374050498008728, 0.6435485482215881, -0.33736979961395264, 0.23614530265331268, 1.9056216478347778, 0.026958098635077477, -0.7233887314796448, 0.4244157373905182, -0.6877934336662292, 1.7827666997909546, 1.698706865310669, 1.1690930128097534, -0.14624516665935516, -0.8701000809669495, 0.6566862463951111, -0.35767626762390137, -0.3365095853805542, 0.7562490105628967, 0.4669908881187439, -0.22740168869495392, -1.5373233556747437, 0.7912362813949585, 1.2496041059494019, -0.7408455610275269, -0.7891167998313904, 0.12673373520374298, -0.7724044322967529, 1.1766189336776733, 0.5419055223464966, 0.3648265600204468, 0.2673260569572449, 1.6824697256088257, 0.6987534165382385, -0.4879130721092224, 0.579107403755188, 0.38889753818511963, -0.32406318187713623, -2.1640846729278564, -1.1916154623031616, 0.22432783246040344, -0.5155900120735168, -1.4717938899993896, 1.3351430892944336, -1.0758978128433228, -1.0756815671920776, 0.5314009785652161, 0.15364894270896912, 1.2286986112594604, 0.3724033534526825, 1.6661778688430786, 2.1073930263519287, 0.8723285794258118, 0.49792006611824036, 1.2424743175506592, -0.14697761833667755, -0.4435666501522064, 1.7817140817642212, -0.3540496230125427, 0.5423556566238403, 1.1518465280532837, -0.4203018248081207, -1.04326331615448, -0.8674014806747437, -1.1262975931167603, -0.6986277103424072, 1.2074990272521973, 0.09242121130228043, -0.9934288263320923, 0.260976105928421, 1.6104472875595093, 0.15692053735256195, -0.1340540498495102, 0.7109590768814087, 0.36864301562309265, -0.6641703844070435, -0.14069479703903198, -0.9809680581092834, 0.5451691150665283, -0.3414503037929535, -0.30798226594924927, 0.23504012823104858, 0.5302550792694092, 1.3398600816726685, 0.0012975959107279778, 0.12182246148586273, 1.004022479057312, -1.3843721151351929, 1.431439995765686, -0.5534182786941528, 0.30998653173446655, -2.344735622406006, 1.3444194793701172, -0.6914804577827454, 2.0759239196777344, -2.620461940765381, 0.4525037705898285, -0.5049880743026733, -0.49040427803993225, 0.26692280173301697, -0.28771352767944336, 0.19578170776367188, -0.16907139122486115, -0.995991587638855, 0.07240302860736847, -0.6416242718696594, 0.5731261372566223, 1.1905672550201416, 1.4094265699386597, -1.1415247917175293, -0.17375320196151733, -1.6104167699813843, -0.16102278232574463, -0.8324466347694397, 0.25753092765808105, -1.9153363704681396, -0.10358645021915436, -1.9676636457443237, -2.3872973918914795, -1.2363523244857788, -0.8182811141014099, 1.121803879737854, 0.20590609312057495, -0.8757051825523376, 1.3511971235275269, -0.3002965450286865, -1.7729984521865845, 1.087529182434082, -2.1880271434783936 ]
https://github.com/huggingface/datasets/issues/3134
Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/rouge/rouge.py
Same issue when running `metric = datasets.load_metric("accuracy")`. Error info is: ``` metric = datasets.load_metric("accuracy") Traceback (most recent call last): File "<ipython-input-2-d25db38b26c5>", line 1, in <module> metric = datasets.load_metric("accuracy") File "D:\anaconda3\lib\site-packages\datasets\load.py", line 610, in load_metric module_path, _ = prepare_module( File "D:\anaconda3\lib\site-packages\datasets\load.py", line 330, in prepare_module local_path = cached_path(file_path, download_config=download_config) File "D:\anaconda3\lib\site-packages\datasets\utils\file_utils.py", line 288, in cached_path output_path = get_from_cache( File "D:\anaconda3\lib\site-packages\datasets\utils\file_utils.py", line 605, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/accuracy/accuracy.py ``` My `datasets-cli env` result is as follows: - `datasets` version: 1.11.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.8.8 - PyArrow version: 6.0.0 @yananchen1989 did you find a way to solve this?
datasets version: 1.12.1 `metric = datasets.load_metric('rouge')` The error: > ConnectionError Traceback (most recent call last) > <ipython-input-3-dd10a0c5212f> in <module> > ----> 1 metric = datasets.load_metric('rouge') > > /usr/local/lib/python3.6/dist-packages/datasets/load.py in load_metric(path, config_name, process_id, num_process, cache_dir, experiment_id, keep_in_memory, download_config, download_mode, script_version, **metric_init_kwargs) > 613 download_config=download_config, > 614 download_mode=download_mode, > --> 615 dataset=False, > 616 ) > 617 metric_cls = import_main_class(module_path, dataset=False) > > /usr/local/lib/python3.6/dist-packages/datasets/load.py in prepare_module(path, script_version, download_config, download_mode, dataset, force_local_path, dynamic_modules_path, return_resolved_file_path, **download_kwargs) > 328 file_path = hf_github_url(path=path, name=name, dataset=dataset, version=script_version) > 329 try: > --> 330 local_path = cached_path(file_path, download_config=download_config) > 331 except FileNotFoundError: > 332 if script_version is not None: > > /usr/local/lib/python3.6/dist-packages/datasets/utils/file_utils.py in cached_path(url_or_filename, download_config, **download_kwargs) > 296 use_etag=download_config.use_etag, > 297 max_retries=download_config.max_retries, > --> 298 use_auth_token=download_config.use_auth_token, > 299 ) > 300 elif os.path.exists(url_or_filename): > > /usr/local/lib/python3.6/dist-packages/datasets/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only, use_etag, max_retries, use_auth_token) > 603 raise FileNotFoundError("Couldn't find file at {}".format(url)) > 604 _raise_if_offline_mode_is_enabled(f"Tried to reach {url}") > --> 605 raise ConnectionError("Couldn't reach {}".format(url)) > 606 > 607 # Try a second time > > ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/rouge/rouge.py Is there any remedy to solve the connection issue ?
1,157
103
Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/rouge/rouge.py datasets version: 1.12.1 `metric = datasets.load_metric('rouge')` The error: > ConnectionError Traceback (most recent call last) > <ipython-input-3-dd10a0c5212f> in <module> > ----> 1 metric = datasets.load_metric('rouge') > > /usr/local/lib/python3.6/dist-packages/datasets/load.py in load_metric(path, config_name, process_id, num_process, cache_dir, experiment_id, keep_in_memory, download_config, download_mode, script_version, **metric_init_kwargs) > 613 download_config=download_config, > 614 download_mode=download_mode, > --> 615 dataset=False, > 616 ) > 617 metric_cls = import_main_class(module_path, dataset=False) > > /usr/local/lib/python3.6/dist-packages/datasets/load.py in prepare_module(path, script_version, download_config, download_mode, dataset, force_local_path, dynamic_modules_path, return_resolved_file_path, **download_kwargs) > 328 file_path = hf_github_url(path=path, name=name, dataset=dataset, version=script_version) > 329 try: > --> 330 local_path = cached_path(file_path, download_config=download_config) > 331 except FileNotFoundError: > 332 if script_version is not None: > > /usr/local/lib/python3.6/dist-packages/datasets/utils/file_utils.py in cached_path(url_or_filename, download_config, **download_kwargs) > 296 use_etag=download_config.use_etag, > 297 max_retries=download_config.max_retries, > --> 298 use_auth_token=download_config.use_auth_token, > 299 ) > 300 elif os.path.exists(url_or_filename): > > /usr/local/lib/python3.6/dist-packages/datasets/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only, use_etag, max_retries, use_auth_token) > 603 raise FileNotFoundError("Couldn't find file at {}".format(url)) > 604 _raise_if_offline_mode_is_enabled(f"Tried to reach {url}") > --> 605 raise ConnectionError("Couldn't reach {}".format(url)) > 606 > 607 # Try a second time > > ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/rouge/rouge.py Is there any remedy to solve the connection issue ? Same issue when running `metric = datasets.load_metric("accuracy")`. Error info is: ``` metric = datasets.load_metric("accuracy") Traceback (most recent call last): File "<ipython-input-2-d25db38b26c5>", line 1, in <module> metric = datasets.load_metric("accuracy") File "D:\anaconda3\lib\site-packages\datasets\load.py", line 610, in load_metric module_path, _ = prepare_module( File "D:\anaconda3\lib\site-packages\datasets\load.py", line 330, in prepare_module local_path = cached_path(file_path, download_config=download_config) File "D:\anaconda3\lib\site-packages\datasets\utils\file_utils.py", line 288, in cached_path output_path = get_from_cache( File "D:\anaconda3\lib\site-packages\datasets\utils\file_utils.py", line 605, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/accuracy/accuracy.py ``` My `datasets-cli env` result is as follows: - `datasets` version: 1.11.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.8.8 - PyArrow version: 6.0.0 @yananchen1989 did you find a way to solve this?
[ -1.2385988235473633, -0.9526150822639465, -0.5611421465873718, 1.4222878217697144, -0.14228807389736176, -1.1780242919921875, 0.18955332040786743, -1.0361979007720947, 1.493194341659546, -0.7912179827690125, 0.17293430864810944, -1.7060819864273071, -0.10105345398187637, -0.6302402019500732, -0.654166579246521, -0.8505915999412537, -0.3619289696216583, -0.8752279877662659, 1.0683754682540894, 2.4249215126037598, 1.3226521015167236, -1.3077716827392578, 2.747208595275879, 0.7443694472312927, -0.3157019019126892, -0.994219958782196, 0.5454591512680054, -0.0012148767709732056, -1.1811820268630981, -0.5296863317489624, -0.9043434262275696, 0.003515789285302162, -0.7428441643714905, -0.22756879031658173, 0.0027805641293525696, 0.3809433877468109, -0.2984720766544342, -0.13319529592990875, -0.6237860321998596, -0.7750001549720764, 0.45793282985687256, -0.37635600566864014, 0.9454586505889893, -0.29544201493263245, 1.5973516702651978, -0.583194375038147, 0.45409929752349854, 0.7690081596374512, 1.213789701461792, 0.18150722980499268, 0.030436499044299126, 0.24846330285072327, 0.3067198395729065, 0.016208220273256302, 0.5545066595077515, 1.1659818887710571, 0.6794145703315735, 0.4692133367061615, 0.5305047631263733, -2.266584873199463, 1.3535141944885254, -0.8834689259529114, 0.3535604178905487, 1.3498082160949707, -0.8321681022644043, 0.39705154299736023, -1.7990598678588867, -0.07693115621805191, 0.7046152353286743, -2.3203914165496826, 0.33416062593460083, -1.3629480600357056, -0.5049917697906494, 0.8682229518890381, 0.40814387798309326, -1.2377887964248657, 0.12894953787326813, -0.5188748240470886, 1.1445271968841553, 0.41082292795181274, 0.9674267768859863, -1.8034398555755615, -0.02531154826283455, -0.21372203528881073, 0.16340181231498718, -1.2358847856521606, -1.7013795375823975, 0.614728569984436, 0.5486032962799072, 0.748301088809967, -0.18867720663547516, 1.0566991567611694, -1.138363003730774, 0.7817400693893433, -1.0595710277557373, -1.5389552116394043, -1.391945242881775, -2.493556499481201, -2.297415256500244, 0.6818128228187561, -0.5486001968383789, -0.4698520004749298, 2.0945584774017334, -0.9799312353134155, -1.6810418367385864, 1.0942680835723877, 0.26491180062294006, 0.05303964018821716, 2.4041097164154053, 0.14587870240211487, -0.7010610103607178, 0.4435364007949829, -0.7994447946548462, 0.881793737411499, -0.23469802737236023, 1.3392831087112427, 0.526116132736206, -1.0409069061279297, 1.5776406526565552, -0.5226215720176697, 0.562451958656311, -0.5720336437225342, -0.5694044828414917, -0.766427218914032, 0.140333890914917, 1.8156278133392334, -0.22534850239753723, 1.5321298837661743, -0.2796522378921509, -1.5274121761322021, -1.5601835250854492, 0.9424736499786377, 0.4724579453468323, -0.9375827312469482, 0.17929063737392426, -0.6001538634300232, 0.2191995233297348, -0.005453748162835836, 1.1331981420516968, 1.3395577669143677, 0.6602417230606079, -0.39867740869522095, -0.8241177201271057, 0.09264857321977615, -0.2060827761888504, -0.6792790293693542, -1.9217958450317383, -0.23854242265224457, 0.08931740373373032, 0.743823766708374, -1.1182749271392822, 1.8111579418182373, 0.9933601021766663, 1.9600622653961182, 0.9427868723869324, -0.47296884655952454, 1.4279476404190063, -0.01393003761768341, 1.7741438150405884, -0.6674050092697144, 0.6555874943733215, -0.40754786133766174, -1.09506094455719, 0.9645794034004211, -0.2973769009113312, -1.9741997718811035, -0.7234858870506287, -0.6460930109024048, -0.24859899282455444, -0.9048237204551697, 0.8907379508018494, -0.2428315281867981, -1.487195372581482, 0.21532347798347473, -0.6971719264984131, 0.29060015082359314, -1.2319273948669434, 0.2859647870063782, 0.6712175011634827, -0.6274346709251404, -0.10895338654518127, -0.2359861433506012, -1.2486909627914429, -0.51095050573349, 0.4001857340335846, 1.8018932342529297, -0.4768683612346649, 0.9435641765594482, 1.0396219491958618, -0.6761583685874939, 0.08199948072433472, 0.23466114699840546, -0.17693576216697693, 0.7601435780525208, -1.0810189247131348, -0.46225622296333313, 1.2829071283340454, -0.4109170436859131, -0.5794131755828857, 1.4157246351242065, 0.7367731928825378, -1.1406290531158447, -0.24011161923408508, -0.21338729560375214, -0.8410165309906006, 0.08504673838615417, -1.5971156358718872, -0.16916298866271973, 0.5514019131660461, -1.530988097190857, -0.3123443126678467, -0.167256698012352, 1.4565898180007935, -0.1609201580286026, 1.4135764837265015, -0.30101293325424194, -0.02837614342570305, -0.3035952150821686, -0.44054463505744934, 0.2147076427936554, -0.12979468703269958, -0.4402768909931183, 0.13488218188285828, -0.8208993077278137, 0.251891165971756, 1.5459004640579224, 0.23652498424053192, 0.022687384858727455, 0.35030385851860046, 1.0391457080841064, 0.33844202756881714, -0.14175264537334442, -0.886877715587616, -1.4832555055618286, 1.9494050741195679, -1.519314169883728, 1.939813494682312, 0.7203803658485413, -0.10487891733646393, -1.7576382160186768, -1.784792423248291, 1.1950809955596924, 1.0926909446716309, 2.2928309440612793, 0.4615463614463806, 0.3564780056476593, -0.8053122162818909, -0.7705242037773132, 0.30195510387420654, -1.0141938924789429, -0.6907431483268738, 0.19081147015094757, 2.43583607673645, 1.7896530628204346, -0.49937179684638977, -0.2122994363307953, -0.866710901260376, 1.3448559045791626, -0.25773191452026367, 0.28388047218322754, 2.094129800796509, -0.34316572546958923, -1.098550796508789, 1.3446459770202637, -2.5155446529388428, 0.2768520414829254, 2.0840401649475098, 0.34747472405433655, 0.24730893969535828, -1.3805387020111084, -0.669528603553772, -0.3440808653831482, -0.5569425821304321, -1.2895967960357666, 0.5932184457778931, -0.2827644944190979, -0.7588661313056946, -1.3778058290481567, 0.15314018726348877, -1.0453077554702759, -1.8163319826126099, 0.29320386052131653, 1.9387022256851196, 2.1763598918914795, -0.7865312099456787, 1.3857437372207642, -0.37573713064193726, 0.022945160046219826, 1.214281678199768, 1.3879103660583496, 3.0822768211364746, 1.9182233810424805, -1.3777011632919312, 0.6835731863975525, -0.23187053203582764, -0.5115795731544495, 1.1424553394317627, -1.0985345840454102, 1.1684306859970093, -0.19097942113876343, -1.2610933780670166, -1.2645540237426758, 1.1085801124572754, 0.43256083130836487, -0.027141258120536804, -0.5600875616073608, 1.2084004878997803, 0.06285056471824646, 1.392720341682434, 0.642940878868103, -0.43251198530197144, 0.47793376445770264, -0.43199434876441956, -0.5872190594673157, 1.6301370859146118, 0.17806926369667053, -1.586281657218933, -2.353177547454834, -0.3168330788612366, -0.9360382556915283, 0.053886860609054565, -0.6566513776779175, -1.1226273775100708, 1.5434823036193848, 0.35105589032173157, -1.1787760257720947, -0.28289616107940674, -0.3066044747829437, -0.3992385268211365, 2.6076836585998535, -1.2590025663375854, -0.08781824260950089, -0.9028935432434082, -0.6287941336631775, 1.6040624380111694, -1.2662193775177002, -0.2790822982788086, -1.0761433839797974, -0.6519308686256409, -1.2546478509902954, -0.3739021420478821, 0.02091706357896328, -0.9875404238700867, 0.72214674949646, 0.2380553036928177, -1.2429670095443726, -0.35832124948501587, -0.823979914188385, 1.0656086206436157, -0.05848824977874756, 0.2247539460659027, 1.7491601705551147, 0.23873461782932281, -0.38974112272262573, 0.8743656277656555, 1.208867073059082, 0.6538397073745728, -0.6469954252243042, -0.04067828133702278, -0.6385217905044556, 0.5245446562767029, -1.2831765413284302, 0.20007286965847015, -3.0448596477508545, 0.7522304654121399, -0.1526452749967575, -0.10601454228162766, -0.14481940865516663, -1.4869245290756226, 1.0796908140182495, 2.556137800216675, -1.1945685148239136, 0.6045486330986023, 0.41370993852615356, 1.079325556755066, -1.6096913814544678, 0.17401865124702454, -0.5633049607276917, 2.180842638015747, 0.2611275315284729, 1.309194564819336, -0.46487995982170105, -2.411586046218872, 0.623799741268158, -1.1647229194641113, -1.0096160173416138, 0.8163486123085022, -0.8930970430374146, 0.26998040080070496, -1.439336895942688, -0.22757373750209808, -0.9569555521011353, -1.226830005645752, 0.710312008857727, 0.11595213413238525, 0.4792480170726776, -0.6004477739334106, 0.3012513816356659, -2.2284374237060547, -1.1954962015151978, -0.11378154903650284, -0.9788488745689392, 0.6150212287902832, -0.4527406096458435, 0.5280988216400146, 0.0011183349415659904, 0.03956686705350876, 0.38409462571144104, 1.5793259143829346, 3.381218194961548, 0.030080152675509453, 0.2092253863811493, -0.12977120280265808, -0.9814490675926208, 1.3860417604446411, 0.8250105977058411, -0.0560029074549675, -0.6177395582199097, -1.0409040451049805, 1.323132038116455, 1.9443190097808838, 0.9567057490348816, 0.08874940127134323, -0.8961378931999207, -0.5915935039520264, -0.01408478431403637, 0.2332991063594818, 0.5629374384880066, 0.9697431325912476, -0.07896505296230316, 0.03145050257444382, 1.344809651374817, 1.125692367553711, -0.21918591856956482, 0.36004361510276794, -0.9501329660415649, -0.3918033540248871, 0.45308253169059753, 0.12714548408985138, -0.10238423198461533, 0.5102664828300476, -0.9783234596252441, -0.21825286746025085, -0.2661322355270386, -0.7483519911766052, -0.7928835153579712, -0.3771488070487976, -0.46050119400024414, 1.581268310546875, 0.0804295688867569, -0.47325265407562256, 0.1239224374294281, -0.6755164861679077, -0.32480719685554504, -1.1790114641189575, 0.16886909306049347, -0.1084388867020607, -0.054607145488262177, -0.24666434526443481, 1.5898044109344482, -0.8785738348960876, -2.0198378562927246, 0.14434677362442017, 0.35037800669670105, -0.27593496441841125, 0.19747474789619446, 1.813539981842041, 0.4343368113040924, 1.419328212738037, 1.2245104312896729, 0.9898850321769714, -0.5819790363311768, -1.1927865743637085, 0.819847583770752, 0.9198905825614929, -1.3382238149642944, 1.0346461534500122, -0.25110623240470886, -0.5481001138687134, 0.6607315540313721, 1.2961294651031494, 0.47681814432144165, -2.01021409034729, 0.9715241193771362, -1.1334757804870605, 0.9011982679367065, 0.6836232542991638, 0.7812595367431641, 0.27361243963241577, 0.9174181222915649, -1.2587634325027466, -1.0446349382400513, -0.6065536737442017, -0.6903586983680725, 1.9579038619995117, -0.3346450626850128, 0.5795484185218811, -0.1597677320241928, -1.2224247455596924, -0.1104668602347374, 0.8596152067184448, 0.37536484003067017, -0.451668918132782, 0.8247681856155396, -0.6015287041664124, -1.0471407175064087, -1.2095731496810913, -0.3960028886795044, -1.0834003686904907, -0.8858926296234131, 1.0244159698486328, 0.7259065508842468, 0.4181724190711975, 1.921330451965332, 0.4875844717025757, 0.3283209800720215, -2.5620594024658203, 0.881645143032074, 0.2892472445964813, -0.12068318575620651, 0.9572427868843079, 0.33825117349624634, 1.1672251224517822, 0.07049428671598434, 0.6789748072624207, -2.4182634353637695, 2.2545981407165527, -0.22825987637043, 0.6924556493759155, 0.062305815517902374, -0.1237880289554596, 1.0877420902252197, 0.6229104399681091, 0.4382610321044922, -1.0332905054092407, 0.8139277696609497, -0.5053300857543945, 1.1136977672576904, 0.9573644995689392, -0.8869869112968445, 0.05996513366699219, 1.3938145637512207, 0.3682113587856293, -0.461487740278244, -0.9885165691375732, -0.8105468153953552, 0.949855387210846, 1.684875249862671, -0.05508239567279816, -0.04747697710990906, 0.6187223196029663, 0.7309437394142151, -1.1752318143844604, 0.11391480267047882, -0.6160240769386292, -0.6395725607872009, 1.6361336708068848, 1.9458379745483398, -0.14194786548614502, -0.12373419851064682, -0.7463493943214417, -1.34824538230896, 0.8180451989173889, -0.10450736433267593, -0.02686629630625248, 0.533810019493103, -0.6489008069038391, 0.9707371592521667, 0.5999520421028137, 0.9622630476951599, 0.0935068279504776, 0.3235294818878174, 0.5208742618560791, -0.36050859093666077, -1.0878854990005493, -0.39276495575904846, -1.2210960388183594, -2.714682102203369, 0.39731255173683167, -0.3221319615840912, -1.4191889762878418, -0.017512209713459015, -1.0352009534835815, 0.8802536129951477, -0.6223991513252258, -1.121619462966919, -1.446783185005188, 0.338982492685318, -0.14654232561588287, 0.9369388818740845, -1.648224949836731, -0.11797203868627548, 1.1672282218933105, 0.8184570074081421, -0.6228631138801575, 1.0035721063613892, 0.2865229845046997, 0.9919471144676208, 0.7560086250305176, -0.42139723896980286, 0.6806973814964294, 0.07274241000413895, -1.3123434782028198, 0.491364449262619, 1.2734788656234741, 0.23901072144508362, 1.3693997859954834, -0.45337316393852234, -0.009072239510715008, 0.4245452284812927, -0.685528576374054, -0.5417808890342712, -0.26418963074684143, 0.6905730366706848, 0.03190023452043533, -1.0428612232208252, -0.19243039190769196, -0.19042082130908966, -0.35591983795166016, 0.21249869465827942, -1.4095346927642822, -0.28476202487945557, -0.5122703313827515, -0.30292484164237976, -1.4596226215362549, -0.11374514549970627, 1.4541003704071045, -0.6720637679100037, -0.2927235960960388, 0.48387402296066284, 0.3853186070919037, 0.5390570163726807, 0.6871061325073242, -0.7195848822593689, -0.2740567922592163, -0.33272403478622437, -0.31163841485977173, 0.36619386076927185, 1.1683069467544556, -0.061915576457977295, -0.9374050498008728, 0.6435485482215881, -0.33736979961395264, 0.23614530265331268, 1.9056216478347778, 0.026958098635077477, -0.7233887314796448, 0.4244157373905182, -0.6877934336662292, 1.7827666997909546, 1.698706865310669, 1.1690930128097534, -0.14624516665935516, -0.8701000809669495, 0.6566862463951111, -0.35767626762390137, -0.3365095853805542, 0.7562490105628967, 0.4669908881187439, -0.22740168869495392, -1.5373233556747437, 0.7912362813949585, 1.2496041059494019, -0.7408455610275269, -0.7891167998313904, 0.12673373520374298, -0.7724044322967529, 1.1766189336776733, 0.5419055223464966, 0.3648265600204468, 0.2673260569572449, 1.6824697256088257, 0.6987534165382385, -0.4879130721092224, 0.579107403755188, 0.38889753818511963, -0.32406318187713623, -2.1640846729278564, -1.1916154623031616, 0.22432783246040344, -0.5155900120735168, -1.4717938899993896, 1.3351430892944336, -1.0758978128433228, -1.0756815671920776, 0.5314009785652161, 0.15364894270896912, 1.2286986112594604, 0.3724033534526825, 1.6661778688430786, 2.1073930263519287, 0.8723285794258118, 0.49792006611824036, 1.2424743175506592, -0.14697761833667755, -0.4435666501522064, 1.7817140817642212, -0.3540496230125427, 0.5423556566238403, 1.1518465280532837, -0.4203018248081207, -1.04326331615448, -0.8674014806747437, -1.1262975931167603, -0.6986277103424072, 1.2074990272521973, 0.09242121130228043, -0.9934288263320923, 0.260976105928421, 1.6104472875595093, 0.15692053735256195, -0.1340540498495102, 0.7109590768814087, 0.36864301562309265, -0.6641703844070435, -0.14069479703903198, -0.9809680581092834, 0.5451691150665283, -0.3414503037929535, -0.30798226594924927, 0.23504012823104858, 0.5302550792694092, 1.3398600816726685, 0.0012975959107279778, 0.12182246148586273, 1.004022479057312, -1.3843721151351929, 1.431439995765686, -0.5534182786941528, 0.30998653173446655, -2.344735622406006, 1.3444194793701172, -0.6914804577827454, 2.0759239196777344, -2.620461940765381, 0.4525037705898285, -0.5049880743026733, -0.49040427803993225, 0.26692280173301697, -0.28771352767944336, 0.19578170776367188, -0.16907139122486115, -0.995991587638855, 0.07240302860736847, -0.6416242718696594, 0.5731261372566223, 1.1905672550201416, 1.4094265699386597, -1.1415247917175293, -0.17375320196151733, -1.6104167699813843, -0.16102278232574463, -0.8324466347694397, 0.25753092765808105, -1.9153363704681396, -0.10358645021915436, -1.9676636457443237, -2.3872973918914795, -1.2363523244857788, -0.8182811141014099, 1.121803879737854, 0.20590609312057495, -0.8757051825523376, 1.3511971235275269, -0.3002965450286865, -1.7729984521865845, 1.087529182434082, -2.1880271434783936 ]
https://github.com/huggingface/datasets/issues/3134
Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/rouge/rouge.py
It seems to be able to solve this issue by adding the equivalent `accuracy.py` locally. change `metric = datasets.load_metric("accuracy")` to `metric = datasets.load_metric(path = "./accuracy.py")`. Copy `accuracy.py` from browser at [accuracy.py](https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/accuracy/accuracy.py)
datasets version: 1.12.1 `metric = datasets.load_metric('rouge')` The error: > ConnectionError Traceback (most recent call last) > <ipython-input-3-dd10a0c5212f> in <module> > ----> 1 metric = datasets.load_metric('rouge') > > /usr/local/lib/python3.6/dist-packages/datasets/load.py in load_metric(path, config_name, process_id, num_process, cache_dir, experiment_id, keep_in_memory, download_config, download_mode, script_version, **metric_init_kwargs) > 613 download_config=download_config, > 614 download_mode=download_mode, > --> 615 dataset=False, > 616 ) > 617 metric_cls = import_main_class(module_path, dataset=False) > > /usr/local/lib/python3.6/dist-packages/datasets/load.py in prepare_module(path, script_version, download_config, download_mode, dataset, force_local_path, dynamic_modules_path, return_resolved_file_path, **download_kwargs) > 328 file_path = hf_github_url(path=path, name=name, dataset=dataset, version=script_version) > 329 try: > --> 330 local_path = cached_path(file_path, download_config=download_config) > 331 except FileNotFoundError: > 332 if script_version is not None: > > /usr/local/lib/python3.6/dist-packages/datasets/utils/file_utils.py in cached_path(url_or_filename, download_config, **download_kwargs) > 296 use_etag=download_config.use_etag, > 297 max_retries=download_config.max_retries, > --> 298 use_auth_token=download_config.use_auth_token, > 299 ) > 300 elif os.path.exists(url_or_filename): > > /usr/local/lib/python3.6/dist-packages/datasets/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only, use_etag, max_retries, use_auth_token) > 603 raise FileNotFoundError("Couldn't find file at {}".format(url)) > 604 _raise_if_offline_mode_is_enabled(f"Tried to reach {url}") > --> 605 raise ConnectionError("Couldn't reach {}".format(url)) > 606 > 607 # Try a second time > > ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/rouge/rouge.py Is there any remedy to solve the connection issue ?
1,157
31
Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/rouge/rouge.py datasets version: 1.12.1 `metric = datasets.load_metric('rouge')` The error: > ConnectionError Traceback (most recent call last) > <ipython-input-3-dd10a0c5212f> in <module> > ----> 1 metric = datasets.load_metric('rouge') > > /usr/local/lib/python3.6/dist-packages/datasets/load.py in load_metric(path, config_name, process_id, num_process, cache_dir, experiment_id, keep_in_memory, download_config, download_mode, script_version, **metric_init_kwargs) > 613 download_config=download_config, > 614 download_mode=download_mode, > --> 615 dataset=False, > 616 ) > 617 metric_cls = import_main_class(module_path, dataset=False) > > /usr/local/lib/python3.6/dist-packages/datasets/load.py in prepare_module(path, script_version, download_config, download_mode, dataset, force_local_path, dynamic_modules_path, return_resolved_file_path, **download_kwargs) > 328 file_path = hf_github_url(path=path, name=name, dataset=dataset, version=script_version) > 329 try: > --> 330 local_path = cached_path(file_path, download_config=download_config) > 331 except FileNotFoundError: > 332 if script_version is not None: > > /usr/local/lib/python3.6/dist-packages/datasets/utils/file_utils.py in cached_path(url_or_filename, download_config, **download_kwargs) > 296 use_etag=download_config.use_etag, > 297 max_retries=download_config.max_retries, > --> 298 use_auth_token=download_config.use_auth_token, > 299 ) > 300 elif os.path.exists(url_or_filename): > > /usr/local/lib/python3.6/dist-packages/datasets/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only, use_etag, max_retries, use_auth_token) > 603 raise FileNotFoundError("Couldn't find file at {}".format(url)) > 604 _raise_if_offline_mode_is_enabled(f"Tried to reach {url}") > --> 605 raise ConnectionError("Couldn't reach {}".format(url)) > 606 > 607 # Try a second time > > ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/rouge/rouge.py Is there any remedy to solve the connection issue ? It seems to be able to solve this issue by adding the equivalent `accuracy.py` locally. change `metric = datasets.load_metric("accuracy")` to `metric = datasets.load_metric(path = "./accuracy.py")`. Copy `accuracy.py` from browser at [accuracy.py](https://raw.githubusercontent.com/huggingface/datasets/1.11.0/metrics/accuracy/accuracy.py)
[ -1.2385988235473633, -0.9526150822639465, -0.5611421465873718, 1.4222878217697144, -0.14228807389736176, -1.1780242919921875, 0.18955332040786743, -1.0361979007720947, 1.493194341659546, -0.7912179827690125, 0.17293430864810944, -1.7060819864273071, -0.10105345398187637, -0.6302402019500732, -0.654166579246521, -0.8505915999412537, -0.3619289696216583, -0.8752279877662659, 1.0683754682540894, 2.4249215126037598, 1.3226521015167236, -1.3077716827392578, 2.747208595275879, 0.7443694472312927, -0.3157019019126892, -0.994219958782196, 0.5454591512680054, -0.0012148767709732056, -1.1811820268630981, -0.5296863317489624, -0.9043434262275696, 0.003515789285302162, -0.7428441643714905, -0.22756879031658173, 0.0027805641293525696, 0.3809433877468109, -0.2984720766544342, -0.13319529592990875, -0.6237860321998596, -0.7750001549720764, 0.45793282985687256, -0.37635600566864014, 0.9454586505889893, -0.29544201493263245, 1.5973516702651978, -0.583194375038147, 0.45409929752349854, 0.7690081596374512, 1.213789701461792, 0.18150722980499268, 0.030436499044299126, 0.24846330285072327, 0.3067198395729065, 0.016208220273256302, 0.5545066595077515, 1.1659818887710571, 0.6794145703315735, 0.4692133367061615, 0.5305047631263733, -2.266584873199463, 1.3535141944885254, -0.8834689259529114, 0.3535604178905487, 1.3498082160949707, -0.8321681022644043, 0.39705154299736023, -1.7990598678588867, -0.07693115621805191, 0.7046152353286743, -2.3203914165496826, 0.33416062593460083, -1.3629480600357056, -0.5049917697906494, 0.8682229518890381, 0.40814387798309326, -1.2377887964248657, 0.12894953787326813, -0.5188748240470886, 1.1445271968841553, 0.41082292795181274, 0.9674267768859863, -1.8034398555755615, -0.02531154826283455, -0.21372203528881073, 0.16340181231498718, -1.2358847856521606, -1.7013795375823975, 0.614728569984436, 0.5486032962799072, 0.748301088809967, -0.18867720663547516, 1.0566991567611694, -1.138363003730774, 0.7817400693893433, -1.0595710277557373, -1.5389552116394043, -1.391945242881775, -2.493556499481201, -2.297415256500244, 0.6818128228187561, -0.5486001968383789, -0.4698520004749298, 2.0945584774017334, -0.9799312353134155, -1.6810418367385864, 1.0942680835723877, 0.26491180062294006, 0.05303964018821716, 2.4041097164154053, 0.14587870240211487, -0.7010610103607178, 0.4435364007949829, -0.7994447946548462, 0.881793737411499, -0.23469802737236023, 1.3392831087112427, 0.526116132736206, -1.0409069061279297, 1.5776406526565552, -0.5226215720176697, 0.562451958656311, -0.5720336437225342, -0.5694044828414917, -0.766427218914032, 0.140333890914917, 1.8156278133392334, -0.22534850239753723, 1.5321298837661743, -0.2796522378921509, -1.5274121761322021, -1.5601835250854492, 0.9424736499786377, 0.4724579453468323, -0.9375827312469482, 0.17929063737392426, -0.6001538634300232, 0.2191995233297348, -0.005453748162835836, 1.1331981420516968, 1.3395577669143677, 0.6602417230606079, -0.39867740869522095, -0.8241177201271057, 0.09264857321977615, -0.2060827761888504, -0.6792790293693542, -1.9217958450317383, -0.23854242265224457, 0.08931740373373032, 0.743823766708374, -1.1182749271392822, 1.8111579418182373, 0.9933601021766663, 1.9600622653961182, 0.9427868723869324, -0.47296884655952454, 1.4279476404190063, -0.01393003761768341, 1.7741438150405884, -0.6674050092697144, 0.6555874943733215, -0.40754786133766174, -1.09506094455719, 0.9645794034004211, -0.2973769009113312, -1.9741997718811035, -0.7234858870506287, -0.6460930109024048, -0.24859899282455444, -0.9048237204551697, 0.8907379508018494, -0.2428315281867981, -1.487195372581482, 0.21532347798347473, -0.6971719264984131, 0.29060015082359314, -1.2319273948669434, 0.2859647870063782, 0.6712175011634827, -0.6274346709251404, -0.10895338654518127, -0.2359861433506012, -1.2486909627914429, -0.51095050573349, 0.4001857340335846, 1.8018932342529297, -0.4768683612346649, 0.9435641765594482, 1.0396219491958618, -0.6761583685874939, 0.08199948072433472, 0.23466114699840546, -0.17693576216697693, 0.7601435780525208, -1.0810189247131348, -0.46225622296333313, 1.2829071283340454, -0.4109170436859131, -0.5794131755828857, 1.4157246351242065, 0.7367731928825378, -1.1406290531158447, -0.24011161923408508, -0.21338729560375214, -0.8410165309906006, 0.08504673838615417, -1.5971156358718872, -0.16916298866271973, 0.5514019131660461, -1.530988097190857, -0.3123443126678467, -0.167256698012352, 1.4565898180007935, -0.1609201580286026, 1.4135764837265015, -0.30101293325424194, -0.02837614342570305, -0.3035952150821686, -0.44054463505744934, 0.2147076427936554, -0.12979468703269958, -0.4402768909931183, 0.13488218188285828, -0.8208993077278137, 0.251891165971756, 1.5459004640579224, 0.23652498424053192, 0.022687384858727455, 0.35030385851860046, 1.0391457080841064, 0.33844202756881714, -0.14175264537334442, -0.886877715587616, -1.4832555055618286, 1.9494050741195679, -1.519314169883728, 1.939813494682312, 0.7203803658485413, -0.10487891733646393, -1.7576382160186768, -1.784792423248291, 1.1950809955596924, 1.0926909446716309, 2.2928309440612793, 0.4615463614463806, 0.3564780056476593, -0.8053122162818909, -0.7705242037773132, 0.30195510387420654, -1.0141938924789429, -0.6907431483268738, 0.19081147015094757, 2.43583607673645, 1.7896530628204346, -0.49937179684638977, -0.2122994363307953, -0.866710901260376, 1.3448559045791626, -0.25773191452026367, 0.28388047218322754, 2.094129800796509, -0.34316572546958923, -1.098550796508789, 1.3446459770202637, -2.5155446529388428, 0.2768520414829254, 2.0840401649475098, 0.34747472405433655, 0.24730893969535828, -1.3805387020111084, -0.669528603553772, -0.3440808653831482, -0.5569425821304321, -1.2895967960357666, 0.5932184457778931, -0.2827644944190979, -0.7588661313056946, -1.3778058290481567, 0.15314018726348877, -1.0453077554702759, -1.8163319826126099, 0.29320386052131653, 1.9387022256851196, 2.1763598918914795, -0.7865312099456787, 1.3857437372207642, -0.37573713064193726, 0.022945160046219826, 1.214281678199768, 1.3879103660583496, 3.0822768211364746, 1.9182233810424805, -1.3777011632919312, 0.6835731863975525, -0.23187053203582764, -0.5115795731544495, 1.1424553394317627, -1.0985345840454102, 1.1684306859970093, -0.19097942113876343, -1.2610933780670166, -1.2645540237426758, 1.1085801124572754, 0.43256083130836487, -0.027141258120536804, -0.5600875616073608, 1.2084004878997803, 0.06285056471824646, 1.392720341682434, 0.642940878868103, -0.43251198530197144, 0.47793376445770264, -0.43199434876441956, -0.5872190594673157, 1.6301370859146118, 0.17806926369667053, -1.586281657218933, -2.353177547454834, -0.3168330788612366, -0.9360382556915283, 0.053886860609054565, -0.6566513776779175, -1.1226273775100708, 1.5434823036193848, 0.35105589032173157, -1.1787760257720947, -0.28289616107940674, -0.3066044747829437, -0.3992385268211365, 2.6076836585998535, -1.2590025663375854, -0.08781824260950089, -0.9028935432434082, -0.6287941336631775, 1.6040624380111694, -1.2662193775177002, -0.2790822982788086, -1.0761433839797974, -0.6519308686256409, -1.2546478509902954, -0.3739021420478821, 0.02091706357896328, -0.9875404238700867, 0.72214674949646, 0.2380553036928177, -1.2429670095443726, -0.35832124948501587, -0.823979914188385, 1.0656086206436157, -0.05848824977874756, 0.2247539460659027, 1.7491601705551147, 0.23873461782932281, -0.38974112272262573, 0.8743656277656555, 1.208867073059082, 0.6538397073745728, -0.6469954252243042, -0.04067828133702278, -0.6385217905044556, 0.5245446562767029, -1.2831765413284302, 0.20007286965847015, -3.0448596477508545, 0.7522304654121399, -0.1526452749967575, -0.10601454228162766, -0.14481940865516663, -1.4869245290756226, 1.0796908140182495, 2.556137800216675, -1.1945685148239136, 0.6045486330986023, 0.41370993852615356, 1.079325556755066, -1.6096913814544678, 0.17401865124702454, -0.5633049607276917, 2.180842638015747, 0.2611275315284729, 1.309194564819336, -0.46487995982170105, -2.411586046218872, 0.623799741268158, -1.1647229194641113, -1.0096160173416138, 0.8163486123085022, -0.8930970430374146, 0.26998040080070496, -1.439336895942688, -0.22757373750209808, -0.9569555521011353, -1.226830005645752, 0.710312008857727, 0.11595213413238525, 0.4792480170726776, -0.6004477739334106, 0.3012513816356659, -2.2284374237060547, -1.1954962015151978, -0.11378154903650284, -0.9788488745689392, 0.6150212287902832, -0.4527406096458435, 0.5280988216400146, 0.0011183349415659904, 0.03956686705350876, 0.38409462571144104, 1.5793259143829346, 3.381218194961548, 0.030080152675509453, 0.2092253863811493, -0.12977120280265808, -0.9814490675926208, 1.3860417604446411, 0.8250105977058411, -0.0560029074549675, -0.6177395582199097, -1.0409040451049805, 1.323132038116455, 1.9443190097808838, 0.9567057490348816, 0.08874940127134323, -0.8961378931999207, -0.5915935039520264, -0.01408478431403637, 0.2332991063594818, 0.5629374384880066, 0.9697431325912476, -0.07896505296230316, 0.03145050257444382, 1.344809651374817, 1.125692367553711, -0.21918591856956482, 0.36004361510276794, -0.9501329660415649, -0.3918033540248871, 0.45308253169059753, 0.12714548408985138, -0.10238423198461533, 0.5102664828300476, -0.9783234596252441, -0.21825286746025085, -0.2661322355270386, -0.7483519911766052, -0.7928835153579712, -0.3771488070487976, -0.46050119400024414, 1.581268310546875, 0.0804295688867569, -0.47325265407562256, 0.1239224374294281, -0.6755164861679077, -0.32480719685554504, -1.1790114641189575, 0.16886909306049347, -0.1084388867020607, -0.054607145488262177, -0.24666434526443481, 1.5898044109344482, -0.8785738348960876, -2.0198378562927246, 0.14434677362442017, 0.35037800669670105, -0.27593496441841125, 0.19747474789619446, 1.813539981842041, 0.4343368113040924, 1.419328212738037, 1.2245104312896729, 0.9898850321769714, -0.5819790363311768, -1.1927865743637085, 0.819847583770752, 0.9198905825614929, -1.3382238149642944, 1.0346461534500122, -0.25110623240470886, -0.5481001138687134, 0.6607315540313721, 1.2961294651031494, 0.47681814432144165, -2.01021409034729, 0.9715241193771362, -1.1334757804870605, 0.9011982679367065, 0.6836232542991638, 0.7812595367431641, 0.27361243963241577, 0.9174181222915649, -1.2587634325027466, -1.0446349382400513, -0.6065536737442017, -0.6903586983680725, 1.9579038619995117, -0.3346450626850128, 0.5795484185218811, -0.1597677320241928, -1.2224247455596924, -0.1104668602347374, 0.8596152067184448, 0.37536484003067017, -0.451668918132782, 0.8247681856155396, -0.6015287041664124, -1.0471407175064087, -1.2095731496810913, -0.3960028886795044, -1.0834003686904907, -0.8858926296234131, 1.0244159698486328, 0.7259065508842468, 0.4181724190711975, 1.921330451965332, 0.4875844717025757, 0.3283209800720215, -2.5620594024658203, 0.881645143032074, 0.2892472445964813, -0.12068318575620651, 0.9572427868843079, 0.33825117349624634, 1.1672251224517822, 0.07049428671598434, 0.6789748072624207, -2.4182634353637695, 2.2545981407165527, -0.22825987637043, 0.6924556493759155, 0.062305815517902374, -0.1237880289554596, 1.0877420902252197, 0.6229104399681091, 0.4382610321044922, -1.0332905054092407, 0.8139277696609497, -0.5053300857543945, 1.1136977672576904, 0.9573644995689392, -0.8869869112968445, 0.05996513366699219, 1.3938145637512207, 0.3682113587856293, -0.461487740278244, -0.9885165691375732, -0.8105468153953552, 0.949855387210846, 1.684875249862671, -0.05508239567279816, -0.04747697710990906, 0.6187223196029663, 0.7309437394142151, -1.1752318143844604, 0.11391480267047882, -0.6160240769386292, -0.6395725607872009, 1.6361336708068848, 1.9458379745483398, -0.14194786548614502, -0.12373419851064682, -0.7463493943214417, -1.34824538230896, 0.8180451989173889, -0.10450736433267593, -0.02686629630625248, 0.533810019493103, -0.6489008069038391, 0.9707371592521667, 0.5999520421028137, 0.9622630476951599, 0.0935068279504776, 0.3235294818878174, 0.5208742618560791, -0.36050859093666077, -1.0878854990005493, -0.39276495575904846, -1.2210960388183594, -2.714682102203369, 0.39731255173683167, -0.3221319615840912, -1.4191889762878418, -0.017512209713459015, -1.0352009534835815, 0.8802536129951477, -0.6223991513252258, -1.121619462966919, -1.446783185005188, 0.338982492685318, -0.14654232561588287, 0.9369388818740845, -1.648224949836731, -0.11797203868627548, 1.1672282218933105, 0.8184570074081421, -0.6228631138801575, 1.0035721063613892, 0.2865229845046997, 0.9919471144676208, 0.7560086250305176, -0.42139723896980286, 0.6806973814964294, 0.07274241000413895, -1.3123434782028198, 0.491364449262619, 1.2734788656234741, 0.23901072144508362, 1.3693997859954834, -0.45337316393852234, -0.009072239510715008, 0.4245452284812927, -0.685528576374054, -0.5417808890342712, -0.26418963074684143, 0.6905730366706848, 0.03190023452043533, -1.0428612232208252, -0.19243039190769196, -0.19042082130908966, -0.35591983795166016, 0.21249869465827942, -1.4095346927642822, -0.28476202487945557, -0.5122703313827515, -0.30292484164237976, -1.4596226215362549, -0.11374514549970627, 1.4541003704071045, -0.6720637679100037, -0.2927235960960388, 0.48387402296066284, 0.3853186070919037, 0.5390570163726807, 0.6871061325073242, -0.7195848822593689, -0.2740567922592163, -0.33272403478622437, -0.31163841485977173, 0.36619386076927185, 1.1683069467544556, -0.061915576457977295, -0.9374050498008728, 0.6435485482215881, -0.33736979961395264, 0.23614530265331268, 1.9056216478347778, 0.026958098635077477, -0.7233887314796448, 0.4244157373905182, -0.6877934336662292, 1.7827666997909546, 1.698706865310669, 1.1690930128097534, -0.14624516665935516, -0.8701000809669495, 0.6566862463951111, -0.35767626762390137, -0.3365095853805542, 0.7562490105628967, 0.4669908881187439, -0.22740168869495392, -1.5373233556747437, 0.7912362813949585, 1.2496041059494019, -0.7408455610275269, -0.7891167998313904, 0.12673373520374298, -0.7724044322967529, 1.1766189336776733, 0.5419055223464966, 0.3648265600204468, 0.2673260569572449, 1.6824697256088257, 0.6987534165382385, -0.4879130721092224, 0.579107403755188, 0.38889753818511963, -0.32406318187713623, -2.1640846729278564, -1.1916154623031616, 0.22432783246040344, -0.5155900120735168, -1.4717938899993896, 1.3351430892944336, -1.0758978128433228, -1.0756815671920776, 0.5314009785652161, 0.15364894270896912, 1.2286986112594604, 0.3724033534526825, 1.6661778688430786, 2.1073930263519287, 0.8723285794258118, 0.49792006611824036, 1.2424743175506592, -0.14697761833667755, -0.4435666501522064, 1.7817140817642212, -0.3540496230125427, 0.5423556566238403, 1.1518465280532837, -0.4203018248081207, -1.04326331615448, -0.8674014806747437, -1.1262975931167603, -0.6986277103424072, 1.2074990272521973, 0.09242121130228043, -0.9934288263320923, 0.260976105928421, 1.6104472875595093, 0.15692053735256195, -0.1340540498495102, 0.7109590768814087, 0.36864301562309265, -0.6641703844070435, -0.14069479703903198, -0.9809680581092834, 0.5451691150665283, -0.3414503037929535, -0.30798226594924927, 0.23504012823104858, 0.5302550792694092, 1.3398600816726685, 0.0012975959107279778, 0.12182246148586273, 1.004022479057312, -1.3843721151351929, 1.431439995765686, -0.5534182786941528, 0.30998653173446655, -2.344735622406006, 1.3444194793701172, -0.6914804577827454, 2.0759239196777344, -2.620461940765381, 0.4525037705898285, -0.5049880743026733, -0.49040427803993225, 0.26692280173301697, -0.28771352767944336, 0.19578170776367188, -0.16907139122486115, -0.995991587638855, 0.07240302860736847, -0.6416242718696594, 0.5731261372566223, 1.1905672550201416, 1.4094265699386597, -1.1415247917175293, -0.17375320196151733, -1.6104167699813843, -0.16102278232574463, -0.8324466347694397, 0.25753092765808105, -1.9153363704681396, -0.10358645021915436, -1.9676636457443237, -2.3872973918914795, -1.2363523244857788, -0.8182811141014099, 1.121803879737854, 0.20590609312057495, -0.8757051825523376, 1.3511971235275269, -0.3002965450286865, -1.7729984521865845, 1.087529182434082, -2.1880271434783936 ]
https://github.com/huggingface/datasets/issues/3127
datasets-cli: convertion of a tfds dataset to a huggingface one.
Hi, the MNIST dataset is already available on the Hub. You can use it as follows: ```python import datasets dataset_dict = datasets.load_dataset("mnist") ``` As for the conversion of TFDS datasets to HF datasets, we will be working on it in the coming months, so stay tuned.
### Discussed in https://github.com/huggingface/datasets/discussions/3079 <div type='discussions-op-text'> <sup>Originally posted by **vitalyshalumov** October 14, 2021</sup> I'm trying to convert a tfds dataset to a huggingface one. I've tried: 1. datasets-cli convert --tfds_path ~/tensorflow_datasets/mnist/3.0.1/ --datasets_directory ~/.cache/huggingface/datasets/mnist/3.0.1/ 2. datasets-cli convert --tfds_path ~/tensorflow_datasets/mnist/3.0.1/ --datasets_directory ~/.cache/huggingface/datasets/ and other permutations. The script appears to be running and finishing without an error but when looking in the huggingface/datasets/ folder nothing is created. </div>
1,159
46
datasets-cli: convertion of a tfds dataset to a huggingface one. ### Discussed in https://github.com/huggingface/datasets/discussions/3079 <div type='discussions-op-text'> <sup>Originally posted by **vitalyshalumov** October 14, 2021</sup> I'm trying to convert a tfds dataset to a huggingface one. I've tried: 1. datasets-cli convert --tfds_path ~/tensorflow_datasets/mnist/3.0.1/ --datasets_directory ~/.cache/huggingface/datasets/mnist/3.0.1/ 2. datasets-cli convert --tfds_path ~/tensorflow_datasets/mnist/3.0.1/ --datasets_directory ~/.cache/huggingface/datasets/ and other permutations. The script appears to be running and finishing without an error but when looking in the huggingface/datasets/ folder nothing is created. </div> Hi, the MNIST dataset is already available on the Hub. You can use it as follows: ```python import datasets dataset_dict = datasets.load_dataset("mnist") ``` As for the conversion of TFDS datasets to HF datasets, we will be working on it in the coming months, so stay tuned.
[ -1.1809792518615723, -0.939287543296814, -0.7410374283790588, 1.4134289026260376, -0.09243842959403992, -1.3572545051574707, 0.041762180626392365, -0.9655032753944397, 1.6887696981430054, -0.779238760471344, 0.2862279713153839, -1.7774150371551514, -0.06432335823774338, -0.49485862255096436, -0.6913169622421265, -0.9078798890113831, -0.33077481389045715, -0.718694269657135, 0.9438204765319824, 2.56386661529541, 1.200897216796875, -1.3250775337219238, 2.7202329635620117, 0.6391903758049011, -0.27301734685897827, -0.9382913112640381, 0.5729947686195374, 0.10950484871864319, -1.3476006984710693, -0.38925716280937195, -0.8471406102180481, 0.08562147617340088, -0.603330135345459, -0.4788232743740082, 0.11209063977003098, 0.3770228624343872, -0.2349877655506134, -0.1873350888490677, -0.5358902215957642, -0.8291530609130859, 0.39059653878211975, -0.36303839087486267, 0.9687196612358093, -0.4238683879375458, 1.8360257148742676, -0.6104803085327148, 0.34060922265052795, 0.7091715335845947, 1.2369633913040161, 0.2016114592552185, 0.06238187104463577, 0.23985406756401062, 0.36206844449043274, 0.03481682389974594, 0.44631335139274597, 1.1552108526229858, 0.5236524343490601, 0.45521581172943115, 0.648004412651062, -2.2550134658813477, 1.4285664558410645, -0.8894415497779846, 0.2906538248062134, 1.3903101682662964, -0.8395504951477051, 0.40171751379966736, -1.7944692373275757, -0.11775471270084381, 0.6152322292327881, -2.3784823417663574, 0.11717764288187027, -1.3536512851715088, -0.5136560797691345, 0.9157596230506897, 0.20616434514522552, -1.1936352252960205, 0.2349521666765213, -0.46312209963798523, 1.029893159866333, 0.5874624252319336, 1.1892361640930176, -1.701952576637268, -0.03142639249563217, -0.14634321630001068, 0.10581192374229431, -1.3809407949447632, -1.6405143737792969, 0.5750291347503662, 0.6652823686599731, 0.6781876683235168, -0.05503208190202713, 0.8746271133422852, -0.9749789237976074, 0.7521318197250366, -0.8405787944793701, -1.728192687034607, -1.41519033908844, -2.376585006713867, -2.431569814682007, 0.781223714351654, -0.4821273684501648, -0.4183668792247772, 1.884307622909546, -1.0616004467010498, -1.8142719268798828, 1.0768910646438599, 0.4270607829093933, 0.01651022583246231, 2.3849167823791504, 0.17279461026191711, -0.7292656898498535, 0.45577895641326904, -0.7485872507095337, 0.821591317653656, -0.2409210056066513, 1.3590855598449707, 0.5816978216171265, -1.0110487937927246, 1.5985429286956787, -0.622207760810852, 0.5036390423774719, -0.7201979160308838, -0.5137064456939697, -0.8254358768463135, 0.25917914509773254, 1.8404529094696045, -0.3709302544593811, 1.69930899143219, -0.32637691497802734, -1.5473932027816772, -1.543760895729065, 0.7404667139053345, 0.49075737595558167, -0.8323231935501099, -0.013746736571192741, -0.4033772349357605, 0.2028764933347702, -0.040010564029216766, 1.0868133306503296, 1.092725396156311, 0.6349266171455383, -0.3821971118450165, -0.8526280522346497, 0.17493657767772675, -0.04516754299402237, -0.6598584651947021, -1.8513044118881226, -0.2986364960670471, 0.3162047564983368, 0.638381838798523, -1.2407019138336182, 1.70656156539917, 0.8994280099868774, 2.0235602855682373, 0.9512231945991516, -0.34753185510635376, 1.458682894706726, 0.0036380747333168983, 1.8529715538024902, -0.47347158193588257, 0.6829164624214172, -0.2783306837081909, -1.099007487297058, 0.7560452818870544, -0.3318828344345093, -2.0435919761657715, -0.7250620126724243, -0.8834157586097717, -0.11657459288835526, -0.725761353969574, 0.9510723948478699, -0.19276030361652374, -1.4256552457809448, 0.10107652097940445, -0.6303079724311829, 0.1083269715309143, -1.2664185762405396, 0.16242438554763794, 0.8039011359214783, -0.7175132036209106, -0.13370372354984283, -0.2244187742471695, -1.3887224197387695, -0.5100577473640442, 0.29147717356681824, 1.9405665397644043, -0.6887484788894653, 1.0331875085830688, 0.9619765877723694, -0.6984875798225403, 0.1209946945309639, 0.309471994638443, -0.3086545467376709, 0.8395147919654846, -0.9439477324485779, -0.3098834156990051, 1.1474497318267822, -0.21171317994594574, -0.6462644934654236, 1.4433962106704712, 0.8092933893203735, -1.0533077716827393, -0.21386556327342987, -0.2203695923089981, -0.7160346508026123, -0.009605977684259415, -1.5405346155166626, -0.15073058009147644, 0.19186680018901825, -1.4202604293823242, -0.4365495443344116, -0.2446409910917282, 1.3244152069091797, -0.18365757167339325, 1.392612099647522, -0.2969912588596344, -0.23012584447860718, -0.543330192565918, -0.5212007164955139, 0.18650370836257935, -0.2320924997329712, -0.6160456538200378, 0.32873857021331787, -0.8944264054298401, 0.2891826629638672, 1.4518529176712036, 0.3926708996295929, 0.06254366040229797, 0.48778802156448364, 1.1046619415283203, 0.29792797565460205, -0.09915507584810257, -0.8192803263664246, -1.583012342453003, 2.064530372619629, -1.4091960191726685, 1.9105175733566284, 0.7043089270591736, -0.05906529724597931, -1.8011016845703125, -1.868852972984314, 1.3480350971221924, 1.1277682781219482, 2.449215888977051, 0.5602865219116211, 0.3069850504398346, -0.8139323592185974, -0.7276077270507812, 0.3477476239204407, -0.9063591957092285, -0.7815222144126892, 0.07073787599802017, 2.299006938934326, 1.818068027496338, -0.6257966756820679, -0.11242897063493729, -1.0420984029769897, 1.3150177001953125, -0.19703802466392517, 0.31306785345077515, 2.0370590686798096, -0.4059641659259796, -1.0427345037460327, 1.359454870223999, -2.28267765045166, 0.1743873953819275, 1.9957761764526367, 0.2252071499824524, 0.08265227824449539, -1.411189317703247, -0.7587174773216248, -0.34891363978385925, -0.4016139507293701, -1.3087400197982788, 0.5266618132591248, -0.2435961812734604, -0.9450767040252686, -1.4431248903274536, 0.024468762800097466, -1.1322495937347412, -1.7463799715042114, 0.39192911982536316, 1.850754737854004, 1.9980826377868652, -0.7481696605682373, 1.339971899986267, -0.2278592735528946, 0.14060679078102112, 1.2826899290084839, 1.317088007926941, 3.102818489074707, 1.8921384811401367, -1.2663823366165161, 0.7921281456947327, -0.13082903623580933, -0.41813236474990845, 1.3000434637069702, -1.0410958528518677, 1.2082891464233398, -0.3127386271953583, -1.3255118131637573, -1.2971774339675903, 1.0333755016326904, 0.4736135005950928, 0.004152803681790829, -0.5738264918327332, 1.240445613861084, 0.04163793474435806, 1.3716599941253662, 0.6124832034111023, -0.5175153017044067, 0.563572883605957, -0.36327335238456726, -0.5828262567520142, 1.5505261421203613, 0.10338511317968369, -1.5693165063858032, -2.3994953632354736, -0.2359500527381897, -0.9093087911605835, -0.22225017845630646, -0.602258563041687, -1.0763537883758545, 1.6378412246704102, 0.5518090128898621, -1.1820265054702759, -0.2379819005727768, -0.36385804414749146, -0.562269389629364, 2.5487771034240723, -1.361765742301941, -0.08442479372024536, -1.0027190446853638, -0.4894282817840576, 1.557946801185608, -1.1695446968078613, -0.15204624831676483, -1.084659457206726, -0.7182244062423706, -1.4088940620422363, -0.4662960171699524, -0.019927246496081352, -0.9259557127952576, 0.7348902225494385, 0.023052027449011803, -1.0663142204284668, -0.3291406035423279, -0.9399147629737854, 0.9760151505470276, -0.09179552644491196, 0.1586499810218811, 1.8859840631484985, 0.3776693642139435, -0.4077029526233673, 0.6937357783317566, 1.1958507299423218, 0.6273410320281982, -0.7248328924179077, 0.18017122149467468, -0.7315829992294312, 0.35969677567481995, -1.4266105890274048, 0.18103134632110596, -2.9469003677368164, 0.7012539505958557, -0.09009919315576553, -0.12842680513858795, -0.06823016703128815, -1.2740190029144287, 1.084147572517395, 2.4975991249084473, -1.1798796653747559, 0.47301435470581055, 0.36780232191085815, 1.1043308973312378, -1.5779907703399658, 0.2525210678577423, -0.4996471703052521, 2.1136863231658936, 0.13297396898269653, 1.1679649353027344, -0.5440481901168823, -2.0248570442199707, 0.6737792491912842, -1.18173086643219, -1.021958827972412, 0.8470222353935242, -0.9247409701347351, 0.20798686146736145, -1.4802463054656982, -0.08824890851974487, -0.943547248840332, -1.3100483417510986, 0.8478449583053589, 0.02801702357828617, 0.574263334274292, -0.5337015986442566, 0.39031100273132324, -2.2301881313323975, -1.281710147857666, -0.30080652236938477, -1.0288456678390503, 0.576181948184967, -0.250014066696167, 0.6765163540840149, -0.046683698892593384, 0.052310049533843994, 0.33493196964263916, 1.339705228805542, 3.3612117767333984, 0.15480206906795502, 0.2885197401046753, -0.010555482469499111, -1.0621901750564575, 1.397217869758606, 0.9994370341300964, -0.13155445456504822, -0.5252081751823425, -0.9763662815093994, 1.3090860843658447, 1.9730385541915894, 1.1854313611984253, 0.12572835385799408, -0.8778696656227112, -0.7314974665641785, 0.1011076346039772, 0.17037025094032288, 0.47911930084228516, 0.9420434832572937, -0.04911171644926071, 0.20115457475185394, 1.5428893566131592, 1.2532755136489868, -0.23855090141296387, 0.41171473264694214, -0.9264912009239197, -0.4272579848766327, 0.5585389137268066, 0.22767531871795654, 0.052634403109550476, 0.5672613382339478, -1.091408610343933, -0.24116429686546326, -0.33019593358039856, -0.9738420844078064, -0.6245279312133789, -0.5784899592399597, -0.4877004623413086, 1.5599753856658936, 0.002959691919386387, -0.4468201994895935, 0.024999311193823814, -0.7763828635215759, -0.20461136102676392, -1.068692684173584, 0.3402769863605499, -0.09946437180042267, -0.007070510648190975, -0.22227559983730316, 1.5967466831207275, -0.9768099188804626, -2.1030285358428955, 0.20032167434692383, 0.3102777302265167, -0.463137686252594, 0.08344420790672302, 1.6931101083755493, 0.4948507249355316, 1.3625317811965942, 1.3389766216278076, 0.9949014782905579, -0.596043050289154, -1.212295413017273, 0.6360185742378235, 0.964730978012085, -1.3171324729919434, 0.9703826904296875, -0.11558365076780319, -0.5881432294845581, 0.7609006762504578, 1.3208814859390259, 0.3019035756587982, -1.9230233430862427, 0.8551577925682068, -0.8457615971565247, 0.7634288668632507, 0.6307174563407898, 0.9244368672370911, 0.14344391226768494, 0.8270003795623779, -1.3395884037017822, -1.093380093574524, -0.7848966717720032, -0.5225118398666382, 1.8672816753387451, -0.1233360767364502, 0.5059043169021606, -0.22203819453716278, -1.1725271940231323, -0.11686673015356064, 0.7839577198028564, 0.3984293043613434, -0.3952961564064026, 0.9002166986465454, -0.5727393627166748, -0.9812546968460083, -1.3289180994033813, -0.3252832889556885, -1.030226230621338, -0.8306641578674316, 1.0035650730133057, 0.8074005842208862, 0.3998163044452667, 1.8634724617004395, 0.511933445930481, 0.3210442364215851, -2.70582914352417, 0.9305209517478943, 0.2810206413269043, -0.025655997917056084, 0.8797262907028198, 0.17371341586112976, 1.2025610208511353, -0.07104311138391495, 0.5939956307411194, -2.3091583251953125, 2.0810863971710205, -0.23892535269260406, 0.6935305595397949, 0.012037312611937523, -0.11005639284849167, 1.108712077140808, 0.5620196461677551, 0.5978553295135498, -1.1158027648925781, 0.8887936472892761, -0.5546742081642151, 1.0445058345794678, 1.015267014503479, -0.8724806904792786, -0.03944326192140579, 1.3684643507003784, 0.501292884349823, -0.3129505217075348, -0.9610989093780518, -0.7442959547042847, 0.9686908721923828, 1.7239447832107544, -0.04637283831834793, -0.05134090036153793, 0.8672126531600952, 0.7089495658874512, -1.2805218696594238, 0.11452668160200119, -0.7363305687904358, -0.567516028881073, 1.6767675876617432, 1.979132890701294, 0.025072092190384865, -0.1395421028137207, -0.7279883623123169, -1.1157612800598145, 0.6775920391082764, 0.01726832427084446, 0.00849640741944313, 0.7811244130134583, -0.7073562741279602, 1.1806296110153198, 0.695125162601471, 0.9641093611717224, 0.03985595703125, 0.2889113128185272, 0.38824325799942017, -0.2908410429954529, -1.1768182516098022, -0.4095238149166107, -1.0380281209945679, -2.5325067043304443, 0.4857471287250519, -0.2920505702495575, -1.47738516330719, 0.013326175510883331, -1.0426950454711914, 0.9350507259368896, -0.6691739559173584, -1.1094107627868652, -1.4527056217193604, 0.30658939480781555, -0.1424783319234848, 0.7851265668869019, -1.6051088571548462, -0.05945049226284027, 1.3284777402877808, 0.7943229079246521, -0.5172618627548218, 1.0519014596939087, 0.32468995451927185, 0.968908965587616, 0.8763958215713501, -0.39144814014434814, 0.5538517236709595, 0.15542367100715637, -1.3762165307998657, 0.3730658292770386, 1.1282631158828735, 0.26061758399009705, 1.3273770809173584, -0.5552993416786194, 0.11389714479446411, 0.40658605098724365, -0.5256069302558899, -0.4830670952796936, -0.523807942867279, 0.7793920636177063, 0.08798940479755402, -1.020248293876648, -0.06841626763343811, -0.14152595400810242, -0.17790433764457703, 0.2845790982246399, -1.4348422288894653, -0.2721971869468689, -0.3536047339439392, -0.4949088990688324, -1.309007167816162, -0.05699087679386139, 1.3906832933425903, -0.9079800248146057, -0.15665845572948456, 0.5951696634292603, 0.3084317147731781, 0.5721130967140198, 0.5971887707710266, -0.5943907499313354, -0.2725178897380829, -0.3410002291202545, -0.2714550197124481, 0.21373777091503143, 1.2118498086929321, -0.11833100765943527, -1.090951681137085, 0.7704476118087769, -0.42699065804481506, 0.10694694519042969, 2.0272324085235596, 0.03408388793468475, -0.8239942193031311, 0.37383323907852173, -0.7024818658828735, 1.8176777362823486, 1.787024974822998, 1.359599232673645, -0.06456708908081055, -0.9282402396202087, 0.46701255440711975, -0.282559335231781, -0.38775819540023804, 0.9882874488830566, 0.5198915600776672, -0.20732481777668, -1.385038137435913, 0.5385963916778564, 1.3244869709014893, -0.8892462849617004, -0.6969489455223083, 0.15603959560394287, -0.8954704403877258, 1.0943254232406616, 0.7735077142715454, 0.3518858253955841, 0.24332308769226074, 1.5531611442565918, 0.6511207222938538, -0.4783649444580078, 0.42389771342277527, 0.5103795528411865, -0.19954313337802887, -1.9971673488616943, -0.9190158843994141, 0.3675317168235779, -0.38996848464012146, -1.5438909530639648, 1.2976937294006348, -1.2473158836364746, -0.9444824457168579, 0.559778094291687, 0.1632082313299179, 1.3304638862609863, 0.38976600766181946, 1.7324066162109375, 2.21773362159729, 0.8667154312133789, 0.3184639513492584, 1.3328893184661865, -0.07976526767015457, -0.3419942259788513, 1.772374153137207, -0.3847687542438507, 0.5916818380355835, 0.9852885007858276, -0.4695509076118469, -1.009110927581787, -0.8150699138641357, -1.1981947422027588, -0.5612744092941284, 1.1380163431167603, 0.1977478414773941, -1.1257681846618652, 0.1823255568742752, 1.4794559478759766, 0.05967036634683609, -0.19270947575569153, 0.7021231055259705, 0.43334436416625977, -0.7039743661880493, -0.043419696390628815, -0.9802818298339844, 0.45809412002563477, -0.12777268886566162, -0.22041936218738556, 0.2003660351037979, 0.5004367232322693, 1.306338906288147, 0.050754643976688385, 0.16448305547237396, 1.3311396837234497, -1.2387568950653076, 1.4522886276245117, -0.7144096493721008, 0.21526363492012024, -2.4721157550811768, 1.4420228004455566, -0.8306977152824402, 1.8677541017532349, -2.6113479137420654, 0.4702102243900299, -0.5099858045578003, -0.4034794270992279, 0.2885671555995941, -0.3587877154350281, 0.131058469414711, -0.11455690115690231, -1.0786948204040527, 0.017743878066539764, -0.793788492679596, 0.5377288460731506, 1.1772786378860474, 1.2892861366271973, -1.1904670000076294, -0.3785383403301239, -1.8268877267837524, -0.22142881155014038, -0.7482377886772156, 0.3843937814235687, -1.9362431764602661, -0.11000388860702515, -1.908286690711975, -2.511960983276367, -1.4725619554519653, -0.8612085580825806, 1.065490961074829, 0.16086943447589874, -0.9541876912117004, 1.0829901695251465, -0.36715593934059143, -1.8284428119659424, 1.1309200525283813, -2.2801156044006348 ]
https://github.com/huggingface/datasets/issues/3126
"arabic_billion_words" dataset does not create the full dataset
Thanks for reporting, @vitalyshalumov. Apparently the script to parse the data has a bug, and does not generate the entire dataset. I'm fixing it.
## Describe the bug When running: raw_dataset = load_dataset('arabic_billion_words','Alittihad') the correct dataset file is pulled from the url. But, the generated dataset includes just a small portion of the data included in the file. This is true for all other portions of the "arabic_billion_words" dataset ('Almasryalyoum',.....) ## Steps to reproduce the bug ```python # Sample code to reproduce the bug raw_dataset = load_dataset('arabic_billion_words','Alittihad') #The screen message Downloading and preparing dataset arabic_billion_words/Alittihad (download: 332.13 MiB, generated: 20.62 MiB, post-processed: Unknown size, total: 352.74 MiB) ## Expected results over 100K sentences ## Actual results only 11K sentences ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.0 - Platform: Linux-5.8.0-63-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 4.0.1
1,160
24
"arabic_billion_words" dataset does not create the full dataset ## Describe the bug When running: raw_dataset = load_dataset('arabic_billion_words','Alittihad') the correct dataset file is pulled from the url. But, the generated dataset includes just a small portion of the data included in the file. This is true for all other portions of the "arabic_billion_words" dataset ('Almasryalyoum',.....) ## Steps to reproduce the bug ```python # Sample code to reproduce the bug raw_dataset = load_dataset('arabic_billion_words','Alittihad') #The screen message Downloading and preparing dataset arabic_billion_words/Alittihad (download: 332.13 MiB, generated: 20.62 MiB, post-processed: Unknown size, total: 352.74 MiB) ## Expected results over 100K sentences ## Actual results only 11K sentences ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.0 - Platform: Linux-5.8.0-63-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 4.0.1 Thanks for reporting, @vitalyshalumov. Apparently the script to parse the data has a bug, and does not generate the entire dataset. I'm fixing it.
[ -1.1933249235153198, -0.8244751691818237, -0.700864315032959, 1.4450217485427856, -0.18942266702651978, -1.2654016017913818, 0.1458308845758438, -0.9651365876197815, 1.6838618516921997, -0.8260760307312012, 0.19554691016674042, -1.6898428201675415, -0.009398935362696648, -0.5583050847053528, -0.68400639295578, -0.9222848415374756, -0.39760226011276245, -0.7363523244857788, 1.0518579483032227, 2.5065507888793945, 1.1091841459274292, -1.4062573909759521, 2.6503472328186035, 0.5751368999481201, -0.11139145493507385, -1.0269732475280762, 0.556857705116272, -0.05145285278558731, -1.3662395477294922, -0.37602484226226807, -0.9059648513793945, -0.07584395259618759, -0.6005685925483704, -0.5301373600959778, 0.02733326330780983, 0.4208836257457733, -0.2744172513484955, -0.4364558458328247, -0.47483107447624207, -0.8349258303642273, 0.4766288995742798, -0.3665163516998291, 0.8749611377716064, -0.34893980622291565, 1.8359826803207397, -0.5395068526268005, 0.530272364616394, 0.7062925696372986, 1.2748829126358032, 0.20850211381912231, 0.028086747974157333, 0.3964294195175171, 0.3285316824913025, 0.040489740669727325, 0.4126931428909302, 1.0749497413635254, 0.5685716867446899, 0.4542160928249359, 0.7216188311576843, -2.2208893299102783, 1.3129510879516602, -0.9537706971168518, 0.30969861149787903, 1.3855794668197632, -1.055129051208496, 0.414727121591568, -1.8063970804214478, -0.07491450756788254, 0.5259317755699158, -2.192368984222412, 0.21937745809555054, -1.2894655466079712, -0.511367678642273, 0.9287480711936951, 0.3614349067211151, -1.1831868886947632, 0.05984139069914818, -0.49353209137916565, 0.9450081586837769, 0.456693172454834, 1.0928370952606201, -1.7307952642440796, -0.04915251210331917, -0.3050510585308075, 0.1603483110666275, -1.383020043373108, -1.5793238878250122, 0.5906161069869995, 0.7262073159217834, 0.581124484539032, -0.0822855681180954, 0.8968558311462402, -1.044919490814209, 0.7374534010887146, -1.0333772897720337, -1.804834246635437, -1.416117787361145, -2.352797508239746, -2.3860111236572266, 0.7391295433044434, -0.44000244140625, -0.4481803774833679, 2.0538532733917236, -0.996900200843811, -1.7082240581512451, 1.1856640577316284, 0.2641077935695648, -0.024467797949910164, 2.407810688018799, 0.17064118385314941, -0.7640092968940735, 0.49594223499298096, -0.768522322177887, 0.6779859662055969, -0.34027040004730225, 1.2761945724487305, 0.45373478531837463, -1.0085487365722656, 1.5968067646026611, -0.40574613213539124, 0.5526635050773621, -0.6996814012527466, -0.48939818143844604, -0.8005802631378174, 0.2526603639125824, 1.907822608947754, -0.23658321797847748, 1.530988097190857, -0.24745337665081024, -1.5648795366287231, -1.5363905429840088, 0.8711786270141602, 0.4146367013454437, -0.762600839138031, 0.1681097447872162, -0.27852296829223633, 0.0884973481297493, -0.023322314023971558, 1.1115063428878784, 1.2766473293304443, 0.6840581893920898, -0.3267468512058258, -0.8954542279243469, 0.18172797560691833, -0.1345096081495285, -0.7387228012084961, -1.7878952026367188, -0.3312707543373108, 0.11176485568284988, 0.6848644018173218, -1.19295334815979, 1.716670274734497, 0.8695040941238403, 1.9500539302825928, 1.0061864852905273, -0.4126755893230438, 1.3969208002090454, 0.09803958237171173, 1.9060426950454712, -0.467794269323349, 0.7181658148765564, -0.4251454174518585, -1.1711143255233765, 0.8542134165763855, -0.3402428925037384, -2.017181634902954, -0.7389540672302246, -0.8445085883140564, -0.22902627289295197, -0.7334944605827332, 0.9534119963645935, -0.2506495416164398, -1.4563053846359253, 0.3063059151172638, -0.6568464636802673, 0.14514614641666412, -1.2593740224838257, 0.2728985846042633, 0.7546352744102478, -0.5909005403518677, 0.0829533040523529, -0.28985968232154846, -1.4300415515899658, -0.47882264852523804, 0.43838778138160706, 1.7799232006072998, -0.727536678314209, 1.0193350315093994, 1.0202205181121826, -0.657413125038147, -0.046583324670791626, 0.2545824348926544, -0.3062203526496887, 0.8897171020507812, -1.036928653717041, -0.40725135803222656, 1.203312635421753, -0.2957957983016968, -0.6099112033843994, 1.4524526596069336, 0.6874903440475464, -0.9874829053878784, -0.1738835722208023, -0.20060332119464874, -0.9018043875694275, 0.023275300860404968, -1.6774091720581055, -0.14762936532497406, 0.3336980640888214, -1.586249828338623, -0.4671573340892792, -0.12207098305225372, 1.2717456817626953, -0.062296442687511444, 1.416334629058838, -0.3587162494659424, -0.19223570823669434, -0.45630374550819397, -0.4182419180870056, 0.23592764139175415, -0.2541440427303314, -0.540111243724823, 0.27851957082748413, -0.8854166865348816, 0.29474419355392456, 1.3787245750427246, 0.3667551875114441, 0.11564470082521439, 0.5891151428222656, 1.0821857452392578, 0.35338813066482544, -0.10705478489398956, -0.8376517295837402, -1.6050348281860352, 2.071784496307373, -1.4271531105041504, 1.9692622423171997, 0.6492899656295776, -0.10110577195882797, -1.878246545791626, -1.8691632747650146, 1.3656599521636963, 1.0981570482254028, 2.303054094314575, 0.5650119781494141, 0.4273897111415863, -0.813044548034668, -0.6599869728088379, 0.25687822699546814, -0.9491375088691711, -0.7759137749671936, 0.1286284327507019, 2.3669936656951904, 1.7268352508544922, -0.4640962481498718, -0.11572626233100891, -1.0197962522506714, 1.4016332626342773, -0.22224515676498413, 0.2626652419567108, 1.979528784751892, -0.27451983094215393, -1.0489572286605835, 1.2621073722839355, -2.34230375289917, 0.2612205743789673, 2.0608396530151367, 0.2775290608406067, 0.06190043315291405, -1.3556931018829346, -0.7432165741920471, -0.2614608108997345, -0.408038854598999, -1.2462821006774902, 0.555312991142273, -0.25234392285346985, -0.7525430917739868, -1.4487073421478271, 0.11118432879447937, -1.0698796510696411, -1.7321672439575195, 0.17480610311031342, 1.884009838104248, 2.0203142166137695, -0.6565149426460266, 1.4868730306625366, -0.2377524971961975, 0.24741330742835999, 1.242717981338501, 1.1353756189346313, 3.135563611984253, 1.9816153049468994, -1.281083345413208, 0.7290903925895691, -0.026399940252304077, -0.45683732628822327, 1.2045783996582031, -1.1123710870742798, 1.2818564176559448, -0.2859632968902588, -1.2562860250473022, -1.2405873537063599, 0.9530569314956665, 0.401969850063324, 0.08117566257715225, -0.49305692315101624, 1.2459609508514404, 0.03178144246339798, 1.314550518989563, 0.5811464190483093, -0.35851025581359863, 0.5973501801490784, -0.4463222324848175, -0.5898666977882385, 1.6453520059585571, 0.24918216466903687, -1.4606640338897705, -2.3305728435516357, -0.30865901708602905, -0.840969979763031, -0.0550810880959034, -0.6215081810951233, -1.0087316036224365, 1.5731450319290161, 0.4762924909591675, -1.1319838762283325, -0.2791040539741516, -0.32517388463020325, -0.6417065858840942, 2.7352194786071777, -1.3851350545883179, -0.19333232939243317, -0.9535081386566162, -0.6878525614738464, 1.6169428825378418, -1.2336270809173584, -0.21551750600337982, -1.1062260866165161, -0.5889115333557129, -1.2933623790740967, -0.5272752046585083, -0.027859684079885483, -0.949529230594635, 0.8201160430908203, 0.08306152373552322, -1.2093967199325562, -0.2404472678899765, -0.9649572968482971, 0.8428299427032471, -0.06704258918762207, 0.2476191520690918, 1.84799325466156, 0.40339505672454834, -0.3617434799671173, 0.7915802001953125, 1.1023054122924805, 0.6564976572990417, -0.6856025457382202, 0.15381260216236115, -0.6118276715278625, 0.35119396448135376, -1.2054545879364014, 0.29430320858955383, -2.8754076957702637, 0.6832780241966248, -0.07049092650413513, -0.06299339979887009, -0.03252837434411049, -1.271537184715271, 1.0184217691421509, 2.557779312133789, -1.2523680925369263, 0.5109261274337769, 0.33863288164138794, 1.1846035718917847, -1.6086606979370117, 0.32073038816452026, -0.46017757058143616, 2.196049928665161, 0.16506536304950714, 1.1390845775604248, -0.5209412574768066, -2.288437843322754, 0.6354121565818787, -1.2361265420913696, -1.176958680152893, 0.7757842540740967, -0.8365100026130676, 0.1753612756729126, -1.3878363370895386, -0.15059982240200043, -0.7746405005455017, -1.2437392473220825, 0.6302873492240906, 0.03769111633300781, 0.4479721784591675, -0.5440868139266968, 0.3184430003166199, -2.2379539012908936, -1.3374890089035034, -0.23428963124752045, -0.9324651956558228, 0.44621044397354126, -0.27638378739356995, 0.7590987682342529, -0.1328882873058319, 0.040556296706199646, 0.30121564865112305, 1.3465003967285156, 3.3532063961029053, 0.09655622392892838, 0.2779797911643982, -0.13418282568454742, -0.9682971835136414, 1.472220540046692, 0.9939364194869995, -0.17758533358573914, -0.6104581356048584, -0.9637560844421387, 1.2923189401626587, 2.0246591567993164, 0.9593395590782166, 0.049268584698438644, -0.7402046918869019, -0.6368341445922852, 0.08228235691785812, 0.1853991150856018, 0.5661804676055908, 0.9126560091972351, 0.09255465865135193, 0.07837599515914917, 1.5091487169265747, 1.1515684127807617, -0.31123724579811096, 0.3117053508758545, -0.7782003283500671, -0.4469570815563202, 0.5677391886711121, 0.35519829392433167, -0.05561862885951996, 0.3786119520664215, -1.023260235786438, -0.22196340560913086, -0.35409119725227356, -0.9715836644172668, -0.7019274234771729, -0.3994999825954437, -0.4510675370693207, 1.6883504390716553, 0.12570536136627197, -0.5679196119308472, -0.0002891058102250099, -0.7539697885513306, -0.0964697003364563, -1.0376275777816772, 0.3329976499080658, -0.16910624504089355, 0.0010766973719000816, -0.09571264684200287, 1.793483018875122, -1.007139801979065, -2.163456916809082, 0.1315888911485672, 0.2777223587036133, -0.2640775442123413, 0.08144388347864151, 1.62379789352417, 0.5248923301696777, 1.479135513305664, 1.3795788288116455, 0.9384052157402039, -0.7098599672317505, -1.3458871841430664, 0.6808937191963196, 0.9443380236625671, -1.426641583442688, 0.8489391207695007, -0.04258253797888756, -0.5893486142158508, 0.6650211215019226, 1.3184382915496826, 0.4403441548347473, -2.0117576122283936, 0.781247615814209, -0.9784733057022095, 0.7379094362258911, 0.7414541244506836, 0.7855632305145264, 0.16233447194099426, 0.7895383834838867, -1.2703090906143188, -1.0636427402496338, -0.7225620746612549, -0.6415284872055054, 1.9262869358062744, -0.3118637800216675, 0.5181757807731628, -0.11843177676200867, -1.3002837896347046, -0.024961180984973907, 0.6485072374343872, 0.3564302325248718, -0.3911331593990326, 0.831790566444397, -0.6454179286956787, -1.250518798828125, -1.3535994291305542, -0.45399466156959534, -1.0357412099838257, -0.9600450992584229, 1.0562896728515625, 0.762634813785553, 0.35327503085136414, 1.8297028541564941, 0.6113683581352234, 0.19855594635009766, -2.5804643630981445, 0.9125252962112427, 0.28940755128860474, -0.034205444157123566, 0.8356483578681946, 0.28179997205734253, 1.1454380750656128, -0.03807912766933441, 0.5666134357452393, -2.3868229389190674, 2.264348030090332, -0.2809983789920807, 0.7209639549255371, 0.03542110696434975, -0.12094192206859589, 0.998976469039917, 0.5624755620956421, 0.6303900480270386, -1.0633113384246826, 0.7689609527587891, -0.6007338166236877, 1.2365748882293701, 0.9782914519309998, -0.8546635508537292, 0.0007544225081801414, 1.3569985628128052, 0.43761515617370605, -0.5246267318725586, -0.9640316367149353, -0.9274917840957642, 0.9767323136329651, 1.7660181522369385, -0.048936955630779266, 0.007643991149961948, 0.8101955056190491, 0.658258318901062, -1.3655376434326172, 0.0979585126042366, -0.7345676422119141, -0.7105579376220703, 1.6792411804199219, 2.0686845779418945, -0.0484442263841629, -0.09072443842887878, -0.7606374621391296, -1.340951919555664, 0.7613336443901062, 0.05962790176272392, 0.09460149705410004, 0.7283514738082886, -0.6376386284828186, 1.0154856443405151, 0.8102420568466187, 0.9877451062202454, 0.1693456918001175, 0.2916807532310486, 0.2874555289745331, -0.23712944984436035, -1.1853104829788208, -0.22347915172576904, -1.067394733428955, -2.532073497772217, 0.4521341919898987, -0.3171493113040924, -1.5091578960418701, 0.08910547196865082, -1.018003225326538, 0.8971337676048279, -0.5402431488037109, -1.1565728187561035, -1.4969505071640015, 0.25047725439071655, -0.14887495338916779, 0.8590363264083862, -1.593171238899231, -0.10458094626665115, 1.3122079372406006, 0.8486672043800354, -0.680686354637146, 1.0846467018127441, 0.31228527426719666, 1.0162429809570312, 0.7731524109840393, -0.3807654082775116, 0.48986151814460754, 0.16736117005348206, -1.3493283987045288, 0.4811359941959381, 1.23728609085083, 0.1744024157524109, 1.4764444828033447, -0.559078574180603, 0.006791618652641773, 0.4236639440059662, -0.4105614125728607, -0.3992514908313751, -0.6914737224578857, 0.7130818963050842, 0.0004895050078630447, -0.8391844034194946, -0.015486117452383041, -0.08889687061309814, -0.2346706986427307, 0.2548607587814331, -1.4632474184036255, -0.13136295974254608, -0.39428940415382385, -0.6105457544326782, -1.2305141687393188, -0.10293266177177429, 1.4427039623260498, -0.7617601752281189, -0.14998272061347961, 0.45721498131752014, 0.36632996797561646, 0.5741834044456482, 0.6921404600143433, -0.6755613684654236, -0.2903636693954468, -0.22949185967445374, -0.32362836599349976, 0.2855271100997925, 1.3333094120025635, -0.17448009550571442, -1.0160846710205078, 0.7137579321861267, -0.31385961174964905, 0.06614425778388977, 1.960024118423462, 0.13640721142292023, -0.821374237537384, 0.30449479818344116, -0.7348194718360901, 1.9895519018173218, 1.6750977039337158, 1.3487398624420166, -0.13605374097824097, -0.9833038449287415, 0.5847169160842896, -0.25953206419944763, -0.3520909547805786, 0.923848569393158, 0.4912456274032593, -0.21194377541542053, -1.2887760400772095, 0.7445282340049744, 1.2212791442871094, -0.8585481643676758, -0.792474091053009, 0.14366310834884644, -0.8269291520118713, 1.1518551111221313, 0.7103818655014038, 0.47411298751831055, 0.19936519861221313, 1.6595944166183472, 0.7348765730857849, -0.5237998366355896, 0.4926462173461914, 0.5521114468574524, -0.1341596096754074, -2.0028488636016846, -1.1160105466842651, 0.35614192485809326, -0.5760338306427002, -1.55984628200531, 1.3843787908554077, -1.2157025337219238, -0.8992055058479309, 0.509731650352478, 0.09983958303928375, 1.3854029178619385, 0.3496055603027344, 1.5891000032424927, 1.9934483766555786, 0.9581063985824585, 0.3986397683620453, 1.32445228099823, -0.11512941122055054, -0.39297956228256226, 1.7383512258529663, -0.3823792338371277, 0.5077967047691345, 1.200592041015625, -0.4545508325099945, -1.0768260955810547, -0.7281548380851746, -1.1160441637039185, -0.5982156991958618, 1.044906497001648, 0.09781453758478165, -1.1546885967254639, 0.2503860294818878, 1.5016926527023315, 0.13120916485786438, -0.2699996531009674, 0.6602763533592224, 0.3734697997570038, -0.7674811482429504, -0.11707016825675964, -0.9686923623085022, 0.4725607931613922, -0.3179708421230316, -0.33869901299476624, 0.25879549980163574, 0.5074528455734253, 1.3558542728424072, 0.038060154765844345, 0.22395075857639313, 1.2830145359039307, -1.345529556274414, 1.3803014755249023, -0.7139252424240112, 0.18219846487045288, -2.296433210372925, 1.3354575634002686, -0.7653471231460571, 1.923964262008667, -2.703007698059082, 0.4352632761001587, -0.5974965691566467, -0.4729299545288086, 0.3045925796031952, -0.308546781539917, 0.11608988791704178, -0.08470248430967331, -1.1568933725357056, -0.10692991316318512, -0.7913019061088562, 0.52285236120224, 1.1718255281448364, 1.2883896827697754, -1.0917134284973145, -0.296296089887619, -1.6521199941635132, -0.27230221033096313, -0.6881803274154663, 0.39200732111930847, -1.9123152494430542, -0.10877906531095505, -1.9227370023727417, -2.505244493484497, -1.3076939582824707, -0.8710804581642151, 1.1501623392105103, 0.1512242704629898, -0.8787596821784973, 1.2075603008270264, -0.331455260515213, -1.7618576288223267, 1.13113534450531, -2.174856185913086 ]
https://github.com/huggingface/datasets/issues/3123
Segmentation fault when loading datasets from file
Hi ! I created an issue on Arrow's JIRA after making a minimum reproducible example https://issues.apache.org/jira/browse/ARROW-14439 ```python import io import pyarrow.json as paj batch = b'{"a": [], "b": 1}\n{"b": 1}' block_size = 12 paj.read_json( io.BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size) ) ``` I don't see a way to workaround this properly now without hurting the performance of the JSON loader significantly though
## Describe the bug Custom dataset loading sometimes segfaults and kills the process if chunks contain a variety of features/ ## Steps to reproduce the bug Download an example file: ``` wget https://gist.githubusercontent.com/TevenLeScao/11e2184394b3fa47d693de2550942c6b/raw/4232704d08fbfcaf93e5b51def9e5051507651ad/tiny_kelm.jsonl ``` Then in Python: ``` import datasets tiny_kelm = datasets.load_dataset("json", data_files="tiny_kelm.jsonl", chunksize=100000) ``` ## Expected results a `tiny_kelm` functional dataset ## Actual results ☠️ `Segmentation fault (core dumped)` ☠️ ## Environment info - `datasets` version: 1.14.0 - Platform: Linux-5.11.0-38-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 5.0.0
1,161
58
Segmentation fault when loading datasets from file ## Describe the bug Custom dataset loading sometimes segfaults and kills the process if chunks contain a variety of features/ ## Steps to reproduce the bug Download an example file: ``` wget https://gist.githubusercontent.com/TevenLeScao/11e2184394b3fa47d693de2550942c6b/raw/4232704d08fbfcaf93e5b51def9e5051507651ad/tiny_kelm.jsonl ``` Then in Python: ``` import datasets tiny_kelm = datasets.load_dataset("json", data_files="tiny_kelm.jsonl", chunksize=100000) ``` ## Expected results a `tiny_kelm` functional dataset ## Actual results ☠️ `Segmentation fault (core dumped)` ☠️ ## Environment info - `datasets` version: 1.14.0 - Platform: Linux-5.11.0-38-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 5.0.0 Hi ! I created an issue on Arrow's JIRA after making a minimum reproducible example https://issues.apache.org/jira/browse/ARROW-14439 ```python import io import pyarrow.json as paj batch = b'{"a": [], "b": 1}\n{"b": 1}' block_size = 12 paj.read_json( io.BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size) ) ``` I don't see a way to workaround this properly now without hurting the performance of the JSON loader significantly though
[ -1.162652850151062, -0.8511763215065002, -0.7794715762138367, 1.5373163223266602, -0.12165305763483047, -1.2352145910263062, 0.14369723200798035, -1.029338002204895, 1.6951777935028076, -0.7259195446968079, 0.35328078269958496, -1.673929214477539, -0.0071411943063139915, -0.6026132106781006, -0.7719212770462036, -0.8193842768669128, -0.362119197845459, -0.7664906978607178, 1.0486174821853638, 2.4997925758361816, 1.2027723789215088, -1.3822100162506104, 2.7375011444091797, 0.7108526229858398, -0.3071609139442444, -0.9376431107521057, 0.5104677081108093, 0.007317592389881611, -1.2809224128723145, -0.45943158864974976, -0.8806970715522766, -0.10444200038909912, -0.5266345739364624, -0.5595085620880127, -0.022943563759326935, 0.4447650909423828, -0.30640947818756104, -0.5076414942741394, -0.4689773619174957, -0.7050378918647766, 0.39969301223754883, -0.3744402825832367, 0.8899542093276978, -0.30306676030158997, 1.834032654762268, -0.6139865517616272, 0.4017274081707001, 0.747861385345459, 1.2934881448745728, 0.2206435650587082, 0.0464961901307106, 0.37829524278640747, 0.4115055799484253, -0.07982803136110306, 0.5449215173721313, 1.1691997051239014, 0.6595417261123657, 0.4906701147556305, 0.7509872317314148, -2.1914560794830322, 1.3239713907241821, -1.0097123384475708, 0.2284063994884491, 1.3467622995376587, -0.9713366031646729, 0.38050514459609985, -1.7908295392990112, -0.0038888128474354744, 0.5593461394309998, -2.245626211166382, 0.3199004530906677, -1.3346595764160156, -0.564213752746582, 1.0315135717391968, 0.3309728801250458, -1.2489105463027954, 0.10242785513401031, -0.404339998960495, 1.0167371034622192, 0.40198230743408203, 1.112395167350769, -1.6889622211456299, -0.10503264516592026, -0.2839953899383545, 0.11122572422027588, -1.3001521825790405, -1.5688904523849487, 0.5191042423248291, 0.5953171253204346, 0.6584100127220154, -0.08141475915908813, 1.008507490158081, -1.025999665260315, 0.748145580291748, -1.0352224111557007, -1.777383804321289, -1.4234510660171509, -2.245980739593506, -2.250103712081909, 0.7786397337913513, -0.46406126022338867, -0.47346803545951843, 2.0440878868103027, -0.9744768142700195, -1.7457876205444336, 1.0775049924850464, 0.33550700545310974, -0.09362328797578812, 2.390596389770508, 0.24157512187957764, -0.744451105594635, 0.44846203923225403, -0.7519578337669373, 0.7609401345252991, -0.39546042680740356, 1.3272455930709839, 0.4700039327144623, -1.0350208282470703, 1.5855810642242432, -0.31936973333358765, 0.6184508800506592, -0.7100076675415039, -0.48191043734550476, -0.7883171439170837, 0.30256009101867676, 1.9277526140213013, -0.33365124464035034, 1.5278140306472778, -0.315992534160614, -1.566720724105835, -1.5748968124389648, 0.8718435764312744, 0.46408700942993164, -0.7729299664497375, 0.19693942368030548, -0.3973276913166046, 0.1118377074599266, -0.07953476160764694, 1.153369426727295, 1.2523818016052246, 0.7382749915122986, -0.3325766324996948, -0.8309440016746521, 0.24355673789978027, -0.025348804891109467, -0.7094401121139526, -1.7511231899261475, -0.32939285039901733, 0.16621331870555878, 0.6089762449264526, -1.2372214794158936, 1.7388471364974976, 0.8520745038986206, 1.8629556894302368, 1.0364545583724976, -0.3697216212749481, 1.5080761909484863, 0.03895417973399162, 1.9081693887710571, -0.4980415105819702, 0.6942675709724426, -0.34819552302360535, -1.1481012105941772, 0.8430668115615845, -0.32379570603370667, -2.0770082473754883, -0.7464070916175842, -0.7854629755020142, -0.19381015002727509, -0.7719486355781555, 0.904121994972229, -0.2778765857219696, -1.4141337871551514, 0.21543815732002258, -0.7348136305809021, 0.1322031170129776, -1.251147985458374, 0.32733526825904846, 0.7268227934837341, -0.5893474221229553, 0.06716912239789963, -0.2039535492658615, -1.2085597515106201, -0.45418649911880493, 0.3311269283294678, 1.900733232498169, -0.720272421836853, 0.9383293390274048, 1.0207648277282715, -0.7663707137107849, 0.03243573009967804, 0.3748759627342224, -0.3253583014011383, 0.8852449059486389, -1.091170310974121, -0.4124719500541687, 1.1138477325439453, -0.1821371465921402, -0.5869352221488953, 1.4767862558364868, 0.7653169631958008, -0.9982104301452637, -0.2244415134191513, -0.17085032165050507, -0.8455226421356201, 0.08050345629453659, -1.56766676902771, -0.1519690901041031, 0.41803407669067383, -1.5563850402832031, -0.5007100105285645, -0.24213926494121552, 1.3101274967193604, -0.2062518447637558, 1.382578730583191, -0.3041855990886688, -0.18357715010643005, -0.33744099736213684, -0.3667415976524353, 0.12954990565776825, -0.23203536868095398, -0.5925691723823547, 0.20037098228931427, -0.7612448930740356, 0.3500726819038391, 1.4375536441802979, 0.3452111482620239, 0.05027644336223602, 0.48413753509521484, 1.149996280670166, 0.37684503197669983, -0.030832521617412567, -0.8759097456932068, -1.5357513427734375, 2.001357316970825, -1.4824475049972534, 1.9987103939056396, 0.7948428988456726, -0.05553605034947395, -1.774343729019165, -1.9690179824829102, 1.3751029968261719, 1.1391174793243408, 2.409013032913208, 0.6128938794136047, 0.398093044757843, -0.7430890202522278, -0.7122650146484375, 0.3208438754081726, -1.0692336559295654, -0.6733896136283875, 0.191293865442276, 2.367171287536621, 1.7129968404769897, -0.4491861164569855, -0.2325781136751175, -0.9948344826698303, 1.398851752281189, -0.12734587490558624, 0.18275634944438934, 2.0802133083343506, -0.2466174066066742, -1.0762903690338135, 1.254865288734436, -2.3673741817474365, 0.21228614449501038, 1.9877722263336182, 0.2567875385284424, 0.06434892117977142, -1.3946353197097778, -0.6474676132202148, -0.26548314094543457, -0.43584051728248596, -1.2036646604537964, 0.5622760057449341, -0.16303317248821259, -0.7798517942428589, -1.4588490724563599, 0.16590562462806702, -1.1177459955215454, -1.7002004384994507, 0.2901439070701599, 1.9139468669891357, 1.9964795112609863, -0.7840047478675842, 1.5558048486709595, -0.2704487144947052, 0.13568152487277985, 1.2543333768844604, 1.2373319864273071, 3.1569252014160156, 1.8377313613891602, -1.2348582744598389, 0.6252468824386597, -0.15721945464611053, -0.4865950047969818, 1.1512293815612793, -1.2457777261734009, 1.2211394309997559, -0.1616111695766449, -1.150069236755371, -1.2457636594772339, 0.8762373328208923, 0.467247873544693, 0.04777897521853447, -0.5339468717575073, 1.1854890584945679, 0.11933059245347977, 1.3661701679229736, 0.5731805562973022, -0.24713179469108582, 0.6654897332191467, -0.3821430504322052, -0.42740756273269653, 1.572020411491394, 0.16069522500038147, -1.3490939140319824, -2.3218371868133545, -0.20953023433685303, -0.8279963135719299, 0.072899229824543, -0.5818687081336975, -1.058173418045044, 1.668910264968872, 0.4290243685245514, -1.2214850187301636, -0.2672075033187866, -0.33963003754615784, -0.5630879402160645, 2.7185423374176025, -1.3831310272216797, -0.16757966578006744, -1.028916835784912, -0.6419128179550171, 1.6702194213867188, -1.199167251586914, -0.2677505612373352, -1.0264471769332886, -0.5206691026687622, -1.31596839427948, -0.5380089282989502, -0.022136203944683075, -0.8728310465812683, 0.8519512414932251, 0.16287001967430115, -1.1853563785552979, -0.3365134298801422, -0.9042462706565857, 0.8665692210197449, -0.14803287386894226, 0.2677634656429291, 1.8121230602264404, 0.41423436999320984, -0.31060683727264404, 0.7447178363800049, 1.146403193473816, 0.6050983667373657, -0.6197824478149414, 0.27324777841567993, -0.6463459730148315, 0.2378920316696167, -1.2988063097000122, 0.30715760588645935, -2.8233723640441895, 0.6371920704841614, -0.10601858049631119, -0.06470659375190735, -0.08460115641355515, -1.3392175436019897, 1.187012791633606, 2.5699949264526367, -1.1905720233917236, 0.519751250743866, 0.30913233757019043, 1.1981486082077026, -1.5760481357574463, 0.2712864577770233, -0.39445048570632935, 2.165558099746704, 0.1939200609922409, 1.2304898500442505, -0.39940422773361206, -2.356011152267456, 0.5975037813186646, -1.2406389713287354, -1.1345913410186768, 0.7653633952140808, -0.8625888228416443, 0.10496141761541367, -1.385932207107544, -0.24255725741386414, -0.8721159100532532, -1.2003883123397827, 0.7214797735214233, 0.11032775789499283, 0.424695760011673, -0.625236451625824, 0.3756890892982483, -2.1807210445404053, -1.3963892459869385, -0.24504896998405457, -0.9103812575340271, 0.46402379870414734, -0.31389209628105164, 0.655066192150116, -0.13269846141338348, 0.017772816121578217, 0.37307995557785034, 1.4881782531738281, 3.3045480251312256, 0.19548343122005463, 0.36672213673591614, -0.13230197131633759, -0.986354649066925, 1.4070056676864624, 0.9066352844238281, -0.11341238021850586, -0.6126493215560913, -1.1145615577697754, 1.2909172773361206, 1.9429891109466553, 1.0480109453201294, -0.014934430830180645, -0.7965871095657349, -0.8153652548789978, -0.04669716954231262, 0.1830524206161499, 0.4702411890029907, 0.8672569394111633, 0.11982395499944687, 0.022666696459054947, 1.3721697330474854, 1.1638591289520264, -0.4381275475025177, 0.3737466037273407, -0.8554597496986389, -0.45235612988471985, 0.43651777505874634, 0.27301594614982605, 0.029110144823789597, 0.31609609723091125, -1.0718889236450195, -0.2596139907836914, -0.3596870005130768, -0.906959056854248, -0.7800164222717285, -0.4157702326774597, -0.3294098675251007, 1.6601485013961792, 0.02713148668408394, -0.5049049258232117, -0.07065767794847488, -0.776789665222168, -0.09451622515916824, -1.034894347190857, 0.28347712755203247, -0.1882428377866745, -0.13464459776878357, -0.08572632819414139, 1.7640372514724731, -0.9733971357345581, -2.0360729694366455, 0.2684043347835541, 0.24476179480552673, -0.37928223609924316, 0.21950623393058777, 1.705432653427124, 0.570576012134552, 1.399239420890808, 1.340253472328186, 0.955436110496521, -0.7319290637969971, -1.2646716833114624, 0.6400030255317688, 0.9919277429580688, -1.3399289846420288, 0.7469063997268677, 0.0022309785708785057, -0.48656773567199707, 0.5719149708747864, 1.3210734128952026, 0.45579397678375244, -2.0767974853515625, 0.7388070225715637, -0.9393224716186523, 0.7681026458740234, 0.7067175507545471, 0.7115983366966248, 0.1593685895204544, 0.7722012996673584, -1.2628862857818604, -1.0976839065551758, -0.7229276299476624, -0.6819255948066711, 1.952665090560913, -0.2644113302230835, 0.5416752099990845, -0.1461275815963745, -1.296583890914917, -0.09405279904603958, 0.65840744972229, 0.40685388445854187, -0.5117783546447754, 0.7778711318969727, -0.618348240852356, -1.0985522270202637, -1.381753921508789, -0.48338741064071655, -1.0265190601348877, -0.9412472248077393, 0.9561876058578491, 0.8097468614578247, 0.3003064692020416, 1.894798755645752, 0.6795323491096497, 0.23511166870594025, -2.609304666519165, 0.880237877368927, 0.31700795888900757, -0.08701764792203903, 0.9273049235343933, 0.33887237310409546, 0.9836224913597107, -0.01704917661845684, 0.5725892782211304, -2.4192094802856445, 2.308403968811035, -0.2727126479148865, 0.7181734442710876, -0.029354941099882126, -0.18998825550079346, 1.0970553159713745, 0.5116991996765137, 0.5925329923629761, -1.0929157733917236, 0.6886833906173706, -0.6202346086502075, 1.2415823936462402, 0.8677815794944763, -0.8437541723251343, -0.0245363749563694, 1.3165738582611084, 0.4366550147533417, -0.5207339525222778, -0.9108072519302368, -0.9903662204742432, 0.920503556728363, 1.7930783033370972, -0.0349290557205677, 0.01321358885616064, 0.8617881536483765, 0.6516357064247131, -1.3047157526016235, 0.0462186336517334, -0.7151140570640564, -0.7632231116294861, 1.6736806631088257, 2.0964725017547607, -0.1418016105890274, -0.22029457986354828, -0.808927595615387, -1.228528618812561, 0.7878251075744629, 0.03636109456419945, 0.06370599567890167, 0.6778717041015625, -0.6709480881690979, 1.1357855796813965, 0.868402898311615, 0.9873263239860535, 0.18565532565116882, 0.3241659700870514, 0.35690781474113464, -0.3067129850387573, -1.2146037817001343, -0.29981932044029236, -1.0819483995437622, -2.570457935333252, 0.47565948963165283, -0.23905694484710693, -1.4054393768310547, 0.0006903950124979019, -1.0642205476760864, 0.8670457601547241, -0.5838251709938049, -1.0569325685501099, -1.4850701093673706, 0.2235393077135086, -0.11699758470058441, 0.906640350818634, -1.5455613136291504, -0.14323611557483673, 1.2845511436462402, 0.9182143807411194, -0.6267129778862, 0.959883451461792, 0.21641020476818085, 1.01560378074646, 0.8863800168037415, -0.3531975746154785, 0.5168164372444153, 0.07208215445280075, -1.3561493158340454, 0.5029099583625793, 1.2575180530548096, 0.19948148727416992, 1.5454579591751099, -0.562519907951355, -0.0024265567772090435, 0.3910129964351654, -0.5120368599891663, -0.469696044921875, -0.5621019005775452, 0.7103583216667175, 0.04591548815369606, -0.9796724319458008, 0.04232590273022652, -0.029532913118600845, -0.11776340752840042, 0.23202888667583466, -1.514115333557129, -0.19477379322052002, -0.3637712895870209, -0.6349490284919739, -1.1925735473632812, -0.09000880271196365, 1.2900251150131226, -0.776791512966156, -0.2123962789773941, 0.4986579716205597, 0.31411635875701904, 0.5297078490257263, 0.5930987596511841, -0.7071589231491089, -0.38916656374931335, -0.2261568158864975, -0.40835776925086975, 0.3538638949394226, 1.280288815498352, -0.08994210511445999, -0.9401366710662842, 0.6616662740707397, -0.3868334889411926, 0.09419538080692291, 1.9037210941314697, 0.022754069417715073, -0.8063040375709534, 0.3157776892185211, -0.7051734924316406, 1.9406719207763672, 1.6771339178085327, 1.3375118970870972, -0.10600749403238297, -0.9593727588653564, 0.6862574219703674, -0.33734315633773804, -0.42559814453125, 0.959376871585846, 0.4040762186050415, -0.2779880464076996, -1.3769046068191528, 0.662850022315979, 1.2728158235549927, -0.9771234393119812, -0.8688436150550842, 0.14391934871673584, -0.8184233903884888, 1.1148179769515991, 0.6761181950569153, 0.3431497812271118, 0.2884921133518219, 1.5787198543548584, 0.7714437246322632, -0.4560920298099518, 0.5466015934944153, 0.4432680606842041, -0.1453840583562851, -2.0750234127044678, -1.1635260581970215, 0.33961132168769836, -0.47808995842933655, -1.5853307247161865, 1.4183127880096436, -1.126371145248413, -0.968206524848938, 0.5829308032989502, 0.11450207233428955, 1.422956943511963, 0.336443692445755, 1.6243385076522827, 2.0033113956451416, 0.8711866736412048, 0.3179265260696411, 1.201496958732605, -0.2221381962299347, -0.5375133156776428, 1.8109877109527588, -0.48740556836128235, 0.49045610427856445, 1.0581055879592896, -0.2972364127635956, -1.1202043294906616, -0.8551796674728394, -1.2736042737960815, -0.7412445545196533, 1.2098305225372314, 0.08727844804525375, -1.1523079872131348, 0.30349791049957275, 1.5957152843475342, 0.1283339560031891, -0.3016337454319, 0.6318228244781494, 0.41463467478752136, -0.7866166234016418, -0.06844520568847656, -0.9368128180503845, 0.5124995112419128, -0.1761358678340912, -0.3674449026584625, 0.30728834867477417, 0.4752318859100342, 1.323184609413147, 0.027013972401618958, 0.056690964847803116, 1.1541988849639893, -1.4366487264633179, 1.552019715309143, -0.728458821773529, 0.287132203578949, -2.3294172286987305, 1.4406545162200928, -0.8398132920265198, 1.96189284324646, -2.5970375537872314, 0.48821040987968445, -0.5290439128875732, -0.4503593444824219, 0.2809366285800934, -0.3082696199417114, 0.193204864859581, -0.2008689045906067, -1.0982989072799683, -0.1603410542011261, -0.7624743580818176, 0.6133527159690857, 1.148636817932129, 1.4268465042114258, -1.0639162063598633, -0.2695341408252716, -1.7169958353042603, -0.11230743676424026, -0.6883149147033691, 0.2892276644706726, -1.9611127376556396, -0.1744145303964615, -1.9614782333374023, -2.3530354499816895, -1.2749910354614258, -0.8299906849861145, 1.0571657419204712, 0.10698562860488892, -0.9005688428878784, 1.1128777265548706, -0.38057276606559753, -1.8062955141067505, 1.1588205099105835, -2.1344826221466064 ]
https://github.com/huggingface/datasets/issues/3123
Segmentation fault when loading datasets from file
The issue has been fixed in pyarrow 6.0.0, please update pyarrow :) The issue was due to missing fields in the JSON data of type list. Now it's working fine and missing list fields are replaced with empty lists
## Describe the bug Custom dataset loading sometimes segfaults and kills the process if chunks contain a variety of features/ ## Steps to reproduce the bug Download an example file: ``` wget https://gist.githubusercontent.com/TevenLeScao/11e2184394b3fa47d693de2550942c6b/raw/4232704d08fbfcaf93e5b51def9e5051507651ad/tiny_kelm.jsonl ``` Then in Python: ``` import datasets tiny_kelm = datasets.load_dataset("json", data_files="tiny_kelm.jsonl", chunksize=100000) ``` ## Expected results a `tiny_kelm` functional dataset ## Actual results ☠️ `Segmentation fault (core dumped)` ☠️ ## Environment info - `datasets` version: 1.14.0 - Platform: Linux-5.11.0-38-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 5.0.0
1,161
39
Segmentation fault when loading datasets from file ## Describe the bug Custom dataset loading sometimes segfaults and kills the process if chunks contain a variety of features/ ## Steps to reproduce the bug Download an example file: ``` wget https://gist.githubusercontent.com/TevenLeScao/11e2184394b3fa47d693de2550942c6b/raw/4232704d08fbfcaf93e5b51def9e5051507651ad/tiny_kelm.jsonl ``` Then in Python: ``` import datasets tiny_kelm = datasets.load_dataset("json", data_files="tiny_kelm.jsonl", chunksize=100000) ``` ## Expected results a `tiny_kelm` functional dataset ## Actual results ☠️ `Segmentation fault (core dumped)` ☠️ ## Environment info - `datasets` version: 1.14.0 - Platform: Linux-5.11.0-38-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 5.0.0 The issue has been fixed in pyarrow 6.0.0, please update pyarrow :) The issue was due to missing fields in the JSON data of type list. Now it's working fine and missing list fields are replaced with empty lists
[ -1.1747406721115112, -0.8085299730300903, -0.7923359274864197, 1.4749140739440918, -0.12760832905769348, -1.239095687866211, 0.16308532655239105, -1.0328837633132935, 1.6969166994094849, -0.7629347443580627, 0.2841615080833435, -1.7005689144134521, 0.02284514158964157, -0.5960378050804138, -0.7752609848976135, -0.8687902688980103, -0.4242202043533325, -0.7577957510948181, 1.0005685091018677, 2.505385398864746, 1.1385918855667114, -1.3703325986862183, 2.7284770011901855, 0.7153281569480896, -0.2726288139820099, -0.9280577301979065, 0.52424156665802, 0.025537531822919846, -1.2979886531829834, -0.4307137131690979, -0.8742014169692993, -0.09044132381677628, -0.5260238647460938, -0.5949358344078064, 0.010897026397287846, 0.3585363030433655, -0.3333205580711365, -0.4610157310962677, -0.39712923765182495, -0.768085777759552, 0.3956763446331024, -0.3756924867630005, 0.8646530508995056, -0.33461734652519226, 1.8531975746154785, -0.5587526559829712, 0.4295755624771118, 0.7377002239227295, 1.2628501653671265, 0.19104376435279846, 0.0021641524508595467, 0.3579389154911041, 0.33356621861457825, -0.02159249596297741, 0.4992374777793884, 1.1571729183197021, 0.6509976387023926, 0.4683069884777069, 0.7143781781196594, -2.1980443000793457, 1.3289573192596436, -0.9968578815460205, 0.19265033304691315, 1.3443957567214966, -1.0002250671386719, 0.3864402174949646, -1.774160385131836, -0.03292020782828331, 0.5562935471534729, -2.3130455017089844, 0.2700227200984955, -1.3065129518508911, -0.5029990673065186, 1.054551362991333, 0.32895219326019287, -1.2328487634658813, 0.09099139273166656, -0.4126327335834503, 1.0537270307540894, 0.48800045251846313, 1.1599743366241455, -1.7051745653152466, -0.1001223549246788, -0.3346211612224579, 0.057904817163944244, -1.3502758741378784, -1.5529783964157104, 0.4887230694293976, 0.6729525923728943, 0.6935940384864807, -0.042248085141181946, 0.9623528122901917, -0.982966959476471, 0.7198123931884766, -1.0076404809951782, -1.7035562992095947, -1.383312702178955, -2.266146183013916, -2.2685084342956543, 0.8541393280029297, -0.426480770111084, -0.5027124285697937, 2.015768051147461, -0.9810035228729248, -1.7656104564666748, 1.1256431341171265, 0.3254772126674652, -0.11377324163913727, 2.4072020053863525, 0.24926084280014038, -0.7411694526672363, 0.46543940901756287, -0.7265820503234863, 0.7279675602912903, -0.37452587485313416, 1.333403468132019, 0.47799310088157654, -1.0800914764404297, 1.5373013019561768, -0.3768278658390045, 0.6365362405776978, -0.699349045753479, -0.5490444302558899, -0.8164196610450745, 0.314008891582489, 1.877791166305542, -0.321636438369751, 1.5268117189407349, -0.2567315399646759, -1.5683811902999878, -1.5761638879776, 0.8624333143234253, 0.45684751868247986, -0.7596643567085266, 0.19272218644618988, -0.2994367182254791, 0.044349752366542816, -0.03982672840356827, 1.0596593618392944, 1.2382045984268188, 0.6814780235290527, -0.32014980912208557, -0.8505018949508667, 0.31879720091819763, -0.017820850014686584, -0.7187645435333252, -1.785776138305664, -0.34799623489379883, 0.14677076041698456, 0.6097944378852844, -1.2827205657958984, 1.6912205219268799, 0.8495267033576965, 1.8936870098114014, 1.0311099290847778, -0.34815654158592224, 1.501904010772705, 0.01620236039161682, 1.8909236192703247, -0.4395074248313904, 0.7212635278701782, -0.3122621178627014, -1.1636314392089844, 0.8230156898498535, -0.3455851972103119, -2.13004994392395, -0.7295602560043335, -0.7919387221336365, -0.17805767059326172, -0.7928335070610046, 0.9783177375793457, -0.2688921391963959, -1.4399983882904053, 0.25543883442878723, -0.7437689304351807, 0.16849355399608612, -1.3200041055679321, 0.31442850828170776, 0.7391212582588196, -0.587654709815979, -0.012503739446401596, -0.22165122628211975, -1.2253004312515259, -0.41081544756889343, 0.28841060400009155, 1.853959321975708, -0.7396196722984314, 0.9554453492164612, 0.9979416131973267, -0.7528349757194519, 0.015760574489831924, 0.36275631189346313, -0.3065605163574219, 0.9120122194290161, -1.1033509969711304, -0.37396830320358276, 1.1872082948684692, -0.18831107020378113, -0.5732244849205017, 1.492034912109375, 0.7854912877082825, -0.9861831665039062, -0.1728956252336502, -0.19007188081741333, -0.8272126913070679, 0.03763292357325554, -1.5908457040786743, -0.14479514956474304, 0.34450793266296387, -1.5360225439071655, -0.4773182272911072, -0.2202526479959488, 1.347427248954773, -0.177314892411232, 1.4168591499328613, -0.3313215672969818, -0.19117394089698792, -0.35283583402633667, -0.3926626145839691, 0.1592300534248352, -0.21145662665367126, -0.5592232346534729, 0.2580738663673401, -0.7263736724853516, 0.303646981716156, 1.4001185894012451, 0.39752158522605896, 0.0924033597111702, 0.5147185921669006, 1.095920205116272, 0.3305593729019165, -0.06472496688365936, -0.8575032353401184, -1.5932443141937256, 2.067034959793091, -1.4636465311050415, 1.983178734779358, 0.7733208537101746, -0.07362731546163559, -1.7511875629425049, -1.9801626205444336, 1.3969309329986572, 1.1461706161499023, 2.392373561859131, 0.6011801362037659, 0.4375380277633667, -0.7852146625518799, -0.7559544444084167, 0.2863568663597107, -1.0868992805480957, -0.7167122960090637, 0.19478842616081238, 2.3830699920654297, 1.6937342882156372, -0.42679885029792786, -0.19227738678455353, -1.0293344259262085, 1.3311117887496948, -0.14070264995098114, 0.14686748385429382, 2.0650436878204346, -0.23426967859268188, -1.1156576871871948, 1.1995185613632202, -2.3696296215057373, 0.17371255159378052, 1.9222391843795776, 0.27342575788497925, 0.0602530762553215, -1.4107108116149902, -0.6702367067337036, -0.277048259973526, -0.4371850788593292, -1.2180112600326538, 0.5820323824882507, -0.17156115174293518, -0.761134922504425, -1.4520941972732544, 0.1714869737625122, -1.0905224084854126, -1.68941330909729, 0.31381353735923767, 1.88056218624115, 2.0030574798583984, -0.794880211353302, 1.5780125856399536, -0.28138116002082825, 0.19420619308948517, 1.2202497720718384, 1.2064021825790405, 3.1479244232177734, 1.821082353591919, -1.2506778240203857, 0.6402484774589539, -0.11951391398906708, -0.4769158959388733, 1.1141204833984375, -1.226660966873169, 1.2651280164718628, -0.16716183722019196, -1.1906328201293945, -1.279881238937378, 0.8766767978668213, 0.435539573431015, 0.07138991355895996, -0.5623703598976135, 1.2255709171295166, 0.06081604212522507, 1.3758165836334229, 0.5008702874183655, -0.2166786938905716, 0.6587816476821899, -0.41070809960365295, -0.45981523394584656, 1.5659677982330322, 0.18161681294441223, -1.3876948356628418, -2.3786497116088867, -0.24598637223243713, -0.8189267516136169, 0.019470572471618652, -0.562675416469574, -1.009617805480957, 1.6801635026931763, 0.462336003780365, -1.1776633262634277, -0.3045714497566223, -0.2858056128025055, -0.5387279987335205, 2.7300169467926025, -1.4420974254608154, -0.1592804193496704, -0.9520748257637024, -0.6447509527206421, 1.6311465501785278, -1.203202724456787, -0.22682176530361176, -1.0345762968063354, -0.6166947484016418, -1.3069530725479126, -0.5540897250175476, -0.13279740512371063, -0.9306968450546265, 0.839605987071991, 0.22453559935092926, -1.1940510272979736, -0.29806894063949585, -0.9536295533180237, 0.8445636630058289, -0.09791645407676697, 0.309849351644516, 1.7762680053710938, 0.43477874994277954, -0.3133937418460846, 0.7199346423149109, 1.1456923484802246, 0.6330667734146118, -0.65189129114151, 0.22516228258609772, -0.6885178685188293, 0.27308833599090576, -1.2580318450927734, 0.2959005534648895, -2.8768229484558105, 0.6509690880775452, -0.12114138901233673, -0.04683205112814903, -0.10594391822814941, -1.3162978887557983, 1.1865220069885254, 2.5876195430755615, -1.1439024209976196, 0.4552011489868164, 0.34614917635917664, 1.2052578926086426, -1.539602279663086, 0.31525835394859314, -0.4274941682815552, 2.2474043369293213, 0.17651237547397614, 1.2307976484298706, -0.3826559782028198, -2.308499813079834, 0.632972240447998, -1.2531182765960693, -1.1675372123718262, 0.8237375617027283, -0.8257927298545837, 0.07761731743812561, -1.3462834358215332, -0.189076766371727, -0.7826992869377136, -1.2318626642227173, 0.7041797637939453, 0.11292359232902527, 0.46137431263923645, -0.575017511844635, 0.35512420535087585, -2.2049098014831543, -1.3660898208618164, -0.25223174691200256, -0.921034574508667, 0.42970383167266846, -0.31854262948036194, 0.7039263248443604, -0.14728152751922607, 0.001142248511314392, 0.41454005241394043, 1.439809799194336, 3.3254616260528564, 0.21543186902999878, 0.37734314799308777, -0.09037644416093826, -0.9714096188545227, 1.3784818649291992, 0.884641706943512, -0.13797184824943542, -0.6101366877555847, -1.0037219524383545, 1.2661757469177246, 1.936543583869934, 1.0684337615966797, -0.00843515433371067, -0.7654681205749512, -0.7358824014663696, 0.02279682457447052, 0.18336869776248932, 0.5067325830459595, 0.8161381483078003, 0.04262938350439072, 0.029943961650133133, 1.4280486106872559, 1.2245019674301147, -0.4474143087863922, 0.43327799439430237, -0.8288894295692444, -0.4619172513484955, 0.48014968633651733, 0.2806195616722107, 0.035179316997528076, 0.35349342226982117, -1.0616648197174072, -0.2111639827489853, -0.34725871682167053, -0.895967960357666, -0.7841136455535889, -0.42482608556747437, -0.3570370376110077, 1.7217172384262085, 0.009906238876283169, -0.4629928469657898, -0.003461572341620922, -0.7845127582550049, -0.07032552361488342, -1.0387208461761475, 0.3220031261444092, -0.17704308032989502, -0.09176486730575562, -0.06385743618011475, 1.7940171957015991, -1.003292202949524, -2.067467212677002, 0.28519049286842346, 0.2532157897949219, -0.3985455632209778, 0.16401386260986328, 1.6594929695129395, 0.5748629570007324, 1.5213252305984497, 1.32367742061615, 0.9647478461265564, -0.754905641078949, -1.2971962690353394, 0.662076473236084, 1.0304547548294067, -1.3946651220321655, 0.7472026944160461, -0.01789066568017006, -0.52972412109375, 0.5769665241241455, 1.3169500827789307, 0.41472601890563965, -2.0308022499084473, 0.8023561239242554, -0.8801462650299072, 0.6937385201454163, 0.7054573893547058, 0.7059511542320251, 0.1260639727115631, 0.7820886969566345, -1.3033522367477417, -1.0999367237091064, -0.7442026138305664, -0.5806445479393005, 1.9508177042007446, -0.22851625084877014, 0.514092743396759, -0.11442582309246063, -1.3401570320129395, -0.016004135832190514, 0.6309611201286316, 0.39993467926979065, -0.4489789307117462, 0.8011335730552673, -0.626527726650238, -1.0895590782165527, -1.4321205615997314, -0.4826112687587738, -1.0113862752914429, -0.9296108484268188, 0.9756843447685242, 0.8018174171447754, 0.31368640065193176, 1.8269009590148926, 0.6582306027412415, 0.21386206150054932, -2.6144328117370605, 0.8944202065467834, 0.27911636233329773, -0.11028967052698135, 0.9162973165512085, 0.28481346368789673, 1.0094993114471436, -0.01173456758260727, 0.5654619932174683, -2.4145913124084473, 2.2836735248565674, -0.2593299150466919, 0.640802264213562, 0.05142897740006447, -0.18983902037143707, 1.0427536964416504, 0.5222253799438477, 0.5936990976333618, -1.1076220273971558, 0.7241383194923401, -0.6367976069450378, 1.264519214630127, 0.8993949294090271, -0.8351970911026001, -0.007710644975304604, 1.270588994026184, 0.47657695412635803, -0.48637136816978455, -0.8978853821754456, -0.9801813364028931, 0.9016563296318054, 1.780706524848938, -0.0442926399409771, 0.037147413939237595, 0.8632495403289795, 0.6717837452888489, -1.3275943994522095, 0.05221327021718025, -0.7216380834579468, -0.7775484919548035, 1.6413019895553589, 2.1156299114227295, -0.0955008789896965, -0.21814686059951782, -0.8241241574287415, -1.185342788696289, 0.8163524866104126, 0.022372376173734665, 0.09746745973825455, 0.6820589303970337, -0.6731687784194946, 1.1442230939865112, 0.9108943939208984, 0.9568357467651367, 0.21705760061740875, 0.28479886054992676, 0.3199763894081116, -0.2886146903038025, -1.1484191417694092, -0.2530415654182434, -1.0577316284179688, -2.596726894378662, 0.4858925938606262, -0.31179824471473694, -1.4000834226608276, 0.004411976784467697, -1.0543127059936523, 0.8686745166778564, -0.5558382868766785, -1.0656979084014893, -1.5194979906082153, 0.21819253265857697, -0.11448215693235397, 0.9087549448013306, -1.4987170696258545, -0.13075634837150574, 1.31147301197052, 0.9281858801841736, -0.589561939239502, 0.978635311126709, 0.21586449444293976, 1.0268828868865967, 0.8642212748527527, -0.3616500198841095, 0.5248166918754578, 0.1404477059841156, -1.3981930017471313, 0.5132333040237427, 1.2653772830963135, 0.1789843887090683, 1.518895149230957, -0.5851690173149109, -0.025418151170015335, 0.36248114705085754, -0.4922584891319275, -0.5177953243255615, -0.624936580657959, 0.7573786377906799, 0.08827795088291168, -0.9782745242118835, 0.08393263816833496, -0.09485993534326553, -0.10514505207538605, 0.23537038266658783, -1.5072342157363892, -0.18576431274414062, -0.3422876000404358, -0.6327151656150818, -1.2111961841583252, -0.07952059060335159, 1.2750816345214844, -0.7936512231826782, -0.19934594631195068, 0.4611932635307312, 0.3865691125392914, 0.5259567499160767, 0.6446362733840942, -0.6739122271537781, -0.37171781063079834, -0.28008225560188293, -0.3891138434410095, 0.3549197316169739, 1.271870493888855, -0.13418801128864288, -0.9562158584594727, 0.7037733793258667, -0.39132481813430786, 0.0394737683236599, 1.9326086044311523, 0.09640037268400192, -0.8530040383338928, 0.3385380804538727, -0.6922241449356079, 1.9272449016571045, 1.6525988578796387, 1.3651262521743774, -0.08104386180639267, -0.9700008630752563, 0.6630403399467468, -0.317154198884964, -0.42874860763549805, 1.0035611391067505, 0.48096993565559387, -0.24379600584506989, -1.3866816759109497, 0.6264616847038269, 1.2339704036712646, -0.9236974716186523, -0.8801087737083435, 0.14747074246406555, -0.8279895186424255, 1.1119966506958008, 0.7110682725906372, 0.3817000091075897, 0.24307307600975037, 1.5762639045715332, 0.7452943921089172, -0.5108190178871155, 0.47881993651390076, 0.4217342138290405, -0.1643884927034378, -2.009063243865967, -1.1301742792129517, 0.32566124200820923, -0.4739675521850586, -1.5334665775299072, 1.4143439531326294, -1.118664264678955, -0.8875511884689331, 0.5380520820617676, 0.12847989797592163, 1.430439829826355, 0.31855231523513794, 1.6547536849975586, 2.000148296356201, 0.9565003514289856, 0.2637925148010254, 1.302526831626892, -0.25688642263412476, -0.4986850321292877, 1.7648550271987915, -0.46143653988838196, 0.46856945753097534, 1.086566686630249, -0.3654334247112274, -1.0551866292953491, -0.8761915564537048, -1.2185988426208496, -0.6754879951477051, 1.1820505857467651, 0.0908578559756279, -1.1590452194213867, 0.2780437171459198, 1.583547592163086, 0.10311298072338104, -0.3339090943336487, 0.6215212941169739, 0.40182363986968994, -0.7811189293861389, -0.0856296494603157, -1.0099716186523438, 0.5096124410629272, -0.17578957974910736, -0.37966910004615784, 0.27971339225769043, 0.4643137454986572, 1.2999862432479858, 0.03169660642743111, 0.11506985127925873, 1.1817885637283325, -1.4082975387573242, 1.46549654006958, -0.7613112926483154, 0.24390822649002075, -2.313736915588379, 1.4056689739227295, -0.8238819241523743, 1.8955919742584229, -2.6090786457061768, 0.49625200033187866, -0.5225824117660522, -0.42055028676986694, 0.3308176100254059, -0.37926873564720154, 0.23655059933662415, -0.21794287860393524, -1.1283290386199951, -0.1990496963262558, -0.8114023804664612, 0.6281835436820984, 1.1454565525054932, 1.4174232482910156, -1.0406811237335205, -0.2962784171104431, -1.6792765855789185, -0.15727077424526215, -0.6956135034561157, 0.2899753749370575, -1.9253859519958496, -0.15378782153129578, -1.9522916078567505, -2.435267448425293, -1.3305021524429321, -0.8181046843528748, 1.0879460573196411, 0.15580107271671295, -0.9471513032913208, 1.093802809715271, -0.4141940176486969, -1.7989749908447266, 1.2004653215408325, -2.1673099994659424 ]
https://github.com/huggingface/datasets/issues/3122
OSError with a custom dataset loading script
Hi, there is a difference in how the `data_dir` is zipped between the `classla/janes_tag` and the `classla/reldi_hr` dataset. After unzipping, for the former, the data files (`*.conllup`) are in the root directory (root -> data files), and for the latter, they are inside the `data` directory (root -> `data` -> data files). This can be fixed by removing the `os.path.join` call in https://huggingface.co/datasets/classla/janes_tag/blob/main/janes_tag.py#L86 Let me know if this works for you.
## Describe the bug I am getting an OS error when trying to load the newly uploaded dataset classla/janes_tag. What puzzles me is that I have already uploaded a very similar dataset - classla/reldi_hr - with no issues. The loading scripts for the two datasets are almost identical and they have the same directory structure, yet I am only getting an error with janes_tag. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('classla/janes_tag', split='validation') ``` ## Expected results Dataset correctly loaded. ## Actual results Traceback (most recent call last): File "C:/mypath/test.py", line 91, in <module> load_and_print('janes_tag') File "C:/mypath/test.py", line 32, in load_and_print dataset = datasets.load_dataset('classla/{}'.format(ds_name), split='validation') File "C:\mypath\venv\lib\site-packages\datasets\load.py", line 1632, in load_dataset use_auth_token=use_auth_token, File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 608, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 704, in _download_and_prepare ) from None OSError: Cannot find data file. Original error: [Errno 2] No such file or directory: 'C:\\mypath\\.cache\\huggingface\\datasets\\downloads\\2c9996e44bdc5af9c89bffb9e6d7a3e42fdb2f56bacab45de13b20f3032ea7ca\\data\\train_all.conllup' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.5 - PyArrow version: 3.0.0
1,162
71
OSError with a custom dataset loading script ## Describe the bug I am getting an OS error when trying to load the newly uploaded dataset classla/janes_tag. What puzzles me is that I have already uploaded a very similar dataset - classla/reldi_hr - with no issues. The loading scripts for the two datasets are almost identical and they have the same directory structure, yet I am only getting an error with janes_tag. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('classla/janes_tag', split='validation') ``` ## Expected results Dataset correctly loaded. ## Actual results Traceback (most recent call last): File "C:/mypath/test.py", line 91, in <module> load_and_print('janes_tag') File "C:/mypath/test.py", line 32, in load_and_print dataset = datasets.load_dataset('classla/{}'.format(ds_name), split='validation') File "C:\mypath\venv\lib\site-packages\datasets\load.py", line 1632, in load_dataset use_auth_token=use_auth_token, File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 608, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 704, in _download_and_prepare ) from None OSError: Cannot find data file. Original error: [Errno 2] No such file or directory: 'C:\\mypath\\.cache\\huggingface\\datasets\\downloads\\2c9996e44bdc5af9c89bffb9e6d7a3e42fdb2f56bacab45de13b20f3032ea7ca\\data\\train_all.conllup' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.5 - PyArrow version: 3.0.0 Hi, there is a difference in how the `data_dir` is zipped between the `classla/janes_tag` and the `classla/reldi_hr` dataset. After unzipping, for the former, the data files (`*.conllup`) are in the root directory (root -> data files), and for the latter, they are inside the `data` directory (root -> `data` -> data files). This can be fixed by removing the `os.path.join` call in https://huggingface.co/datasets/classla/janes_tag/blob/main/janes_tag.py#L86 Let me know if this works for you.
[ -1.2348365783691406, -0.9167017936706543, -0.6255295276641846, 1.4129399061203003, -0.15435607731342316, -1.219717264175415, 0.05580707639455795, -1.0339274406433105, 1.6345734596252441, -0.7894803285598755, 0.18790456652641296, -1.686458706855774, 0.013226320967078209, -0.5875965356826782, -0.6818221211433411, -0.8906069993972778, -0.3390595614910126, -0.7812573313713074, 1.0421231985092163, 2.508939266204834, 1.2591992616653442, -1.351700782775879, 2.7811203002929688, 0.7346806526184082, -0.2850492596626282, -0.9954200983047485, 0.625596821308136, 0.001601003110408783, -1.1909252405166626, -0.4009263515472412, -0.9366761445999146, 0.01851845532655716, -0.6162446141242981, -0.4589817523956299, -0.008252069354057312, 0.44643059372901917, -0.27462178468704224, -0.3620757758617401, -0.6483681797981262, -0.7207871079444885, 0.4872911274433136, -0.4327394366264343, 1.0095666646957397, -0.32511967420578003, 1.8659980297088623, -0.6112620830535889, 0.31127655506134033, 0.745195209980011, 1.257041096687317, 0.1406187117099762, 0.07779939472675323, 0.2900480329990387, 0.3612469732761383, -0.0014107800088822842, 0.437688946723938, 1.132994532585144, 0.6085389256477356, 0.41105887293815613, 0.7954228520393372, -2.156581163406372, 1.3620715141296387, -0.9151310324668884, 0.20791684091091156, 1.3417887687683105, -0.9512231349945068, 0.39042022824287415, -1.726682424545288, -0.0629015564918518, 0.5694078803062439, -2.1644468307495117, 0.1890328973531723, -1.2814148664474487, -0.5541693568229675, 0.9903518557548523, 0.294261634349823, -1.1330649852752686, 0.22384954988956451, -0.5685374140739441, 1.034645438194275, 0.45079460740089417, 1.0807677507400513, -1.6047898530960083, -0.005885306745767593, -0.21114489436149597, 0.10140188783407211, -1.4784502983093262, -1.5681411027908325, 0.6486680507659912, 0.5503091216087341, 0.6894562244415283, -0.059508584439754486, 1.0968142747879028, -1.0443665981292725, 0.7698361873626709, -0.9904894828796387, -1.7152085304260254, -1.3995389938354492, -2.3358755111694336, -2.3219263553619385, 0.7221172451972961, -0.545979380607605, -0.5226593017578125, 2.0402965545654297, -1.069326400756836, -1.7101577520370483, 1.1297264099121094, 0.23337744176387787, -0.019066065549850464, 2.4109585285186768, 0.23320472240447998, -0.804060697555542, 0.4075927138328552, -0.7982314229011536, 0.8103695511817932, -0.21738706529140472, 1.3521145582199097, 0.49681681394577026, -1.0236315727233887, 1.5540820360183716, -0.4602217376232147, 0.6557011008262634, -0.5671355724334717, -0.5168842673301697, -0.7591068744659424, 0.3049124479293823, 1.8136519193649292, -0.35901156067848206, 1.6320394277572632, -0.3468419313430786, -1.5255553722381592, -1.5627161264419556, 0.8263673186302185, 0.35688281059265137, -0.7630893588066101, 0.11790655553340912, -0.449471116065979, 0.09167646616697311, -0.055243030190467834, 1.1555134057998657, 1.2920856475830078, 0.6505948901176453, -0.3593403995037079, -0.8760426640510559, 0.1340729147195816, -0.08798976987600327, -0.6594566106796265, -1.7819643020629883, -0.34725233912467957, 0.15421175956726074, 0.7054311633110046, -1.262969970703125, 1.756989598274231, 0.9626779556274414, 1.9260975122451782, 1.0191433429718018, -0.3712891936302185, 1.3435744047164917, 0.061918847262859344, 1.7965850830078125, -0.5275317430496216, 0.6274517178535461, -0.4226570725440979, -1.1987003087997437, 0.8537265658378601, -0.3547460436820984, -1.9822875261306763, -0.8245264291763306, -0.7661271095275879, -0.11997310817241669, -0.81405109167099, 0.9177332520484924, -0.3526748716831207, -1.4900405406951904, 0.1962069272994995, -0.6497527360916138, 0.07194561511278152, -1.2747883796691895, 0.20292946696281433, 0.7132558226585388, -0.6340736746788025, 0.044005386531353, -0.22330190241336823, -1.2929863929748535, -0.5176461935043335, 0.2911427915096283, 1.8626958131790161, -0.7238693237304688, 0.9277719259262085, 1.0467513799667358, -0.6571099758148193, 0.15078747272491455, 0.22952701151371002, -0.3113156259059906, 0.7762405872344971, -1.0406348705291748, -0.4447123408317566, 1.1519051790237427, -0.22596824169158936, -0.6551083326339722, 1.4848121404647827, 0.7860657572746277, -1.1188186407089233, -0.2593112587928772, -0.20973250269889832, -0.8546611666679382, -0.05715178698301315, -1.4755220413208008, -0.16823501884937286, 0.3488138020038605, -1.537685513496399, -0.37955233454704285, -0.24774770438671112, 1.3696365356445312, -0.16000276803970337, 1.4084205627441406, -0.4112069010734558, -0.20745906233787537, -0.2933158576488495, -0.5808423757553101, 0.16718724370002747, -0.16688531637191772, -0.5479642748832703, 0.16385000944137573, -0.9311087131500244, 0.3528018295764923, 1.4673056602478027, 0.37807267904281616, -0.04574645310640335, 0.4301198422908783, 1.1397628784179688, 0.3369362950325012, -0.0858481228351593, -0.8332441449165344, -1.46759033203125, 2.0052239894866943, -1.5315860509872437, 1.9643304347991943, 0.7711774706840515, -0.09943217784166336, -1.769344449043274, -1.7599456310272217, 1.3330357074737549, 1.1945929527282715, 2.2272446155548096, 0.6024171710014343, 0.3457965552806854, -0.8359128832817078, -0.6330868005752563, 0.42107704281806946, -1.0267590284347534, -0.5475718975067139, 0.16516250371932983, 2.3929967880249023, 1.817708969116211, -0.5210181474685669, -0.1584545224905014, -0.8505398631095886, 1.3723561763763428, -0.16463139653205872, 0.27682650089263916, 2.0270111560821533, -0.37994885444641113, -1.028635859489441, 1.3186372518539429, -2.3351712226867676, 0.19033025205135345, 2.030339002609253, 0.26351234316825867, 0.09510089457035065, -1.3426423072814941, -0.6239039301872253, -0.4508020877838135, -0.36958077549934387, -1.1926103830337524, 0.5607280731201172, -0.2709997296333313, -0.8009064197540283, -1.4750334024429321, 0.12129202485084534, -1.2265074253082275, -1.7945411205291748, 0.3416298031806946, 1.897492527961731, 2.14511775970459, -0.8404290080070496, 1.5566085577011108, -0.30479705333709717, 0.15055575966835022, 1.134281873703003, 1.315470814704895, 3.0625805854797363, 1.8564399480819702, -1.1595357656478882, 0.642960250377655, -0.17219622433185577, -0.5099451541900635, 1.1467573642730713, -1.172094464302063, 1.2845309972763062, -0.19606253504753113, -1.1435097455978394, -1.2428902387619019, 0.9316375851631165, 0.3911622166633606, -0.03707673400640488, -0.4648698568344116, 1.3309167623519897, 0.11092743277549744, 1.4146738052368164, 0.534903883934021, -0.3588722050189972, 0.5165672898292542, -0.4408193826675415, -0.565760612487793, 1.578674077987671, 0.17728760838508606, -1.4929970502853394, -2.24709415435791, -0.3256811201572418, -0.7434393167495728, 0.03287697583436966, -0.641845166683197, -1.0277806520462036, 1.6618049144744873, 0.31740373373031616, -1.1945674419403076, -0.2726726233959198, -0.42441028356552124, -0.5149831175804138, 2.6870779991149902, -1.376197099685669, -0.08998652547597885, -0.9388251900672913, -0.6258746981620789, 1.6057020425796509, -1.1339075565338135, -0.18260902166366577, -1.094862461090088, -0.6410588622093201, -1.3553531169891357, -0.5423914790153503, 0.020457785576581955, -1.000964641571045, 0.8026666045188904, 0.23998816311359406, -1.045066475868225, -0.313643217086792, -0.8497905731201172, 0.9547600746154785, -0.20700785517692566, 0.24544262886047363, 1.8903981447219849, 0.40417325496673584, -0.4448815882205963, 0.7779325246810913, 1.1888935565948486, 0.6416229605674744, -0.7425622940063477, -0.051557160913944244, -0.7257977724075317, 0.38289982080459595, -1.3575469255447388, 0.25235500931739807, -2.874931573867798, 0.6642296314239502, -0.10892953723669052, -0.04386650770902634, -0.05888983607292175, -1.2509821653366089, 1.0945613384246826, 2.6722612380981445, -1.2724236249923706, 0.4828573167324066, 0.4432641565799713, 1.169111967086792, -1.5711456537246704, 0.3677988648414612, -0.4247182607650757, 1.9975807666778564, 0.2088189572095871, 1.2779651880264282, -0.5602304339408875, -2.3189194202423096, 0.6394795775413513, -1.2048381567001343, -1.1795477867126465, 0.835365891456604, -0.8909435868263245, 0.19714918732643127, -1.489643931388855, -0.18366366624832153, -1.0025995969772339, -1.2549058198928833, 0.6486543416976929, 0.21086007356643677, 0.5116103887557983, -0.6081045269966125, 0.3499215841293335, -2.2404797077178955, -1.4375016689300537, -0.23767425119876862, -0.9773999452590942, 0.5999849438667297, -0.4727115035057068, 0.6528944969177246, -0.12117709964513779, 0.03915382921695709, 0.3354121744632721, 1.3861857652664185, 3.4670636653900146, 0.16982781887054443, 0.23066966235637665, -0.10510554909706116, -0.966579794883728, 1.432725191116333, 0.9438503384590149, -0.16374319791793823, -0.5157153010368347, -1.076941967010498, 1.2655466794967651, 1.9879136085510254, 1.0721566677093506, -0.04617734253406525, -0.7756171822547913, -0.6999198198318481, -0.04439028352499008, 0.19339005649089813, 0.5168439745903015, 0.8389180302619934, -0.05820373445749283, 0.14530383050441742, 1.4929776191711426, 1.1501761674880981, -0.4236108958721161, 0.20505641400814056, -0.8777843713760376, -0.41904217004776, 0.5110330581665039, 0.17710943520069122, 0.0007682750001549721, 0.4599950611591339, -0.8993379473686218, -0.2739391624927521, -0.3378639221191406, -0.8449000716209412, -0.676638126373291, -0.38726359605789185, -0.4018419682979584, 1.6188730001449585, 0.06692129373550415, -0.534424364566803, -0.13097989559173584, -0.665314793586731, -0.25404730439186096, -1.085253357887268, 0.25547337532043457, -0.12832246720790863, -0.03883686661720276, -0.21310096979141235, 1.7199541330337524, -0.9336446523666382, -2.03999400138855, 0.21247540414333344, 0.28322991728782654, -0.2180536687374115, 0.1616114377975464, 1.6537361145019531, 0.5198858380317688, 1.3414274454116821, 1.257475733757019, 0.9635933041572571, -0.7068553566932678, -1.2589820623397827, 0.6060177087783813, 1.0420663356781006, -1.3786323070526123, 0.8846862316131592, -0.10942526161670685, -0.6104224324226379, 0.6459201574325562, 1.380730152130127, 0.49764466285705566, -1.9813669919967651, 0.8093783259391785, -1.026638388633728, 0.8646343350410461, 0.7360391020774841, 0.7301830649375916, 0.1524987667798996, 0.7880806922912598, -1.1293857097625732, -1.195565104484558, -0.7606867551803589, -0.68108731508255, 1.9616121053695679, -0.232747420668602, 0.5858058333396912, -0.17516806721687317, -1.1686294078826904, -0.055939242243766785, 0.7260244488716125, 0.3830474615097046, -0.45723849534988403, 0.8437066078186035, -0.6161560416221619, -1.0076335668563843, -1.2997329235076904, -0.3652257025241852, -0.9785853624343872, -1.0219987630844116, 1.0151636600494385, 0.7310301661491394, 0.35887977480888367, 1.8614845275878906, 0.6333321928977966, 0.2603144645690918, -2.519045352935791, 0.957105815410614, 0.2979888916015625, -0.10619145631790161, 0.8722749948501587, 0.33729085326194763, 1.0171984434127808, 0.04676765203475952, 0.5654187798500061, -2.428847551345825, 2.2246170043945312, -0.24002471566200256, 0.6545584797859192, 0.032805152237415314, -0.18274398148059845, 1.1152070760726929, 0.6403191089630127, 0.46797528862953186, -1.0256319046020508, 0.7150579690933228, -0.40225982666015625, 1.1749376058578491, 1.0387142896652222, -0.841720700263977, 0.05621182173490524, 1.3689405918121338, 0.5201869606971741, -0.5668292045593262, -0.8555628657341003, -0.9108239412307739, 0.9606917500495911, 1.7832684516906738, -0.10903874784708023, -0.031141094863414764, 0.8148192763328552, 0.6156551837921143, -1.1715433597564697, 0.028628835454583168, -0.6352024674415588, -0.6981760859489441, 1.6463816165924072, 2.1036436557769775, -0.10022618621587753, -0.10461848229169846, -0.7053106427192688, -1.202030062675476, 0.8856721520423889, -0.08110830932855606, 0.09708978980779648, 0.6551974415779114, -0.6739370226860046, 1.1241710186004639, 0.7093818783760071, 0.9007818102836609, 0.1573198288679123, 0.238310307264328, 0.4810529947280884, -0.2062559723854065, -1.075675129890442, -0.35112932324409485, -1.0701454877853394, -2.4408669471740723, 0.3625786602497101, -0.20405064523220062, -1.4813802242279053, -0.10571596026420593, -0.9726034998893738, 1.0034393072128296, -0.5915153622627258, -1.0547689199447632, -1.6049911975860596, 0.21547622978687286, -0.08303885161876678, 0.9580851793289185, -1.6931045055389404, -0.20780038833618164, 1.2917041778564453, 0.8660252094268799, -0.582753598690033, 1.0999830961227417, 0.24460738897323608, 0.9845921993255615, 0.7115890383720398, -0.30672693252563477, 0.6527175307273865, 0.07018983364105225, -1.3436837196350098, 0.47537440061569214, 1.2522543668746948, 0.1525963395833969, 1.4437872171401978, -0.3886411786079407, 0.0170035008341074, 0.3874281942844391, -0.5515086054801941, -0.4931339621543884, -0.41529738903045654, 0.6750543713569641, 0.09083487838506699, -0.860871434211731, -0.07205159217119217, -0.1615341752767563, -0.3380255401134491, 0.2603045105934143, -1.5411930084228516, -0.2327428013086319, -0.4736439883708954, -0.47339922189712524, -1.3253194093704224, -0.028399482369422913, 1.488789439201355, -0.771555483341217, -0.20498543977737427, 0.48980891704559326, 0.43611064553260803, 0.4795634150505066, 0.6261508464813232, -0.8159762620925903, -0.2867187261581421, -0.378611296415329, -0.34170275926589966, 0.25088727474212646, 1.3247672319412231, -0.0684376135468483, -1.0450019836425781, 0.6854820251464844, -0.37402793765068054, 0.09439785778522491, 1.9980120658874512, 0.14583870768547058, -0.716471791267395, 0.34216517210006714, -0.7999690771102905, 1.8892918825149536, 1.6372098922729492, 1.3464419841766357, -0.13515254855155945, -0.8918136358261108, 0.5714755654335022, -0.2598792314529419, -0.33857613801956177, 0.9147342443466187, 0.3814880847930908, -0.2490098774433136, -1.4709137678146362, 0.6996967196464539, 1.258387804031372, -0.8695768713951111, -0.7028072476387024, 0.10123516619205475, -0.8477848172187805, 1.081714391708374, 0.6295871734619141, 0.398772656917572, 0.2871512770652771, 1.7723805904388428, 0.7468671798706055, -0.583828866481781, 0.5088565945625305, 0.4960489869117737, -0.1519199013710022, -2.075587272644043, -1.0731759071350098, 0.3419613838195801, -0.4508734345436096, -1.5791125297546387, 1.4250684976577759, -1.1675726175308228, -0.9699972867965698, 0.5583388209342957, 0.015184134244918823, 1.3439106941223145, 0.359386682510376, 1.5752689838409424, 2.1036925315856934, 0.7219297885894775, 0.3566405475139618, 1.1833181381225586, -0.20066289603710175, -0.47681644558906555, 1.8172376155853271, -0.46489521861076355, 0.47015199065208435, 1.1464807987213135, -0.3343837261199951, -0.9996421337127686, -0.7790926694869995, -1.2632938623428345, -0.6092244386672974, 1.135941982269287, 0.06669529527425766, -1.1824990510940552, 0.24305585026741028, 1.5923579931259155, 0.15989969670772552, -0.31404680013656616, 0.6461677551269531, 0.4487389922142029, -0.8714514970779419, -0.15795932710170746, -0.9026681184768677, 0.560028612613678, -0.13167279958724976, -0.319278359413147, 0.29228103160858154, 0.5106762051582336, 1.3688491582870483, -0.08741306513547897, 0.1670454740524292, 1.1907501220703125, -1.3345674276351929, 1.543297290802002, -0.6293419003486633, 0.22415970265865326, -2.3625385761260986, 1.3710609674453735, -0.7234260439872742, 1.969774603843689, -2.6330199241638184, 0.4370095431804657, -0.5747601985931396, -0.45593759417533875, 0.2926568388938904, -0.3290248513221741, 0.12628258764743805, -0.11979376524686813, -1.0288687944412231, -0.007524975575506687, -0.5598769187927246, 0.6520882844924927, 1.1223411560058594, 1.4218387603759766, -1.2063921689987183, -0.2935091555118561, -1.6559115648269653, -0.2639860212802887, -0.8130505084991455, 0.29551446437835693, -2.016721725463867, -0.239318385720253, -1.9794684648513794, -2.419135332107544, -1.3613179922103882, -0.8354490995407104, 1.1577740907669067, 0.15060484409332275, -1.0312544107437134, 1.2628763914108276, -0.3863453269004822, -1.820457100868225, 1.1984667778015137, -2.1046886444091797 ]
https://github.com/huggingface/datasets/issues/3122
OSError with a custom dataset loading script
Hi Mario, I had already tried that before, but it didn't work. I have now recreated the `classla/janes_tag` zip file so that it also contains the `data` directory, but I am still getting the same error.
## Describe the bug I am getting an OS error when trying to load the newly uploaded dataset classla/janes_tag. What puzzles me is that I have already uploaded a very similar dataset - classla/reldi_hr - with no issues. The loading scripts for the two datasets are almost identical and they have the same directory structure, yet I am only getting an error with janes_tag. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('classla/janes_tag', split='validation') ``` ## Expected results Dataset correctly loaded. ## Actual results Traceback (most recent call last): File "C:/mypath/test.py", line 91, in <module> load_and_print('janes_tag') File "C:/mypath/test.py", line 32, in load_and_print dataset = datasets.load_dataset('classla/{}'.format(ds_name), split='validation') File "C:\mypath\venv\lib\site-packages\datasets\load.py", line 1632, in load_dataset use_auth_token=use_auth_token, File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 608, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 704, in _download_and_prepare ) from None OSError: Cannot find data file. Original error: [Errno 2] No such file or directory: 'C:\\mypath\\.cache\\huggingface\\datasets\\downloads\\2c9996e44bdc5af9c89bffb9e6d7a3e42fdb2f56bacab45de13b20f3032ea7ca\\data\\train_all.conllup' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.5 - PyArrow version: 3.0.0
1,162
36
OSError with a custom dataset loading script ## Describe the bug I am getting an OS error when trying to load the newly uploaded dataset classla/janes_tag. What puzzles me is that I have already uploaded a very similar dataset - classla/reldi_hr - with no issues. The loading scripts for the two datasets are almost identical and they have the same directory structure, yet I am only getting an error with janes_tag. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('classla/janes_tag', split='validation') ``` ## Expected results Dataset correctly loaded. ## Actual results Traceback (most recent call last): File "C:/mypath/test.py", line 91, in <module> load_and_print('janes_tag') File "C:/mypath/test.py", line 32, in load_and_print dataset = datasets.load_dataset('classla/{}'.format(ds_name), split='validation') File "C:\mypath\venv\lib\site-packages\datasets\load.py", line 1632, in load_dataset use_auth_token=use_auth_token, File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 608, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 704, in _download_and_prepare ) from None OSError: Cannot find data file. Original error: [Errno 2] No such file or directory: 'C:\\mypath\\.cache\\huggingface\\datasets\\downloads\\2c9996e44bdc5af9c89bffb9e6d7a3e42fdb2f56bacab45de13b20f3032ea7ca\\data\\train_all.conllup' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.5 - PyArrow version: 3.0.0 Hi Mario, I had already tried that before, but it didn't work. I have now recreated the `classla/janes_tag` zip file so that it also contains the `data` directory, but I am still getting the same error.
[ -1.2348365783691406, -0.9167017936706543, -0.6255295276641846, 1.4129399061203003, -0.15435607731342316, -1.219717264175415, 0.05580707639455795, -1.0339274406433105, 1.6345734596252441, -0.7894803285598755, 0.18790456652641296, -1.686458706855774, 0.013226320967078209, -0.5875965356826782, -0.6818221211433411, -0.8906069993972778, -0.3390595614910126, -0.7812573313713074, 1.0421231985092163, 2.508939266204834, 1.2591992616653442, -1.351700782775879, 2.7811203002929688, 0.7346806526184082, -0.2850492596626282, -0.9954200983047485, 0.625596821308136, 0.001601003110408783, -1.1909252405166626, -0.4009263515472412, -0.9366761445999146, 0.01851845532655716, -0.6162446141242981, -0.4589817523956299, -0.008252069354057312, 0.44643059372901917, -0.27462178468704224, -0.3620757758617401, -0.6483681797981262, -0.7207871079444885, 0.4872911274433136, -0.4327394366264343, 1.0095666646957397, -0.32511967420578003, 1.8659980297088623, -0.6112620830535889, 0.31127655506134033, 0.745195209980011, 1.257041096687317, 0.1406187117099762, 0.07779939472675323, 0.2900480329990387, 0.3612469732761383, -0.0014107800088822842, 0.437688946723938, 1.132994532585144, 0.6085389256477356, 0.41105887293815613, 0.7954228520393372, -2.156581163406372, 1.3620715141296387, -0.9151310324668884, 0.20791684091091156, 1.3417887687683105, -0.9512231349945068, 0.39042022824287415, -1.726682424545288, -0.0629015564918518, 0.5694078803062439, -2.1644468307495117, 0.1890328973531723, -1.2814148664474487, -0.5541693568229675, 0.9903518557548523, 0.294261634349823, -1.1330649852752686, 0.22384954988956451, -0.5685374140739441, 1.034645438194275, 0.45079460740089417, 1.0807677507400513, -1.6047898530960083, -0.005885306745767593, -0.21114489436149597, 0.10140188783407211, -1.4784502983093262, -1.5681411027908325, 0.6486680507659912, 0.5503091216087341, 0.6894562244415283, -0.059508584439754486, 1.0968142747879028, -1.0443665981292725, 0.7698361873626709, -0.9904894828796387, -1.7152085304260254, -1.3995389938354492, -2.3358755111694336, -2.3219263553619385, 0.7221172451972961, -0.545979380607605, -0.5226593017578125, 2.0402965545654297, -1.069326400756836, -1.7101577520370483, 1.1297264099121094, 0.23337744176387787, -0.019066065549850464, 2.4109585285186768, 0.23320472240447998, -0.804060697555542, 0.4075927138328552, -0.7982314229011536, 0.8103695511817932, -0.21738706529140472, 1.3521145582199097, 0.49681681394577026, -1.0236315727233887, 1.5540820360183716, -0.4602217376232147, 0.6557011008262634, -0.5671355724334717, -0.5168842673301697, -0.7591068744659424, 0.3049124479293823, 1.8136519193649292, -0.35901156067848206, 1.6320394277572632, -0.3468419313430786, -1.5255553722381592, -1.5627161264419556, 0.8263673186302185, 0.35688281059265137, -0.7630893588066101, 0.11790655553340912, -0.449471116065979, 0.09167646616697311, -0.055243030190467834, 1.1555134057998657, 1.2920856475830078, 0.6505948901176453, -0.3593403995037079, -0.8760426640510559, 0.1340729147195816, -0.08798976987600327, -0.6594566106796265, -1.7819643020629883, -0.34725233912467957, 0.15421175956726074, 0.7054311633110046, -1.262969970703125, 1.756989598274231, 0.9626779556274414, 1.9260975122451782, 1.0191433429718018, -0.3712891936302185, 1.3435744047164917, 0.061918847262859344, 1.7965850830078125, -0.5275317430496216, 0.6274517178535461, -0.4226570725440979, -1.1987003087997437, 0.8537265658378601, -0.3547460436820984, -1.9822875261306763, -0.8245264291763306, -0.7661271095275879, -0.11997310817241669, -0.81405109167099, 0.9177332520484924, -0.3526748716831207, -1.4900405406951904, 0.1962069272994995, -0.6497527360916138, 0.07194561511278152, -1.2747883796691895, 0.20292946696281433, 0.7132558226585388, -0.6340736746788025, 0.044005386531353, -0.22330190241336823, -1.2929863929748535, -0.5176461935043335, 0.2911427915096283, 1.8626958131790161, -0.7238693237304688, 0.9277719259262085, 1.0467513799667358, -0.6571099758148193, 0.15078747272491455, 0.22952701151371002, -0.3113156259059906, 0.7762405872344971, -1.0406348705291748, -0.4447123408317566, 1.1519051790237427, -0.22596824169158936, -0.6551083326339722, 1.4848121404647827, 0.7860657572746277, -1.1188186407089233, -0.2593112587928772, -0.20973250269889832, -0.8546611666679382, -0.05715178698301315, -1.4755220413208008, -0.16823501884937286, 0.3488138020038605, -1.537685513496399, -0.37955233454704285, -0.24774770438671112, 1.3696365356445312, -0.16000276803970337, 1.4084205627441406, -0.4112069010734558, -0.20745906233787537, -0.2933158576488495, -0.5808423757553101, 0.16718724370002747, -0.16688531637191772, -0.5479642748832703, 0.16385000944137573, -0.9311087131500244, 0.3528018295764923, 1.4673056602478027, 0.37807267904281616, -0.04574645310640335, 0.4301198422908783, 1.1397628784179688, 0.3369362950325012, -0.0858481228351593, -0.8332441449165344, -1.46759033203125, 2.0052239894866943, -1.5315860509872437, 1.9643304347991943, 0.7711774706840515, -0.09943217784166336, -1.769344449043274, -1.7599456310272217, 1.3330357074737549, 1.1945929527282715, 2.2272446155548096, 0.6024171710014343, 0.3457965552806854, -0.8359128832817078, -0.6330868005752563, 0.42107704281806946, -1.0267590284347534, -0.5475718975067139, 0.16516250371932983, 2.3929967880249023, 1.817708969116211, -0.5210181474685669, -0.1584545224905014, -0.8505398631095886, 1.3723561763763428, -0.16463139653205872, 0.27682650089263916, 2.0270111560821533, -0.37994885444641113, -1.028635859489441, 1.3186372518539429, -2.3351712226867676, 0.19033025205135345, 2.030339002609253, 0.26351234316825867, 0.09510089457035065, -1.3426423072814941, -0.6239039301872253, -0.4508020877838135, -0.36958077549934387, -1.1926103830337524, 0.5607280731201172, -0.2709997296333313, -0.8009064197540283, -1.4750334024429321, 0.12129202485084534, -1.2265074253082275, -1.7945411205291748, 0.3416298031806946, 1.897492527961731, 2.14511775970459, -0.8404290080070496, 1.5566085577011108, -0.30479705333709717, 0.15055575966835022, 1.134281873703003, 1.315470814704895, 3.0625805854797363, 1.8564399480819702, -1.1595357656478882, 0.642960250377655, -0.17219622433185577, -0.5099451541900635, 1.1467573642730713, -1.172094464302063, 1.2845309972763062, -0.19606253504753113, -1.1435097455978394, -1.2428902387619019, 0.9316375851631165, 0.3911622166633606, -0.03707673400640488, -0.4648698568344116, 1.3309167623519897, 0.11092743277549744, 1.4146738052368164, 0.534903883934021, -0.3588722050189972, 0.5165672898292542, -0.4408193826675415, -0.565760612487793, 1.578674077987671, 0.17728760838508606, -1.4929970502853394, -2.24709415435791, -0.3256811201572418, -0.7434393167495728, 0.03287697583436966, -0.641845166683197, -1.0277806520462036, 1.6618049144744873, 0.31740373373031616, -1.1945674419403076, -0.2726726233959198, -0.42441028356552124, -0.5149831175804138, 2.6870779991149902, -1.376197099685669, -0.08998652547597885, -0.9388251900672913, -0.6258746981620789, 1.6057020425796509, -1.1339075565338135, -0.18260902166366577, -1.094862461090088, -0.6410588622093201, -1.3553531169891357, -0.5423914790153503, 0.020457785576581955, -1.000964641571045, 0.8026666045188904, 0.23998816311359406, -1.045066475868225, -0.313643217086792, -0.8497905731201172, 0.9547600746154785, -0.20700785517692566, 0.24544262886047363, 1.8903981447219849, 0.40417325496673584, -0.4448815882205963, 0.7779325246810913, 1.1888935565948486, 0.6416229605674744, -0.7425622940063477, -0.051557160913944244, -0.7257977724075317, 0.38289982080459595, -1.3575469255447388, 0.25235500931739807, -2.874931573867798, 0.6642296314239502, -0.10892953723669052, -0.04386650770902634, -0.05888983607292175, -1.2509821653366089, 1.0945613384246826, 2.6722612380981445, -1.2724236249923706, 0.4828573167324066, 0.4432641565799713, 1.169111967086792, -1.5711456537246704, 0.3677988648414612, -0.4247182607650757, 1.9975807666778564, 0.2088189572095871, 1.2779651880264282, -0.5602304339408875, -2.3189194202423096, 0.6394795775413513, -1.2048381567001343, -1.1795477867126465, 0.835365891456604, -0.8909435868263245, 0.19714918732643127, -1.489643931388855, -0.18366366624832153, -1.0025995969772339, -1.2549058198928833, 0.6486543416976929, 0.21086007356643677, 0.5116103887557983, -0.6081045269966125, 0.3499215841293335, -2.2404797077178955, -1.4375016689300537, -0.23767425119876862, -0.9773999452590942, 0.5999849438667297, -0.4727115035057068, 0.6528944969177246, -0.12117709964513779, 0.03915382921695709, 0.3354121744632721, 1.3861857652664185, 3.4670636653900146, 0.16982781887054443, 0.23066966235637665, -0.10510554909706116, -0.966579794883728, 1.432725191116333, 0.9438503384590149, -0.16374319791793823, -0.5157153010368347, -1.076941967010498, 1.2655466794967651, 1.9879136085510254, 1.0721566677093506, -0.04617734253406525, -0.7756171822547913, -0.6999198198318481, -0.04439028352499008, 0.19339005649089813, 0.5168439745903015, 0.8389180302619934, -0.05820373445749283, 0.14530383050441742, 1.4929776191711426, 1.1501761674880981, -0.4236108958721161, 0.20505641400814056, -0.8777843713760376, -0.41904217004776, 0.5110330581665039, 0.17710943520069122, 0.0007682750001549721, 0.4599950611591339, -0.8993379473686218, -0.2739391624927521, -0.3378639221191406, -0.8449000716209412, -0.676638126373291, -0.38726359605789185, -0.4018419682979584, 1.6188730001449585, 0.06692129373550415, -0.534424364566803, -0.13097989559173584, -0.665314793586731, -0.25404730439186096, -1.085253357887268, 0.25547337532043457, -0.12832246720790863, -0.03883686661720276, -0.21310096979141235, 1.7199541330337524, -0.9336446523666382, -2.03999400138855, 0.21247540414333344, 0.28322991728782654, -0.2180536687374115, 0.1616114377975464, 1.6537361145019531, 0.5198858380317688, 1.3414274454116821, 1.257475733757019, 0.9635933041572571, -0.7068553566932678, -1.2589820623397827, 0.6060177087783813, 1.0420663356781006, -1.3786323070526123, 0.8846862316131592, -0.10942526161670685, -0.6104224324226379, 0.6459201574325562, 1.380730152130127, 0.49764466285705566, -1.9813669919967651, 0.8093783259391785, -1.026638388633728, 0.8646343350410461, 0.7360391020774841, 0.7301830649375916, 0.1524987667798996, 0.7880806922912598, -1.1293857097625732, -1.195565104484558, -0.7606867551803589, -0.68108731508255, 1.9616121053695679, -0.232747420668602, 0.5858058333396912, -0.17516806721687317, -1.1686294078826904, -0.055939242243766785, 0.7260244488716125, 0.3830474615097046, -0.45723849534988403, 0.8437066078186035, -0.6161560416221619, -1.0076335668563843, -1.2997329235076904, -0.3652257025241852, -0.9785853624343872, -1.0219987630844116, 1.0151636600494385, 0.7310301661491394, 0.35887977480888367, 1.8614845275878906, 0.6333321928977966, 0.2603144645690918, -2.519045352935791, 0.957105815410614, 0.2979888916015625, -0.10619145631790161, 0.8722749948501587, 0.33729085326194763, 1.0171984434127808, 0.04676765203475952, 0.5654187798500061, -2.428847551345825, 2.2246170043945312, -0.24002471566200256, 0.6545584797859192, 0.032805152237415314, -0.18274398148059845, 1.1152070760726929, 0.6403191089630127, 0.46797528862953186, -1.0256319046020508, 0.7150579690933228, -0.40225982666015625, 1.1749376058578491, 1.0387142896652222, -0.841720700263977, 0.05621182173490524, 1.3689405918121338, 0.5201869606971741, -0.5668292045593262, -0.8555628657341003, -0.9108239412307739, 0.9606917500495911, 1.7832684516906738, -0.10903874784708023, -0.031141094863414764, 0.8148192763328552, 0.6156551837921143, -1.1715433597564697, 0.028628835454583168, -0.6352024674415588, -0.6981760859489441, 1.6463816165924072, 2.1036436557769775, -0.10022618621587753, -0.10461848229169846, -0.7053106427192688, -1.202030062675476, 0.8856721520423889, -0.08110830932855606, 0.09708978980779648, 0.6551974415779114, -0.6739370226860046, 1.1241710186004639, 0.7093818783760071, 0.9007818102836609, 0.1573198288679123, 0.238310307264328, 0.4810529947280884, -0.2062559723854065, -1.075675129890442, -0.35112932324409485, -1.0701454877853394, -2.4408669471740723, 0.3625786602497101, -0.20405064523220062, -1.4813802242279053, -0.10571596026420593, -0.9726034998893738, 1.0034393072128296, -0.5915153622627258, -1.0547689199447632, -1.6049911975860596, 0.21547622978687286, -0.08303885161876678, 0.9580851793289185, -1.6931045055389404, -0.20780038833618164, 1.2917041778564453, 0.8660252094268799, -0.582753598690033, 1.0999830961227417, 0.24460738897323608, 0.9845921993255615, 0.7115890383720398, -0.30672693252563477, 0.6527175307273865, 0.07018983364105225, -1.3436837196350098, 0.47537440061569214, 1.2522543668746948, 0.1525963395833969, 1.4437872171401978, -0.3886411786079407, 0.0170035008341074, 0.3874281942844391, -0.5515086054801941, -0.4931339621543884, -0.41529738903045654, 0.6750543713569641, 0.09083487838506699, -0.860871434211731, -0.07205159217119217, -0.1615341752767563, -0.3380255401134491, 0.2603045105934143, -1.5411930084228516, -0.2327428013086319, -0.4736439883708954, -0.47339922189712524, -1.3253194093704224, -0.028399482369422913, 1.488789439201355, -0.771555483341217, -0.20498543977737427, 0.48980891704559326, 0.43611064553260803, 0.4795634150505066, 0.6261508464813232, -0.8159762620925903, -0.2867187261581421, -0.378611296415329, -0.34170275926589966, 0.25088727474212646, 1.3247672319412231, -0.0684376135468483, -1.0450019836425781, 0.6854820251464844, -0.37402793765068054, 0.09439785778522491, 1.9980120658874512, 0.14583870768547058, -0.716471791267395, 0.34216517210006714, -0.7999690771102905, 1.8892918825149536, 1.6372098922729492, 1.3464419841766357, -0.13515254855155945, -0.8918136358261108, 0.5714755654335022, -0.2598792314529419, -0.33857613801956177, 0.9147342443466187, 0.3814880847930908, -0.2490098774433136, -1.4709137678146362, 0.6996967196464539, 1.258387804031372, -0.8695768713951111, -0.7028072476387024, 0.10123516619205475, -0.8477848172187805, 1.081714391708374, 0.6295871734619141, 0.398772656917572, 0.2871512770652771, 1.7723805904388428, 0.7468671798706055, -0.583828866481781, 0.5088565945625305, 0.4960489869117737, -0.1519199013710022, -2.075587272644043, -1.0731759071350098, 0.3419613838195801, -0.4508734345436096, -1.5791125297546387, 1.4250684976577759, -1.1675726175308228, -0.9699972867965698, 0.5583388209342957, 0.015184134244918823, 1.3439106941223145, 0.359386682510376, 1.5752689838409424, 2.1036925315856934, 0.7219297885894775, 0.3566405475139618, 1.1833181381225586, -0.20066289603710175, -0.47681644558906555, 1.8172376155853271, -0.46489521861076355, 0.47015199065208435, 1.1464807987213135, -0.3343837261199951, -0.9996421337127686, -0.7790926694869995, -1.2632938623428345, -0.6092244386672974, 1.135941982269287, 0.06669529527425766, -1.1824990510940552, 0.24305585026741028, 1.5923579931259155, 0.15989969670772552, -0.31404680013656616, 0.6461677551269531, 0.4487389922142029, -0.8714514970779419, -0.15795932710170746, -0.9026681184768677, 0.560028612613678, -0.13167279958724976, -0.319278359413147, 0.29228103160858154, 0.5106762051582336, 1.3688491582870483, -0.08741306513547897, 0.1670454740524292, 1.1907501220703125, -1.3345674276351929, 1.543297290802002, -0.6293419003486633, 0.22415970265865326, -2.3625385761260986, 1.3710609674453735, -0.7234260439872742, 1.969774603843689, -2.6330199241638184, 0.4370095431804657, -0.5747601985931396, -0.45593759417533875, 0.2926568388938904, -0.3290248513221741, 0.12628258764743805, -0.11979376524686813, -1.0288687944412231, -0.007524975575506687, -0.5598769187927246, 0.6520882844924927, 1.1223411560058594, 1.4218387603759766, -1.2063921689987183, -0.2935091555118561, -1.6559115648269653, -0.2639860212802887, -0.8130505084991455, 0.29551446437835693, -2.016721725463867, -0.239318385720253, -1.9794684648513794, -2.419135332107544, -1.3613179922103882, -0.8354490995407104, 1.1577740907669067, 0.15060484409332275, -1.0312544107437134, 1.2628763914108276, -0.3863453269004822, -1.820457100868225, 1.1984667778015137, -2.1046886444091797 ]
https://github.com/huggingface/datasets/issues/3122
OSError with a custom dataset loading script
Hi, I just tried to download the `classla/janes_tag` dataset, and this time the zip file is extracted correctly. However, the script is now throwing the IndexError, probably due to a bug in the `_generate_examples`. Let me know if you are still getting the same error.
## Describe the bug I am getting an OS error when trying to load the newly uploaded dataset classla/janes_tag. What puzzles me is that I have already uploaded a very similar dataset - classla/reldi_hr - with no issues. The loading scripts for the two datasets are almost identical and they have the same directory structure, yet I am only getting an error with janes_tag. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('classla/janes_tag', split='validation') ``` ## Expected results Dataset correctly loaded. ## Actual results Traceback (most recent call last): File "C:/mypath/test.py", line 91, in <module> load_and_print('janes_tag') File "C:/mypath/test.py", line 32, in load_and_print dataset = datasets.load_dataset('classla/{}'.format(ds_name), split='validation') File "C:\mypath\venv\lib\site-packages\datasets\load.py", line 1632, in load_dataset use_auth_token=use_auth_token, File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 608, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 704, in _download_and_prepare ) from None OSError: Cannot find data file. Original error: [Errno 2] No such file or directory: 'C:\\mypath\\.cache\\huggingface\\datasets\\downloads\\2c9996e44bdc5af9c89bffb9e6d7a3e42fdb2f56bacab45de13b20f3032ea7ca\\data\\train_all.conllup' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.5 - PyArrow version: 3.0.0
1,162
45
OSError with a custom dataset loading script ## Describe the bug I am getting an OS error when trying to load the newly uploaded dataset classla/janes_tag. What puzzles me is that I have already uploaded a very similar dataset - classla/reldi_hr - with no issues. The loading scripts for the two datasets are almost identical and they have the same directory structure, yet I am only getting an error with janes_tag. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('classla/janes_tag', split='validation') ``` ## Expected results Dataset correctly loaded. ## Actual results Traceback (most recent call last): File "C:/mypath/test.py", line 91, in <module> load_and_print('janes_tag') File "C:/mypath/test.py", line 32, in load_and_print dataset = datasets.load_dataset('classla/{}'.format(ds_name), split='validation') File "C:\mypath\venv\lib\site-packages\datasets\load.py", line 1632, in load_dataset use_auth_token=use_auth_token, File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 608, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 704, in _download_and_prepare ) from None OSError: Cannot find data file. Original error: [Errno 2] No such file or directory: 'C:\\mypath\\.cache\\huggingface\\datasets\\downloads\\2c9996e44bdc5af9c89bffb9e6d7a3e42fdb2f56bacab45de13b20f3032ea7ca\\data\\train_all.conllup' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.5 - PyArrow version: 3.0.0 Hi, I just tried to download the `classla/janes_tag` dataset, and this time the zip file is extracted correctly. However, the script is now throwing the IndexError, probably due to a bug in the `_generate_examples`. Let me know if you are still getting the same error.
[ -1.2348365783691406, -0.9167017936706543, -0.6255295276641846, 1.4129399061203003, -0.15435607731342316, -1.219717264175415, 0.05580707639455795, -1.0339274406433105, 1.6345734596252441, -0.7894803285598755, 0.18790456652641296, -1.686458706855774, 0.013226320967078209, -0.5875965356826782, -0.6818221211433411, -0.8906069993972778, -0.3390595614910126, -0.7812573313713074, 1.0421231985092163, 2.508939266204834, 1.2591992616653442, -1.351700782775879, 2.7811203002929688, 0.7346806526184082, -0.2850492596626282, -0.9954200983047485, 0.625596821308136, 0.001601003110408783, -1.1909252405166626, -0.4009263515472412, -0.9366761445999146, 0.01851845532655716, -0.6162446141242981, -0.4589817523956299, -0.008252069354057312, 0.44643059372901917, -0.27462178468704224, -0.3620757758617401, -0.6483681797981262, -0.7207871079444885, 0.4872911274433136, -0.4327394366264343, 1.0095666646957397, -0.32511967420578003, 1.8659980297088623, -0.6112620830535889, 0.31127655506134033, 0.745195209980011, 1.257041096687317, 0.1406187117099762, 0.07779939472675323, 0.2900480329990387, 0.3612469732761383, -0.0014107800088822842, 0.437688946723938, 1.132994532585144, 0.6085389256477356, 0.41105887293815613, 0.7954228520393372, -2.156581163406372, 1.3620715141296387, -0.9151310324668884, 0.20791684091091156, 1.3417887687683105, -0.9512231349945068, 0.39042022824287415, -1.726682424545288, -0.0629015564918518, 0.5694078803062439, -2.1644468307495117, 0.1890328973531723, -1.2814148664474487, -0.5541693568229675, 0.9903518557548523, 0.294261634349823, -1.1330649852752686, 0.22384954988956451, -0.5685374140739441, 1.034645438194275, 0.45079460740089417, 1.0807677507400513, -1.6047898530960083, -0.005885306745767593, -0.21114489436149597, 0.10140188783407211, -1.4784502983093262, -1.5681411027908325, 0.6486680507659912, 0.5503091216087341, 0.6894562244415283, -0.059508584439754486, 1.0968142747879028, -1.0443665981292725, 0.7698361873626709, -0.9904894828796387, -1.7152085304260254, -1.3995389938354492, -2.3358755111694336, -2.3219263553619385, 0.7221172451972961, -0.545979380607605, -0.5226593017578125, 2.0402965545654297, -1.069326400756836, -1.7101577520370483, 1.1297264099121094, 0.23337744176387787, -0.019066065549850464, 2.4109585285186768, 0.23320472240447998, -0.804060697555542, 0.4075927138328552, -0.7982314229011536, 0.8103695511817932, -0.21738706529140472, 1.3521145582199097, 0.49681681394577026, -1.0236315727233887, 1.5540820360183716, -0.4602217376232147, 0.6557011008262634, -0.5671355724334717, -0.5168842673301697, -0.7591068744659424, 0.3049124479293823, 1.8136519193649292, -0.35901156067848206, 1.6320394277572632, -0.3468419313430786, -1.5255553722381592, -1.5627161264419556, 0.8263673186302185, 0.35688281059265137, -0.7630893588066101, 0.11790655553340912, -0.449471116065979, 0.09167646616697311, -0.055243030190467834, 1.1555134057998657, 1.2920856475830078, 0.6505948901176453, -0.3593403995037079, -0.8760426640510559, 0.1340729147195816, -0.08798976987600327, -0.6594566106796265, -1.7819643020629883, -0.34725233912467957, 0.15421175956726074, 0.7054311633110046, -1.262969970703125, 1.756989598274231, 0.9626779556274414, 1.9260975122451782, 1.0191433429718018, -0.3712891936302185, 1.3435744047164917, 0.061918847262859344, 1.7965850830078125, -0.5275317430496216, 0.6274517178535461, -0.4226570725440979, -1.1987003087997437, 0.8537265658378601, -0.3547460436820984, -1.9822875261306763, -0.8245264291763306, -0.7661271095275879, -0.11997310817241669, -0.81405109167099, 0.9177332520484924, -0.3526748716831207, -1.4900405406951904, 0.1962069272994995, -0.6497527360916138, 0.07194561511278152, -1.2747883796691895, 0.20292946696281433, 0.7132558226585388, -0.6340736746788025, 0.044005386531353, -0.22330190241336823, -1.2929863929748535, -0.5176461935043335, 0.2911427915096283, 1.8626958131790161, -0.7238693237304688, 0.9277719259262085, 1.0467513799667358, -0.6571099758148193, 0.15078747272491455, 0.22952701151371002, -0.3113156259059906, 0.7762405872344971, -1.0406348705291748, -0.4447123408317566, 1.1519051790237427, -0.22596824169158936, -0.6551083326339722, 1.4848121404647827, 0.7860657572746277, -1.1188186407089233, -0.2593112587928772, -0.20973250269889832, -0.8546611666679382, -0.05715178698301315, -1.4755220413208008, -0.16823501884937286, 0.3488138020038605, -1.537685513496399, -0.37955233454704285, -0.24774770438671112, 1.3696365356445312, -0.16000276803970337, 1.4084205627441406, -0.4112069010734558, -0.20745906233787537, -0.2933158576488495, -0.5808423757553101, 0.16718724370002747, -0.16688531637191772, -0.5479642748832703, 0.16385000944137573, -0.9311087131500244, 0.3528018295764923, 1.4673056602478027, 0.37807267904281616, -0.04574645310640335, 0.4301198422908783, 1.1397628784179688, 0.3369362950325012, -0.0858481228351593, -0.8332441449165344, -1.46759033203125, 2.0052239894866943, -1.5315860509872437, 1.9643304347991943, 0.7711774706840515, -0.09943217784166336, -1.769344449043274, -1.7599456310272217, 1.3330357074737549, 1.1945929527282715, 2.2272446155548096, 0.6024171710014343, 0.3457965552806854, -0.8359128832817078, -0.6330868005752563, 0.42107704281806946, -1.0267590284347534, -0.5475718975067139, 0.16516250371932983, 2.3929967880249023, 1.817708969116211, -0.5210181474685669, -0.1584545224905014, -0.8505398631095886, 1.3723561763763428, -0.16463139653205872, 0.27682650089263916, 2.0270111560821533, -0.37994885444641113, -1.028635859489441, 1.3186372518539429, -2.3351712226867676, 0.19033025205135345, 2.030339002609253, 0.26351234316825867, 0.09510089457035065, -1.3426423072814941, -0.6239039301872253, -0.4508020877838135, -0.36958077549934387, -1.1926103830337524, 0.5607280731201172, -0.2709997296333313, -0.8009064197540283, -1.4750334024429321, 0.12129202485084534, -1.2265074253082275, -1.7945411205291748, 0.3416298031806946, 1.897492527961731, 2.14511775970459, -0.8404290080070496, 1.5566085577011108, -0.30479705333709717, 0.15055575966835022, 1.134281873703003, 1.315470814704895, 3.0625805854797363, 1.8564399480819702, -1.1595357656478882, 0.642960250377655, -0.17219622433185577, -0.5099451541900635, 1.1467573642730713, -1.172094464302063, 1.2845309972763062, -0.19606253504753113, -1.1435097455978394, -1.2428902387619019, 0.9316375851631165, 0.3911622166633606, -0.03707673400640488, -0.4648698568344116, 1.3309167623519897, 0.11092743277549744, 1.4146738052368164, 0.534903883934021, -0.3588722050189972, 0.5165672898292542, -0.4408193826675415, -0.565760612487793, 1.578674077987671, 0.17728760838508606, -1.4929970502853394, -2.24709415435791, -0.3256811201572418, -0.7434393167495728, 0.03287697583436966, -0.641845166683197, -1.0277806520462036, 1.6618049144744873, 0.31740373373031616, -1.1945674419403076, -0.2726726233959198, -0.42441028356552124, -0.5149831175804138, 2.6870779991149902, -1.376197099685669, -0.08998652547597885, -0.9388251900672913, -0.6258746981620789, 1.6057020425796509, -1.1339075565338135, -0.18260902166366577, -1.094862461090088, -0.6410588622093201, -1.3553531169891357, -0.5423914790153503, 0.020457785576581955, -1.000964641571045, 0.8026666045188904, 0.23998816311359406, -1.045066475868225, -0.313643217086792, -0.8497905731201172, 0.9547600746154785, -0.20700785517692566, 0.24544262886047363, 1.8903981447219849, 0.40417325496673584, -0.4448815882205963, 0.7779325246810913, 1.1888935565948486, 0.6416229605674744, -0.7425622940063477, -0.051557160913944244, -0.7257977724075317, 0.38289982080459595, -1.3575469255447388, 0.25235500931739807, -2.874931573867798, 0.6642296314239502, -0.10892953723669052, -0.04386650770902634, -0.05888983607292175, -1.2509821653366089, 1.0945613384246826, 2.6722612380981445, -1.2724236249923706, 0.4828573167324066, 0.4432641565799713, 1.169111967086792, -1.5711456537246704, 0.3677988648414612, -0.4247182607650757, 1.9975807666778564, 0.2088189572095871, 1.2779651880264282, -0.5602304339408875, -2.3189194202423096, 0.6394795775413513, -1.2048381567001343, -1.1795477867126465, 0.835365891456604, -0.8909435868263245, 0.19714918732643127, -1.489643931388855, -0.18366366624832153, -1.0025995969772339, -1.2549058198928833, 0.6486543416976929, 0.21086007356643677, 0.5116103887557983, -0.6081045269966125, 0.3499215841293335, -2.2404797077178955, -1.4375016689300537, -0.23767425119876862, -0.9773999452590942, 0.5999849438667297, -0.4727115035057068, 0.6528944969177246, -0.12117709964513779, 0.03915382921695709, 0.3354121744632721, 1.3861857652664185, 3.4670636653900146, 0.16982781887054443, 0.23066966235637665, -0.10510554909706116, -0.966579794883728, 1.432725191116333, 0.9438503384590149, -0.16374319791793823, -0.5157153010368347, -1.076941967010498, 1.2655466794967651, 1.9879136085510254, 1.0721566677093506, -0.04617734253406525, -0.7756171822547913, -0.6999198198318481, -0.04439028352499008, 0.19339005649089813, 0.5168439745903015, 0.8389180302619934, -0.05820373445749283, 0.14530383050441742, 1.4929776191711426, 1.1501761674880981, -0.4236108958721161, 0.20505641400814056, -0.8777843713760376, -0.41904217004776, 0.5110330581665039, 0.17710943520069122, 0.0007682750001549721, 0.4599950611591339, -0.8993379473686218, -0.2739391624927521, -0.3378639221191406, -0.8449000716209412, -0.676638126373291, -0.38726359605789185, -0.4018419682979584, 1.6188730001449585, 0.06692129373550415, -0.534424364566803, -0.13097989559173584, -0.665314793586731, -0.25404730439186096, -1.085253357887268, 0.25547337532043457, -0.12832246720790863, -0.03883686661720276, -0.21310096979141235, 1.7199541330337524, -0.9336446523666382, -2.03999400138855, 0.21247540414333344, 0.28322991728782654, -0.2180536687374115, 0.1616114377975464, 1.6537361145019531, 0.5198858380317688, 1.3414274454116821, 1.257475733757019, 0.9635933041572571, -0.7068553566932678, -1.2589820623397827, 0.6060177087783813, 1.0420663356781006, -1.3786323070526123, 0.8846862316131592, -0.10942526161670685, -0.6104224324226379, 0.6459201574325562, 1.380730152130127, 0.49764466285705566, -1.9813669919967651, 0.8093783259391785, -1.026638388633728, 0.8646343350410461, 0.7360391020774841, 0.7301830649375916, 0.1524987667798996, 0.7880806922912598, -1.1293857097625732, -1.195565104484558, -0.7606867551803589, -0.68108731508255, 1.9616121053695679, -0.232747420668602, 0.5858058333396912, -0.17516806721687317, -1.1686294078826904, -0.055939242243766785, 0.7260244488716125, 0.3830474615097046, -0.45723849534988403, 0.8437066078186035, -0.6161560416221619, -1.0076335668563843, -1.2997329235076904, -0.3652257025241852, -0.9785853624343872, -1.0219987630844116, 1.0151636600494385, 0.7310301661491394, 0.35887977480888367, 1.8614845275878906, 0.6333321928977966, 0.2603144645690918, -2.519045352935791, 0.957105815410614, 0.2979888916015625, -0.10619145631790161, 0.8722749948501587, 0.33729085326194763, 1.0171984434127808, 0.04676765203475952, 0.5654187798500061, -2.428847551345825, 2.2246170043945312, -0.24002471566200256, 0.6545584797859192, 0.032805152237415314, -0.18274398148059845, 1.1152070760726929, 0.6403191089630127, 0.46797528862953186, -1.0256319046020508, 0.7150579690933228, -0.40225982666015625, 1.1749376058578491, 1.0387142896652222, -0.841720700263977, 0.05621182173490524, 1.3689405918121338, 0.5201869606971741, -0.5668292045593262, -0.8555628657341003, -0.9108239412307739, 0.9606917500495911, 1.7832684516906738, -0.10903874784708023, -0.031141094863414764, 0.8148192763328552, 0.6156551837921143, -1.1715433597564697, 0.028628835454583168, -0.6352024674415588, -0.6981760859489441, 1.6463816165924072, 2.1036436557769775, -0.10022618621587753, -0.10461848229169846, -0.7053106427192688, -1.202030062675476, 0.8856721520423889, -0.08110830932855606, 0.09708978980779648, 0.6551974415779114, -0.6739370226860046, 1.1241710186004639, 0.7093818783760071, 0.9007818102836609, 0.1573198288679123, 0.238310307264328, 0.4810529947280884, -0.2062559723854065, -1.075675129890442, -0.35112932324409485, -1.0701454877853394, -2.4408669471740723, 0.3625786602497101, -0.20405064523220062, -1.4813802242279053, -0.10571596026420593, -0.9726034998893738, 1.0034393072128296, -0.5915153622627258, -1.0547689199447632, -1.6049911975860596, 0.21547622978687286, -0.08303885161876678, 0.9580851793289185, -1.6931045055389404, -0.20780038833618164, 1.2917041778564453, 0.8660252094268799, -0.582753598690033, 1.0999830961227417, 0.24460738897323608, 0.9845921993255615, 0.7115890383720398, -0.30672693252563477, 0.6527175307273865, 0.07018983364105225, -1.3436837196350098, 0.47537440061569214, 1.2522543668746948, 0.1525963395833969, 1.4437872171401978, -0.3886411786079407, 0.0170035008341074, 0.3874281942844391, -0.5515086054801941, -0.4931339621543884, -0.41529738903045654, 0.6750543713569641, 0.09083487838506699, -0.860871434211731, -0.07205159217119217, -0.1615341752767563, -0.3380255401134491, 0.2603045105934143, -1.5411930084228516, -0.2327428013086319, -0.4736439883708954, -0.47339922189712524, -1.3253194093704224, -0.028399482369422913, 1.488789439201355, -0.771555483341217, -0.20498543977737427, 0.48980891704559326, 0.43611064553260803, 0.4795634150505066, 0.6261508464813232, -0.8159762620925903, -0.2867187261581421, -0.378611296415329, -0.34170275926589966, 0.25088727474212646, 1.3247672319412231, -0.0684376135468483, -1.0450019836425781, 0.6854820251464844, -0.37402793765068054, 0.09439785778522491, 1.9980120658874512, 0.14583870768547058, -0.716471791267395, 0.34216517210006714, -0.7999690771102905, 1.8892918825149536, 1.6372098922729492, 1.3464419841766357, -0.13515254855155945, -0.8918136358261108, 0.5714755654335022, -0.2598792314529419, -0.33857613801956177, 0.9147342443466187, 0.3814880847930908, -0.2490098774433136, -1.4709137678146362, 0.6996967196464539, 1.258387804031372, -0.8695768713951111, -0.7028072476387024, 0.10123516619205475, -0.8477848172187805, 1.081714391708374, 0.6295871734619141, 0.398772656917572, 0.2871512770652771, 1.7723805904388428, 0.7468671798706055, -0.583828866481781, 0.5088565945625305, 0.4960489869117737, -0.1519199013710022, -2.075587272644043, -1.0731759071350098, 0.3419613838195801, -0.4508734345436096, -1.5791125297546387, 1.4250684976577759, -1.1675726175308228, -0.9699972867965698, 0.5583388209342957, 0.015184134244918823, 1.3439106941223145, 0.359386682510376, 1.5752689838409424, 2.1036925315856934, 0.7219297885894775, 0.3566405475139618, 1.1833181381225586, -0.20066289603710175, -0.47681644558906555, 1.8172376155853271, -0.46489521861076355, 0.47015199065208435, 1.1464807987213135, -0.3343837261199951, -0.9996421337127686, -0.7790926694869995, -1.2632938623428345, -0.6092244386672974, 1.135941982269287, 0.06669529527425766, -1.1824990510940552, 0.24305585026741028, 1.5923579931259155, 0.15989969670772552, -0.31404680013656616, 0.6461677551269531, 0.4487389922142029, -0.8714514970779419, -0.15795932710170746, -0.9026681184768677, 0.560028612613678, -0.13167279958724976, -0.319278359413147, 0.29228103160858154, 0.5106762051582336, 1.3688491582870483, -0.08741306513547897, 0.1670454740524292, 1.1907501220703125, -1.3345674276351929, 1.543297290802002, -0.6293419003486633, 0.22415970265865326, -2.3625385761260986, 1.3710609674453735, -0.7234260439872742, 1.969774603843689, -2.6330199241638184, 0.4370095431804657, -0.5747601985931396, -0.45593759417533875, 0.2926568388938904, -0.3290248513221741, 0.12628258764743805, -0.11979376524686813, -1.0288687944412231, -0.007524975575506687, -0.5598769187927246, 0.6520882844924927, 1.1223411560058594, 1.4218387603759766, -1.2063921689987183, -0.2935091555118561, -1.6559115648269653, -0.2639860212802887, -0.8130505084991455, 0.29551446437835693, -2.016721725463867, -0.239318385720253, -1.9794684648513794, -2.419135332107544, -1.3613179922103882, -0.8354490995407104, 1.1577740907669067, 0.15060484409332275, -1.0312544107437134, 1.2628763914108276, -0.3863453269004822, -1.820457100868225, 1.1984667778015137, -2.1046886444091797 ]
https://github.com/huggingface/datasets/issues/3122
OSError with a custom dataset loading script
Hi, could you try to download the dataset with a different `cache_dir` like so: ```python import datasets dataset = datasets.load_dataset('classla/janes_tag', split='validation', cache_dir="path/to/different/cache/dir") ``` If this works, then most likely the cached extracted data is causing issues. This data is stored at `~/.cache/huggingface/datasets/downloads/extracted` and needs to be deleted, and then it should work (you can easily locate the directory with the path given in the `OSError` message). Additionally, I'd suggest you to update `datasets` to the newest version with: ``` pip install -U datasets ```
## Describe the bug I am getting an OS error when trying to load the newly uploaded dataset classla/janes_tag. What puzzles me is that I have already uploaded a very similar dataset - classla/reldi_hr - with no issues. The loading scripts for the two datasets are almost identical and they have the same directory structure, yet I am only getting an error with janes_tag. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('classla/janes_tag', split='validation') ``` ## Expected results Dataset correctly loaded. ## Actual results Traceback (most recent call last): File "C:/mypath/test.py", line 91, in <module> load_and_print('janes_tag') File "C:/mypath/test.py", line 32, in load_and_print dataset = datasets.load_dataset('classla/{}'.format(ds_name), split='validation') File "C:\mypath\venv\lib\site-packages\datasets\load.py", line 1632, in load_dataset use_auth_token=use_auth_token, File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 608, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 704, in _download_and_prepare ) from None OSError: Cannot find data file. Original error: [Errno 2] No such file or directory: 'C:\\mypath\\.cache\\huggingface\\datasets\\downloads\\2c9996e44bdc5af9c89bffb9e6d7a3e42fdb2f56bacab45de13b20f3032ea7ca\\data\\train_all.conllup' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.5 - PyArrow version: 3.0.0
1,162
84
OSError with a custom dataset loading script ## Describe the bug I am getting an OS error when trying to load the newly uploaded dataset classla/janes_tag. What puzzles me is that I have already uploaded a very similar dataset - classla/reldi_hr - with no issues. The loading scripts for the two datasets are almost identical and they have the same directory structure, yet I am only getting an error with janes_tag. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('classla/janes_tag', split='validation') ``` ## Expected results Dataset correctly loaded. ## Actual results Traceback (most recent call last): File "C:/mypath/test.py", line 91, in <module> load_and_print('janes_tag') File "C:/mypath/test.py", line 32, in load_and_print dataset = datasets.load_dataset('classla/{}'.format(ds_name), split='validation') File "C:\mypath\venv\lib\site-packages\datasets\load.py", line 1632, in load_dataset use_auth_token=use_auth_token, File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 608, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 704, in _download_and_prepare ) from None OSError: Cannot find data file. Original error: [Errno 2] No such file or directory: 'C:\\mypath\\.cache\\huggingface\\datasets\\downloads\\2c9996e44bdc5af9c89bffb9e6d7a3e42fdb2f56bacab45de13b20f3032ea7ca\\data\\train_all.conllup' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.5 - PyArrow version: 3.0.0 Hi, could you try to download the dataset with a different `cache_dir` like so: ```python import datasets dataset = datasets.load_dataset('classla/janes_tag', split='validation', cache_dir="path/to/different/cache/dir") ``` If this works, then most likely the cached extracted data is causing issues. This data is stored at `~/.cache/huggingface/datasets/downloads/extracted` and needs to be deleted, and then it should work (you can easily locate the directory with the path given in the `OSError` message). Additionally, I'd suggest you to update `datasets` to the newest version with: ``` pip install -U datasets ```
[ -1.2348365783691406, -0.9167017936706543, -0.6255295276641846, 1.4129399061203003, -0.15435607731342316, -1.219717264175415, 0.05580707639455795, -1.0339274406433105, 1.6345734596252441, -0.7894803285598755, 0.18790456652641296, -1.686458706855774, 0.013226320967078209, -0.5875965356826782, -0.6818221211433411, -0.8906069993972778, -0.3390595614910126, -0.7812573313713074, 1.0421231985092163, 2.508939266204834, 1.2591992616653442, -1.351700782775879, 2.7811203002929688, 0.7346806526184082, -0.2850492596626282, -0.9954200983047485, 0.625596821308136, 0.001601003110408783, -1.1909252405166626, -0.4009263515472412, -0.9366761445999146, 0.01851845532655716, -0.6162446141242981, -0.4589817523956299, -0.008252069354057312, 0.44643059372901917, -0.27462178468704224, -0.3620757758617401, -0.6483681797981262, -0.7207871079444885, 0.4872911274433136, -0.4327394366264343, 1.0095666646957397, -0.32511967420578003, 1.8659980297088623, -0.6112620830535889, 0.31127655506134033, 0.745195209980011, 1.257041096687317, 0.1406187117099762, 0.07779939472675323, 0.2900480329990387, 0.3612469732761383, -0.0014107800088822842, 0.437688946723938, 1.132994532585144, 0.6085389256477356, 0.41105887293815613, 0.7954228520393372, -2.156581163406372, 1.3620715141296387, -0.9151310324668884, 0.20791684091091156, 1.3417887687683105, -0.9512231349945068, 0.39042022824287415, -1.726682424545288, -0.0629015564918518, 0.5694078803062439, -2.1644468307495117, 0.1890328973531723, -1.2814148664474487, -0.5541693568229675, 0.9903518557548523, 0.294261634349823, -1.1330649852752686, 0.22384954988956451, -0.5685374140739441, 1.034645438194275, 0.45079460740089417, 1.0807677507400513, -1.6047898530960083, -0.005885306745767593, -0.21114489436149597, 0.10140188783407211, -1.4784502983093262, -1.5681411027908325, 0.6486680507659912, 0.5503091216087341, 0.6894562244415283, -0.059508584439754486, 1.0968142747879028, -1.0443665981292725, 0.7698361873626709, -0.9904894828796387, -1.7152085304260254, -1.3995389938354492, -2.3358755111694336, -2.3219263553619385, 0.7221172451972961, -0.545979380607605, -0.5226593017578125, 2.0402965545654297, -1.069326400756836, -1.7101577520370483, 1.1297264099121094, 0.23337744176387787, -0.019066065549850464, 2.4109585285186768, 0.23320472240447998, -0.804060697555542, 0.4075927138328552, -0.7982314229011536, 0.8103695511817932, -0.21738706529140472, 1.3521145582199097, 0.49681681394577026, -1.0236315727233887, 1.5540820360183716, -0.4602217376232147, 0.6557011008262634, -0.5671355724334717, -0.5168842673301697, -0.7591068744659424, 0.3049124479293823, 1.8136519193649292, -0.35901156067848206, 1.6320394277572632, -0.3468419313430786, -1.5255553722381592, -1.5627161264419556, 0.8263673186302185, 0.35688281059265137, -0.7630893588066101, 0.11790655553340912, -0.449471116065979, 0.09167646616697311, -0.055243030190467834, 1.1555134057998657, 1.2920856475830078, 0.6505948901176453, -0.3593403995037079, -0.8760426640510559, 0.1340729147195816, -0.08798976987600327, -0.6594566106796265, -1.7819643020629883, -0.34725233912467957, 0.15421175956726074, 0.7054311633110046, -1.262969970703125, 1.756989598274231, 0.9626779556274414, 1.9260975122451782, 1.0191433429718018, -0.3712891936302185, 1.3435744047164917, 0.061918847262859344, 1.7965850830078125, -0.5275317430496216, 0.6274517178535461, -0.4226570725440979, -1.1987003087997437, 0.8537265658378601, -0.3547460436820984, -1.9822875261306763, -0.8245264291763306, -0.7661271095275879, -0.11997310817241669, -0.81405109167099, 0.9177332520484924, -0.3526748716831207, -1.4900405406951904, 0.1962069272994995, -0.6497527360916138, 0.07194561511278152, -1.2747883796691895, 0.20292946696281433, 0.7132558226585388, -0.6340736746788025, 0.044005386531353, -0.22330190241336823, -1.2929863929748535, -0.5176461935043335, 0.2911427915096283, 1.8626958131790161, -0.7238693237304688, 0.9277719259262085, 1.0467513799667358, -0.6571099758148193, 0.15078747272491455, 0.22952701151371002, -0.3113156259059906, 0.7762405872344971, -1.0406348705291748, -0.4447123408317566, 1.1519051790237427, -0.22596824169158936, -0.6551083326339722, 1.4848121404647827, 0.7860657572746277, -1.1188186407089233, -0.2593112587928772, -0.20973250269889832, -0.8546611666679382, -0.05715178698301315, -1.4755220413208008, -0.16823501884937286, 0.3488138020038605, -1.537685513496399, -0.37955233454704285, -0.24774770438671112, 1.3696365356445312, -0.16000276803970337, 1.4084205627441406, -0.4112069010734558, -0.20745906233787537, -0.2933158576488495, -0.5808423757553101, 0.16718724370002747, -0.16688531637191772, -0.5479642748832703, 0.16385000944137573, -0.9311087131500244, 0.3528018295764923, 1.4673056602478027, 0.37807267904281616, -0.04574645310640335, 0.4301198422908783, 1.1397628784179688, 0.3369362950325012, -0.0858481228351593, -0.8332441449165344, -1.46759033203125, 2.0052239894866943, -1.5315860509872437, 1.9643304347991943, 0.7711774706840515, -0.09943217784166336, -1.769344449043274, -1.7599456310272217, 1.3330357074737549, 1.1945929527282715, 2.2272446155548096, 0.6024171710014343, 0.3457965552806854, -0.8359128832817078, -0.6330868005752563, 0.42107704281806946, -1.0267590284347534, -0.5475718975067139, 0.16516250371932983, 2.3929967880249023, 1.817708969116211, -0.5210181474685669, -0.1584545224905014, -0.8505398631095886, 1.3723561763763428, -0.16463139653205872, 0.27682650089263916, 2.0270111560821533, -0.37994885444641113, -1.028635859489441, 1.3186372518539429, -2.3351712226867676, 0.19033025205135345, 2.030339002609253, 0.26351234316825867, 0.09510089457035065, -1.3426423072814941, -0.6239039301872253, -0.4508020877838135, -0.36958077549934387, -1.1926103830337524, 0.5607280731201172, -0.2709997296333313, -0.8009064197540283, -1.4750334024429321, 0.12129202485084534, -1.2265074253082275, -1.7945411205291748, 0.3416298031806946, 1.897492527961731, 2.14511775970459, -0.8404290080070496, 1.5566085577011108, -0.30479705333709717, 0.15055575966835022, 1.134281873703003, 1.315470814704895, 3.0625805854797363, 1.8564399480819702, -1.1595357656478882, 0.642960250377655, -0.17219622433185577, -0.5099451541900635, 1.1467573642730713, -1.172094464302063, 1.2845309972763062, -0.19606253504753113, -1.1435097455978394, -1.2428902387619019, 0.9316375851631165, 0.3911622166633606, -0.03707673400640488, -0.4648698568344116, 1.3309167623519897, 0.11092743277549744, 1.4146738052368164, 0.534903883934021, -0.3588722050189972, 0.5165672898292542, -0.4408193826675415, -0.565760612487793, 1.578674077987671, 0.17728760838508606, -1.4929970502853394, -2.24709415435791, -0.3256811201572418, -0.7434393167495728, 0.03287697583436966, -0.641845166683197, -1.0277806520462036, 1.6618049144744873, 0.31740373373031616, -1.1945674419403076, -0.2726726233959198, -0.42441028356552124, -0.5149831175804138, 2.6870779991149902, -1.376197099685669, -0.08998652547597885, -0.9388251900672913, -0.6258746981620789, 1.6057020425796509, -1.1339075565338135, -0.18260902166366577, -1.094862461090088, -0.6410588622093201, -1.3553531169891357, -0.5423914790153503, 0.020457785576581955, -1.000964641571045, 0.8026666045188904, 0.23998816311359406, -1.045066475868225, -0.313643217086792, -0.8497905731201172, 0.9547600746154785, -0.20700785517692566, 0.24544262886047363, 1.8903981447219849, 0.40417325496673584, -0.4448815882205963, 0.7779325246810913, 1.1888935565948486, 0.6416229605674744, -0.7425622940063477, -0.051557160913944244, -0.7257977724075317, 0.38289982080459595, -1.3575469255447388, 0.25235500931739807, -2.874931573867798, 0.6642296314239502, -0.10892953723669052, -0.04386650770902634, -0.05888983607292175, -1.2509821653366089, 1.0945613384246826, 2.6722612380981445, -1.2724236249923706, 0.4828573167324066, 0.4432641565799713, 1.169111967086792, -1.5711456537246704, 0.3677988648414612, -0.4247182607650757, 1.9975807666778564, 0.2088189572095871, 1.2779651880264282, -0.5602304339408875, -2.3189194202423096, 0.6394795775413513, -1.2048381567001343, -1.1795477867126465, 0.835365891456604, -0.8909435868263245, 0.19714918732643127, -1.489643931388855, -0.18366366624832153, -1.0025995969772339, -1.2549058198928833, 0.6486543416976929, 0.21086007356643677, 0.5116103887557983, -0.6081045269966125, 0.3499215841293335, -2.2404797077178955, -1.4375016689300537, -0.23767425119876862, -0.9773999452590942, 0.5999849438667297, -0.4727115035057068, 0.6528944969177246, -0.12117709964513779, 0.03915382921695709, 0.3354121744632721, 1.3861857652664185, 3.4670636653900146, 0.16982781887054443, 0.23066966235637665, -0.10510554909706116, -0.966579794883728, 1.432725191116333, 0.9438503384590149, -0.16374319791793823, -0.5157153010368347, -1.076941967010498, 1.2655466794967651, 1.9879136085510254, 1.0721566677093506, -0.04617734253406525, -0.7756171822547913, -0.6999198198318481, -0.04439028352499008, 0.19339005649089813, 0.5168439745903015, 0.8389180302619934, -0.05820373445749283, 0.14530383050441742, 1.4929776191711426, 1.1501761674880981, -0.4236108958721161, 0.20505641400814056, -0.8777843713760376, -0.41904217004776, 0.5110330581665039, 0.17710943520069122, 0.0007682750001549721, 0.4599950611591339, -0.8993379473686218, -0.2739391624927521, -0.3378639221191406, -0.8449000716209412, -0.676638126373291, -0.38726359605789185, -0.4018419682979584, 1.6188730001449585, 0.06692129373550415, -0.534424364566803, -0.13097989559173584, -0.665314793586731, -0.25404730439186096, -1.085253357887268, 0.25547337532043457, -0.12832246720790863, -0.03883686661720276, -0.21310096979141235, 1.7199541330337524, -0.9336446523666382, -2.03999400138855, 0.21247540414333344, 0.28322991728782654, -0.2180536687374115, 0.1616114377975464, 1.6537361145019531, 0.5198858380317688, 1.3414274454116821, 1.257475733757019, 0.9635933041572571, -0.7068553566932678, -1.2589820623397827, 0.6060177087783813, 1.0420663356781006, -1.3786323070526123, 0.8846862316131592, -0.10942526161670685, -0.6104224324226379, 0.6459201574325562, 1.380730152130127, 0.49764466285705566, -1.9813669919967651, 0.8093783259391785, -1.026638388633728, 0.8646343350410461, 0.7360391020774841, 0.7301830649375916, 0.1524987667798996, 0.7880806922912598, -1.1293857097625732, -1.195565104484558, -0.7606867551803589, -0.68108731508255, 1.9616121053695679, -0.232747420668602, 0.5858058333396912, -0.17516806721687317, -1.1686294078826904, -0.055939242243766785, 0.7260244488716125, 0.3830474615097046, -0.45723849534988403, 0.8437066078186035, -0.6161560416221619, -1.0076335668563843, -1.2997329235076904, -0.3652257025241852, -0.9785853624343872, -1.0219987630844116, 1.0151636600494385, 0.7310301661491394, 0.35887977480888367, 1.8614845275878906, 0.6333321928977966, 0.2603144645690918, -2.519045352935791, 0.957105815410614, 0.2979888916015625, -0.10619145631790161, 0.8722749948501587, 0.33729085326194763, 1.0171984434127808, 0.04676765203475952, 0.5654187798500061, -2.428847551345825, 2.2246170043945312, -0.24002471566200256, 0.6545584797859192, 0.032805152237415314, -0.18274398148059845, 1.1152070760726929, 0.6403191089630127, 0.46797528862953186, -1.0256319046020508, 0.7150579690933228, -0.40225982666015625, 1.1749376058578491, 1.0387142896652222, -0.841720700263977, 0.05621182173490524, 1.3689405918121338, 0.5201869606971741, -0.5668292045593262, -0.8555628657341003, -0.9108239412307739, 0.9606917500495911, 1.7832684516906738, -0.10903874784708023, -0.031141094863414764, 0.8148192763328552, 0.6156551837921143, -1.1715433597564697, 0.028628835454583168, -0.6352024674415588, -0.6981760859489441, 1.6463816165924072, 2.1036436557769775, -0.10022618621587753, -0.10461848229169846, -0.7053106427192688, -1.202030062675476, 0.8856721520423889, -0.08110830932855606, 0.09708978980779648, 0.6551974415779114, -0.6739370226860046, 1.1241710186004639, 0.7093818783760071, 0.9007818102836609, 0.1573198288679123, 0.238310307264328, 0.4810529947280884, -0.2062559723854065, -1.075675129890442, -0.35112932324409485, -1.0701454877853394, -2.4408669471740723, 0.3625786602497101, -0.20405064523220062, -1.4813802242279053, -0.10571596026420593, -0.9726034998893738, 1.0034393072128296, -0.5915153622627258, -1.0547689199447632, -1.6049911975860596, 0.21547622978687286, -0.08303885161876678, 0.9580851793289185, -1.6931045055389404, -0.20780038833618164, 1.2917041778564453, 0.8660252094268799, -0.582753598690033, 1.0999830961227417, 0.24460738897323608, 0.9845921993255615, 0.7115890383720398, -0.30672693252563477, 0.6527175307273865, 0.07018983364105225, -1.3436837196350098, 0.47537440061569214, 1.2522543668746948, 0.1525963395833969, 1.4437872171401978, -0.3886411786079407, 0.0170035008341074, 0.3874281942844391, -0.5515086054801941, -0.4931339621543884, -0.41529738903045654, 0.6750543713569641, 0.09083487838506699, -0.860871434211731, -0.07205159217119217, -0.1615341752767563, -0.3380255401134491, 0.2603045105934143, -1.5411930084228516, -0.2327428013086319, -0.4736439883708954, -0.47339922189712524, -1.3253194093704224, -0.028399482369422913, 1.488789439201355, -0.771555483341217, -0.20498543977737427, 0.48980891704559326, 0.43611064553260803, 0.4795634150505066, 0.6261508464813232, -0.8159762620925903, -0.2867187261581421, -0.378611296415329, -0.34170275926589966, 0.25088727474212646, 1.3247672319412231, -0.0684376135468483, -1.0450019836425781, 0.6854820251464844, -0.37402793765068054, 0.09439785778522491, 1.9980120658874512, 0.14583870768547058, -0.716471791267395, 0.34216517210006714, -0.7999690771102905, 1.8892918825149536, 1.6372098922729492, 1.3464419841766357, -0.13515254855155945, -0.8918136358261108, 0.5714755654335022, -0.2598792314529419, -0.33857613801956177, 0.9147342443466187, 0.3814880847930908, -0.2490098774433136, -1.4709137678146362, 0.6996967196464539, 1.258387804031372, -0.8695768713951111, -0.7028072476387024, 0.10123516619205475, -0.8477848172187805, 1.081714391708374, 0.6295871734619141, 0.398772656917572, 0.2871512770652771, 1.7723805904388428, 0.7468671798706055, -0.583828866481781, 0.5088565945625305, 0.4960489869117737, -0.1519199013710022, -2.075587272644043, -1.0731759071350098, 0.3419613838195801, -0.4508734345436096, -1.5791125297546387, 1.4250684976577759, -1.1675726175308228, -0.9699972867965698, 0.5583388209342957, 0.015184134244918823, 1.3439106941223145, 0.359386682510376, 1.5752689838409424, 2.1036925315856934, 0.7219297885894775, 0.3566405475139618, 1.1833181381225586, -0.20066289603710175, -0.47681644558906555, 1.8172376155853271, -0.46489521861076355, 0.47015199065208435, 1.1464807987213135, -0.3343837261199951, -0.9996421337127686, -0.7790926694869995, -1.2632938623428345, -0.6092244386672974, 1.135941982269287, 0.06669529527425766, -1.1824990510940552, 0.24305585026741028, 1.5923579931259155, 0.15989969670772552, -0.31404680013656616, 0.6461677551269531, 0.4487389922142029, -0.8714514970779419, -0.15795932710170746, -0.9026681184768677, 0.560028612613678, -0.13167279958724976, -0.319278359413147, 0.29228103160858154, 0.5106762051582336, 1.3688491582870483, -0.08741306513547897, 0.1670454740524292, 1.1907501220703125, -1.3345674276351929, 1.543297290802002, -0.6293419003486633, 0.22415970265865326, -2.3625385761260986, 1.3710609674453735, -0.7234260439872742, 1.969774603843689, -2.6330199241638184, 0.4370095431804657, -0.5747601985931396, -0.45593759417533875, 0.2926568388938904, -0.3290248513221741, 0.12628258764743805, -0.11979376524686813, -1.0288687944412231, -0.007524975575506687, -0.5598769187927246, 0.6520882844924927, 1.1223411560058594, 1.4218387603759766, -1.2063921689987183, -0.2935091555118561, -1.6559115648269653, -0.2639860212802887, -0.8130505084991455, 0.29551446437835693, -2.016721725463867, -0.239318385720253, -1.9794684648513794, -2.419135332107544, -1.3613179922103882, -0.8354490995407104, 1.1577740907669067, 0.15060484409332275, -1.0312544107437134, 1.2628763914108276, -0.3863453269004822, -1.820457100868225, 1.1984667778015137, -2.1046886444091797 ]
https://github.com/huggingface/datasets/issues/3122
OSError with a custom dataset loading script
Thank you, deleting the `~/.cache/huggingface/datasets/downloads/extracted` directory helped. However, I am still having problems. There was indeed a bug in the script that was throwing an `IndexError`, which I have now corrected (added the condition to skip the lines starting with '# text') and it is working locally, but still throws an error when I try to load the dataset from HuggingFace. I literally copied and pasted the `_generate_examples` function and ran it on the `dev_all.conllup` file, which I even re-downloaded from the repository to be certain that the files are exactly the same. I also deleted everything again just in case, but it didn't help. The code works locally, but throws an `IndexError` when loading from `datasets.`
## Describe the bug I am getting an OS error when trying to load the newly uploaded dataset classla/janes_tag. What puzzles me is that I have already uploaded a very similar dataset - classla/reldi_hr - with no issues. The loading scripts for the two datasets are almost identical and they have the same directory structure, yet I am only getting an error with janes_tag. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('classla/janes_tag', split='validation') ``` ## Expected results Dataset correctly loaded. ## Actual results Traceback (most recent call last): File "C:/mypath/test.py", line 91, in <module> load_and_print('janes_tag') File "C:/mypath/test.py", line 32, in load_and_print dataset = datasets.load_dataset('classla/{}'.format(ds_name), split='validation') File "C:\mypath\venv\lib\site-packages\datasets\load.py", line 1632, in load_dataset use_auth_token=use_auth_token, File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 608, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 704, in _download_and_prepare ) from None OSError: Cannot find data file. Original error: [Errno 2] No such file or directory: 'C:\\mypath\\.cache\\huggingface\\datasets\\downloads\\2c9996e44bdc5af9c89bffb9e6d7a3e42fdb2f56bacab45de13b20f3032ea7ca\\data\\train_all.conllup' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.5 - PyArrow version: 3.0.0
1,162
117
OSError with a custom dataset loading script ## Describe the bug I am getting an OS error when trying to load the newly uploaded dataset classla/janes_tag. What puzzles me is that I have already uploaded a very similar dataset - classla/reldi_hr - with no issues. The loading scripts for the two datasets are almost identical and they have the same directory structure, yet I am only getting an error with janes_tag. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('classla/janes_tag', split='validation') ``` ## Expected results Dataset correctly loaded. ## Actual results Traceback (most recent call last): File "C:/mypath/test.py", line 91, in <module> load_and_print('janes_tag') File "C:/mypath/test.py", line 32, in load_and_print dataset = datasets.load_dataset('classla/{}'.format(ds_name), split='validation') File "C:\mypath\venv\lib\site-packages\datasets\load.py", line 1632, in load_dataset use_auth_token=use_auth_token, File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 608, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 704, in _download_and_prepare ) from None OSError: Cannot find data file. Original error: [Errno 2] No such file or directory: 'C:\\mypath\\.cache\\huggingface\\datasets\\downloads\\2c9996e44bdc5af9c89bffb9e6d7a3e42fdb2f56bacab45de13b20f3032ea7ca\\data\\train_all.conllup' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.5 - PyArrow version: 3.0.0 Thank you, deleting the `~/.cache/huggingface/datasets/downloads/extracted` directory helped. However, I am still having problems. There was indeed a bug in the script that was throwing an `IndexError`, which I have now corrected (added the condition to skip the lines starting with '# text') and it is working locally, but still throws an error when I try to load the dataset from HuggingFace. I literally copied and pasted the `_generate_examples` function and ran it on the `dev_all.conllup` file, which I even re-downloaded from the repository to be certain that the files are exactly the same. I also deleted everything again just in case, but it didn't help. The code works locally, but throws an `IndexError` when loading from `datasets.`
[ -1.2348365783691406, -0.9167017936706543, -0.6255295276641846, 1.4129399061203003, -0.15435607731342316, -1.219717264175415, 0.05580707639455795, -1.0339274406433105, 1.6345734596252441, -0.7894803285598755, 0.18790456652641296, -1.686458706855774, 0.013226320967078209, -0.5875965356826782, -0.6818221211433411, -0.8906069993972778, -0.3390595614910126, -0.7812573313713074, 1.0421231985092163, 2.508939266204834, 1.2591992616653442, -1.351700782775879, 2.7811203002929688, 0.7346806526184082, -0.2850492596626282, -0.9954200983047485, 0.625596821308136, 0.001601003110408783, -1.1909252405166626, -0.4009263515472412, -0.9366761445999146, 0.01851845532655716, -0.6162446141242981, -0.4589817523956299, -0.008252069354057312, 0.44643059372901917, -0.27462178468704224, -0.3620757758617401, -0.6483681797981262, -0.7207871079444885, 0.4872911274433136, -0.4327394366264343, 1.0095666646957397, -0.32511967420578003, 1.8659980297088623, -0.6112620830535889, 0.31127655506134033, 0.745195209980011, 1.257041096687317, 0.1406187117099762, 0.07779939472675323, 0.2900480329990387, 0.3612469732761383, -0.0014107800088822842, 0.437688946723938, 1.132994532585144, 0.6085389256477356, 0.41105887293815613, 0.7954228520393372, -2.156581163406372, 1.3620715141296387, -0.9151310324668884, 0.20791684091091156, 1.3417887687683105, -0.9512231349945068, 0.39042022824287415, -1.726682424545288, -0.0629015564918518, 0.5694078803062439, -2.1644468307495117, 0.1890328973531723, -1.2814148664474487, -0.5541693568229675, 0.9903518557548523, 0.294261634349823, -1.1330649852752686, 0.22384954988956451, -0.5685374140739441, 1.034645438194275, 0.45079460740089417, 1.0807677507400513, -1.6047898530960083, -0.005885306745767593, -0.21114489436149597, 0.10140188783407211, -1.4784502983093262, -1.5681411027908325, 0.6486680507659912, 0.5503091216087341, 0.6894562244415283, -0.059508584439754486, 1.0968142747879028, -1.0443665981292725, 0.7698361873626709, -0.9904894828796387, -1.7152085304260254, -1.3995389938354492, -2.3358755111694336, -2.3219263553619385, 0.7221172451972961, -0.545979380607605, -0.5226593017578125, 2.0402965545654297, -1.069326400756836, -1.7101577520370483, 1.1297264099121094, 0.23337744176387787, -0.019066065549850464, 2.4109585285186768, 0.23320472240447998, -0.804060697555542, 0.4075927138328552, -0.7982314229011536, 0.8103695511817932, -0.21738706529140472, 1.3521145582199097, 0.49681681394577026, -1.0236315727233887, 1.5540820360183716, -0.4602217376232147, 0.6557011008262634, -0.5671355724334717, -0.5168842673301697, -0.7591068744659424, 0.3049124479293823, 1.8136519193649292, -0.35901156067848206, 1.6320394277572632, -0.3468419313430786, -1.5255553722381592, -1.5627161264419556, 0.8263673186302185, 0.35688281059265137, -0.7630893588066101, 0.11790655553340912, -0.449471116065979, 0.09167646616697311, -0.055243030190467834, 1.1555134057998657, 1.2920856475830078, 0.6505948901176453, -0.3593403995037079, -0.8760426640510559, 0.1340729147195816, -0.08798976987600327, -0.6594566106796265, -1.7819643020629883, -0.34725233912467957, 0.15421175956726074, 0.7054311633110046, -1.262969970703125, 1.756989598274231, 0.9626779556274414, 1.9260975122451782, 1.0191433429718018, -0.3712891936302185, 1.3435744047164917, 0.061918847262859344, 1.7965850830078125, -0.5275317430496216, 0.6274517178535461, -0.4226570725440979, -1.1987003087997437, 0.8537265658378601, -0.3547460436820984, -1.9822875261306763, -0.8245264291763306, -0.7661271095275879, -0.11997310817241669, -0.81405109167099, 0.9177332520484924, -0.3526748716831207, -1.4900405406951904, 0.1962069272994995, -0.6497527360916138, 0.07194561511278152, -1.2747883796691895, 0.20292946696281433, 0.7132558226585388, -0.6340736746788025, 0.044005386531353, -0.22330190241336823, -1.2929863929748535, -0.5176461935043335, 0.2911427915096283, 1.8626958131790161, -0.7238693237304688, 0.9277719259262085, 1.0467513799667358, -0.6571099758148193, 0.15078747272491455, 0.22952701151371002, -0.3113156259059906, 0.7762405872344971, -1.0406348705291748, -0.4447123408317566, 1.1519051790237427, -0.22596824169158936, -0.6551083326339722, 1.4848121404647827, 0.7860657572746277, -1.1188186407089233, -0.2593112587928772, -0.20973250269889832, -0.8546611666679382, -0.05715178698301315, -1.4755220413208008, -0.16823501884937286, 0.3488138020038605, -1.537685513496399, -0.37955233454704285, -0.24774770438671112, 1.3696365356445312, -0.16000276803970337, 1.4084205627441406, -0.4112069010734558, -0.20745906233787537, -0.2933158576488495, -0.5808423757553101, 0.16718724370002747, -0.16688531637191772, -0.5479642748832703, 0.16385000944137573, -0.9311087131500244, 0.3528018295764923, 1.4673056602478027, 0.37807267904281616, -0.04574645310640335, 0.4301198422908783, 1.1397628784179688, 0.3369362950325012, -0.0858481228351593, -0.8332441449165344, -1.46759033203125, 2.0052239894866943, -1.5315860509872437, 1.9643304347991943, 0.7711774706840515, -0.09943217784166336, -1.769344449043274, -1.7599456310272217, 1.3330357074737549, 1.1945929527282715, 2.2272446155548096, 0.6024171710014343, 0.3457965552806854, -0.8359128832817078, -0.6330868005752563, 0.42107704281806946, -1.0267590284347534, -0.5475718975067139, 0.16516250371932983, 2.3929967880249023, 1.817708969116211, -0.5210181474685669, -0.1584545224905014, -0.8505398631095886, 1.3723561763763428, -0.16463139653205872, 0.27682650089263916, 2.0270111560821533, -0.37994885444641113, -1.028635859489441, 1.3186372518539429, -2.3351712226867676, 0.19033025205135345, 2.030339002609253, 0.26351234316825867, 0.09510089457035065, -1.3426423072814941, -0.6239039301872253, -0.4508020877838135, -0.36958077549934387, -1.1926103830337524, 0.5607280731201172, -0.2709997296333313, -0.8009064197540283, -1.4750334024429321, 0.12129202485084534, -1.2265074253082275, -1.7945411205291748, 0.3416298031806946, 1.897492527961731, 2.14511775970459, -0.8404290080070496, 1.5566085577011108, -0.30479705333709717, 0.15055575966835022, 1.134281873703003, 1.315470814704895, 3.0625805854797363, 1.8564399480819702, -1.1595357656478882, 0.642960250377655, -0.17219622433185577, -0.5099451541900635, 1.1467573642730713, -1.172094464302063, 1.2845309972763062, -0.19606253504753113, -1.1435097455978394, -1.2428902387619019, 0.9316375851631165, 0.3911622166633606, -0.03707673400640488, -0.4648698568344116, 1.3309167623519897, 0.11092743277549744, 1.4146738052368164, 0.534903883934021, -0.3588722050189972, 0.5165672898292542, -0.4408193826675415, -0.565760612487793, 1.578674077987671, 0.17728760838508606, -1.4929970502853394, -2.24709415435791, -0.3256811201572418, -0.7434393167495728, 0.03287697583436966, -0.641845166683197, -1.0277806520462036, 1.6618049144744873, 0.31740373373031616, -1.1945674419403076, -0.2726726233959198, -0.42441028356552124, -0.5149831175804138, 2.6870779991149902, -1.376197099685669, -0.08998652547597885, -0.9388251900672913, -0.6258746981620789, 1.6057020425796509, -1.1339075565338135, -0.18260902166366577, -1.094862461090088, -0.6410588622093201, -1.3553531169891357, -0.5423914790153503, 0.020457785576581955, -1.000964641571045, 0.8026666045188904, 0.23998816311359406, -1.045066475868225, -0.313643217086792, -0.8497905731201172, 0.9547600746154785, -0.20700785517692566, 0.24544262886047363, 1.8903981447219849, 0.40417325496673584, -0.4448815882205963, 0.7779325246810913, 1.1888935565948486, 0.6416229605674744, -0.7425622940063477, -0.051557160913944244, -0.7257977724075317, 0.38289982080459595, -1.3575469255447388, 0.25235500931739807, -2.874931573867798, 0.6642296314239502, -0.10892953723669052, -0.04386650770902634, -0.05888983607292175, -1.2509821653366089, 1.0945613384246826, 2.6722612380981445, -1.2724236249923706, 0.4828573167324066, 0.4432641565799713, 1.169111967086792, -1.5711456537246704, 0.3677988648414612, -0.4247182607650757, 1.9975807666778564, 0.2088189572095871, 1.2779651880264282, -0.5602304339408875, -2.3189194202423096, 0.6394795775413513, -1.2048381567001343, -1.1795477867126465, 0.835365891456604, -0.8909435868263245, 0.19714918732643127, -1.489643931388855, -0.18366366624832153, -1.0025995969772339, -1.2549058198928833, 0.6486543416976929, 0.21086007356643677, 0.5116103887557983, -0.6081045269966125, 0.3499215841293335, -2.2404797077178955, -1.4375016689300537, -0.23767425119876862, -0.9773999452590942, 0.5999849438667297, -0.4727115035057068, 0.6528944969177246, -0.12117709964513779, 0.03915382921695709, 0.3354121744632721, 1.3861857652664185, 3.4670636653900146, 0.16982781887054443, 0.23066966235637665, -0.10510554909706116, -0.966579794883728, 1.432725191116333, 0.9438503384590149, -0.16374319791793823, -0.5157153010368347, -1.076941967010498, 1.2655466794967651, 1.9879136085510254, 1.0721566677093506, -0.04617734253406525, -0.7756171822547913, -0.6999198198318481, -0.04439028352499008, 0.19339005649089813, 0.5168439745903015, 0.8389180302619934, -0.05820373445749283, 0.14530383050441742, 1.4929776191711426, 1.1501761674880981, -0.4236108958721161, 0.20505641400814056, -0.8777843713760376, -0.41904217004776, 0.5110330581665039, 0.17710943520069122, 0.0007682750001549721, 0.4599950611591339, -0.8993379473686218, -0.2739391624927521, -0.3378639221191406, -0.8449000716209412, -0.676638126373291, -0.38726359605789185, -0.4018419682979584, 1.6188730001449585, 0.06692129373550415, -0.534424364566803, -0.13097989559173584, -0.665314793586731, -0.25404730439186096, -1.085253357887268, 0.25547337532043457, -0.12832246720790863, -0.03883686661720276, -0.21310096979141235, 1.7199541330337524, -0.9336446523666382, -2.03999400138855, 0.21247540414333344, 0.28322991728782654, -0.2180536687374115, 0.1616114377975464, 1.6537361145019531, 0.5198858380317688, 1.3414274454116821, 1.257475733757019, 0.9635933041572571, -0.7068553566932678, -1.2589820623397827, 0.6060177087783813, 1.0420663356781006, -1.3786323070526123, 0.8846862316131592, -0.10942526161670685, -0.6104224324226379, 0.6459201574325562, 1.380730152130127, 0.49764466285705566, -1.9813669919967651, 0.8093783259391785, -1.026638388633728, 0.8646343350410461, 0.7360391020774841, 0.7301830649375916, 0.1524987667798996, 0.7880806922912598, -1.1293857097625732, -1.195565104484558, -0.7606867551803589, -0.68108731508255, 1.9616121053695679, -0.232747420668602, 0.5858058333396912, -0.17516806721687317, -1.1686294078826904, -0.055939242243766785, 0.7260244488716125, 0.3830474615097046, -0.45723849534988403, 0.8437066078186035, -0.6161560416221619, -1.0076335668563843, -1.2997329235076904, -0.3652257025241852, -0.9785853624343872, -1.0219987630844116, 1.0151636600494385, 0.7310301661491394, 0.35887977480888367, 1.8614845275878906, 0.6333321928977966, 0.2603144645690918, -2.519045352935791, 0.957105815410614, 0.2979888916015625, -0.10619145631790161, 0.8722749948501587, 0.33729085326194763, 1.0171984434127808, 0.04676765203475952, 0.5654187798500061, -2.428847551345825, 2.2246170043945312, -0.24002471566200256, 0.6545584797859192, 0.032805152237415314, -0.18274398148059845, 1.1152070760726929, 0.6403191089630127, 0.46797528862953186, -1.0256319046020508, 0.7150579690933228, -0.40225982666015625, 1.1749376058578491, 1.0387142896652222, -0.841720700263977, 0.05621182173490524, 1.3689405918121338, 0.5201869606971741, -0.5668292045593262, -0.8555628657341003, -0.9108239412307739, 0.9606917500495911, 1.7832684516906738, -0.10903874784708023, -0.031141094863414764, 0.8148192763328552, 0.6156551837921143, -1.1715433597564697, 0.028628835454583168, -0.6352024674415588, -0.6981760859489441, 1.6463816165924072, 2.1036436557769775, -0.10022618621587753, -0.10461848229169846, -0.7053106427192688, -1.202030062675476, 0.8856721520423889, -0.08110830932855606, 0.09708978980779648, 0.6551974415779114, -0.6739370226860046, 1.1241710186004639, 0.7093818783760071, 0.9007818102836609, 0.1573198288679123, 0.238310307264328, 0.4810529947280884, -0.2062559723854065, -1.075675129890442, -0.35112932324409485, -1.0701454877853394, -2.4408669471740723, 0.3625786602497101, -0.20405064523220062, -1.4813802242279053, -0.10571596026420593, -0.9726034998893738, 1.0034393072128296, -0.5915153622627258, -1.0547689199447632, -1.6049911975860596, 0.21547622978687286, -0.08303885161876678, 0.9580851793289185, -1.6931045055389404, -0.20780038833618164, 1.2917041778564453, 0.8660252094268799, -0.582753598690033, 1.0999830961227417, 0.24460738897323608, 0.9845921993255615, 0.7115890383720398, -0.30672693252563477, 0.6527175307273865, 0.07018983364105225, -1.3436837196350098, 0.47537440061569214, 1.2522543668746948, 0.1525963395833969, 1.4437872171401978, -0.3886411786079407, 0.0170035008341074, 0.3874281942844391, -0.5515086054801941, -0.4931339621543884, -0.41529738903045654, 0.6750543713569641, 0.09083487838506699, -0.860871434211731, -0.07205159217119217, -0.1615341752767563, -0.3380255401134491, 0.2603045105934143, -1.5411930084228516, -0.2327428013086319, -0.4736439883708954, -0.47339922189712524, -1.3253194093704224, -0.028399482369422913, 1.488789439201355, -0.771555483341217, -0.20498543977737427, 0.48980891704559326, 0.43611064553260803, 0.4795634150505066, 0.6261508464813232, -0.8159762620925903, -0.2867187261581421, -0.378611296415329, -0.34170275926589966, 0.25088727474212646, 1.3247672319412231, -0.0684376135468483, -1.0450019836425781, 0.6854820251464844, -0.37402793765068054, 0.09439785778522491, 1.9980120658874512, 0.14583870768547058, -0.716471791267395, 0.34216517210006714, -0.7999690771102905, 1.8892918825149536, 1.6372098922729492, 1.3464419841766357, -0.13515254855155945, -0.8918136358261108, 0.5714755654335022, -0.2598792314529419, -0.33857613801956177, 0.9147342443466187, 0.3814880847930908, -0.2490098774433136, -1.4709137678146362, 0.6996967196464539, 1.258387804031372, -0.8695768713951111, -0.7028072476387024, 0.10123516619205475, -0.8477848172187805, 1.081714391708374, 0.6295871734619141, 0.398772656917572, 0.2871512770652771, 1.7723805904388428, 0.7468671798706055, -0.583828866481781, 0.5088565945625305, 0.4960489869117737, -0.1519199013710022, -2.075587272644043, -1.0731759071350098, 0.3419613838195801, -0.4508734345436096, -1.5791125297546387, 1.4250684976577759, -1.1675726175308228, -0.9699972867965698, 0.5583388209342957, 0.015184134244918823, 1.3439106941223145, 0.359386682510376, 1.5752689838409424, 2.1036925315856934, 0.7219297885894775, 0.3566405475139618, 1.1833181381225586, -0.20066289603710175, -0.47681644558906555, 1.8172376155853271, -0.46489521861076355, 0.47015199065208435, 1.1464807987213135, -0.3343837261199951, -0.9996421337127686, -0.7790926694869995, -1.2632938623428345, -0.6092244386672974, 1.135941982269287, 0.06669529527425766, -1.1824990510940552, 0.24305585026741028, 1.5923579931259155, 0.15989969670772552, -0.31404680013656616, 0.6461677551269531, 0.4487389922142029, -0.8714514970779419, -0.15795932710170746, -0.9026681184768677, 0.560028612613678, -0.13167279958724976, -0.319278359413147, 0.29228103160858154, 0.5106762051582336, 1.3688491582870483, -0.08741306513547897, 0.1670454740524292, 1.1907501220703125, -1.3345674276351929, 1.543297290802002, -0.6293419003486633, 0.22415970265865326, -2.3625385761260986, 1.3710609674453735, -0.7234260439872742, 1.969774603843689, -2.6330199241638184, 0.4370095431804657, -0.5747601985931396, -0.45593759417533875, 0.2926568388938904, -0.3290248513221741, 0.12628258764743805, -0.11979376524686813, -1.0288687944412231, -0.007524975575506687, -0.5598769187927246, 0.6520882844924927, 1.1223411560058594, 1.4218387603759766, -1.2063921689987183, -0.2935091555118561, -1.6559115648269653, -0.2639860212802887, -0.8130505084991455, 0.29551446437835693, -2.016721725463867, -0.239318385720253, -1.9794684648513794, -2.419135332107544, -1.3613179922103882, -0.8354490995407104, 1.1577740907669067, 0.15060484409332275, -1.0312544107437134, 1.2628763914108276, -0.3863453269004822, -1.820457100868225, 1.1984667778015137, -2.1046886444091797 ]
https://github.com/huggingface/datasets/issues/3122
OSError with a custom dataset loading script
Hi, Did some investigation. To fix the dataset script on the Hub, append the following labels to the `names` list of the `upos_tags` field: ```'INTJ NOUN', 'AUX PRON', 'PART ADV', 'PRON ADP', 'INTJ INTJ', 'VERB NOUN', 'NOUN AUX'```. This step is required to avoid an error due to missing labels in the following step which is: ```python load_dataset("classla/janes_tag", split="validation", download_mode="force_redownload") ``` This will generate and cache the dataset, so specifying `download_mode` will not be required anymore unless you update the script/data on the Hub.
## Describe the bug I am getting an OS error when trying to load the newly uploaded dataset classla/janes_tag. What puzzles me is that I have already uploaded a very similar dataset - classla/reldi_hr - with no issues. The loading scripts for the two datasets are almost identical and they have the same directory structure, yet I am only getting an error with janes_tag. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('classla/janes_tag', split='validation') ``` ## Expected results Dataset correctly loaded. ## Actual results Traceback (most recent call last): File "C:/mypath/test.py", line 91, in <module> load_and_print('janes_tag') File "C:/mypath/test.py", line 32, in load_and_print dataset = datasets.load_dataset('classla/{}'.format(ds_name), split='validation') File "C:\mypath\venv\lib\site-packages\datasets\load.py", line 1632, in load_dataset use_auth_token=use_auth_token, File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 608, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 704, in _download_and_prepare ) from None OSError: Cannot find data file. Original error: [Errno 2] No such file or directory: 'C:\\mypath\\.cache\\huggingface\\datasets\\downloads\\2c9996e44bdc5af9c89bffb9e6d7a3e42fdb2f56bacab45de13b20f3032ea7ca\\data\\train_all.conllup' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.5 - PyArrow version: 3.0.0
1,162
84
OSError with a custom dataset loading script ## Describe the bug I am getting an OS error when trying to load the newly uploaded dataset classla/janes_tag. What puzzles me is that I have already uploaded a very similar dataset - classla/reldi_hr - with no issues. The loading scripts for the two datasets are almost identical and they have the same directory structure, yet I am only getting an error with janes_tag. ## Steps to reproduce the bug ```python dataset = datasets.load_dataset('classla/janes_tag', split='validation') ``` ## Expected results Dataset correctly loaded. ## Actual results Traceback (most recent call last): File "C:/mypath/test.py", line 91, in <module> load_and_print('janes_tag') File "C:/mypath/test.py", line 32, in load_and_print dataset = datasets.load_dataset('classla/{}'.format(ds_name), split='validation') File "C:\mypath\venv\lib\site-packages\datasets\load.py", line 1632, in load_dataset use_auth_token=use_auth_token, File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 608, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "C:\mypath\venv\lib\site-packages\datasets\builder.py", line 704, in _download_and_prepare ) from None OSError: Cannot find data file. Original error: [Errno 2] No such file or directory: 'C:\\mypath\\.cache\\huggingface\\datasets\\downloads\\2c9996e44bdc5af9c89bffb9e6d7a3e42fdb2f56bacab45de13b20f3032ea7ca\\data\\train_all.conllup' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.14.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.5 - PyArrow version: 3.0.0 Hi, Did some investigation. To fix the dataset script on the Hub, append the following labels to the `names` list of the `upos_tags` field: ```'INTJ NOUN', 'AUX PRON', 'PART ADV', 'PRON ADP', 'INTJ INTJ', 'VERB NOUN', 'NOUN AUX'```. This step is required to avoid an error due to missing labels in the following step which is: ```python load_dataset("classla/janes_tag", split="validation", download_mode="force_redownload") ``` This will generate and cache the dataset, so specifying `download_mode` will not be required anymore unless you update the script/data on the Hub.
[ -1.2348365783691406, -0.9167017936706543, -0.6255295276641846, 1.4129399061203003, -0.15435607731342316, -1.219717264175415, 0.05580707639455795, -1.0339274406433105, 1.6345734596252441, -0.7894803285598755, 0.18790456652641296, -1.686458706855774, 0.013226320967078209, -0.5875965356826782, -0.6818221211433411, -0.8906069993972778, -0.3390595614910126, -0.7812573313713074, 1.0421231985092163, 2.508939266204834, 1.2591992616653442, -1.351700782775879, 2.7811203002929688, 0.7346806526184082, -0.2850492596626282, -0.9954200983047485, 0.625596821308136, 0.001601003110408783, -1.1909252405166626, -0.4009263515472412, -0.9366761445999146, 0.01851845532655716, -0.6162446141242981, -0.4589817523956299, -0.008252069354057312, 0.44643059372901917, -0.27462178468704224, -0.3620757758617401, -0.6483681797981262, -0.7207871079444885, 0.4872911274433136, -0.4327394366264343, 1.0095666646957397, -0.32511967420578003, 1.8659980297088623, -0.6112620830535889, 0.31127655506134033, 0.745195209980011, 1.257041096687317, 0.1406187117099762, 0.07779939472675323, 0.2900480329990387, 0.3612469732761383, -0.0014107800088822842, 0.437688946723938, 1.132994532585144, 0.6085389256477356, 0.41105887293815613, 0.7954228520393372, -2.156581163406372, 1.3620715141296387, -0.9151310324668884, 0.20791684091091156, 1.3417887687683105, -0.9512231349945068, 0.39042022824287415, -1.726682424545288, -0.0629015564918518, 0.5694078803062439, -2.1644468307495117, 0.1890328973531723, -1.2814148664474487, -0.5541693568229675, 0.9903518557548523, 0.294261634349823, -1.1330649852752686, 0.22384954988956451, -0.5685374140739441, 1.034645438194275, 0.45079460740089417, 1.0807677507400513, -1.6047898530960083, -0.005885306745767593, -0.21114489436149597, 0.10140188783407211, -1.4784502983093262, -1.5681411027908325, 0.6486680507659912, 0.5503091216087341, 0.6894562244415283, -0.059508584439754486, 1.0968142747879028, -1.0443665981292725, 0.7698361873626709, -0.9904894828796387, -1.7152085304260254, -1.3995389938354492, -2.3358755111694336, -2.3219263553619385, 0.7221172451972961, -0.545979380607605, -0.5226593017578125, 2.0402965545654297, -1.069326400756836, -1.7101577520370483, 1.1297264099121094, 0.23337744176387787, -0.019066065549850464, 2.4109585285186768, 0.23320472240447998, -0.804060697555542, 0.4075927138328552, -0.7982314229011536, 0.8103695511817932, -0.21738706529140472, 1.3521145582199097, 0.49681681394577026, -1.0236315727233887, 1.5540820360183716, -0.4602217376232147, 0.6557011008262634, -0.5671355724334717, -0.5168842673301697, -0.7591068744659424, 0.3049124479293823, 1.8136519193649292, -0.35901156067848206, 1.6320394277572632, -0.3468419313430786, -1.5255553722381592, -1.5627161264419556, 0.8263673186302185, 0.35688281059265137, -0.7630893588066101, 0.11790655553340912, -0.449471116065979, 0.09167646616697311, -0.055243030190467834, 1.1555134057998657, 1.2920856475830078, 0.6505948901176453, -0.3593403995037079, -0.8760426640510559, 0.1340729147195816, -0.08798976987600327, -0.6594566106796265, -1.7819643020629883, -0.34725233912467957, 0.15421175956726074, 0.7054311633110046, -1.262969970703125, 1.756989598274231, 0.9626779556274414, 1.9260975122451782, 1.0191433429718018, -0.3712891936302185, 1.3435744047164917, 0.061918847262859344, 1.7965850830078125, -0.5275317430496216, 0.6274517178535461, -0.4226570725440979, -1.1987003087997437, 0.8537265658378601, -0.3547460436820984, -1.9822875261306763, -0.8245264291763306, -0.7661271095275879, -0.11997310817241669, -0.81405109167099, 0.9177332520484924, -0.3526748716831207, -1.4900405406951904, 0.1962069272994995, -0.6497527360916138, 0.07194561511278152, -1.2747883796691895, 0.20292946696281433, 0.7132558226585388, -0.6340736746788025, 0.044005386531353, -0.22330190241336823, -1.2929863929748535, -0.5176461935043335, 0.2911427915096283, 1.8626958131790161, -0.7238693237304688, 0.9277719259262085, 1.0467513799667358, -0.6571099758148193, 0.15078747272491455, 0.22952701151371002, -0.3113156259059906, 0.7762405872344971, -1.0406348705291748, -0.4447123408317566, 1.1519051790237427, -0.22596824169158936, -0.6551083326339722, 1.4848121404647827, 0.7860657572746277, -1.1188186407089233, -0.2593112587928772, -0.20973250269889832, -0.8546611666679382, -0.05715178698301315, -1.4755220413208008, -0.16823501884937286, 0.3488138020038605, -1.537685513496399, -0.37955233454704285, -0.24774770438671112, 1.3696365356445312, -0.16000276803970337, 1.4084205627441406, -0.4112069010734558, -0.20745906233787537, -0.2933158576488495, -0.5808423757553101, 0.16718724370002747, -0.16688531637191772, -0.5479642748832703, 0.16385000944137573, -0.9311087131500244, 0.3528018295764923, 1.4673056602478027, 0.37807267904281616, -0.04574645310640335, 0.4301198422908783, 1.1397628784179688, 0.3369362950325012, -0.0858481228351593, -0.8332441449165344, -1.46759033203125, 2.0052239894866943, -1.5315860509872437, 1.9643304347991943, 0.7711774706840515, -0.09943217784166336, -1.769344449043274, -1.7599456310272217, 1.3330357074737549, 1.1945929527282715, 2.2272446155548096, 0.6024171710014343, 0.3457965552806854, -0.8359128832817078, -0.6330868005752563, 0.42107704281806946, -1.0267590284347534, -0.5475718975067139, 0.16516250371932983, 2.3929967880249023, 1.817708969116211, -0.5210181474685669, -0.1584545224905014, -0.8505398631095886, 1.3723561763763428, -0.16463139653205872, 0.27682650089263916, 2.0270111560821533, -0.37994885444641113, -1.028635859489441, 1.3186372518539429, -2.3351712226867676, 0.19033025205135345, 2.030339002609253, 0.26351234316825867, 0.09510089457035065, -1.3426423072814941, -0.6239039301872253, -0.4508020877838135, -0.36958077549934387, -1.1926103830337524, 0.5607280731201172, -0.2709997296333313, -0.8009064197540283, -1.4750334024429321, 0.12129202485084534, -1.2265074253082275, -1.7945411205291748, 0.3416298031806946, 1.897492527961731, 2.14511775970459, -0.8404290080070496, 1.5566085577011108, -0.30479705333709717, 0.15055575966835022, 1.134281873703003, 1.315470814704895, 3.0625805854797363, 1.8564399480819702, -1.1595357656478882, 0.642960250377655, -0.17219622433185577, -0.5099451541900635, 1.1467573642730713, -1.172094464302063, 1.2845309972763062, -0.19606253504753113, -1.1435097455978394, -1.2428902387619019, 0.9316375851631165, 0.3911622166633606, -0.03707673400640488, -0.4648698568344116, 1.3309167623519897, 0.11092743277549744, 1.4146738052368164, 0.534903883934021, -0.3588722050189972, 0.5165672898292542, -0.4408193826675415, -0.565760612487793, 1.578674077987671, 0.17728760838508606, -1.4929970502853394, -2.24709415435791, -0.3256811201572418, -0.7434393167495728, 0.03287697583436966, -0.641845166683197, -1.0277806520462036, 1.6618049144744873, 0.31740373373031616, -1.1945674419403076, -0.2726726233959198, -0.42441028356552124, -0.5149831175804138, 2.6870779991149902, -1.376197099685669, -0.08998652547597885, -0.9388251900672913, -0.6258746981620789, 1.6057020425796509, -1.1339075565338135, -0.18260902166366577, -1.094862461090088, -0.6410588622093201, -1.3553531169891357, -0.5423914790153503, 0.020457785576581955, -1.000964641571045, 0.8026666045188904, 0.23998816311359406, -1.045066475868225, -0.313643217086792, -0.8497905731201172, 0.9547600746154785, -0.20700785517692566, 0.24544262886047363, 1.8903981447219849, 0.40417325496673584, -0.4448815882205963, 0.7779325246810913, 1.1888935565948486, 0.6416229605674744, -0.7425622940063477, -0.051557160913944244, -0.7257977724075317, 0.38289982080459595, -1.3575469255447388, 0.25235500931739807, -2.874931573867798, 0.6642296314239502, -0.10892953723669052, -0.04386650770902634, -0.05888983607292175, -1.2509821653366089, 1.0945613384246826, 2.6722612380981445, -1.2724236249923706, 0.4828573167324066, 0.4432641565799713, 1.169111967086792, -1.5711456537246704, 0.3677988648414612, -0.4247182607650757, 1.9975807666778564, 0.2088189572095871, 1.2779651880264282, -0.5602304339408875, -2.3189194202423096, 0.6394795775413513, -1.2048381567001343, -1.1795477867126465, 0.835365891456604, -0.8909435868263245, 0.19714918732643127, -1.489643931388855, -0.18366366624832153, -1.0025995969772339, -1.2549058198928833, 0.6486543416976929, 0.21086007356643677, 0.5116103887557983, -0.6081045269966125, 0.3499215841293335, -2.2404797077178955, -1.4375016689300537, -0.23767425119876862, -0.9773999452590942, 0.5999849438667297, -0.4727115035057068, 0.6528944969177246, -0.12117709964513779, 0.03915382921695709, 0.3354121744632721, 1.3861857652664185, 3.4670636653900146, 0.16982781887054443, 0.23066966235637665, -0.10510554909706116, -0.966579794883728, 1.432725191116333, 0.9438503384590149, -0.16374319791793823, -0.5157153010368347, -1.076941967010498, 1.2655466794967651, 1.9879136085510254, 1.0721566677093506, -0.04617734253406525, -0.7756171822547913, -0.6999198198318481, -0.04439028352499008, 0.19339005649089813, 0.5168439745903015, 0.8389180302619934, -0.05820373445749283, 0.14530383050441742, 1.4929776191711426, 1.1501761674880981, -0.4236108958721161, 0.20505641400814056, -0.8777843713760376, -0.41904217004776, 0.5110330581665039, 0.17710943520069122, 0.0007682750001549721, 0.4599950611591339, -0.8993379473686218, -0.2739391624927521, -0.3378639221191406, -0.8449000716209412, -0.676638126373291, -0.38726359605789185, -0.4018419682979584, 1.6188730001449585, 0.06692129373550415, -0.534424364566803, -0.13097989559173584, -0.665314793586731, -0.25404730439186096, -1.085253357887268, 0.25547337532043457, -0.12832246720790863, -0.03883686661720276, -0.21310096979141235, 1.7199541330337524, -0.9336446523666382, -2.03999400138855, 0.21247540414333344, 0.28322991728782654, -0.2180536687374115, 0.1616114377975464, 1.6537361145019531, 0.5198858380317688, 1.3414274454116821, 1.257475733757019, 0.9635933041572571, -0.7068553566932678, -1.2589820623397827, 0.6060177087783813, 1.0420663356781006, -1.3786323070526123, 0.8846862316131592, -0.10942526161670685, -0.6104224324226379, 0.6459201574325562, 1.380730152130127, 0.49764466285705566, -1.9813669919967651, 0.8093783259391785, -1.026638388633728, 0.8646343350410461, 0.7360391020774841, 0.7301830649375916, 0.1524987667798996, 0.7880806922912598, -1.1293857097625732, -1.195565104484558, -0.7606867551803589, -0.68108731508255, 1.9616121053695679, -0.232747420668602, 0.5858058333396912, -0.17516806721687317, -1.1686294078826904, -0.055939242243766785, 0.7260244488716125, 0.3830474615097046, -0.45723849534988403, 0.8437066078186035, -0.6161560416221619, -1.0076335668563843, -1.2997329235076904, -0.3652257025241852, -0.9785853624343872, -1.0219987630844116, 1.0151636600494385, 0.7310301661491394, 0.35887977480888367, 1.8614845275878906, 0.6333321928977966, 0.2603144645690918, -2.519045352935791, 0.957105815410614, 0.2979888916015625, -0.10619145631790161, 0.8722749948501587, 0.33729085326194763, 1.0171984434127808, 0.04676765203475952, 0.5654187798500061, -2.428847551345825, 2.2246170043945312, -0.24002471566200256, 0.6545584797859192, 0.032805152237415314, -0.18274398148059845, 1.1152070760726929, 0.6403191089630127, 0.46797528862953186, -1.0256319046020508, 0.7150579690933228, -0.40225982666015625, 1.1749376058578491, 1.0387142896652222, -0.841720700263977, 0.05621182173490524, 1.3689405918121338, 0.5201869606971741, -0.5668292045593262, -0.8555628657341003, -0.9108239412307739, 0.9606917500495911, 1.7832684516906738, -0.10903874784708023, -0.031141094863414764, 0.8148192763328552, 0.6156551837921143, -1.1715433597564697, 0.028628835454583168, -0.6352024674415588, -0.6981760859489441, 1.6463816165924072, 2.1036436557769775, -0.10022618621587753, -0.10461848229169846, -0.7053106427192688, -1.202030062675476, 0.8856721520423889, -0.08110830932855606, 0.09708978980779648, 0.6551974415779114, -0.6739370226860046, 1.1241710186004639, 0.7093818783760071, 0.9007818102836609, 0.1573198288679123, 0.238310307264328, 0.4810529947280884, -0.2062559723854065, -1.075675129890442, -0.35112932324409485, -1.0701454877853394, -2.4408669471740723, 0.3625786602497101, -0.20405064523220062, -1.4813802242279053, -0.10571596026420593, -0.9726034998893738, 1.0034393072128296, -0.5915153622627258, -1.0547689199447632, -1.6049911975860596, 0.21547622978687286, -0.08303885161876678, 0.9580851793289185, -1.6931045055389404, -0.20780038833618164, 1.2917041778564453, 0.8660252094268799, -0.582753598690033, 1.0999830961227417, 0.24460738897323608, 0.9845921993255615, 0.7115890383720398, -0.30672693252563477, 0.6527175307273865, 0.07018983364105225, -1.3436837196350098, 0.47537440061569214, 1.2522543668746948, 0.1525963395833969, 1.4437872171401978, -0.3886411786079407, 0.0170035008341074, 0.3874281942844391, -0.5515086054801941, -0.4931339621543884, -0.41529738903045654, 0.6750543713569641, 0.09083487838506699, -0.860871434211731, -0.07205159217119217, -0.1615341752767563, -0.3380255401134491, 0.2603045105934143, -1.5411930084228516, -0.2327428013086319, -0.4736439883708954, -0.47339922189712524, -1.3253194093704224, -0.028399482369422913, 1.488789439201355, -0.771555483341217, -0.20498543977737427, 0.48980891704559326, 0.43611064553260803, 0.4795634150505066, 0.6261508464813232, -0.8159762620925903, -0.2867187261581421, -0.378611296415329, -0.34170275926589966, 0.25088727474212646, 1.3247672319412231, -0.0684376135468483, -1.0450019836425781, 0.6854820251464844, -0.37402793765068054, 0.09439785778522491, 1.9980120658874512, 0.14583870768547058, -0.716471791267395, 0.34216517210006714, -0.7999690771102905, 1.8892918825149536, 1.6372098922729492, 1.3464419841766357, -0.13515254855155945, -0.8918136358261108, 0.5714755654335022, -0.2598792314529419, -0.33857613801956177, 0.9147342443466187, 0.3814880847930908, -0.2490098774433136, -1.4709137678146362, 0.6996967196464539, 1.258387804031372, -0.8695768713951111, -0.7028072476387024, 0.10123516619205475, -0.8477848172187805, 1.081714391708374, 0.6295871734619141, 0.398772656917572, 0.2871512770652771, 1.7723805904388428, 0.7468671798706055, -0.583828866481781, 0.5088565945625305, 0.4960489869117737, -0.1519199013710022, -2.075587272644043, -1.0731759071350098, 0.3419613838195801, -0.4508734345436096, -1.5791125297546387, 1.4250684976577759, -1.1675726175308228, -0.9699972867965698, 0.5583388209342957, 0.015184134244918823, 1.3439106941223145, 0.359386682510376, 1.5752689838409424, 2.1036925315856934, 0.7219297885894775, 0.3566405475139618, 1.1833181381225586, -0.20066289603710175, -0.47681644558906555, 1.8172376155853271, -0.46489521861076355, 0.47015199065208435, 1.1464807987213135, -0.3343837261199951, -0.9996421337127686, -0.7790926694869995, -1.2632938623428345, -0.6092244386672974, 1.135941982269287, 0.06669529527425766, -1.1824990510940552, 0.24305585026741028, 1.5923579931259155, 0.15989969670772552, -0.31404680013656616, 0.6461677551269531, 0.4487389922142029, -0.8714514970779419, -0.15795932710170746, -0.9026681184768677, 0.560028612613678, -0.13167279958724976, -0.319278359413147, 0.29228103160858154, 0.5106762051582336, 1.3688491582870483, -0.08741306513547897, 0.1670454740524292, 1.1907501220703125, -1.3345674276351929, 1.543297290802002, -0.6293419003486633, 0.22415970265865326, -2.3625385761260986, 1.3710609674453735, -0.7234260439872742, 1.969774603843689, -2.6330199241638184, 0.4370095431804657, -0.5747601985931396, -0.45593759417533875, 0.2926568388938904, -0.3290248513221741, 0.12628258764743805, -0.11979376524686813, -1.0288687944412231, -0.007524975575506687, -0.5598769187927246, 0.6520882844924927, 1.1223411560058594, 1.4218387603759766, -1.2063921689987183, -0.2935091555118561, -1.6559115648269653, -0.2639860212802887, -0.8130505084991455, 0.29551446437835693, -2.016721725463867, -0.239318385720253, -1.9794684648513794, -2.419135332107544, -1.3613179922103882, -0.8354490995407104, 1.1577740907669067, 0.15060484409332275, -1.0312544107437134, 1.2628763914108276, -0.3863453269004822, -1.820457100868225, 1.1984667778015137, -2.1046886444091797 ]
https://github.com/huggingface/datasets/issues/3119
Add OpenSLR 83 - Crowdsourced high-quality UK and Ireland English Dialect speech
Ugh. The index files for SLR83 are CSV, not TSV. I need to add logic to process these index files.
## Adding a Dataset - **Name:** *openslr** - **Description:** *Data set which contains male and female recordings of English from various dialects of the UK and Ireland.* - **Paper:** *https://www.openslr.org/resources/83/about.html* - **Data:** *Eleven separate data files can be found via https://www.openslr.org/resources/83/* - **Motivation:** *Increase english ASR data with UK and Irish dialects* Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md). The *openslr* dataset already exists, this will add additional subset, *SLR83*.
1,163
20
Add OpenSLR 83 - Crowdsourced high-quality UK and Ireland English Dialect speech ## Adding a Dataset - **Name:** *openslr** - **Description:** *Data set which contains male and female recordings of English from various dialects of the UK and Ireland.* - **Paper:** *https://www.openslr.org/resources/83/about.html* - **Data:** *Eleven separate data files can be found via https://www.openslr.org/resources/83/* - **Motivation:** *Increase english ASR data with UK and Irish dialects* Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md). The *openslr* dataset already exists, this will add additional subset, *SLR83*. Ugh. The index files for SLR83 are CSV, not TSV. I need to add logic to process these index files.
[ -1.2155710458755493, -1.1286088228225708, -0.5822110176086426, 1.2496706247329712, -0.2718657851219177, -1.3179337978363037, 0.15315952897071838, -0.9607557654380798, 1.654067039489746, -0.5179534554481506, 0.2122470587491989, -1.697288990020752, -0.017263345420360565, -0.4677712023258209, -0.7740016579627991, -0.7599053382873535, -0.4646682143211365, -0.8694025874137878, 0.9241747260093689, 2.5290303230285645, 1.2026277780532837, -1.4394747018814087, 2.6624386310577393, 0.6333553791046143, -0.22854278981685638, -0.9693531394004822, 0.438278466463089, 0.23196205496788025, -1.3074207305908203, -0.541813850402832, -0.8246334791183472, -0.16110557317733765, -0.2921149730682373, -0.3891569972038269, 0.22740311920642853, 0.37749162316322327, 0.012711949646472931, -0.320382684469223, -0.6372879147529602, -0.6411998867988586, 0.5293918251991272, -0.41111046075820923, 0.8850774168968201, -0.4623948931694031, 1.807091236114502, -0.7369400858879089, 0.4275192618370056, 0.6139286160469055, 1.3990191221237183, 0.12614963948726654, -0.1163441464304924, 0.28897419571876526, 0.5298723578453064, 0.045539163053035736, 0.31783682107925415, 1.153386116027832, 0.6125606894493103, 0.4573865532875061, 0.6583846211433411, -2.1286168098449707, 1.3515965938568115, -0.9659722447395325, 0.4372909367084503, 1.4347525835037231, -1.107958436012268, 0.41509076952934265, -1.8004060983657837, -0.13263733685016632, 0.5352370738983154, -2.422905921936035, 0.10210181027650833, -1.3174209594726562, -0.7976995706558228, 0.8800211548805237, 0.21078144013881683, -1.3035454750061035, 0.19394484162330627, -0.6224145293235779, 0.9684835076332092, 0.38005638122558594, 1.0867180824279785, -1.8196032047271729, -0.19400998950004578, -0.1527121663093567, -0.035404883325099945, -1.3910942077636719, -1.5830901861190796, 0.7969712018966675, 0.5297552943229675, 0.6847703456878662, -0.18152958154678345, 0.8105288147926331, -1.1052409410476685, 1.1245391368865967, -1.0915626287460327, -1.5451384782791138, -1.4007847309112549, -2.3988749980926514, -2.222942590713501, 1.042543649673462, -0.36126968264579773, -0.39229121804237366, 1.884369969367981, -0.8635261058807373, -1.7045907974243164, 1.0899658203125, 0.18886490166187286, 0.1032964214682579, 2.245915174484253, 0.11027690768241882, -0.594006359577179, 0.2651144564151764, -0.849517285823822, 0.9077197313308716, -0.4542609453201294, 1.4948601722717285, 0.5085743069648743, -0.9266632199287415, 1.5250117778778076, -0.49510878324508667, 0.42915892601013184, -0.5714468955993652, -0.7303329706192017, -0.858020544052124, 0.4703424870967865, 1.9729294776916504, -0.34031248092651367, 1.5325043201446533, -0.33902430534362793, -1.7276488542556763, -1.4058268070220947, 0.7966328859329224, 0.6845000982284546, -0.833259105682373, -0.06514483690261841, -0.32747992873191833, 0.12480101734399796, -0.1560066193342209, 1.0362972021102905, 1.068172574043274, 0.6847177147865295, -0.40893059968948364, -0.8325283527374268, 0.2632535398006439, -0.18894317746162415, -0.7541373372077942, -1.8335026502609253, -0.3979847729206085, 0.22194845974445343, 0.6423201560974121, -1.3112056255340576, 1.5834777355194092, 0.8326138854026794, 2.1177639961242676, 0.8421615362167358, -0.3527962267398834, 1.3336961269378662, -0.017672762274742126, 1.8846842050552368, -0.7978051900863647, 0.760979950428009, -0.36691659688949585, -0.8843933939933777, 0.8706896901130676, -0.5086000561714172, -2.095155715942383, -0.6277238726615906, -0.9980600476264954, -0.3263562321662903, -0.7763721346855164, 0.9789226651191711, -0.2541314959526062, -1.2856700420379639, 0.13052207231521606, -0.677375853061676, 0.2725321054458618, -1.2732399702072144, 0.23266583681106567, 0.9532270431518555, -0.5552149415016174, -0.13901165127754211, -0.28704753518104553, -1.3139753341674805, -0.7125811576843262, 0.29746460914611816, 2.0156867504119873, -0.634829044342041, 1.049999713897705, 0.7683296203613281, -0.700492799282074, 0.15210765600204468, 0.32857760787010193, -0.2537151873111725, 0.8316641449928284, -1.220513105392456, -0.298372745513916, 0.9124113917350769, -0.15262530744075775, -0.25059762597084045, 1.5092748403549194, 0.8108057975769043, -0.9557273983955383, -0.2935474216938019, -0.33247920870780945, -0.8005377650260925, 0.067548006772995, -1.6025029420852661, -0.2782662808895111, 0.15498310327529907, -1.4633524417877197, -0.5953423380851746, -0.28125113248825073, 1.3063421249389648, -0.10014230757951736, 1.1716665029525757, -0.16901269555091858, -0.46650615334510803, -0.38126349449157715, -0.3666611313819885, 0.26572245359420776, -0.42495620250701904, -0.6690409183502197, 0.2704983949661255, -0.7431880235671997, 0.36060822010040283, 1.524792194366455, 0.4910613000392914, 0.0380152091383934, 0.651227593421936, 0.9651108980178833, 0.2324983924627304, -0.1384936422109604, -0.9057734608650208, -1.6139148473739624, 1.9331142902374268, -1.5989614725112915, 1.8230211734771729, 0.7964064478874207, -0.06778626143932343, -1.6632156372070312, -1.9232380390167236, 1.1826471090316772, 1.2030929327011108, 2.3556973934173584, 0.6553133726119995, 0.4062766432762146, -0.7728526592254639, -0.6351304054260254, 0.20483842492103577, -1.042592167854309, -0.6987730860710144, 0.04420233517885208, 2.2988648414611816, 1.7880626916885376, -0.8616110682487488, -0.169640451669693, -1.051964521408081, 1.3099477291107178, -0.0700269564986229, 0.2521459758281708, 2.1357409954071045, -0.36742547154426575, -1.087988257408142, 1.1970632076263428, -2.240886926651001, 0.23561562597751617, 2.012087345123291, 0.5036779642105103, 0.19260273873806, -1.4475873708724976, -0.575347363948822, -0.4071037769317627, -0.4524294435977936, -1.2419633865356445, 0.5158957839012146, -0.34222471714019775, -0.8078018426895142, -1.5278908014297485, 0.06288605183362961, -1.1338993310928345, -1.6928144693374634, 0.5118899941444397, 1.9062550067901611, 1.9371116161346436, -0.5807178616523743, 1.2438923120498657, -0.2731020450592041, -0.004673120100051165, 1.3524599075317383, 1.167424201965332, 2.9883065223693848, 2.061000108718872, -0.9832008481025696, 0.8039683103561401, -0.28888803720474243, -0.35141608119010925, 1.0914534330368042, -0.9354116916656494, 1.1061327457427979, -0.12840713560581207, -1.163679599761963, -1.09671151638031, 1.0160789489746094, 0.5408002734184265, -0.0037325220182538033, -0.5734991431236267, 1.245637059211731, 0.055198028683662415, 1.4426536560058594, 0.598937451839447, -0.41819772124290466, 0.5589534640312195, -0.44727998971939087, -0.48001813888549805, 1.7283951044082642, 0.24684631824493408, -1.6021826267242432, -2.5434072017669678, -0.2436215877532959, -0.9785392880439758, -0.02250714786350727, -0.6316841244697571, -1.070128083229065, 1.706286907196045, 0.5791063904762268, -1.31767737865448, -0.11365962028503418, -0.30862367153167725, -0.7493835687637329, 2.620572090148926, -1.4436933994293213, -0.18609027564525604, -0.9578489065170288, -0.37735891342163086, 1.6606945991516113, -1.343499779701233, -0.18911820650100708, -1.0399545431137085, -0.6248418688774109, -1.115936040878296, -0.4953323006629944, -0.09955208748579025, -0.9234623908996582, 0.9680737853050232, -0.11895004659891129, -1.032463788986206, -0.28567299246788025, -0.9611769318580627, 0.8217785954475403, -0.02442324161529541, 0.18456503748893738, 1.934989333152771, 0.3981705605983734, -0.35539013147354126, 0.598962128162384, 1.3097859621047974, 0.6716732978820801, -0.8519259691238403, 0.12570764124393463, -0.6200616955757141, 0.28640517592430115, -1.2831487655639648, 0.3839837610721588, -2.9134840965270996, 0.6390423774719238, -0.08040301501750946, -0.1239987313747406, -0.01938028633594513, -1.3755748271942139, 1.211738109588623, 2.5668063163757324, -1.1812242269515991, 0.4633637070655823, 0.3146461546421051, 1.1976238489151, -1.5312168598175049, 0.40809366106987, -0.3398538827896118, 2.126405715942383, 0.24666908383369446, 1.0838977098464966, -0.6619961857795715, -2.0237951278686523, 0.6859637498855591, -1.1233272552490234, -1.1345043182373047, 0.28975680470466614, -0.8386141657829285, 0.21482078731060028, -1.6726068258285522, -0.08191486448049545, -0.9064808487892151, -1.32003915309906, 0.6503092050552368, 0.10186689347028732, 0.29939088225364685, -0.6173422932624817, 0.31347665190696716, -2.1792218685150146, -1.3836255073547363, -0.31263601779937744, -0.8165662884712219, 0.6016801595687866, -0.25989261269569397, 0.6230067014694214, 0.03175002336502075, 0.2120724320411682, 0.18606437742710114, 1.4988380670547485, 3.266280174255371, 0.06318909674882889, 0.380977600812912, -0.059212878346443176, -0.9359580278396606, 1.4226289987564087, 1.0265233516693115, 0.23875194787979126, -0.6165471076965332, -1.0644646883010864, 1.3959438800811768, 2.02655291557312, 1.1002591848373413, 0.14940030872821808, -0.7036871314048767, -0.6959275007247925, 0.0851612463593483, 0.3513972759246826, 0.5217703580856323, 1.0417057275772095, 0.06963729858398438, 0.027255838736891747, 1.404966950416565, 1.3260648250579834, -0.46029895544052124, 0.4371849000453949, -0.8801477551460266, -0.4374525547027588, 0.37131553888320923, 0.35559576749801636, 0.06272570043802261, 0.33399784564971924, -1.016504168510437, -0.300223171710968, -0.1487361341714859, -1.0829943418502808, -0.596889853477478, -0.4784961938858032, -0.5852361917495728, 1.7150789499282837, 0.11597294360399246, -0.41872555017471313, -0.040630463510751724, -0.5902659296989441, 0.019724106416106224, -1.2090165615081787, 0.3219023644924164, -0.010617217049002647, 0.07451440393924713, -0.22113119065761566, 1.832135558128357, -0.7755094766616821, -2.1910266876220703, 0.2839168310165405, 0.4095345139503479, -0.7689355611801147, 0.09242506325244904, 1.4583828449249268, 0.6014457941055298, 1.4452258348464966, 1.2977440357208252, 1.0461955070495605, -0.5383338332176208, -1.4037322998046875, 0.5988950729370117, 0.8821415901184082, -1.453446865081787, 0.733039915561676, 0.040879987180233, -0.4861944913864136, 0.7958987951278687, 1.522166132926941, 0.35827091336250305, -1.9613659381866455, 0.8554356694221497, -0.8154268264770508, 0.8562290072441101, 0.7914092540740967, 0.7647802829742432, 0.35753634572029114, 0.9267603754997253, -1.464638113975525, -1.0323566198349, -0.9455625414848328, -0.44809332489967346, 2.033790111541748, -0.15440420806407928, 0.44698426127433777, -0.23077292740345, -1.1309409141540527, -0.010333123616874218, 0.6917110681533813, 0.5144030451774597, -0.21677561104297638, 0.8502587676048279, -0.6252405643463135, -1.027142882347107, -1.2499362230300903, -0.47209012508392334, -0.8006630539894104, -0.8390241861343384, 0.9475305676460266, 0.941809892654419, 0.5977144837379456, 1.975286841392517, 0.5209231972694397, 0.2637956738471985, -2.6139955520629883, 0.810360848903656, 0.23320430517196655, 0.04177810251712799, 0.9731683731079102, 0.16141384840011597, 1.2454891204833984, -0.036709658801555634, 0.42723360657691956, -2.344393253326416, 2.17016339302063, -0.2641860246658325, 0.7845984101295471, 0.11619936674833298, 0.018671376630663872, 1.2826546430587769, 0.5365684628486633, 0.49550822377204895, -1.1068191528320312, 0.6346717476844788, -0.6675043702125549, 1.1446239948272705, 0.7782756686210632, -0.6516175270080566, 0.012632908299565315, 1.2324364185333252, 0.6397795677185059, -0.39225685596466064, -1.0110816955566406, -0.8400838375091553, 0.8691921830177307, 1.747710108757019, -0.11882738023996353, -0.07355577498674393, 0.8656232357025146, 0.7326772212982178, -1.1891131401062012, 0.03887293487787247, -0.774877667427063, -0.593392014503479, 1.591107964515686, 2.11509108543396, 0.12164469808340073, -0.18509069085121155, -0.6112240552902222, -1.2328770160675049, 0.682689905166626, 0.009702008217573166, 0.11135999113321304, 0.7330708503723145, -0.5240980386734009, 1.0242406129837036, 0.78629469871521, 1.067613124847412, -0.013048670254647732, 0.5638139247894287, 0.3658579885959625, -0.24019955098628998, -1.1460981369018555, -0.41146138310432434, -1.3121213912963867, -2.5739526748657227, 0.5077881217002869, -0.4632842242717743, -1.4340015649795532, 0.06617848575115204, -1.154543399810791, 0.9073166251182556, -0.6496047973632812, -1.2054458856582642, -1.6403944492340088, 0.21252694725990295, -0.14745758473873138, 1.0101890563964844, -1.609045147895813, -0.2303735464811325, 1.112210750579834, 0.5899240970611572, -0.4333425462245941, 0.9274899959564209, 0.20919911563396454, 0.9891848564147949, 0.697733998298645, -0.41070544719696045, 0.3470228910446167, 0.18362075090408325, -1.3820093870162964, 0.6335784792900085, 1.193493366241455, 0.22476769983768463, 1.252453327178955, -0.496060848236084, 0.2317945659160614, 0.5349909067153931, -0.5322163105010986, -0.5035874843597412, -0.4393681287765503, 0.8077858686447144, 0.08532781898975372, -1.2007259130477905, -0.09184920787811279, -0.17570379376411438, -0.1853877454996109, 0.18478944897651672, -1.4140199422836304, -0.4056119918823242, -0.45959508419036865, -0.42418143153190613, -1.2575862407684326, -0.1271744668483734, 1.250459909439087, -0.7628047466278076, -0.10518860071897507, 0.6194198727607727, 0.5557572841644287, 0.6555949449539185, 0.691480815410614, -0.5833432078361511, -0.359951913356781, -0.25043976306915283, -0.2905101478099823, 0.18967269361019135, 1.2209056615829468, -0.21369075775146484, -1.0226737260818481, 0.6152836084365845, -0.35218626260757446, 0.17675288021564484, 2.0720767974853516, -0.08024314790964127, -0.7626369595527649, 0.3495370149612427, -0.7010195851325989, 1.7407512664794922, 1.5200436115264893, 1.237924337387085, -0.05145713686943054, -0.8630449771881104, 0.24185174703598022, -0.13538140058517456, -0.47281932830810547, 0.7340579628944397, 0.6732519268989563, -0.2095261961221695, -1.3557826280593872, 0.4764513373374939, 1.3905304670333862, -1.055259346961975, -0.8360422849655151, 0.3125927448272705, -0.7668430209159851, 1.1319820880889893, 0.5338281393051147, 0.5277040600776672, 0.3581176698207855, 1.5986655950546265, 0.6035286784172058, -0.43111452460289, 0.3819133937358856, 0.5768837332725525, -0.17437978088855743, -2.111003875732422, -1.2289819717407227, 0.23932354152202606, -0.46889728307724, -1.4348468780517578, 1.29656982421875, -1.1250197887420654, -0.7524327635765076, 0.528987467288971, 0.4054083526134491, 1.4464631080627441, 0.4094464182853699, 1.7782261371612549, 2.009070634841919, 0.8124074935913086, 0.3607374429702759, 1.4556442499160767, 0.23635554313659668, -0.5849505662918091, 1.8435157537460327, -0.33411192893981934, 0.6369737982749939, 1.088877558708191, -0.3927974998950958, -1.2400466203689575, -0.7636060118675232, -1.1286442279815674, -0.5254319906234741, 1.0562474727630615, 0.16836732625961304, -1.2872482538223267, 0.11347683519124985, 1.5209816694259644, 0.11218002438545227, -0.23248079419136047, 0.3360426723957062, 0.24519124627113342, -0.6595800518989563, -0.17533060908317566, -1.135588526725769, 0.35228872299194336, -0.18457071483135223, -0.35608693957328796, 0.10900760442018509, 0.7838801145553589, 1.1294596195220947, -0.04125261306762695, 0.1578599512577057, 1.2368884086608887, -1.4360318183898926, 1.4370005130767822, -0.6204969882965088, 0.2801096737384796, -2.4408068656921387, 1.5420939922332764, -0.7227830290794373, 1.9442986249923706, -2.7234673500061035, 0.3222835659980774, -0.4645341634750366, -0.31905022263526917, 0.23297235369682312, -0.3317105770111084, 0.21261242032051086, -0.05159333348274231, -1.126459002494812, 0.03696165978908539, -0.834848165512085, 0.5590639710426331, 1.3440730571746826, 1.4662394523620605, -1.1016391515731812, -0.21761256456375122, -1.7718099355697632, -0.11594054102897644, -0.7471266984939575, 0.44178470969200134, -1.9596028327941895, 0.09054858982563019, -1.724449872970581, -2.1464009284973145, -1.4859859943389893, -0.9958617091178894, 0.8948630094528198, 0.1526869684457779, -0.8767430186271667, 0.9067838191986084, -0.2812378704547882, -1.623288869857788, 1.0154967308044434, -2.3546669483184814 ]
https://github.com/huggingface/datasets/issues/3114
load_from_disk in DatasetsDict/Dataset not working with PyArrowHDFS wrapper implementing fsspec.spec.AbstractFileSystem
Hi ! Can you try again with pyarrow 6.0.0 ? I think it includes some changes regarding filesystems compatibility with fsspec.
## Describe the bug Passing a PyArrowHDFS implementation of fsspec.spec.AbstractFileSystem (in the `fs` param required by `load_from_disk` methods in `DatasetDict` (in datasets_dict.py) and `Dataset` (in arrow_dataset.py) results in an error when calling the download method in the `fs` parameter. ## Steps to reproduce the bug The documentation for the `fs` parameter states: ``` fs (:class:`~filesystems.S3FileSystem` or ``fsspec.spec.AbstractFileSystem``, optional, default ``None``): Instance of the remote filesystem used to download the files from. ``` `PyArrowHDFS` from [fsspec](https://filesystem-spec.readthedocs.io/en/latest/_modules/fsspec/implementations/hdfs.html) implements `fsspec.spec.AbstractFileSystem`. However, when using it as shown below, I get an error. ```python from fsspec.implementations.hdfs import PyArrowHDFS ... transformed_corpus_path = "/user/my_user/clickbait/transformed_ds/" fs = PyArrowHDFS(host, port, user, kerb_ticket=kerb_ticket) dss = DatasetDict.load_from_disk(transformed_corpus_path, fs, True) ``` ## Expected results Previous to load from disk, I have managed to successfully store in HDFS the data and meta-information of a DatasetDict by doing: ```python transformed_corpus_path = "/user/my_user/clickbait/transformed_ds/" fs = PyArrowHDFS(host, port, user, kerb_ticket=kerb_ticket) my_datasets.save_to_disk(transformed_corpus_path, fs=fs) ``` As I have 3 datasets in the DatasetDict named `my_datasets`, the previous Python code creates the following contents in HDFS: ```sh $ hadoop fs -ls "/user/my_user/clickbait/transformed_ds/" Found 4 items -rw------- 3 my_user users 43 2021-10-19 03:08 /user/my_user/clickbait/transformed_ds/dataset_dict.json drwx------ - my_user users 0 2021-10-19 03:08 /user/my_user/clickbait/transformed_ds/test drwx------ - my_user users 0 2021-10-19 03:08 /user/my_user/clickbait/transformed_ds/train drwx------ - my_user users 0 2021-10-19 03:08 /user/my_user/clickbait/transformed_ds/validation ``` I would expect to recover on `dss` the Arrow-backed datasets I previously saved in HDFS calling the `save_to_disk` method on the `DatasetDict` object when invoking `DatasetDict.load_from_disk(...)` as described above. ## Actual results However, when trying to recover the saved datasets, I get this error: ``` ... File "/home/fperez/dev/neuromancer/neuromancer/corpus.py", line 186, in load_transformed_corpus_from_disk dss = DatasetDict.load_from_disk(transformed_corpus_path, fs, True) File "/home/fperez/anaconda3/envs/neuromancer/lib/python3.9/site-packages/datasets/dataset_dict.py", line 748, in load_from_disk dataset_dict[k] = Dataset.load_from_disk(dataset_dict_split_path, fs, keep_in_memory=keep_in_memory) File "/home/fperez/anaconda3/envs/neuromancer/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 1048, in load_from_disk fs.download(src_dataset_path, dataset_path.as_posix(), recursive=True) File "pyarrow/_hdfsio.pyx", line 438, in pyarrow._hdfsio.HadoopFileSystem.download TypeError: download() got an unexpected keyword argument 'recursive' ``` Examining the [signature of the download method in pyarrow 5.0.0](https://github.com/apache/arrow/blob/54d2bd89c99df72fa091b025452f85dd5d88e3cf/python/pyarrow/_hdfsio.pyx#L438) we can see that there's no download parameter: ```python def download(self, path, stream, buffer_size=None): with self.open(path, 'rb') as f: f.download(stream, buffer_size=buffer_size) ``` ## Environment info - `datasets` version: 1.13.3 - Platform: Linux-3.10.0-1160.15.2.el7.x86_64-x86_64-with-glibc2.33 - Python version: 3.9.7 - PyArrow version: 5.0.0
1,164
21
load_from_disk in DatasetsDict/Dataset not working with PyArrowHDFS wrapper implementing fsspec.spec.AbstractFileSystem ## Describe the bug Passing a PyArrowHDFS implementation of fsspec.spec.AbstractFileSystem (in the `fs` param required by `load_from_disk` methods in `DatasetDict` (in datasets_dict.py) and `Dataset` (in arrow_dataset.py) results in an error when calling the download method in the `fs` parameter. ## Steps to reproduce the bug The documentation for the `fs` parameter states: ``` fs (:class:`~filesystems.S3FileSystem` or ``fsspec.spec.AbstractFileSystem``, optional, default ``None``): Instance of the remote filesystem used to download the files from. ``` `PyArrowHDFS` from [fsspec](https://filesystem-spec.readthedocs.io/en/latest/_modules/fsspec/implementations/hdfs.html) implements `fsspec.spec.AbstractFileSystem`. However, when using it as shown below, I get an error. ```python from fsspec.implementations.hdfs import PyArrowHDFS ... transformed_corpus_path = "/user/my_user/clickbait/transformed_ds/" fs = PyArrowHDFS(host, port, user, kerb_ticket=kerb_ticket) dss = DatasetDict.load_from_disk(transformed_corpus_path, fs, True) ``` ## Expected results Previous to load from disk, I have managed to successfully store in HDFS the data and meta-information of a DatasetDict by doing: ```python transformed_corpus_path = "/user/my_user/clickbait/transformed_ds/" fs = PyArrowHDFS(host, port, user, kerb_ticket=kerb_ticket) my_datasets.save_to_disk(transformed_corpus_path, fs=fs) ``` As I have 3 datasets in the DatasetDict named `my_datasets`, the previous Python code creates the following contents in HDFS: ```sh $ hadoop fs -ls "/user/my_user/clickbait/transformed_ds/" Found 4 items -rw------- 3 my_user users 43 2021-10-19 03:08 /user/my_user/clickbait/transformed_ds/dataset_dict.json drwx------ - my_user users 0 2021-10-19 03:08 /user/my_user/clickbait/transformed_ds/test drwx------ - my_user users 0 2021-10-19 03:08 /user/my_user/clickbait/transformed_ds/train drwx------ - my_user users 0 2021-10-19 03:08 /user/my_user/clickbait/transformed_ds/validation ``` I would expect to recover on `dss` the Arrow-backed datasets I previously saved in HDFS calling the `save_to_disk` method on the `DatasetDict` object when invoking `DatasetDict.load_from_disk(...)` as described above. ## Actual results However, when trying to recover the saved datasets, I get this error: ``` ... File "/home/fperez/dev/neuromancer/neuromancer/corpus.py", line 186, in load_transformed_corpus_from_disk dss = DatasetDict.load_from_disk(transformed_corpus_path, fs, True) File "/home/fperez/anaconda3/envs/neuromancer/lib/python3.9/site-packages/datasets/dataset_dict.py", line 748, in load_from_disk dataset_dict[k] = Dataset.load_from_disk(dataset_dict_split_path, fs, keep_in_memory=keep_in_memory) File "/home/fperez/anaconda3/envs/neuromancer/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 1048, in load_from_disk fs.download(src_dataset_path, dataset_path.as_posix(), recursive=True) File "pyarrow/_hdfsio.pyx", line 438, in pyarrow._hdfsio.HadoopFileSystem.download TypeError: download() got an unexpected keyword argument 'recursive' ``` Examining the [signature of the download method in pyarrow 5.0.0](https://github.com/apache/arrow/blob/54d2bd89c99df72fa091b025452f85dd5d88e3cf/python/pyarrow/_hdfsio.pyx#L438) we can see that there's no download parameter: ```python def download(self, path, stream, buffer_size=None): with self.open(path, 'rb') as f: f.download(stream, buffer_size=buffer_size) ``` ## Environment info - `datasets` version: 1.13.3 - Platform: Linux-3.10.0-1160.15.2.el7.x86_64-x86_64-with-glibc2.33 - Python version: 3.9.7 - PyArrow version: 5.0.0 Hi ! Can you try again with pyarrow 6.0.0 ? I think it includes some changes regarding filesystems compatibility with fsspec.
[ -1.2320432662963867, -0.8434974551200867, -0.6415994167327881, 1.4545531272888184, -0.08525841683149338, -1.2882745265960693, 0.21978053450584412, -1.1482622623443604, 1.7084405422210693, -0.8320690989494324, 0.3824213445186615, -1.661045789718628, -0.004411435220390558, -0.615102231502533, -0.7726868987083435, -0.8081659078598022, -0.38606297969818115, -0.7921249866485596, 1.0966342687606812, 2.338405132293701, 1.2569524049758911, -1.3325716257095337, 2.755690097808838, 0.7028726935386658, -0.2521974742412567, -0.9803416132926941, 0.44352424144744873, -0.05958564579486847, -1.2792102098464966, -0.6277645826339722, -0.9073721766471863, -0.10545039176940918, -0.621921181678772, -0.6000568270683289, 0.04273267835378647, 0.46520403027534485, -0.3267292380332947, -0.38311100006103516, -0.537397563457489, -0.8792232871055603, 0.4178653359413147, -0.39133259654045105, 0.9515683054924011, -0.4226604998111725, 1.7765216827392578, -0.6119277477264404, 0.502713680267334, 0.7650878429412842, 1.392423152923584, 0.12710809707641602, -0.018612217158079147, 0.2887500524520874, 0.38782480359077454, 0.1002521887421608, 0.6092376112937927, 1.144136905670166, 0.7073181867599487, 0.4806469976902008, 0.6633591055870056, -2.202509641647339, 1.2658212184906006, -1.034367322921753, 0.2053622156381607, 1.3595818281173706, -0.9242910742759705, 0.3252742290496826, -1.7187025547027588, -0.07747668772935867, 0.5687336921691895, -2.274575710296631, 0.26168093085289, -1.3053103685379028, -0.43517935276031494, 1.0657845735549927, 0.4314412474632263, -1.2013161182403564, 0.14926421642303467, -0.4371815323829651, 1.1132481098175049, 0.4197724461555481, 1.1322842836380005, -1.6319702863693237, -0.041173383593559265, -0.30036982893943787, 0.0697496086359024, -1.347927451133728, -1.5619912147521973, 0.497836172580719, 0.7064660787582397, 0.5721448659896851, -0.2276741862297058, 1.1695163249969482, -0.9769604802131653, 0.7139762043952942, -1.0454953908920288, -1.7425872087478638, -1.4228910207748413, -2.2102553844451904, -2.257441520690918, 0.7792332172393799, -0.5343310236930847, -0.49873602390289307, 2.0825319290161133, -0.9546511173248291, -1.7818950414657593, 1.0090254545211792, 0.2103416919708252, 0.05450790375471115, 2.3083696365356445, 0.18853828310966492, -0.7676822543144226, 0.37807026505470276, -0.711400032043457, 0.8057078719139099, -0.36211293935775757, 1.3891799449920654, 0.43401387333869934, -1.0980639457702637, 1.5231308937072754, -0.30755147337913513, 0.634838879108429, -0.6555616855621338, -0.46823373436927795, -0.7544830441474915, 0.2856942117214203, 1.8630554676055908, -0.37536191940307617, 1.5259350538253784, -0.3912827968597412, -1.4794256687164307, -1.6533684730529785, 0.8189913034439087, 0.38883984088897705, -0.7241286635398865, 0.08036985993385315, -0.393471360206604, 0.2343006134033203, -0.14879220724105835, 1.18242609500885, 1.2608716487884521, 0.7074187397956848, -0.41280463337898254, -0.8233025074005127, 0.20576892793178558, -0.02185601368546486, -0.7368866801261902, -1.7794150114059448, -0.353489488363266, 0.05312804877758026, 0.6170821785926819, -1.1637519598007202, 1.833210825920105, 0.8581447601318359, 1.9180505275726318, 1.0493037700653076, -0.40261587500572205, 1.4914541244506836, 0.09544839709997177, 1.9238609075546265, -0.5088555216789246, 0.5509544610977173, -0.3811427354812622, -1.1731470823287964, 0.946688711643219, -0.23482239246368408, -2.113762617111206, -0.6547257900238037, -0.7465425729751587, -0.18045303225517273, -0.7859034538269043, 0.9050304293632507, -0.2429889589548111, -1.4329081773757935, 0.18038828670978546, -0.6732065677642822, 0.20821669697761536, -1.2239720821380615, 0.28816863894462585, 0.7791907787322998, -0.6794233322143555, 0.023462826386094093, -0.28688421845436096, -1.2842074632644653, -0.521308183670044, 0.3113563358783722, 1.8974939584732056, -0.6696131229400635, 0.9150940775871277, 1.1327388286590576, -0.7369836568832397, 0.05820692330598831, 0.3432327210903168, -0.2502540051937103, 0.7602248191833496, -1.0989179611206055, -0.4568661153316498, 1.2828683853149414, -0.30478888750076294, -0.6639890670776367, 1.4910314083099365, 0.8067200779914856, -1.0727900266647339, -0.13434018194675446, -0.13548403978347778, -0.8707988262176514, 0.10560794919729233, -1.5231785774230957, -0.07993051409721375, 0.533845841884613, -1.5599035024642944, -0.4553046226501465, -0.17479223012924194, 1.3305834531784058, -0.20790423452854156, 1.4924837350845337, -0.2399931102991104, -0.10837849229574203, -0.35887905955314636, -0.35117051005363464, 0.10617899149656296, -0.16700923442840576, -0.5929964780807495, 0.25635331869125366, -0.692118763923645, 0.40773898363113403, 1.4025967121124268, 0.3089160919189453, -0.06419548392295837, 0.49408817291259766, 1.1134430170059204, 0.2642730474472046, -0.1289391964673996, -0.859948456287384, -1.4745630025863647, 1.9475191831588745, -1.3946518898010254, 1.9792466163635254, 0.7197993993759155, 0.004925672896206379, -1.757290244102478, -1.8876681327819824, 1.3236627578735352, 1.105726957321167, 2.2406833171844482, 0.6077224016189575, 0.36762675642967224, -0.7929701209068298, -0.6934813261032104, 0.3567509949207306, -0.9966568946838379, -0.6277656555175781, 0.15092778205871582, 2.375318765640259, 1.7408993244171143, -0.4500618278980255, -0.16908963024616241, -0.9616435766220093, 1.3960622549057007, -0.23547764122486115, 0.31887462735176086, 1.9992375373840332, -0.2761012613773346, -1.0510478019714355, 1.3066965341567993, -2.436838150024414, 0.31395354866981506, 2.0447750091552734, 0.2555053234100342, 0.0910927951335907, -1.3522100448608398, -0.6092544794082642, -0.3659117817878723, -0.292044997215271, -1.2502844333648682, 0.489456444978714, -0.2284628003835678, -0.7761638760566711, -1.3719265460968018, 0.213659405708313, -1.085774540901184, -1.7162150144577026, 0.2839704751968384, 1.9858585596084595, 1.935585618019104, -0.6592954397201538, 1.5804040431976318, -0.40096643567085266, 0.09234000742435455, 1.299824833869934, 1.254453182220459, 3.093085765838623, 1.9018933773040771, -1.317293405532837, 0.7099218368530273, -0.1666756570339203, -0.4842207729816437, 1.194130539894104, -1.1732500791549683, 1.2035537958145142, -0.1560164988040924, -1.1589884757995605, -1.2961721420288086, 0.9727197289466858, 0.5055611729621887, 0.04025237262248993, -0.4971995949745178, 1.1885857582092285, 0.12422014027833939, 1.3416513204574585, 0.576107919216156, -0.3137448728084564, 0.6590744853019714, -0.2786059081554413, -0.44849327206611633, 1.4784679412841797, 0.2180768996477127, -1.3927513360977173, -2.2226450443267822, -0.27318865060806274, -0.8837426900863647, 0.09816982597112656, -0.6966751217842102, -0.9707966446876526, 1.691329002380371, 0.42629337310791016, -1.3380520343780518, -0.25027161836624146, -0.34989452362060547, -0.5269647836685181, 2.7104954719543457, -1.3728091716766357, -0.19762247800827026, -1.000861644744873, -0.5423486232757568, 1.6046710014343262, -1.2322404384613037, -0.2814674973487854, -1.0083508491516113, -0.5901919603347778, -1.2067254781723022, -0.5101205706596375, 0.07201188802719116, -0.8949015140533447, 0.768515408039093, 0.20296955108642578, -1.2160168886184692, -0.43700265884399414, -0.8570253849029541, 1.0188825130462646, -0.12563997507095337, 0.15869715809822083, 1.8084744215011597, 0.37929603457450867, -0.5034119486808777, 0.7559273838996887, 1.1275088787078857, 0.6580147743225098, -0.5680205225944519, 0.2599213421344757, -0.6967256665229797, 0.345518559217453, -1.3238962888717651, 0.26722753047943115, -2.8528385162353516, 0.6546180844306946, -0.1495814025402069, 0.009597234427928925, -0.14801305532455444, -1.4330086708068848, 1.0673807859420776, 2.747011423110962, -1.2137807607650757, 0.41114041209220886, 0.3475181460380554, 1.1576889753341675, -1.5637611150741577, 0.3134705126285553, -0.4466274678707123, 2.069491147994995, 0.18469403684139252, 1.1960774660110474, -0.4547397792339325, -2.3400909900665283, 0.592282772064209, -1.2457152605056763, -1.1603214740753174, 0.8925155401229858, -0.8148394227027893, 0.058072030544281006, -1.3779112100601196, -0.20178627967834473, -0.8550686240196228, -1.2468929290771484, 0.718109667301178, 0.07516851276159286, 0.42958563566207886, -0.6930862665176392, 0.30021360516548157, -2.084672212600708, -1.2490090131759644, -0.2754462957382202, -0.9370563626289368, 0.5214449167251587, -0.3876321315765381, 0.6155964732170105, -0.06336214393377304, -0.08638828247785568, 0.41851305961608887, 1.583946704864502, 3.408935308456421, 0.1278330236673355, 0.27010849118232727, -0.20156258344650269, -0.9176033139228821, 1.3274177312850952, 0.8742274641990662, -0.14910738170146942, -0.528083086013794, -1.0069388151168823, 1.216927170753479, 1.982162594795227, 1.0414109230041504, 0.03041292168200016, -0.8788938522338867, -0.8321940898895264, -0.012259451672434807, 0.1451716125011444, 0.47727447748184204, 0.8664085268974304, 0.1013881266117096, 0.0248794537037611, 1.3611739873886108, 1.1991323232650757, -0.43728840351104736, 0.37369704246520996, -0.9541162848472595, -0.3886648714542389, 0.5255357623100281, 0.23889468610286713, -0.03915712982416153, 0.33275485038757324, -0.9374836087226868, -0.1828058660030365, -0.3490023612976074, -0.8066020607948303, -0.8409834504127502, -0.36804160475730896, -0.3983861207962036, 1.666056752204895, 0.019896816462278366, -0.539463996887207, 0.0013382257893681526, -0.6567258238792419, -0.1115710660815239, -1.0727794170379639, 0.29842036962509155, -0.19446350634098053, -0.07300864905118942, -0.15959569811820984, 1.587202787399292, -0.928841769695282, -1.964339256286621, 0.23226065933704376, 0.2198878973722458, -0.3479597866535187, 0.2791578471660614, 1.6692839860916138, 0.5586786270141602, 1.3930230140686035, 1.3820210695266724, 0.9905931353569031, -0.7406173348426819, -1.2667618989944458, 0.7385204434394836, 0.9289848208427429, -1.4277981519699097, 0.8385350704193115, -0.026410475373268127, -0.4678441882133484, 0.632225513458252, 1.3315341472625732, 0.45031309127807617, -2.089015483856201, 0.7999913096427917, -0.945905327796936, 0.7680538892745972, 0.723488986492157, 0.7211799025535583, 0.2316714972257614, 0.872416079044342, -1.1882617473602295, -1.0717642307281494, -0.6665542721748352, -0.6551330089569092, 1.8399085998535156, -0.3068016767501831, 0.6305163502693176, -0.13771657645702362, -1.4097075462341309, -0.16624629497528076, 0.6642298698425293, 0.38409101963043213, -0.5558621883392334, 0.751790463924408, -0.7297559976577759, -1.0366222858428955, -1.2845345735549927, -0.4912024438381195, -1.1284215450286865, -0.9521718621253967, 1.0543479919433594, 0.7854869365692139, 0.3709684908390045, 1.8543837070465088, 0.6220414042472839, 0.24959494173526764, -2.6898672580718994, 0.9054378867149353, 0.2796579897403717, -0.14122945070266724, 0.9146241545677185, 0.33685439825057983, 0.9710113406181335, -0.04510592669248581, 0.6081827282905579, -2.401064157485962, 2.3510799407958984, -0.2786507308483124, 0.5805434584617615, 0.00806582160294056, -0.22523702681064606, 1.1078089475631714, 0.5676292181015015, 0.5638613104820251, -1.1374329328536987, 0.7220568060874939, -0.6044678092002869, 1.1804320812225342, 0.8645487427711487, -0.8448111414909363, 0.0064536575227975845, 1.314109206199646, 0.42586490511894226, -0.547502338886261, -0.9445769190788269, -0.9862158298492432, 0.9245092272758484, 1.6690651178359985, -0.03794313594698906, -0.09592470526695251, 0.8989646434783936, 0.7613077759742737, -1.2359521389007568, 0.14846859872341156, -0.7079357504844666, -0.7381493449211121, 1.6687414646148682, 1.968456745147705, -0.13384076952934265, -0.1703455150127411, -0.7922683954238892, -1.195953369140625, 0.7832778096199036, -0.052611663937568665, -0.071228988468647, 0.5302339792251587, -0.6229543685913086, 1.114820957183838, 0.8268438577651978, 0.9204679131507874, 0.1166405901312828, 0.23936757445335388, 0.4187367856502533, -0.37243708968162537, -1.179418921470642, -0.27466729283332825, -1.0733802318572998, -2.7281157970428467, 0.4724041521549225, -0.19552065432071686, -1.4453165531158447, -0.01318555511534214, -1.0817015171051025, 0.918128490447998, -0.5550404191017151, -1.2283575534820557, -1.5299619436264038, 0.22927521169185638, -0.04973848909139633, 0.9264804124832153, -1.610353708267212, -0.03948512673377991, 1.2365939617156982, 0.844032347202301, -0.6057317852973938, 0.973335325717926, 0.211258202791214, 1.1360909938812256, 0.9170648455619812, -0.2949126660823822, 0.5329744815826416, 0.04323233664035797, -1.3010520935058594, 0.5371258854866028, 1.152177333831787, 0.13620704412460327, 1.361308217048645, -0.5570092797279358, 0.1345151662826538, 0.30056464672088623, -0.554794430732727, -0.509131908416748, -0.5505808591842651, 0.7663146257400513, 0.015467336401343346, -0.9584414958953857, -0.014123957604169846, -0.09272786974906921, -0.1951027661561966, 0.12399887293577194, -1.445235252380371, -0.22738951444625854, -0.3701161742210388, -0.5549673438072205, -1.2158496379852295, -0.018514003604650497, 1.3312820196151733, -0.6865819692611694, -0.2835180163383484, 0.4499053359031677, 0.2598828673362732, 0.5747698545455933, 0.5934321284294128, -0.6786885857582092, -0.3553999066352844, -0.3217756748199463, -0.4102662205696106, 0.3492758870124817, 1.3893930912017822, -0.020613083615899086, -0.8848550915718079, 0.7598857879638672, -0.4340466856956482, 0.05571039021015167, 1.9453741312026978, 0.13790589570999146, -0.743730902671814, 0.2950572371482849, -0.7239922285079956, 1.8553038835525513, 1.8584402799606323, 1.2772430181503296, -0.1282857358455658, -1.0623795986175537, 0.647689700126648, -0.3992331027984619, -0.4302319586277008, 0.9233807325363159, 0.3259149193763733, -0.312176376581192, -1.3949575424194336, 0.711393415927887, 1.3393217325210571, -0.7377061247825623, -0.8588927388191223, 0.13786393404006958, -0.7701098918914795, 1.0792218446731567, 0.6090459227561951, 0.2982886731624603, 0.2930908501148224, 1.5914936065673828, 0.7631273865699768, -0.40236419439315796, 0.5748727321624756, 0.5174295902252197, -0.1977047324180603, -2.1479568481445312, -1.1525846719741821, 0.3749063313007355, -0.5060448050498962, -1.649127721786499, 1.445296287536621, -1.1430246829986572, -0.9870248436927795, 0.5833646655082703, 0.15803207457065582, 1.4380604028701782, 0.3731536269187927, 1.577648639678955, 2.0592758655548096, 0.8113269209861755, 0.4364999830722809, 1.232489824295044, -0.14864112436771393, -0.5111905932426453, 1.8216359615325928, -0.4476070702075958, 0.4053361713886261, 1.1143327951431274, -0.2910051643848419, -0.996987521648407, -0.8170701265335083, -1.2780914306640625, -0.7023937106132507, 1.2207432985305786, 0.07655619829893112, -1.0931241512298584, 0.31489142775535583, 1.5605829954147339, 0.150518998503685, -0.29793626070022583, 0.6686786413192749, 0.4007766842842102, -0.8020680546760559, -0.053788378834724426, -0.9326940774917603, 0.5265921950340271, -0.2397134006023407, -0.3483790457248688, 0.3585072457790375, 0.5139543414115906, 1.3199000358581543, 0.0056008631363511086, 0.12058217078447342, 1.0543214082717896, -1.4097832441329956, 1.4901717901229858, -0.6364486813545227, 0.36128145456314087, -2.3730671405792236, 1.4205831289291382, -0.7379854321479797, 1.9586150646209717, -2.5805070400238037, 0.42104268074035645, -0.574958324432373, -0.4408477544784546, 0.3027119040489197, -0.3818671405315399, 0.15721769630908966, -0.19487132132053375, -1.1455014944076538, -0.003296974115073681, -0.7162889838218689, 0.699781596660614, 1.1018218994140625, 1.470892310142517, -1.128618597984314, -0.32865089178085327, -1.7417933940887451, -0.09384454041719437, -0.7046070098876953, 0.4168916344642639, -1.9336638450622559, -0.15821628272533417, -2.0609567165374756, -2.3475096225738525, -1.3157532215118408, -0.6796642541885376, 1.0034202337265015, 0.1209777370095253, -0.7790800929069519, 1.2320338487625122, -0.38542184233665466, -1.906766414642334, 1.1369022130966187, -2.17218017578125 ]
https://github.com/huggingface/datasets/issues/3114
load_from_disk in DatasetsDict/Dataset not working with PyArrowHDFS wrapper implementing fsspec.spec.AbstractFileSystem
Hi @lhoestq! I ended up using `fsspec.implementations.arrow.HadoopFileSystem` which doesn't have the problem I described with pyarrow 5.0.0. I'll try again with `PyArrowHDFS` once I update arrow to 6.0.0. Thanks!
## Describe the bug Passing a PyArrowHDFS implementation of fsspec.spec.AbstractFileSystem (in the `fs` param required by `load_from_disk` methods in `DatasetDict` (in datasets_dict.py) and `Dataset` (in arrow_dataset.py) results in an error when calling the download method in the `fs` parameter. ## Steps to reproduce the bug The documentation for the `fs` parameter states: ``` fs (:class:`~filesystems.S3FileSystem` or ``fsspec.spec.AbstractFileSystem``, optional, default ``None``): Instance of the remote filesystem used to download the files from. ``` `PyArrowHDFS` from [fsspec](https://filesystem-spec.readthedocs.io/en/latest/_modules/fsspec/implementations/hdfs.html) implements `fsspec.spec.AbstractFileSystem`. However, when using it as shown below, I get an error. ```python from fsspec.implementations.hdfs import PyArrowHDFS ... transformed_corpus_path = "/user/my_user/clickbait/transformed_ds/" fs = PyArrowHDFS(host, port, user, kerb_ticket=kerb_ticket) dss = DatasetDict.load_from_disk(transformed_corpus_path, fs, True) ``` ## Expected results Previous to load from disk, I have managed to successfully store in HDFS the data and meta-information of a DatasetDict by doing: ```python transformed_corpus_path = "/user/my_user/clickbait/transformed_ds/" fs = PyArrowHDFS(host, port, user, kerb_ticket=kerb_ticket) my_datasets.save_to_disk(transformed_corpus_path, fs=fs) ``` As I have 3 datasets in the DatasetDict named `my_datasets`, the previous Python code creates the following contents in HDFS: ```sh $ hadoop fs -ls "/user/my_user/clickbait/transformed_ds/" Found 4 items -rw------- 3 my_user users 43 2021-10-19 03:08 /user/my_user/clickbait/transformed_ds/dataset_dict.json drwx------ - my_user users 0 2021-10-19 03:08 /user/my_user/clickbait/transformed_ds/test drwx------ - my_user users 0 2021-10-19 03:08 /user/my_user/clickbait/transformed_ds/train drwx------ - my_user users 0 2021-10-19 03:08 /user/my_user/clickbait/transformed_ds/validation ``` I would expect to recover on `dss` the Arrow-backed datasets I previously saved in HDFS calling the `save_to_disk` method on the `DatasetDict` object when invoking `DatasetDict.load_from_disk(...)` as described above. ## Actual results However, when trying to recover the saved datasets, I get this error: ``` ... File "/home/fperez/dev/neuromancer/neuromancer/corpus.py", line 186, in load_transformed_corpus_from_disk dss = DatasetDict.load_from_disk(transformed_corpus_path, fs, True) File "/home/fperez/anaconda3/envs/neuromancer/lib/python3.9/site-packages/datasets/dataset_dict.py", line 748, in load_from_disk dataset_dict[k] = Dataset.load_from_disk(dataset_dict_split_path, fs, keep_in_memory=keep_in_memory) File "/home/fperez/anaconda3/envs/neuromancer/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 1048, in load_from_disk fs.download(src_dataset_path, dataset_path.as_posix(), recursive=True) File "pyarrow/_hdfsio.pyx", line 438, in pyarrow._hdfsio.HadoopFileSystem.download TypeError: download() got an unexpected keyword argument 'recursive' ``` Examining the [signature of the download method in pyarrow 5.0.0](https://github.com/apache/arrow/blob/54d2bd89c99df72fa091b025452f85dd5d88e3cf/python/pyarrow/_hdfsio.pyx#L438) we can see that there's no download parameter: ```python def download(self, path, stream, buffer_size=None): with self.open(path, 'rb') as f: f.download(stream, buffer_size=buffer_size) ``` ## Environment info - `datasets` version: 1.13.3 - Platform: Linux-3.10.0-1160.15.2.el7.x86_64-x86_64-with-glibc2.33 - Python version: 3.9.7 - PyArrow version: 5.0.0
1,164
29
load_from_disk in DatasetsDict/Dataset not working with PyArrowHDFS wrapper implementing fsspec.spec.AbstractFileSystem ## Describe the bug Passing a PyArrowHDFS implementation of fsspec.spec.AbstractFileSystem (in the `fs` param required by `load_from_disk` methods in `DatasetDict` (in datasets_dict.py) and `Dataset` (in arrow_dataset.py) results in an error when calling the download method in the `fs` parameter. ## Steps to reproduce the bug The documentation for the `fs` parameter states: ``` fs (:class:`~filesystems.S3FileSystem` or ``fsspec.spec.AbstractFileSystem``, optional, default ``None``): Instance of the remote filesystem used to download the files from. ``` `PyArrowHDFS` from [fsspec](https://filesystem-spec.readthedocs.io/en/latest/_modules/fsspec/implementations/hdfs.html) implements `fsspec.spec.AbstractFileSystem`. However, when using it as shown below, I get an error. ```python from fsspec.implementations.hdfs import PyArrowHDFS ... transformed_corpus_path = "/user/my_user/clickbait/transformed_ds/" fs = PyArrowHDFS(host, port, user, kerb_ticket=kerb_ticket) dss = DatasetDict.load_from_disk(transformed_corpus_path, fs, True) ``` ## Expected results Previous to load from disk, I have managed to successfully store in HDFS the data and meta-information of a DatasetDict by doing: ```python transformed_corpus_path = "/user/my_user/clickbait/transformed_ds/" fs = PyArrowHDFS(host, port, user, kerb_ticket=kerb_ticket) my_datasets.save_to_disk(transformed_corpus_path, fs=fs) ``` As I have 3 datasets in the DatasetDict named `my_datasets`, the previous Python code creates the following contents in HDFS: ```sh $ hadoop fs -ls "/user/my_user/clickbait/transformed_ds/" Found 4 items -rw------- 3 my_user users 43 2021-10-19 03:08 /user/my_user/clickbait/transformed_ds/dataset_dict.json drwx------ - my_user users 0 2021-10-19 03:08 /user/my_user/clickbait/transformed_ds/test drwx------ - my_user users 0 2021-10-19 03:08 /user/my_user/clickbait/transformed_ds/train drwx------ - my_user users 0 2021-10-19 03:08 /user/my_user/clickbait/transformed_ds/validation ``` I would expect to recover on `dss` the Arrow-backed datasets I previously saved in HDFS calling the `save_to_disk` method on the `DatasetDict` object when invoking `DatasetDict.load_from_disk(...)` as described above. ## Actual results However, when trying to recover the saved datasets, I get this error: ``` ... File "/home/fperez/dev/neuromancer/neuromancer/corpus.py", line 186, in load_transformed_corpus_from_disk dss = DatasetDict.load_from_disk(transformed_corpus_path, fs, True) File "/home/fperez/anaconda3/envs/neuromancer/lib/python3.9/site-packages/datasets/dataset_dict.py", line 748, in load_from_disk dataset_dict[k] = Dataset.load_from_disk(dataset_dict_split_path, fs, keep_in_memory=keep_in_memory) File "/home/fperez/anaconda3/envs/neuromancer/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 1048, in load_from_disk fs.download(src_dataset_path, dataset_path.as_posix(), recursive=True) File "pyarrow/_hdfsio.pyx", line 438, in pyarrow._hdfsio.HadoopFileSystem.download TypeError: download() got an unexpected keyword argument 'recursive' ``` Examining the [signature of the download method in pyarrow 5.0.0](https://github.com/apache/arrow/blob/54d2bd89c99df72fa091b025452f85dd5d88e3cf/python/pyarrow/_hdfsio.pyx#L438) we can see that there's no download parameter: ```python def download(self, path, stream, buffer_size=None): with self.open(path, 'rb') as f: f.download(stream, buffer_size=buffer_size) ``` ## Environment info - `datasets` version: 1.13.3 - Platform: Linux-3.10.0-1160.15.2.el7.x86_64-x86_64-with-glibc2.33 - Python version: 3.9.7 - PyArrow version: 5.0.0 Hi @lhoestq! I ended up using `fsspec.implementations.arrow.HadoopFileSystem` which doesn't have the problem I described with pyarrow 5.0.0. I'll try again with `PyArrowHDFS` once I update arrow to 6.0.0. Thanks!
[ -1.2320432662963867, -0.8434974551200867, -0.6415994167327881, 1.4545531272888184, -0.08525841683149338, -1.2882745265960693, 0.21978053450584412, -1.1482622623443604, 1.7084405422210693, -0.8320690989494324, 0.3824213445186615, -1.661045789718628, -0.004411435220390558, -0.615102231502533, -0.7726868987083435, -0.8081659078598022, -0.38606297969818115, -0.7921249866485596, 1.0966342687606812, 2.338405132293701, 1.2569524049758911, -1.3325716257095337, 2.755690097808838, 0.7028726935386658, -0.2521974742412567, -0.9803416132926941, 0.44352424144744873, -0.05958564579486847, -1.2792102098464966, -0.6277645826339722, -0.9073721766471863, -0.10545039176940918, -0.621921181678772, -0.6000568270683289, 0.04273267835378647, 0.46520403027534485, -0.3267292380332947, -0.38311100006103516, -0.537397563457489, -0.8792232871055603, 0.4178653359413147, -0.39133259654045105, 0.9515683054924011, -0.4226604998111725, 1.7765216827392578, -0.6119277477264404, 0.502713680267334, 0.7650878429412842, 1.392423152923584, 0.12710809707641602, -0.018612217158079147, 0.2887500524520874, 0.38782480359077454, 0.1002521887421608, 0.6092376112937927, 1.144136905670166, 0.7073181867599487, 0.4806469976902008, 0.6633591055870056, -2.202509641647339, 1.2658212184906006, -1.034367322921753, 0.2053622156381607, 1.3595818281173706, -0.9242910742759705, 0.3252742290496826, -1.7187025547027588, -0.07747668772935867, 0.5687336921691895, -2.274575710296631, 0.26168093085289, -1.3053103685379028, -0.43517935276031494, 1.0657845735549927, 0.4314412474632263, -1.2013161182403564, 0.14926421642303467, -0.4371815323829651, 1.1132481098175049, 0.4197724461555481, 1.1322842836380005, -1.6319702863693237, -0.041173383593559265, -0.30036982893943787, 0.0697496086359024, -1.347927451133728, -1.5619912147521973, 0.497836172580719, 0.7064660787582397, 0.5721448659896851, -0.2276741862297058, 1.1695163249969482, -0.9769604802131653, 0.7139762043952942, -1.0454953908920288, -1.7425872087478638, -1.4228910207748413, -2.2102553844451904, -2.257441520690918, 0.7792332172393799, -0.5343310236930847, -0.49873602390289307, 2.0825319290161133, -0.9546511173248291, -1.7818950414657593, 1.0090254545211792, 0.2103416919708252, 0.05450790375471115, 2.3083696365356445, 0.18853828310966492, -0.7676822543144226, 0.37807026505470276, -0.711400032043457, 0.8057078719139099, -0.36211293935775757, 1.3891799449920654, 0.43401387333869934, -1.0980639457702637, 1.5231308937072754, -0.30755147337913513, 0.634838879108429, -0.6555616855621338, -0.46823373436927795, -0.7544830441474915, 0.2856942117214203, 1.8630554676055908, -0.37536191940307617, 1.5259350538253784, -0.3912827968597412, -1.4794256687164307, -1.6533684730529785, 0.8189913034439087, 0.38883984088897705, -0.7241286635398865, 0.08036985993385315, -0.393471360206604, 0.2343006134033203, -0.14879220724105835, 1.18242609500885, 1.2608716487884521, 0.7074187397956848, -0.41280463337898254, -0.8233025074005127, 0.20576892793178558, -0.02185601368546486, -0.7368866801261902, -1.7794150114059448, -0.353489488363266, 0.05312804877758026, 0.6170821785926819, -1.1637519598007202, 1.833210825920105, 0.8581447601318359, 1.9180505275726318, 1.0493037700653076, -0.40261587500572205, 1.4914541244506836, 0.09544839709997177, 1.9238609075546265, -0.5088555216789246, 0.5509544610977173, -0.3811427354812622, -1.1731470823287964, 0.946688711643219, -0.23482239246368408, -2.113762617111206, -0.6547257900238037, -0.7465425729751587, -0.18045303225517273, -0.7859034538269043, 0.9050304293632507, -0.2429889589548111, -1.4329081773757935, 0.18038828670978546, -0.6732065677642822, 0.20821669697761536, -1.2239720821380615, 0.28816863894462585, 0.7791907787322998, -0.6794233322143555, 0.023462826386094093, -0.28688421845436096, -1.2842074632644653, -0.521308183670044, 0.3113563358783722, 1.8974939584732056, -0.6696131229400635, 0.9150940775871277, 1.1327388286590576, -0.7369836568832397, 0.05820692330598831, 0.3432327210903168, -0.2502540051937103, 0.7602248191833496, -1.0989179611206055, -0.4568661153316498, 1.2828683853149414, -0.30478888750076294, -0.6639890670776367, 1.4910314083099365, 0.8067200779914856, -1.0727900266647339, -0.13434018194675446, -0.13548403978347778, -0.8707988262176514, 0.10560794919729233, -1.5231785774230957, -0.07993051409721375, 0.533845841884613, -1.5599035024642944, -0.4553046226501465, -0.17479223012924194, 1.3305834531784058, -0.20790423452854156, 1.4924837350845337, -0.2399931102991104, -0.10837849229574203, -0.35887905955314636, -0.35117051005363464, 0.10617899149656296, -0.16700923442840576, -0.5929964780807495, 0.25635331869125366, -0.692118763923645, 0.40773898363113403, 1.4025967121124268, 0.3089160919189453, -0.06419548392295837, 0.49408817291259766, 1.1134430170059204, 0.2642730474472046, -0.1289391964673996, -0.859948456287384, -1.4745630025863647, 1.9475191831588745, -1.3946518898010254, 1.9792466163635254, 0.7197993993759155, 0.004925672896206379, -1.757290244102478, -1.8876681327819824, 1.3236627578735352, 1.105726957321167, 2.2406833171844482, 0.6077224016189575, 0.36762675642967224, -0.7929701209068298, -0.6934813261032104, 0.3567509949207306, -0.9966568946838379, -0.6277656555175781, 0.15092778205871582, 2.375318765640259, 1.7408993244171143, -0.4500618278980255, -0.16908963024616241, -0.9616435766220093, 1.3960622549057007, -0.23547764122486115, 0.31887462735176086, 1.9992375373840332, -0.2761012613773346, -1.0510478019714355, 1.3066965341567993, -2.436838150024414, 0.31395354866981506, 2.0447750091552734, 0.2555053234100342, 0.0910927951335907, -1.3522100448608398, -0.6092544794082642, -0.3659117817878723, -0.292044997215271, -1.2502844333648682, 0.489456444978714, -0.2284628003835678, -0.7761638760566711, -1.3719265460968018, 0.213659405708313, -1.085774540901184, -1.7162150144577026, 0.2839704751968384, 1.9858585596084595, 1.935585618019104, -0.6592954397201538, 1.5804040431976318, -0.40096643567085266, 0.09234000742435455, 1.299824833869934, 1.254453182220459, 3.093085765838623, 1.9018933773040771, -1.317293405532837, 0.7099218368530273, -0.1666756570339203, -0.4842207729816437, 1.194130539894104, -1.1732500791549683, 1.2035537958145142, -0.1560164988040924, -1.1589884757995605, -1.2961721420288086, 0.9727197289466858, 0.5055611729621887, 0.04025237262248993, -0.4971995949745178, 1.1885857582092285, 0.12422014027833939, 1.3416513204574585, 0.576107919216156, -0.3137448728084564, 0.6590744853019714, -0.2786059081554413, -0.44849327206611633, 1.4784679412841797, 0.2180768996477127, -1.3927513360977173, -2.2226450443267822, -0.27318865060806274, -0.8837426900863647, 0.09816982597112656, -0.6966751217842102, -0.9707966446876526, 1.691329002380371, 0.42629337310791016, -1.3380520343780518, -0.25027161836624146, -0.34989452362060547, -0.5269647836685181, 2.7104954719543457, -1.3728091716766357, -0.19762247800827026, -1.000861644744873, -0.5423486232757568, 1.6046710014343262, -1.2322404384613037, -0.2814674973487854, -1.0083508491516113, -0.5901919603347778, -1.2067254781723022, -0.5101205706596375, 0.07201188802719116, -0.8949015140533447, 0.768515408039093, 0.20296955108642578, -1.2160168886184692, -0.43700265884399414, -0.8570253849029541, 1.0188825130462646, -0.12563997507095337, 0.15869715809822083, 1.8084744215011597, 0.37929603457450867, -0.5034119486808777, 0.7559273838996887, 1.1275088787078857, 0.6580147743225098, -0.5680205225944519, 0.2599213421344757, -0.6967256665229797, 0.345518559217453, -1.3238962888717651, 0.26722753047943115, -2.8528385162353516, 0.6546180844306946, -0.1495814025402069, 0.009597234427928925, -0.14801305532455444, -1.4330086708068848, 1.0673807859420776, 2.747011423110962, -1.2137807607650757, 0.41114041209220886, 0.3475181460380554, 1.1576889753341675, -1.5637611150741577, 0.3134705126285553, -0.4466274678707123, 2.069491147994995, 0.18469403684139252, 1.1960774660110474, -0.4547397792339325, -2.3400909900665283, 0.592282772064209, -1.2457152605056763, -1.1603214740753174, 0.8925155401229858, -0.8148394227027893, 0.058072030544281006, -1.3779112100601196, -0.20178627967834473, -0.8550686240196228, -1.2468929290771484, 0.718109667301178, 0.07516851276159286, 0.42958563566207886, -0.6930862665176392, 0.30021360516548157, -2.084672212600708, -1.2490090131759644, -0.2754462957382202, -0.9370563626289368, 0.5214449167251587, -0.3876321315765381, 0.6155964732170105, -0.06336214393377304, -0.08638828247785568, 0.41851305961608887, 1.583946704864502, 3.408935308456421, 0.1278330236673355, 0.27010849118232727, -0.20156258344650269, -0.9176033139228821, 1.3274177312850952, 0.8742274641990662, -0.14910738170146942, -0.528083086013794, -1.0069388151168823, 1.216927170753479, 1.982162594795227, 1.0414109230041504, 0.03041292168200016, -0.8788938522338867, -0.8321940898895264, -0.012259451672434807, 0.1451716125011444, 0.47727447748184204, 0.8664085268974304, 0.1013881266117096, 0.0248794537037611, 1.3611739873886108, 1.1991323232650757, -0.43728840351104736, 0.37369704246520996, -0.9541162848472595, -0.3886648714542389, 0.5255357623100281, 0.23889468610286713, -0.03915712982416153, 0.33275485038757324, -0.9374836087226868, -0.1828058660030365, -0.3490023612976074, -0.8066020607948303, -0.8409834504127502, -0.36804160475730896, -0.3983861207962036, 1.666056752204895, 0.019896816462278366, -0.539463996887207, 0.0013382257893681526, -0.6567258238792419, -0.1115710660815239, -1.0727794170379639, 0.29842036962509155, -0.19446350634098053, -0.07300864905118942, -0.15959569811820984, 1.587202787399292, -0.928841769695282, -1.964339256286621, 0.23226065933704376, 0.2198878973722458, -0.3479597866535187, 0.2791578471660614, 1.6692839860916138, 0.5586786270141602, 1.3930230140686035, 1.3820210695266724, 0.9905931353569031, -0.7406173348426819, -1.2667618989944458, 0.7385204434394836, 0.9289848208427429, -1.4277981519699097, 0.8385350704193115, -0.026410475373268127, -0.4678441882133484, 0.632225513458252, 1.3315341472625732, 0.45031309127807617, -2.089015483856201, 0.7999913096427917, -0.945905327796936, 0.7680538892745972, 0.723488986492157, 0.7211799025535583, 0.2316714972257614, 0.872416079044342, -1.1882617473602295, -1.0717642307281494, -0.6665542721748352, -0.6551330089569092, 1.8399085998535156, -0.3068016767501831, 0.6305163502693176, -0.13771657645702362, -1.4097075462341309, -0.16624629497528076, 0.6642298698425293, 0.38409101963043213, -0.5558621883392334, 0.751790463924408, -0.7297559976577759, -1.0366222858428955, -1.2845345735549927, -0.4912024438381195, -1.1284215450286865, -0.9521718621253967, 1.0543479919433594, 0.7854869365692139, 0.3709684908390045, 1.8543837070465088, 0.6220414042472839, 0.24959494173526764, -2.6898672580718994, 0.9054378867149353, 0.2796579897403717, -0.14122945070266724, 0.9146241545677185, 0.33685439825057983, 0.9710113406181335, -0.04510592669248581, 0.6081827282905579, -2.401064157485962, 2.3510799407958984, -0.2786507308483124, 0.5805434584617615, 0.00806582160294056, -0.22523702681064606, 1.1078089475631714, 0.5676292181015015, 0.5638613104820251, -1.1374329328536987, 0.7220568060874939, -0.6044678092002869, 1.1804320812225342, 0.8645487427711487, -0.8448111414909363, 0.0064536575227975845, 1.314109206199646, 0.42586490511894226, -0.547502338886261, -0.9445769190788269, -0.9862158298492432, 0.9245092272758484, 1.6690651178359985, -0.03794313594698906, -0.09592470526695251, 0.8989646434783936, 0.7613077759742737, -1.2359521389007568, 0.14846859872341156, -0.7079357504844666, -0.7381493449211121, 1.6687414646148682, 1.968456745147705, -0.13384076952934265, -0.1703455150127411, -0.7922683954238892, -1.195953369140625, 0.7832778096199036, -0.052611663937568665, -0.071228988468647, 0.5302339792251587, -0.6229543685913086, 1.114820957183838, 0.8268438577651978, 0.9204679131507874, 0.1166405901312828, 0.23936757445335388, 0.4187367856502533, -0.37243708968162537, -1.179418921470642, -0.27466729283332825, -1.0733802318572998, -2.7281157970428467, 0.4724041521549225, -0.19552065432071686, -1.4453165531158447, -0.01318555511534214, -1.0817015171051025, 0.918128490447998, -0.5550404191017151, -1.2283575534820557, -1.5299619436264038, 0.22927521169185638, -0.04973848909139633, 0.9264804124832153, -1.610353708267212, -0.03948512673377991, 1.2365939617156982, 0.844032347202301, -0.6057317852973938, 0.973335325717926, 0.211258202791214, 1.1360909938812256, 0.9170648455619812, -0.2949126660823822, 0.5329744815826416, 0.04323233664035797, -1.3010520935058594, 0.5371258854866028, 1.152177333831787, 0.13620704412460327, 1.361308217048645, -0.5570092797279358, 0.1345151662826538, 0.30056464672088623, -0.554794430732727, -0.509131908416748, -0.5505808591842651, 0.7663146257400513, 0.015467336401343346, -0.9584414958953857, -0.014123957604169846, -0.09272786974906921, -0.1951027661561966, 0.12399887293577194, -1.445235252380371, -0.22738951444625854, -0.3701161742210388, -0.5549673438072205, -1.2158496379852295, -0.018514003604650497, 1.3312820196151733, -0.6865819692611694, -0.2835180163383484, 0.4499053359031677, 0.2598828673362732, 0.5747698545455933, 0.5934321284294128, -0.6786885857582092, -0.3553999066352844, -0.3217756748199463, -0.4102662205696106, 0.3492758870124817, 1.3893930912017822, -0.020613083615899086, -0.8848550915718079, 0.7598857879638672, -0.4340466856956482, 0.05571039021015167, 1.9453741312026978, 0.13790589570999146, -0.743730902671814, 0.2950572371482849, -0.7239922285079956, 1.8553038835525513, 1.8584402799606323, 1.2772430181503296, -0.1282857358455658, -1.0623795986175537, 0.647689700126648, -0.3992331027984619, -0.4302319586277008, 0.9233807325363159, 0.3259149193763733, -0.312176376581192, -1.3949575424194336, 0.711393415927887, 1.3393217325210571, -0.7377061247825623, -0.8588927388191223, 0.13786393404006958, -0.7701098918914795, 1.0792218446731567, 0.6090459227561951, 0.2982886731624603, 0.2930908501148224, 1.5914936065673828, 0.7631273865699768, -0.40236419439315796, 0.5748727321624756, 0.5174295902252197, -0.1977047324180603, -2.1479568481445312, -1.1525846719741821, 0.3749063313007355, -0.5060448050498962, -1.649127721786499, 1.445296287536621, -1.1430246829986572, -0.9870248436927795, 0.5833646655082703, 0.15803207457065582, 1.4380604028701782, 0.3731536269187927, 1.577648639678955, 2.0592758655548096, 0.8113269209861755, 0.4364999830722809, 1.232489824295044, -0.14864112436771393, -0.5111905932426453, 1.8216359615325928, -0.4476070702075958, 0.4053361713886261, 1.1143327951431274, -0.2910051643848419, -0.996987521648407, -0.8170701265335083, -1.2780914306640625, -0.7023937106132507, 1.2207432985305786, 0.07655619829893112, -1.0931241512298584, 0.31489142775535583, 1.5605829954147339, 0.150518998503685, -0.29793626070022583, 0.6686786413192749, 0.4007766842842102, -0.8020680546760559, -0.053788378834724426, -0.9326940774917603, 0.5265921950340271, -0.2397134006023407, -0.3483790457248688, 0.3585072457790375, 0.5139543414115906, 1.3199000358581543, 0.0056008631363511086, 0.12058217078447342, 1.0543214082717896, -1.4097832441329956, 1.4901717901229858, -0.6364486813545227, 0.36128145456314087, -2.3730671405792236, 1.4205831289291382, -0.7379854321479797, 1.9586150646209717, -2.5805070400238037, 0.42104268074035645, -0.574958324432373, -0.4408477544784546, 0.3027119040489197, -0.3818671405315399, 0.15721769630908966, -0.19487132132053375, -1.1455014944076538, -0.003296974115073681, -0.7162889838218689, 0.699781596660614, 1.1018218994140625, 1.470892310142517, -1.128618597984314, -0.32865089178085327, -1.7417933940887451, -0.09384454041719437, -0.7046070098876953, 0.4168916344642639, -1.9336638450622559, -0.15821628272533417, -2.0609567165374756, -2.3475096225738525, -1.3157532215118408, -0.6796642541885376, 1.0034202337265015, 0.1209777370095253, -0.7790800929069519, 1.2320338487625122, -0.38542184233665466, -1.906766414642334, 1.1369022130966187, -2.17218017578125 ]
https://github.com/huggingface/datasets/issues/3113
Loading Data from HDF files
I would also like this support or something similar. Geospatial datasets come in netcdf which is derived from hdf5, or zarr. I've gotten zarr stores to work with datasets and streaming, but it takes awhile to convert the data to zarr if it's not stored in that natively.
**Is your feature request related to a problem? Please describe.** More often than not I come along big HDF datasets, and currently there is no straight forward way to feed them to a dataset. **Describe the solution you'd like** I would love to see a `from_h5` method that gets an interface implemented by the user on how items are extracted from dataset (in case of multiple datasets containing elements like arrays and metadata and etc). **Describe alternatives you've considered** Currently I manually load hdf files using `h5py` and implement PyTorch dataset interface. For small h5 files I load them into a pandas dataframe and use `from_pandas` function in the `datasets` package to load them, but for big datasets this is not feasible. **Additional context** HDF files are widespread throughout different domains and are one of the go to's for many researchers/scientists/engineers who work with numerical data. Given `datasets`' usecases have outgrown NLP use cases, it will make a lot of sense focusing on things like supporting HDF files.
1,165
48
Loading Data from HDF files **Is your feature request related to a problem? Please describe.** More often than not I come along big HDF datasets, and currently there is no straight forward way to feed them to a dataset. **Describe the solution you'd like** I would love to see a `from_h5` method that gets an interface implemented by the user on how items are extracted from dataset (in case of multiple datasets containing elements like arrays and metadata and etc). **Describe alternatives you've considered** Currently I manually load hdf files using `h5py` and implement PyTorch dataset interface. For small h5 files I load them into a pandas dataframe and use `from_pandas` function in the `datasets` package to load them, but for big datasets this is not feasible. **Additional context** HDF files are widespread throughout different domains and are one of the go to's for many researchers/scientists/engineers who work with numerical data. Given `datasets`' usecases have outgrown NLP use cases, it will make a lot of sense focusing on things like supporting HDF files. I would also like this support or something similar. Geospatial datasets come in netcdf which is derived from hdf5, or zarr. I've gotten zarr stores to work with datasets and streaming, but it takes awhile to convert the data to zarr if it's not stored in that natively.
[ -1.2234126329421997, -1.0743210315704346, -0.6722300052642822, 1.281704306602478, -0.2383677363395691, -1.2452539205551147, 0.16791288554668427, -1.1577773094177246, 1.7835322618484497, -0.8676137328147888, 0.28145045042037964, -1.6657413244247437, 0.05179290845990181, -0.5536896586418152, -0.8120035529136658, -0.9179020524024963, -0.4605843126773834, -0.8668966889381409, 0.9461408853530884, 2.5230367183685303, 1.0434989929199219, -1.5302627086639404, 2.7069711685180664, 0.6402330994606018, -0.13294725120067596, -0.9975706338882446, 0.4055141806602478, 0.1681082546710968, -1.140884280204773, -0.47563236951828003, -0.9089801907539368, -0.02332298830151558, -0.5799286365509033, -0.5547309517860413, 0.04441187530755997, 0.31112077832221985, -0.1906672567129135, -0.41850316524505615, -0.531355619430542, -0.6287681460380554, 0.4989090859889984, -0.38313552737236023, 1.004893183708191, -0.43431273102760315, 1.9034936428070068, -0.5030179023742676, 0.4576723277568817, 0.7462883591651917, 1.420019507408142, 0.2621263265609741, -0.021454446017742157, 0.3130764365196228, 0.4128248393535614, -0.11963574588298798, 0.3499016761779785, 1.1523646116256714, 0.6312622427940369, 0.4201257824897766, 0.7839644551277161, -2.155083656311035, 1.285595417022705, -1.0202895402908325, 0.412757009267807, 1.4991453886032104, -0.9517425298690796, 0.3924404978752136, -1.7735930681228638, -0.09243951737880707, 0.5576243996620178, -2.2891950607299805, 0.1117745041847229, -1.2252016067504883, -0.49233147501945496, 0.9919194579124451, 0.2947719693183899, -1.2541508674621582, 0.19114476442337036, -0.5306184887886047, 0.9390656352043152, 0.485720694065094, 1.1245875358581543, -1.7374669313430786, -0.10135020315647125, -0.2815644443035126, 0.1412564516067505, -1.311908483505249, -1.481341004371643, 0.502269983291626, 0.6217067241668701, 0.5241258144378662, -0.10563226789236069, 0.968977153301239, -1.0859661102294922, 0.8034932017326355, -0.9532507061958313, -1.5679200887680054, -1.380995273590088, -2.2908942699432373, -2.2987122535705566, 0.9110805988311768, -0.4024040997028351, -0.5641081929206848, 2.0008397102355957, -0.9657716751098633, -1.7259671688079834, 1.2182509899139404, 0.2709399163722992, -0.00511581776663661, 2.3422021865844727, 0.20457054674625397, -0.7100468873977661, 0.4082808196544647, -0.6988692879676819, 0.8281393051147461, -0.44693002104759216, 1.4828786849975586, 0.48181214928627014, -1.046553134918213, 1.515398383140564, -0.44165876507759094, 0.6119422912597656, -0.651676595211029, -0.5982567071914673, -0.900879979133606, 0.43430423736572266, 1.8962821960449219, -0.30686548352241516, 1.58229660987854, -0.41705450415611267, -1.632494330406189, -1.6437164545059204, 0.9408441781997681, 0.4321644902229309, -0.7258508205413818, 0.011459196917712688, -0.34842050075531006, 0.07459494471549988, -0.05587192252278328, 1.0426256656646729, 1.1605885028839111, 0.732803225517273, -0.36131930351257324, -0.8574548959732056, 0.13967128098011017, -0.12396896630525589, -0.7369550466537476, -1.8443681001663208, -0.35550037026405334, 0.13214722275733948, 0.6017414927482605, -1.2796541452407837, 1.6662399768829346, 0.998134195804596, 1.9291491508483887, 0.9361118078231812, -0.3485071063041687, 1.4062449932098389, 0.05123788118362427, 1.8456426858901978, -0.5630308389663696, 0.7530906796455383, -0.23745828866958618, -1.0848995447158813, 0.8007788062095642, -0.3899874985218048, -2.0808587074279785, -0.7185995578765869, -0.951564610004425, -0.17856143414974213, -0.7543081641197205, 0.8637210130691528, -0.23177674412727356, -1.4178581237792969, 0.25825104117393494, -0.5410011410713196, 0.20535357296466827, -1.1290977001190186, 0.3844369351863861, 0.7683190107345581, -0.6502668261528015, -0.0766209214925766, -0.2118217498064041, -1.327223777770996, -0.48040470480918884, 0.23671084642410278, 1.881946086883545, -0.8111991286277771, 0.9490013122558594, 0.9776989221572876, -0.7371758818626404, 0.05959479510784149, 0.31551089882850647, -0.2743210196495056, 0.9098182916641235, -1.1294612884521484, -0.2281634658575058, 1.156524658203125, -0.22261293232440948, -0.39129364490509033, 1.5201401710510254, 0.7870058417320251, -0.973706066608429, -0.12783123552799225, -0.2776777148246765, -0.7688306570053101, -0.07496209442615509, -1.4866487979888916, -0.1009475365281105, 0.14626853168010712, -1.4451045989990234, -0.5214073061943054, -0.29814043641090393, 1.2747938632965088, -0.1308438628911972, 1.3689271211624146, -0.39097774028778076, -0.3457769453525543, -0.4110432267189026, -0.3969779312610626, 0.23997078835964203, -0.2742875814437866, -0.5937144756317139, 0.2332865595817566, -0.7482967376708984, 0.44211074709892273, 1.4295555353164673, 0.4381047189235687, 0.010259010829031467, 0.5079901814460754, 0.9748457074165344, 0.24565370380878448, -0.041845787316560745, -0.8177089691162109, -1.5618438720703125, 2.081725835800171, -1.4678099155426025, 1.9295912981033325, 0.7868072390556335, -0.00879015401005745, -1.6897711753845215, -1.84506094455719, 1.3359707593917847, 1.2865046262741089, 2.331833839416504, 0.510394811630249, 0.38064834475517273, -0.8825464248657227, -0.7097843885421753, 0.31640148162841797, -1.03020441532135, -0.6957188844680786, 0.006419673562049866, 2.255680561065674, 1.7952110767364502, -0.6060273051261902, -0.14096485078334808, -1.0982847213745117, 1.5175285339355469, -0.17619933187961578, 0.23381590843200684, 2.047039031982422, -0.3054623007774353, -1.1775966882705688, 1.3520729541778564, -2.2397584915161133, 0.13288143277168274, 1.9371607303619385, 0.26393404603004456, 0.10814417153596878, -1.3962602615356445, -0.6191717386245728, -0.35592585802078247, -0.31911924481391907, -1.2707140445709229, 0.46064770221710205, -0.3383709192276001, -0.6700774431228638, -1.594740390777588, 0.18153035640716553, -1.2155046463012695, -1.6005243062973022, 0.3680477440357208, 1.834564208984375, 2.0264980792999268, -0.6587477326393127, 1.4694269895553589, -0.25325852632522583, 0.22715918719768524, 1.181601643562317, 1.1492682695388794, 3.123166084289551, 1.8889950513839722, -1.1841349601745605, 0.5569038987159729, -0.123296357691288, -0.508738100528717, 1.0954868793487549, -1.0911970138549805, 1.2888703346252441, -0.12743476033210754, -1.0801082849502563, -1.2264007329940796, 0.9691927433013916, 0.4660379886627197, 0.17862442135810852, -0.5277227163314819, 1.1311180591583252, -0.00430556433275342, 1.375917911529541, 0.497110515832901, -0.35135045647621155, 0.5799941420555115, -0.5046572685241699, -0.5453417897224426, 1.6247161626815796, 0.28362420201301575, -1.42073392868042, -2.3499207496643066, -0.24901819229125977, -0.8571301102638245, 0.06297169625759125, -0.5423652529716492, -0.9539503455162048, 1.6155924797058105, 0.5102776288986206, -1.247557282447815, -0.2944602072238922, -0.2902695834636688, -0.6416592001914978, 2.5955734252929688, -1.406128168106079, -0.2630496621131897, -0.8312727212905884, -0.6112625598907471, 1.5617220401763916, -1.2272485494613647, -0.1348402202129364, -1.0368683338165283, -0.614693284034729, -1.2889668941497803, -0.5740655064582825, -0.11940362304449081, -0.9423403143882751, 0.865262508392334, 0.2738533914089203, -1.081865906715393, -0.38078129291534424, -0.9730283617973328, 0.7664517164230347, -0.06678051501512527, 0.3431668281555176, 1.7230157852172852, 0.4456596076488495, -0.38968363404273987, 0.6531838178634644, 1.2026293277740479, 0.6377749443054199, -0.7290677428245544, 0.20113399624824524, -0.7594713568687439, 0.3049735724925995, -1.2641364336013794, 0.2770901620388031, -2.979022264480591, 0.6314334273338318, -0.09049424529075623, -0.1324254423379898, -0.003980766050517559, -1.279059648513794, 1.1215355396270752, 2.5462806224823, -1.1651524305343628, 0.41509994864463806, 0.36656925082206726, 1.2441288232803345, -1.5429595708847046, 0.36629387736320496, -0.3367916941642761, 2.1645801067352295, 0.22276334464550018, 1.171464204788208, -0.5801908373832703, -2.2537410259246826, 0.5420101284980774, -1.2291125059127808, -1.246845006942749, 0.6222419738769531, -0.8538118600845337, 0.03822702914476395, -1.5544264316558838, -0.1487695276737213, -0.8548412919044495, -1.2591359615325928, 0.7321160435676575, 0.13877855241298676, 0.3819901645183563, -0.6358017921447754, 0.321768194437027, -2.1873855590820312, -1.4163544178009033, -0.23064200580120087, -0.9509788751602173, 0.5198144316673279, -0.3350856602191925, 0.7820485234260559, -0.17246517539024353, 0.0597061887383461, 0.31795820593833923, 1.4798089265823364, 3.386120319366455, 0.2364269196987152, 0.48841655254364014, -0.06753967702388763, -0.857070803642273, 1.4236950874328613, 1.0425300598144531, -0.04395291209220886, -0.5442776083946228, -1.0924409627914429, 1.2483597993850708, 2.0047857761383057, 1.0130373239517212, 0.008584772236645222, -0.6571023464202881, -0.5584884881973267, -0.07555318623781204, 0.16776913404464722, 0.4968474209308624, 0.907303512096405, -0.03925805538892746, 0.12615126371383667, 1.5169192552566528, 1.3132916688919067, -0.5845797657966614, 0.3937256932258606, -0.7634866833686829, -0.53266841173172, 0.5048661231994629, 0.4017549753189087, 0.010907015763223171, 0.3367632031440735, -1.040742039680481, -0.21985559165477753, -0.36134475469589233, -1.008918046951294, -0.6537179350852966, -0.5486847162246704, -0.42743635177612305, 1.6431759595870972, 0.14872321486473083, -0.5030165910720825, -0.06106027588248253, -0.7292693257331848, 0.009044400416314602, -1.1078770160675049, 0.3120494782924652, -0.10428240150213242, -0.051192402839660645, -0.11157191544771194, 1.7656408548355103, -0.9335780739784241, -2.0206968784332275, 0.20300902426242828, 0.28220927715301514, -0.5357926487922668, 0.15031178295612335, 1.5499428510665894, 0.5363587737083435, 1.5543686151504517, 1.3930749893188477, 0.9368772506713867, -0.6338858604431152, -1.3058403730392456, 0.7105633020401001, 0.9081780910491943, -1.4104962348937988, 0.762400209903717, 0.20702862739562988, -0.6406770944595337, 0.7612354159355164, 1.3156399726867676, 0.4476173222064972, -1.9761682748794556, 0.8353459239006042, -0.8564399480819702, 0.8084532618522644, 0.7127636075019836, 0.6648967266082764, 0.2247859686613083, 0.9247037768363953, -1.2770148515701294, -1.126675009727478, -0.9038569331169128, -0.584966778755188, 2.072659730911255, -0.2555845379829407, 0.5467362999916077, -0.17057682573795319, -1.202793836593628, -0.08685798943042755, 0.6730955243110657, 0.503097653388977, -0.38458192348480225, 0.7710309624671936, -0.6540187001228333, -1.124794840812683, -1.4120628833770752, -0.32387444376945496, -1.0609618425369263, -0.8499131798744202, 1.053763508796692, 0.7755751013755798, 0.23130090534687042, 1.8977130651474, 0.6812397837638855, 0.23585979640483856, -2.5708487033843994, 0.8811790943145752, 0.2383614033460617, -0.1010860800743103, 0.961033046245575, 0.22643756866455078, 1.06033194065094, 0.002304261550307274, 0.5276632308959961, -2.402169942855835, 2.1293060779571533, -0.20211681723594666, 0.6814806461334229, -0.0762537270784378, -0.18627075850963593, 1.292137861251831, 0.6380320191383362, 0.5216886401176453, -1.168940544128418, 0.6781677603721619, -0.5125494599342346, 1.1518076658248901, 0.8990774750709534, -0.7664284110069275, -0.05956452339887619, 1.2836768627166748, 0.5066549181938171, -0.48769834637641907, -0.942414402961731, -0.9615786671638489, 0.8759357333183289, 1.6858916282653809, -0.17658065259456635, -0.0018302896060049534, 0.7946926355361938, 0.7851117849349976, -1.2970649003982544, 0.10559849441051483, -0.8189241886138916, -0.7925517559051514, 1.6413462162017822, 2.0638153553009033, -0.08000288158655167, -0.15060992538928986, -0.7238708138465881, -1.248274326324463, 0.7742429375648499, 0.05595644563436508, 0.10216937959194183, 0.6139774322509766, -0.6789485812187195, 1.1277129650115967, 0.9981144070625305, 0.854665994644165, 0.17878620326519012, 0.36455079913139343, 0.4513334333896637, -0.28542107343673706, -1.1564863920211792, -0.2669210433959961, -1.1609728336334229, -2.428276300430298, 0.5267287492752075, -0.28404760360717773, -1.488726019859314, -0.05863550677895546, -0.9734816551208496, 0.9690736532211304, -0.559400737285614, -1.1396244764328003, -1.6488797664642334, 0.18490388989448547, 0.005929852835834026, 0.9424551725387573, -1.4988969564437866, -0.04690573737025261, 1.2034237384796143, 0.8691113591194153, -0.4563254117965698, 1.0476183891296387, 0.29730749130249023, 1.004083514213562, 0.7505365610122681, -0.5035572052001953, 0.5178259015083313, 0.101669080555439, -1.3165680170059204, 0.5074787139892578, 1.0923751592636108, 0.18293115496635437, 1.370550513267517, -0.5791850686073303, 0.08725930750370026, 0.3958922326564789, -0.5300066471099854, -0.40515589714050293, -0.4546394944190979, 0.756531298160553, 0.014853128232061863, -0.8146863579750061, 0.1120142936706543, -0.06014509126543999, -0.29155638813972473, 0.22953340411186218, -1.5538233518600464, -0.2802397906780243, -0.4947602450847626, -0.485470712184906, -1.1505271196365356, -0.06623080372810364, 1.4729527235031128, -0.7340152263641357, -0.22442229092121124, 0.5912982225418091, 0.5755696296691895, 0.6003903150558472, 0.6838135719299316, -0.5865631699562073, -0.37430983781814575, -0.36500284075737, -0.3738445043563843, 0.1972249150276184, 1.2679800987243652, -0.18305596709251404, -1.0158231258392334, 0.7423562407493591, -0.4038868546485901, -0.008305897936224937, 1.8752975463867188, 0.12346026301383972, -0.8113517761230469, 0.4093223512172699, -0.7940263152122498, 1.8913439512252808, 1.7955535650253296, 1.3732554912567139, 0.006764713674783707, -0.9682549834251404, 0.48286858201026917, -0.237471804022789, -0.3799375295639038, 0.9720935225486755, 0.5080902576446533, -0.16330230236053467, -1.3492927551269531, 0.6249901652336121, 1.2972731590270996, -0.8880825042724609, -0.8397585153579712, 0.10855287313461304, -0.7915542125701904, 1.0870896577835083, 0.7077216506004333, 0.5233792066574097, 0.24073289334774017, 1.7568024396896362, 0.7035291790962219, -0.48136448860168457, 0.5563746690750122, 0.5767800211906433, -0.2343052327632904, -2.0415079593658447, -1.2303247451782227, 0.2511787414550781, -0.5985865592956543, -1.5566132068634033, 1.3131258487701416, -1.0438989400863647, -0.8677969574928284, 0.5415733456611633, 0.07551461458206177, 1.44772469997406, 0.380405992269516, 1.6662217378616333, 2.120328903198242, 0.881252646446228, 0.303883820772171, 1.3234699964523315, -0.07505936920642853, -0.4856185019016266, 1.9429388046264648, -0.4043863117694855, 0.3858887255191803, 1.2317277193069458, -0.3095346987247467, -1.038732886314392, -0.7376881837844849, -1.0667102336883545, -0.6100074052810669, 1.0302752256393433, 0.11869336664676666, -1.2469736337661743, 0.08584954589605331, 1.5850629806518555, 0.1517333984375, -0.4222927689552307, 0.5008544325828552, 0.3903830647468567, -0.7248300313949585, -0.0842561274766922, -1.1471585035324097, 0.5305901765823364, -0.28548088669776917, -0.4064995348453522, 0.28760018944740295, 0.49709823727607727, 1.2721580266952515, -0.03201781213283539, 0.16872432827949524, 1.192576289176941, -1.5137269496917725, 1.3608492612838745, -0.7305288910865784, 0.23246164619922638, -2.4443376064300537, 1.4766511917114258, -0.6803337335586548, 1.9298075437545776, -2.677729606628418, 0.4025803208351135, -0.6442869901657104, -0.4614737033843994, 0.3898938298225403, -0.33170995116233826, 0.23399342596530914, -0.07115050405263901, -1.2568477392196655, -0.0673554539680481, -0.7085391283035278, 0.5725158452987671, 1.1149778366088867, 1.2952460050582886, -1.125667929649353, -0.38890382647514343, -1.6832098960876465, -0.1977895051240921, -0.6255177855491638, 0.41322413086891174, -2.0493974685668945, -0.11755882948637009, -1.8217822313308716, -2.2631688117980957, -1.3966705799102783, -0.8456103205680847, 1.0941123962402344, 0.05305014178156853, -0.9445587396621704, 1.1038475036621094, -0.3845624029636383, -1.8403270244598389, 1.14192795753479, -2.2333271503448486 ]
https://github.com/huggingface/datasets/issues/3113
Loading Data from HDF files
@mariosasko , I would like to contribute on this "good second issue" . Is there anything in the works for this Issue or can I go ahead ?
**Is your feature request related to a problem? Please describe.** More often than not I come along big HDF datasets, and currently there is no straight forward way to feed them to a dataset. **Describe the solution you'd like** I would love to see a `from_h5` method that gets an interface implemented by the user on how items are extracted from dataset (in case of multiple datasets containing elements like arrays and metadata and etc). **Describe alternatives you've considered** Currently I manually load hdf files using `h5py` and implement PyTorch dataset interface. For small h5 files I load them into a pandas dataframe and use `from_pandas` function in the `datasets` package to load them, but for big datasets this is not feasible. **Additional context** HDF files are widespread throughout different domains and are one of the go to's for many researchers/scientists/engineers who work with numerical data. Given `datasets`' usecases have outgrown NLP use cases, it will make a lot of sense focusing on things like supporting HDF files.
1,165
28
Loading Data from HDF files **Is your feature request related to a problem? Please describe.** More often than not I come along big HDF datasets, and currently there is no straight forward way to feed them to a dataset. **Describe the solution you'd like** I would love to see a `from_h5` method that gets an interface implemented by the user on how items are extracted from dataset (in case of multiple datasets containing elements like arrays and metadata and etc). **Describe alternatives you've considered** Currently I manually load hdf files using `h5py` and implement PyTorch dataset interface. For small h5 files I load them into a pandas dataframe and use `from_pandas` function in the `datasets` package to load them, but for big datasets this is not feasible. **Additional context** HDF files are widespread throughout different domains and are one of the go to's for many researchers/scientists/engineers who work with numerical data. Given `datasets`' usecases have outgrown NLP use cases, it will make a lot of sense focusing on things like supporting HDF files. @mariosasko , I would like to contribute on this "good second issue" . Is there anything in the works for this Issue or can I go ahead ?
[ -1.2161248922348022, -1.07193124294281, -0.6916710138320923, 1.337469220161438, -0.25310900807380676, -1.293769359588623, 0.1386803239583969, -1.148705244064331, 1.777288794517517, -0.8647724986076355, 0.29142633080482483, -1.6751539707183838, 0.0755249485373497, -0.5529330968856812, -0.8462281227111816, -0.9164865016937256, -0.43561264872550964, -0.8634552955627441, 0.9622356295585632, 2.497276782989502, 1.0889657735824585, -1.5231101512908936, 2.703010082244873, 0.6365087628364563, -0.12506148219108582, -0.9796043634414673, 0.41964685916900635, 0.16575250029563904, -1.1268682479858398, -0.47445714473724365, -0.9049403667449951, -0.05933379381895065, -0.572058916091919, -0.536401629447937, 0.07525783777236938, 0.34945541620254517, -0.19459956884384155, -0.4318777322769165, -0.5384401679039001, -0.6718044281005859, 0.5392407774925232, -0.3580513298511505, 1.0155035257339478, -0.45556995272636414, 1.905489206314087, -0.5400687456130981, 0.44513997435569763, 0.7448451519012451, 1.4396939277648926, 0.25975608825683594, 0.0036018304526805878, 0.27709248661994934, 0.40240126848220825, -0.08945349603891373, 0.33488914370536804, 1.136048436164856, 0.6377768516540527, 0.4613167941570282, 0.779148519039154, -2.120537757873535, 1.3113551139831543, -1.0582045316696167, 0.4014192521572113, 1.4626573324203491, -0.9610018134117126, 0.3890254497528076, -1.7847073078155518, -0.08385220170021057, 0.5412216782569885, -2.2396914958953857, 0.10769391059875488, -1.2347239255905151, -0.5049390196800232, 0.9515078067779541, 0.2579542398452759, -1.300942301750183, 0.20775417983531952, -0.5439648628234863, 0.9522356390953064, 0.5169234871864319, 1.0857837200164795, -1.7625433206558228, -0.09725886583328247, -0.29108309745788574, 0.11689560115337372, -1.3198555707931519, -1.488685965538025, 0.538950502872467, 0.5897315144538879, 0.5152579545974731, -0.12906724214553833, 0.9675382971763611, -1.0931283235549927, 0.7857790589332581, -0.942559003829956, -1.5510436296463013, -1.4233709573745728, -2.2673697471618652, -2.3102517127990723, 0.9232615232467651, -0.40823379158973694, -0.5516359210014343, 1.9874941110610962, -0.9822177886962891, -1.7245726585388184, 1.1976391077041626, 0.2549518942832947, -0.008950503543019295, 2.327347993850708, 0.22208620607852936, -0.7162859439849854, 0.38541534543037415, -0.6853052377700806, 0.8175615072250366, -0.479418009519577, 1.4875911474227905, 0.49836471676826477, -1.0337157249450684, 1.5616967678070068, -0.4411614239215851, 0.5934363603591919, -0.6358047127723694, -0.6101424098014832, -0.8784677386283875, 0.4163179099559784, 1.907675862312317, -0.299968957901001, 1.585410714149475, -0.39805784821510315, -1.6339002847671509, -1.6414787769317627, 0.9467625021934509, 0.4546782672405243, -0.7335629463195801, 0.05203628167510033, -0.3698652982711792, 0.08864808082580566, -0.07168270647525787, 1.0554407835006714, 1.1324477195739746, 0.7456448078155518, -0.3455372750759125, -0.8525046706199646, 0.15250499546527863, -0.10368608683347702, -0.7258644700050354, -1.8398057222366333, -0.38223984837532043, 0.12991896271705627, 0.6220535635948181, -1.2546254396438599, 1.6589391231536865, 0.9678991436958313, 1.910101056098938, 0.9401370286941528, -0.32749927043914795, 1.3635019063949585, 0.01611410081386566, 1.8522868156433105, -0.576636016368866, 0.7638643980026245, -0.24726958572864532, -1.0672396421432495, 0.804789662361145, -0.39766624569892883, -2.069166660308838, -0.7008031606674194, -0.9713207483291626, -0.18058183789253235, -0.7688732743263245, 0.8801502585411072, -0.26906388998031616, -1.3977209329605103, 0.2766181528568268, -0.5333243012428284, 0.1693713665008545, -1.147720456123352, 0.37085676193237305, 0.7492170929908752, -0.6235620379447937, -0.08718132972717285, -0.1830972284078598, -1.298140287399292, -0.49022242426872253, 0.19627410173416138, 1.907192587852478, -0.8266237378120422, 0.9772570729255676, 0.9396160244941711, -0.7604578733444214, 0.06119195371866226, 0.3636113703250885, -0.2948514223098755, 0.9086527824401855, -1.101702332496643, -0.25194740295410156, 1.1681078672409058, -0.21713757514953613, -0.38921070098876953, 1.4976123571395874, 0.7968786358833313, -0.9436357617378235, -0.10624364763498306, -0.29248881340026855, -0.8105254173278809, -0.06423253566026688, -1.4604696035385132, -0.1125417947769165, 0.16405455768108368, -1.4296704530715942, -0.5381850004196167, -0.2654981315135956, 1.2590086460113525, -0.16799136996269226, 1.3348779678344727, -0.3802686631679535, -0.37314659357070923, -0.40980008244514465, -0.39468103647232056, 0.22540846467018127, -0.24676454067230225, -0.6017398834228516, 0.25756171345710754, -0.7776412963867188, 0.43220219016075134, 1.413146734237671, 0.427790105342865, -0.02805030718445778, 0.5274049043655396, 0.9829968214035034, 0.22159622609615326, -0.019408056512475014, -0.8256605267524719, -1.526286005973816, 2.042726516723633, -1.4873629808425903, 1.9362696409225464, 0.7690256834030151, -0.02445710450410843, -1.6711695194244385, -1.8432085514068604, 1.332772970199585, 1.3138890266418457, 2.3378987312316895, 0.5448395013809204, 0.33613985776901245, -0.8867929577827454, -0.7214874029159546, 0.3237002491950989, -1.087001085281372, -0.6946426630020142, -0.006804022006690502, 2.2449607849121094, 1.770246982574463, -0.613590657711029, -0.17009852826595306, -1.1131609678268433, 1.5048917531967163, -0.14868901669979095, 0.23221375048160553, 2.0390374660491943, -0.3523517847061157, -1.1668702363967896, 1.3315151929855347, -2.25057053565979, 0.11510030925273895, 1.9354201555252075, 0.30204451084136963, 0.08686403185129166, -1.4604238271713257, -0.638690710067749, -0.325664758682251, -0.3242550790309906, -1.2891299724578857, 0.4662756323814392, -0.33800721168518066, -0.6818872690200806, -1.5842854976654053, 0.18654920160770416, -1.2266274690628052, -1.591375470161438, 0.3593524992465973, 1.844799280166626, 1.9968334436416626, -0.6466202139854431, 1.4861313104629517, -0.24373841285705566, 0.23172229528427124, 1.2505501508712769, 1.140708088874817, 3.1503117084503174, 1.8738139867782593, -1.1715476512908936, 0.582120418548584, -0.11280848830938339, -0.5052348375320435, 1.1098270416259766, -1.0900294780731201, 1.2565122842788696, -0.11804986000061035, -1.0583056211471558, -1.2150695323944092, 0.9365665912628174, 0.45454853773117065, 0.1665315181016922, -0.48790597915649414, 1.127329707145691, 0.003802713006734848, 1.385358214378357, 0.5354267954826355, -0.3549461364746094, 0.5885738134384155, -0.4942823648452759, -0.5020455121994019, 1.6297041177749634, 0.3090856969356537, -1.3901902437210083, -2.3322908878326416, -0.21987321972846985, -0.827579915523529, 0.040555689483881, -0.518488883972168, -0.9775298237800598, 1.6273261308670044, 0.5137496590614319, -1.2766532897949219, -0.2645424008369446, -0.3198126256465912, -0.6896596550941467, 2.5994060039520264, -1.411728858947754, -0.2813092768192291, -0.8660365343093872, -0.5920039415359497, 1.5883010625839233, -1.2489875555038452, -0.1543189138174057, -1.0210063457489014, -0.5800025463104248, -1.3225570917129517, -0.5767925381660461, -0.1010938435792923, -0.9074940085411072, 0.8426035642623901, 0.198030486702919, -1.065440058708191, -0.4006468951702118, -0.9469577074050903, 0.7201147675514221, -0.06270255148410797, 0.35836559534072876, 1.7630635499954224, 0.4502485692501068, -0.3790462613105774, 0.6566368341445923, 1.1652978658676147, 0.6471920609474182, -0.720714807510376, 0.245758056640625, -0.716144323348999, 0.2860194146633148, -1.2946490049362183, 0.3075317144393921, -2.966224193572998, 0.655725359916687, -0.10755635052919388, -0.15354867279529572, 0.01106641162186861, -1.3145684003829956, 1.1253995895385742, 2.5451300144195557, -1.1511447429656982, 0.41218674182891846, 0.31806203722953796, 1.2365903854370117, -1.5786763429641724, 0.3713808059692383, -0.3302691578865051, 2.1619937419891357, 0.20514442026615143, 1.1982734203338623, -0.5748507380485535, -2.2445156574249268, 0.563518226146698, -1.2354322671890259, -1.2737627029418945, 0.6281432509422302, -0.8227242231369019, 0.05132925510406494, -1.55564284324646, -0.15469036996364594, -0.9064570665359497, -1.2659941911697388, 0.7757743000984192, 0.14628802239894867, 0.3827020227909088, -0.6460087895393372, 0.3113749921321869, -2.188349723815918, -1.4004907608032227, -0.23155483603477478, -0.9136128425598145, 0.5101519227027893, -0.32695722579956055, 0.7790188789367676, -0.1683477759361267, 0.06532612442970276, 0.306628555059433, 1.486708402633667, 3.4099843502044678, 0.18955287337303162, 0.49027320742607117, -0.06133859232068062, -0.8315718173980713, 1.4595894813537598, 1.038063883781433, -0.019063882529735565, -0.5510759353637695, -1.077797532081604, 1.2450917959213257, 1.9740129709243774, 0.9828162789344788, 0.023760713636875153, -0.6353714466094971, -0.5289828777313232, -0.0773673951625824, 0.16705577075481415, 0.469239205121994, 0.9189411997795105, -0.0024099331349134445, 0.10441233217716217, 1.5027639865875244, 1.2969894409179688, -0.588057816028595, 0.3587048053741455, -0.7723524570465088, -0.5090972185134888, 0.4815860986709595, 0.40492409467697144, -0.0019820434972643852, 0.29551467299461365, -1.0215940475463867, -0.2762158513069153, -0.33876097202301025, -1.022430658340454, -0.644871175289154, -0.5868155360221863, -0.4220122992992401, 1.6291956901550293, 0.13245674967765808, -0.5126307010650635, -0.09843935817480087, -0.7457706928253174, 0.012288733385503292, -1.113846778869629, 0.2709493637084961, -0.0981634259223938, -0.0732554942369461, -0.12162173539400101, 1.7726536989212036, -0.9245843291282654, -2.0668535232543945, 0.24012596905231476, 0.28557172417640686, -0.5111194252967834, 0.12799188494682312, 1.5490554571151733, 0.5278683304786682, 1.5598584413528442, 1.4003103971481323, 0.9331302046775818, -0.6393429040908813, -1.3021962642669678, 0.6751691102981567, 0.8932379484176636, -1.4159698486328125, 0.7947506904602051, 0.18494118750095367, -0.6157816052436829, 0.7253478169441223, 1.308435320854187, 0.45916348695755005, -1.9623388051986694, 0.7950761318206787, -0.825464129447937, 0.7791301012039185, 0.7660803198814392, 0.7042983174324036, 0.24644622206687927, 0.9142780900001526, -1.26474130153656, -1.1265276670455933, -0.8920609354972839, -0.6174432635307312, 2.0521652698516846, -0.22625984251499176, 0.570833146572113, -0.16286681592464447, -1.1982756853103638, -0.10908474773168564, 0.6793069243431091, 0.4883967339992523, -0.3486729562282562, 0.8022710084915161, -0.6614002585411072, -1.1189653873443604, -1.4135934114456177, -0.32673558592796326, -1.0370477437973022, -0.8642058372497559, 1.045719861984253, 0.8524250984191895, 0.27439820766448975, 1.9486881494522095, 0.6910335421562195, 0.24130259454250336, -2.5809998512268066, 0.8409691452980042, 0.26999324560165405, -0.08806456625461578, 0.9611387848854065, 0.2175251990556717, 1.0472301244735718, 0.008055382408201694, 0.5241222977638245, -2.4091899394989014, 2.1267592906951904, -0.20434576272964478, 0.6561640501022339, -0.08052314817905426, -0.19174319505691528, 1.3121837377548218, 0.6273860931396484, 0.4937601387500763, -1.1664074659347534, 0.6747327446937561, -0.5092990398406982, 1.150959849357605, 0.9308537840843201, -0.7610469460487366, -0.04453425481915474, 1.2700090408325195, 0.5095424056053162, -0.4649340808391571, -0.9752640724182129, -0.9084470272064209, 0.8827494978904724, 1.671391248703003, -0.15334030985832214, -0.013475177809596062, 0.7895387411117554, 0.7635581493377686, -1.2832409143447876, 0.11157434433698654, -0.830977201461792, -0.7901574373245239, 1.6600216627120972, 2.0216829776763916, -0.07447078078985214, -0.13341157138347626, -0.7443426847457886, -1.2260535955429077, 0.7859823107719421, 0.09319708496332169, 0.11362376064062119, 0.6284031271934509, -0.7053579092025757, 1.1032735109329224, 1.0001212358474731, 0.8814486861228943, 0.18303322792053223, 0.4028157591819763, 0.44492819905281067, -0.2522076964378357, -1.1422338485717773, -0.24380098283290863, -1.2098792791366577, -2.454350233078003, 0.5442100763320923, -0.323557585477829, -1.4613275527954102, -0.04503779485821724, -0.9973456263542175, 0.9659389853477478, -0.5618411898612976, -1.145379662513733, -1.6398146152496338, 0.1562419831752777, 0.009907319210469723, 0.9403719902038574, -1.5296332836151123, -0.03382642939686775, 1.2179924249649048, 0.8478745222091675, -0.4754703938961029, 1.0293503999710083, 0.2864445745944977, 1.0064696073532104, 0.7659795880317688, -0.5128850340843201, 0.47923600673675537, 0.09773270785808563, -1.33848237991333, 0.5470235347747803, 1.0773890018463135, 0.15819671750068665, 1.4073985815048218, -0.5566404461860657, 0.10076884925365448, 0.40829089283943176, -0.5236033797264099, -0.3845747113227844, -0.4839383661746979, 0.744581401348114, 0.058627352118492126, -0.7748373746871948, 0.11438784003257751, -0.04948509484529495, -0.2869690954685211, 0.2074345201253891, -1.5657706260681152, -0.2822091281414032, -0.4962049722671509, -0.4821752607822418, -1.1497907638549805, -0.07173457741737366, 1.4480255842208862, -0.6979172229766846, -0.2006622850894928, 0.5861033797264099, 0.5493658185005188, 0.6161444187164307, 0.6811317801475525, -0.5933449864387512, -0.38447824120521545, -0.3651694059371948, -0.33612897992134094, 0.16844424605369568, 1.2678802013397217, -0.1852351874113083, -1.0210998058319092, 0.7474420070648193, -0.3937467038631439, -0.013757962733507156, 1.902669906616211, 0.0993768721818924, -0.7895830869674683, 0.37982580065727234, -0.7804383635520935, 1.9335297346115112, 1.784889817237854, 1.3394407033920288, 0.033301934599876404, -0.9577566981315613, 0.5042608976364136, -0.2211986780166626, -0.39034825563430786, 0.9674425721168518, 0.5060004591941833, -0.16394273936748505, -1.3440808057785034, 0.6063414216041565, 1.3055962324142456, -0.9312729835510254, -0.8366053104400635, 0.0944860577583313, -0.801139771938324, 1.0819119215011597, 0.6836841106414795, 0.5215931534767151, 0.27310991287231445, 1.7791507244110107, 0.6791163682937622, -0.4793761670589447, 0.5564318895339966, 0.5705636143684387, -0.19408424198627472, -2.0645294189453125, -1.221168875694275, 0.3064570426940918, -0.5874842405319214, -1.5530353784561157, 1.332542896270752, -1.0093426704406738, -0.8556997776031494, 0.5544241070747375, 0.13304831087589264, 1.4842777252197266, 0.38441574573516846, 1.6562703847885132, 2.1035025119781494, 0.8584593534469604, 0.3046961724758148, 1.2999316453933716, -0.06599082797765732, -0.49751850962638855, 1.9467921257019043, -0.4350944459438324, 0.41961589455604553, 1.2000389099121094, -0.26728394627571106, -1.0800609588623047, -0.7528222799301147, -1.0313085317611694, -0.6213911175727844, 1.0329196453094482, 0.11088177561759949, -1.239629864692688, 0.08872166275978088, 1.6172014474868774, 0.14468885958194733, -0.40744540095329285, 0.48448804020881653, 0.36792370676994324, -0.7371671199798584, -0.048492152243852615, -1.1204051971435547, 0.5374290943145752, -0.2727687656879425, -0.41453817486763, 0.28094565868377686, 0.542077362537384, 1.2470370531082153, -0.04579583555459976, 0.15032777190208435, 1.2299275398254395, -1.5646047592163086, 1.4152169227600098, -0.7302533984184265, 0.23453624546527863, -2.450002431869507, 1.4927854537963867, -0.7031911015510559, 1.9391648769378662, -2.668652296066284, 0.35320279002189636, -0.6162993311882019, -0.470204621553421, 0.36878126859664917, -0.34704911708831787, 0.23580864071846008, -0.08698886632919312, -1.2002384662628174, -0.02276208996772766, -0.7288565635681152, 0.5828229188919067, 1.1047217845916748, 1.2875890731811523, -1.1636993885040283, -0.3650340437889099, -1.696998119354248, -0.16671161353588104, -0.6201728582382202, 0.39247366786003113, -2.083341360092163, -0.09770645946264267, -1.822780966758728, -2.236030340194702, -1.4179359674453735, -0.8605902194976807, 1.076096534729004, 0.04350689798593521, -0.9473276138305664, 1.0526310205459595, -0.38178136944770813, -1.8395541906356812, 1.1334517002105713, -2.2021427154541016 ]
https://github.com/huggingface/datasets/issues/3113
Loading Data from HDF files
Hi @VijayKalmath! As far as I know, nobody is working on it, so feel free to take over. Also, before you start, I suggest you comment `#self-assign` on this issue to assign it to yourself.
**Is your feature request related to a problem? Please describe.** More often than not I come along big HDF datasets, and currently there is no straight forward way to feed them to a dataset. **Describe the solution you'd like** I would love to see a `from_h5` method that gets an interface implemented by the user on how items are extracted from dataset (in case of multiple datasets containing elements like arrays and metadata and etc). **Describe alternatives you've considered** Currently I manually load hdf files using `h5py` and implement PyTorch dataset interface. For small h5 files I load them into a pandas dataframe and use `from_pandas` function in the `datasets` package to load them, but for big datasets this is not feasible. **Additional context** HDF files are widespread throughout different domains and are one of the go to's for many researchers/scientists/engineers who work with numerical data. Given `datasets`' usecases have outgrown NLP use cases, it will make a lot of sense focusing on things like supporting HDF files.
1,165
35
Loading Data from HDF files **Is your feature request related to a problem? Please describe.** More often than not I come along big HDF datasets, and currently there is no straight forward way to feed them to a dataset. **Describe the solution you'd like** I would love to see a `from_h5` method that gets an interface implemented by the user on how items are extracted from dataset (in case of multiple datasets containing elements like arrays and metadata and etc). **Describe alternatives you've considered** Currently I manually load hdf files using `h5py` and implement PyTorch dataset interface. For small h5 files I load them into a pandas dataframe and use `from_pandas` function in the `datasets` package to load them, but for big datasets this is not feasible. **Additional context** HDF files are widespread throughout different domains and are one of the go to's for many researchers/scientists/engineers who work with numerical data. Given `datasets`' usecases have outgrown NLP use cases, it will make a lot of sense focusing on things like supporting HDF files. Hi @VijayKalmath! As far as I know, nobody is working on it, so feel free to take over. Also, before you start, I suggest you comment `#self-assign` on this issue to assign it to yourself.
[ -1.2121500968933105, -1.0587314367294312, -0.6765270829200745, 1.3023241758346558, -0.26700177788734436, -1.2752137184143066, 0.1686159074306488, -1.14130437374115, 1.8037394285202026, -0.8821200728416443, 0.31639227271080017, -1.6826906204223633, 0.030980534851551056, -0.5680145621299744, -0.8317183256149292, -0.8947600722312927, -0.4468836784362793, -0.8623082637786865, 0.960740864276886, 2.530698776245117, 1.0946886539459229, -1.5143898725509644, 2.6830689907073975, 0.6241269111633301, -0.12060324847698212, -0.9650362133979797, 0.4269065856933594, 0.13935405015945435, -1.1371557712554932, -0.4605916738510132, -0.9405533671379089, -0.07161137461662292, -0.5740649700164795, -0.5312232375144958, 0.062470026314258575, 0.3302985727787018, -0.19361039996147156, -0.42086854577064514, -0.517055332660675, -0.6992690563201904, 0.5438271164894104, -0.38270556926727295, 1.0508453845977783, -0.4258221387863159, 1.8836737871170044, -0.49439576268196106, 0.4895389974117279, 0.7700311541557312, 1.4445735216140747, 0.25899210572242737, 0.007935939356684685, 0.26402437686920166, 0.3890300989151001, -0.0936637744307518, 0.34138014912605286, 1.1343295574188232, 0.6306446194648743, 0.492152601480484, 0.775593101978302, -2.120436191558838, 1.3062337636947632, -1.0554202795028687, 0.4154120683670044, 1.4536744356155396, -0.951691746711731, 0.3951747417449951, -1.8087443113327026, -0.08713554590940475, 0.5631732940673828, -2.235409736633301, 0.15113285183906555, -1.2289059162139893, -0.5103470683097839, 0.9665520191192627, 0.3005170226097107, -1.2945027351379395, 0.1972113847732544, -0.5161339640617371, 0.9449439644813538, 0.49915435910224915, 1.0955137014389038, -1.8061294555664062, -0.0980277806520462, -0.3025032877922058, 0.14293065667152405, -1.3194012641906738, -1.4975570440292358, 0.5258194208145142, 0.5840926170349121, 0.525615394115448, -0.11982934176921844, 0.9570334553718567, -1.0727005004882812, 0.8057557344436646, -0.9848991632461548, -1.5520936250686646, -1.3918871879577637, -2.244716167449951, -2.3443634510040283, 0.8852673172950745, -0.40420001745224, -0.5158102512359619, 2.0029358863830566, -0.9388877153396606, -1.7086784839630127, 1.2006196975708008, 0.30359992384910583, 0.00674243550747633, 2.3407857418060303, 0.2306983768939972, -0.6799314618110657, 0.41099610924720764, -0.7199409008026123, 0.8274765610694885, -0.489430695772171, 1.4717038869857788, 0.4734131693840027, -1.0536675453186035, 1.5749289989471436, -0.46009814739227295, 0.5811027884483337, -0.6709818243980408, -0.5825332999229431, -0.8817692995071411, 0.4264882802963257, 1.8922479152679443, -0.296356201171875, 1.570790410041809, -0.4084908664226532, -1.624337911605835, -1.6328431367874146, 0.9563924074172974, 0.49006715416908264, -0.7208489775657654, 0.014369562268257141, -0.35241979360580444, 0.11411412060260773, -0.049683503806591034, 1.0386492013931274, 1.1182646751403809, 0.7299813628196716, -0.32773518562316895, -0.8716950416564941, 0.15110215544700623, -0.1405971348285675, -0.7233414053916931, -1.8480890989303589, -0.3924495577812195, 0.08540551364421844, 0.6099151968955994, -1.2412840127944946, 1.6933815479278564, 0.9682649374008179, 1.9328733682632446, 0.9306833148002625, -0.3253442645072937, 1.4147369861602783, 0.051866378635168076, 1.8708486557006836, -0.610011637210846, 0.7683061361312866, -0.243843674659729, -1.0534453392028809, 0.8014586567878723, -0.38379713892936707, -2.0665969848632812, -0.6845239996910095, -0.9580009579658508, -0.1848546862602234, -0.7385680079460144, 0.8695544600486755, -0.28290024399757385, -1.401877760887146, 0.2553614377975464, -0.5666386485099792, 0.15357497334480286, -1.1620819568634033, 0.38846278190612793, 0.752047598361969, -0.6292651295661926, -0.04971824958920479, -0.176756352186203, -1.3298157453536987, -0.4820656478404999, 0.24326130747795105, 1.9123272895812988, -0.7924466729164124, 0.9265555143356323, 0.9444125294685364, -0.7428257465362549, 0.029847867786884308, 0.3546273708343506, -0.3027912378311157, 0.8487393260002136, -1.1173865795135498, -0.2675038278102875, 1.197739601135254, -0.21008050441741943, -0.43874168395996094, 1.486943006515503, 0.7717143893241882, -0.9819716215133667, -0.13137683272361755, -0.2864016890525818, -0.778806209564209, -0.032079264521598816, -1.5030661821365356, -0.09834889322519302, 0.18141499161720276, -1.4276467561721802, -0.5233755707740784, -0.2614487409591675, 1.257217288017273, -0.18000313639640808, 1.3465021848678589, -0.3665509521961212, -0.33585816621780396, -0.40913334488868713, -0.39367732405662537, 0.23037871718406677, -0.2727835476398468, -0.5744743347167969, 0.24322161078453064, -0.7802034020423889, 0.44046086072921753, 1.4481078386306763, 0.4072801172733307, -0.01655825786292553, 0.4807025194168091, 0.9735901951789856, 0.2393985390663147, -0.008260069414973259, -0.8243797421455383, -1.5169552564620972, 2.04189133644104, -1.4792989492416382, 1.9375334978103638, 0.7900669574737549, -0.028206927701830864, -1.6829243898391724, -1.8233282566070557, 1.3152453899383545, 1.2984927892684937, 2.325861692428589, 0.5546267628669739, 0.28649604320526123, -0.8646301627159119, -0.7072772979736328, 0.35417139530181885, -1.083949089050293, -0.7186121940612793, 0.011762065812945366, 2.2664339542388916, 1.7631255388259888, -0.5700736045837402, -0.18044665455818176, -1.1086457967758179, 1.5155166387557983, -0.17778849601745605, 0.2570059299468994, 2.0228657722473145, -0.3786095976829529, -1.1723872423171997, 1.3144110441207886, -2.258082151412964, 0.1561495065689087, 1.9501556158065796, 0.30053284764289856, 0.13347595930099487, -1.4607754945755005, -0.6256850361824036, -0.30598172545433044, -0.31130608916282654, -1.2764654159545898, 0.5071306228637695, -0.3383455276489258, -0.7208225131034851, -1.571010708808899, 0.21349000930786133, -1.2008192539215088, -1.6150282621383667, 0.321419358253479, 1.8341649770736694, 2.011691093444824, -0.6712189316749573, 1.4906214475631714, -0.25338849425315857, 0.26117849349975586, 1.22594153881073, 1.1810541152954102, 3.1164767742156982, 1.8621710538864136, -1.1779013872146606, 0.566575288772583, -0.12202763557434082, -0.5277112126350403, 1.1082485914230347, -1.0519922971725464, 1.2650090456008911, -0.10021130740642548, -1.070730447769165, -1.2131009101867676, 0.9659044742584229, 0.4751318693161011, 0.1657124161720276, -0.5016608238220215, 1.1386423110961914, 0.030595462769269943, 1.3556498289108276, 0.5231578350067139, -0.3677956461906433, 0.5983260869979858, -0.47256892919540405, -0.5140475630760193, 1.628920078277588, 0.30559900403022766, -1.4239062070846558, -2.3518526554107666, -0.2456670105457306, -0.8490810394287109, 0.06109027564525604, -0.5554168224334717, -0.9992467164993286, 1.6366503238677979, 0.49330058693885803, -1.2728381156921387, -0.26078489422798157, -0.30215373635292053, -0.6400417685508728, 2.6115241050720215, -1.3888071775436401, -0.26612523198127747, -0.8668496012687683, -0.5935153365135193, 1.5929502248764038, -1.249251365661621, -0.12026537209749222, -1.0405696630477905, -0.5946473479270935, -1.301141381263733, -0.5761634707450867, -0.07949192076921463, -0.9369256496429443, 0.8486462235450745, 0.22294649481773376, -1.1293574571609497, -0.40114086866378784, -0.9706777334213257, 0.7314184308052063, -0.06184006109833717, 0.36336055397987366, 1.7638051509857178, 0.43957096338272095, -0.4057668447494507, 0.6637632250785828, 1.1830261945724487, 0.6449609994888306, -0.7361069917678833, 0.2576195299625397, -0.740067720413208, 0.3212955892086029, -1.255914330482483, 0.2636456787586212, -2.9780969619750977, 0.6640356779098511, -0.11235379427671432, -0.18209731578826904, -0.0019844165071845055, -1.3113034963607788, 1.1268385648727417, 2.58833646774292, -1.1589020490646362, 0.4360397160053253, 0.33650705218315125, 1.271350622177124, -1.5868064165115356, 0.3411589562892914, -0.33451732993125916, 2.1507561206817627, 0.22322940826416016, 1.1822128295898438, -0.5854591131210327, -2.250013589859009, 0.5395912528038025, -1.243773341178894, -1.273192286491394, 0.6396253108978271, -0.8747543096542358, 0.041391246020793915, -1.549180269241333, -0.15227395296096802, -0.863740861415863, -1.255997657775879, 0.7532786130905151, 0.13315942883491516, 0.3952757716178894, -0.6370810866355896, 0.31860196590423584, -2.1241910457611084, -1.3930950164794922, -0.24985870718955994, -0.9102078676223755, 0.5179513096809387, -0.27479416131973267, 0.7625004053115845, -0.1677289605140686, 0.05505631864070892, 0.3177020847797394, 1.5019030570983887, 3.364961862564087, 0.20165953040122986, 0.4649793207645416, -0.08888625353574753, -0.8536702990531921, 1.464401364326477, 1.0602741241455078, 0.021827276796102524, -0.5509499907493591, -1.0596965551376343, 1.2532728910446167, 2.005615711212158, 0.9839582443237305, 0.016888055950403214, -0.6441863179206848, -0.5444057583808899, -0.06897635757923126, 0.14594337344169617, 0.43498849868774414, 0.8903958797454834, 0.02707243338227272, 0.09992989152669907, 1.4518630504608154, 1.3028043508529663, -0.5976287722587585, 0.37526318430900574, -0.783706784248352, -0.5267088413238525, 0.4857368767261505, 0.3760809898376465, -0.0007902951911091805, 0.2904253602027893, -0.9934393167495728, -0.2504357099533081, -0.3434935510158539, -0.9808320999145508, -0.6525701284408569, -0.5793733596801758, -0.4373258054256439, 1.6568814516067505, 0.12772923707962036, -0.5075321793556213, -0.039823275059461594, -0.7511751055717468, 0.030685212463140488, -1.0980665683746338, 0.23903542757034302, -0.11288302391767502, -0.075811006128788, -0.11470945924520493, 1.79795503616333, -0.9266690611839294, -2.010770320892334, 0.22244060039520264, 0.27484622597694397, -0.5239226818084717, 0.17528635263442993, 1.5554686784744263, 0.5178203582763672, 1.5523399114608765, 1.4127861261367798, 0.9432879090309143, -0.6276097893714905, -1.3065760135650635, 0.7229800820350647, 0.8875617980957031, -1.3956900835037231, 0.8117660880088806, 0.19485491514205933, -0.5926772356033325, 0.7430235147476196, 1.285801649093628, 0.4556989371776581, -1.9509328603744507, 0.8056137561798096, -0.8691614866256714, 0.8403103351593018, 0.755674421787262, 0.6879804730415344, 0.22544273734092712, 0.8988080620765686, -1.2605758905410767, -1.1422080993652344, -0.9017543196678162, -0.590614378452301, 2.056304693222046, -0.25911644101142883, 0.5732365250587463, -0.12832675874233246, -1.2212218046188354, -0.10641655325889587, 0.690955638885498, 0.49974194169044495, -0.3535790741443634, 0.7779499292373657, -0.6690548658370972, -1.095121145248413, -1.4074903726577759, -0.3299926519393921, -1.0516932010650635, -0.8803591728210449, 1.063740849494934, 0.8246644735336304, 0.2996758818626404, 1.9108054637908936, 0.6776739358901978, 0.25770318508148193, -2.5796661376953125, 0.8707456588745117, 0.27148401737213135, -0.12275014817714691, 0.9297171831130981, 0.247480571269989, 1.0447713136672974, -0.02796562761068344, 0.5239897966384888, -2.4178307056427, 2.160088539123535, -0.21281671524047852, 0.6725413203239441, -0.05374414101243019, -0.1815471351146698, 1.2981622219085693, 0.5858737230300903, 0.48896875977516174, -1.158392310142517, 0.6368160247802734, -0.527871310710907, 1.1722608804702759, 0.9204368591308594, -0.8005503416061401, -0.05968956649303436, 1.2880022525787354, 0.5013881325721741, -0.49374645948410034, -0.9579063653945923, -0.9383819103240967, 0.9047811031341553, 1.673579216003418, -0.1614406704902649, -0.0691232681274414, 0.8199896812438965, 0.7646562457084656, -1.2678743600845337, 0.09487453103065491, -0.8363847732543945, -0.8090436458587646, 1.6589093208312988, 2.031928300857544, -0.08101342618465424, -0.16066396236419678, -0.7267471551895142, -1.2377055883407593, 0.7826236486434937, 0.08158204704523087, 0.11079280823469162, 0.5840446949005127, -0.6656746864318848, 1.1035460233688354, 0.9775798320770264, 0.8707232475280762, 0.1968965232372284, 0.3786887526512146, 0.41318178176879883, -0.32757630944252014, -1.133238434791565, -0.22759771347045898, -1.1866670846939087, -2.524872064590454, 0.5244880318641663, -0.30432429909706116, -1.4599934816360474, -0.0453607477247715, -1.0113474130630493, 0.9762415289878845, -0.5369651317596436, -1.1439529657363892, -1.639512300491333, 0.18449640274047852, -0.0011792061850428581, 0.9777719974517822, -1.561100959777832, -0.003919261507689953, 1.187017560005188, 0.8251660466194153, -0.5026649832725525, 1.0035958290100098, 0.288481205701828, 1.0230010747909546, 0.781319797039032, -0.49721333384513855, 0.5098028779029846, 0.1005881279706955, -1.3388344049453735, 0.5203321576118469, 1.0737740993499756, 0.15214526653289795, 1.3960239887237549, -0.5481932163238525, 0.10369229316711426, 0.41124045848846436, -0.5347157120704651, -0.409700870513916, -0.486205518245697, 0.762143611907959, 0.04414909705519676, -0.8352165222167969, 0.09561365842819214, -0.02359858900308609, -0.2750781774520874, 0.22443240880966187, -1.5827172994613647, -0.2615812122821808, -0.4800928235054016, -0.49752503633499146, -1.1465356349945068, -0.07874097675085068, 1.453658103942871, -0.6843234896659851, -0.21337971091270447, 0.5791255831718445, 0.5521166324615479, 0.5981394648551941, 0.6788018345832825, -0.609019935131073, -0.4013047516345978, -0.3585380017757416, -0.359775185585022, 0.18160858750343323, 1.2694658041000366, -0.19421568512916565, -1.037479281425476, 0.7229793071746826, -0.4075796604156494, 0.012801039963960648, 1.8814042806625366, 0.12719669938087463, -0.8040637373924255, 0.3790416419506073, -0.7893940806388855, 1.9048080444335938, 1.7813620567321777, 1.3266681432724, 0.020285721868276596, -0.9551208019256592, 0.5197256207466125, -0.2685069739818573, -0.36469975113868713, 0.9832322597503662, 0.46383631229400635, -0.15997305512428284, -1.3130475282669067, 0.6180305480957031, 1.328535556793213, -0.8774219751358032, -0.8864297866821289, 0.11212490499019623, -0.7973483800888062, 1.087941288948059, 0.6914756894111633, 0.5057300925254822, 0.26777756214141846, 1.731480598449707, 0.693723738193512, -0.4642256796360016, 0.5662663578987122, 0.5632442235946655, -0.19926580786705017, -2.0508766174316406, -1.2493939399719238, 0.26188963651657104, -0.5852158665657043, -1.523708462715149, 1.3490794897079468, -1.0146417617797852, -0.8840509653091431, 0.5627673864364624, 0.12229468673467636, 1.4834117889404297, 0.3695341646671295, 1.6330466270446777, 2.0973525047302246, 0.8453646898269653, 0.3069261908531189, 1.328467845916748, -0.08468178659677505, -0.4960276484489441, 1.9489130973815918, -0.4389916956424713, 0.40502360463142395, 1.1555511951446533, -0.27083954215049744, -1.0660862922668457, -0.7414172887802124, -1.0531200170516968, -0.6335564851760864, 1.0375977754592896, 0.0932629182934761, -1.24106764793396, 0.1272222101688385, 1.6380058526992798, 0.12279889732599258, -0.4045843780040741, 0.5287269353866577, 0.36723512411117554, -0.7153134942054749, -0.05069904401898384, -1.1261571645736694, 0.5204552412033081, -0.26148080825805664, -0.3875396251678467, 0.2847575843334198, 0.5310164093971252, 1.2385276556015015, -0.06699279695749283, 0.15240302681922913, 1.1692742109298706, -1.5321450233459473, 1.3830472230911255, -0.707435131072998, 0.2633763253688812, -2.4656014442443848, 1.4695987701416016, -0.6975007653236389, 1.8836829662322998, -2.680750846862793, 0.3717370331287384, -0.6052621603012085, -0.47661149501800537, 0.364715039730072, -0.33777639269828796, 0.23862561583518982, -0.0740695521235466, -1.2273221015930176, -0.032919757068157196, -0.715309202671051, 0.5744127035140991, 1.0791518688201904, 1.2858041524887085, -1.1396303176879883, -0.37168338894844055, -1.700156331062317, -0.1216982752084732, -0.6283085942268372, 0.39930373430252075, -2.0760586261749268, -0.1294136494398117, -1.8314306735992432, -2.2086760997772217, -1.4171758890151978, -0.8363972902297974, 1.0771998167037964, 0.07187043875455856, -0.9272224307060242, 1.0824142694473267, -0.3373245596885681, -1.8710132837295532, 1.1202762126922607, -2.2258505821228027 ]
https://github.com/huggingface/datasets/issues/3112
OverflowError: There was an overflow in the <class 'pyarrow.lib.ListArray'>. Try to reduce writer_batch_size to have batches smaller than 2GB
I am very unsure on why you tagged me here. I am not a maintainer of the Datasets library and have no idea how to help you.
## Describe the bug Despite having batches way under 2Gb when running `datasets.map()`, after processing correctly the data of the first batch without fuss and irrespective of writer_batch_size (say 2,4,8,16,32,64 and 128 in my case), it returns the following error : > OverflowError: There was an overflow in the <class 'pyarrow.lib.ListArray'>. Try to reduce writer_batch_size to have batches smaller than 2GB Note that I always run `batch_size=writer_batch_size` : ## Steps to reproduce the bug ```python datasets.map(lambda example : {"column_name" : function(arguments)}, batched=False, remove_columns = datasets.column_names, batch_size=batch_size, writer_batch_size=batch_size, disable_nullable=True, num_proc=None, desc="blablabla") ``` ## Introspecting CUDA memory during bug Placed within `function(arguments)` the following statement to introspect memory usage, merely a little over 1/4 of 2Gb `print(torch.cuda.memory_summary(device=device, abbreviated=False))` > |===========================================================================| | PyTorch CUDA memory summary, device ID 0 | |---------------------------------------------------------------------------| | CUDA OOMs: 0 | cudaMalloc retries: 0 | |===========================================================================| | Metric | Cur Usage | Peak Usage | Tot Alloc | Tot Freed | |---------------------------------------------------------------------------| | Allocated memory | 541418 KB | 545725 KB | 555695 KB | 14276 KB | | from large pool | 540672 KB | 544431 KB | 544431 KB | 3759 KB | | from small pool | 746 KB | 1714 KB | 11264 KB | 10517 KB | |---------------------------------------------------------------------------| | Active memory | 541418 KB | 545725 KB | 555695 KB | 14276 KB | | from large pool | 540672 KB | 544431 KB | 544431 KB | 3759 KB | | from small pool | 746 KB | 1714 KB | 11264 KB | 10517 KB | |---------------------------------------------------------------------------| | GPU reserved memory | 598016 KB | 598016 KB | 598016 KB | 0 B | | from large pool | 595968 KB | 595968 KB | 595968 KB | 0 B | | from small pool | 2048 KB | 2048 KB | 2048 KB | 0 B | |---------------------------------------------------------------------------| | Non-releasable memory | 36117 KB | 52292 KB | 274275 KB | 238158 KB | | from large pool | 34816 KB | 51537 KB | 261713 KB | 226897 KB | | from small pool | 1301 KB | 2045 KB | 12562 KB | 11261 KB | |---------------------------------------------------------------------------| | Allocations | 198 | 224 | 478 | 280 | | from large pool | 74 | 75 | 75 | 1 | | from small pool | 124 | 150 | 403 | 279 | |---------------------------------------------------------------------------| | Active allocs | 198 | 224 | 478 | 280 | | from large pool | 74 | 75 | 75 | 1 | | from small pool | 124 | 150 | 403 | 279 | |---------------------------------------------------------------------------| | GPU reserved segments | 21 | 21 | 21 | 0 | | from large pool | 20 | 20 | 20 | 0 | | from small pool | 1 | 1 | 1 | 0 | |---------------------------------------------------------------------------| | Non-releasable allocs | 18 | 23 | 166 | 148 | | from large pool | 17 | 18 | 19 | 2 | | from small pool | 1 | 6 | 147 | 146 | |===========================================================================| ## Expected results Efficiently process the datasets and write it down to disk. ## Actual results -------------------------------------------------------------------------- OverflowError Traceback (most recent call last) ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in _map_single(self, function, with_indices, 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, new_fingerprint, rank, offset, disable_tqdm, desc, cache_only) 2390 else: -> 2391 writer.write(example) 2392 else: ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_writer.py in write(self, example, key, writer_batch_size) 367 --> 368 self.write_examples_on_file() 369 ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_writer.py in write_examples_on_file(self) 316 if not isinstance(pa_array[0], pa.lib.FloatScalar): --> 317 raise OverflowError( 318 "There was an overflow in the {}. Try to reduce writer_batch_size to have batches smaller than 2GB".format( OverflowError: There was an overflow in the <class 'pyarrow.lib.ListArray'>. Try to reduce writer_batch_size to have batches smaller than 2GB During handling of the above exception, another exception occurred: OverflowError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_16268/2456940807.py in <module> 3 #tracker = OfflineEmissionsTracker(country_iso_code="FRA", project_name='xxx'+time_stamp,output_dir='./codecarbon') 4 #tracker.start() ----> 5 process_datasets(source_datasets_paths, dataset_dir, LM_tokenizer, LMhead_model, datasets_selection=['wikipedia'], from_scratch=True, 6 clean_sentences=False, negative_sampling=False, translate=False, tokenize=False, generate_embeddings=True, concatenate_embeddings=False, 7 max_sample=10000, padding='do_not_pad', truncation=True, cpu_batch_size=1000, gpu_batch_size=2, cpu_writer_batch_size=1000, gpu_writer_batch_size=2, disable_nullable=True, num_proc=None) # ~\xxx\xxx.py in process_datasets(source_datasets_paths, dataset_dir, LM_tokenizer, LMhead_model, datasets_selection, from_scratch, clean_sentences, translate, negative_sampling, tokenize, generate_embeddings, concatenate_embeddings, max_sample, padding, truncation, cpu_batch_size, gpu_batch_size, cpu_writer_batch_size, gpu_writer_batch_size, disable_nullable, num_proc) 481 for column in tqdm(dataset.column_names, desc=f'Processing column', leave=False): 482 if "xxx_" in column: --> 483 dataset = dataset.map(lambda example : 484 {"embeddings_"+str(column).replace("translated_",""):function(input_ids=example[column], 485 token_type_ids=example[column.replace("input_ids","token_type_ids")], ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in map(self, function, with_indices, 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) 2034 2035 if num_proc is None or num_proc == 1: -> 2036 return self._map_single( 2037 function=function, 2038 with_indices=with_indices, ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in wrapper(*args, **kwargs) 501 self: "Dataset" = kwargs.pop("self") 502 # apply actual function --> 503 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 504 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 505 for dataset in datasets: ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in wrapper(*args, **kwargs) 468 } 469 # apply actual function --> 470 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 471 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 472 # re-apply format to the output ~\anaconda3\envs\xxx\lib\site-packages\datasets\fingerprint.py in wrapper(*args, **kwargs) 404 # Call actual function 405 --> 406 out = func(self, *args, **kwargs) 407 408 # Update fingerprint of in-place transforms + update in-place history of transforms ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in _map_single(self, function, with_indices, 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, new_fingerprint, rank, offset, disable_tqdm, desc, cache_only) 2425 if update_data: 2426 if writer is not None: -> 2427 writer.finalize() 2428 if tmp_file is not None: 2429 tmp_file.close() ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_writer.py in finalize(self, close_stream) 440 # Re-intializing to empty list for next batch 441 self.hkey_record = [] --> 442 self.write_examples_on_file() 443 if self.pa_writer is None: 444 if self._schema is not None: ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_writer.py in write_examples_on_file(self) 315 # This check fails with FloatArrays with nans, which is not what we want, so account for that: 316 if not isinstance(pa_array[0], pa.lib.FloatScalar): --> 317 raise OverflowError( 318 "There was an overflow in the {}. Try to reduce writer_batch_size to have batches smaller than 2GB".format( 319 type(pa_array) OverflowError: There was an overflow in the <class 'pyarrow.lib.ListArray'>. Try to reduce writer_batch_size to have batches smaller than 2GB ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.13.3 - Platform: Windows-10-10.0.19042-SP0 - Python version: 3.8.11 - PyArrow version: 3.0.0 ##Next steps Testing on Linux. @albertvillanova
1,166
27
OverflowError: There was an overflow in the <class 'pyarrow.lib.ListArray'>. Try to reduce writer_batch_size to have batches smaller than 2GB ## Describe the bug Despite having batches way under 2Gb when running `datasets.map()`, after processing correctly the data of the first batch without fuss and irrespective of writer_batch_size (say 2,4,8,16,32,64 and 128 in my case), it returns the following error : > OverflowError: There was an overflow in the <class 'pyarrow.lib.ListArray'>. Try to reduce writer_batch_size to have batches smaller than 2GB Note that I always run `batch_size=writer_batch_size` : ## Steps to reproduce the bug ```python datasets.map(lambda example : {"column_name" : function(arguments)}, batched=False, remove_columns = datasets.column_names, batch_size=batch_size, writer_batch_size=batch_size, disable_nullable=True, num_proc=None, desc="blablabla") ``` ## Introspecting CUDA memory during bug Placed within `function(arguments)` the following statement to introspect memory usage, merely a little over 1/4 of 2Gb `print(torch.cuda.memory_summary(device=device, abbreviated=False))` > |===========================================================================| | PyTorch CUDA memory summary, device ID 0 | |---------------------------------------------------------------------------| | CUDA OOMs: 0 | cudaMalloc retries: 0 | |===========================================================================| | Metric | Cur Usage | Peak Usage | Tot Alloc | Tot Freed | |---------------------------------------------------------------------------| | Allocated memory | 541418 KB | 545725 KB | 555695 KB | 14276 KB | | from large pool | 540672 KB | 544431 KB | 544431 KB | 3759 KB | | from small pool | 746 KB | 1714 KB | 11264 KB | 10517 KB | |---------------------------------------------------------------------------| | Active memory | 541418 KB | 545725 KB | 555695 KB | 14276 KB | | from large pool | 540672 KB | 544431 KB | 544431 KB | 3759 KB | | from small pool | 746 KB | 1714 KB | 11264 KB | 10517 KB | |---------------------------------------------------------------------------| | GPU reserved memory | 598016 KB | 598016 KB | 598016 KB | 0 B | | from large pool | 595968 KB | 595968 KB | 595968 KB | 0 B | | from small pool | 2048 KB | 2048 KB | 2048 KB | 0 B | |---------------------------------------------------------------------------| | Non-releasable memory | 36117 KB | 52292 KB | 274275 KB | 238158 KB | | from large pool | 34816 KB | 51537 KB | 261713 KB | 226897 KB | | from small pool | 1301 KB | 2045 KB | 12562 KB | 11261 KB | |---------------------------------------------------------------------------| | Allocations | 198 | 224 | 478 | 280 | | from large pool | 74 | 75 | 75 | 1 | | from small pool | 124 | 150 | 403 | 279 | |---------------------------------------------------------------------------| | Active allocs | 198 | 224 | 478 | 280 | | from large pool | 74 | 75 | 75 | 1 | | from small pool | 124 | 150 | 403 | 279 | |---------------------------------------------------------------------------| | GPU reserved segments | 21 | 21 | 21 | 0 | | from large pool | 20 | 20 | 20 | 0 | | from small pool | 1 | 1 | 1 | 0 | |---------------------------------------------------------------------------| | Non-releasable allocs | 18 | 23 | 166 | 148 | | from large pool | 17 | 18 | 19 | 2 | | from small pool | 1 | 6 | 147 | 146 | |===========================================================================| ## Expected results Efficiently process the datasets and write it down to disk. ## Actual results -------------------------------------------------------------------------- OverflowError Traceback (most recent call last) ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in _map_single(self, function, with_indices, 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, new_fingerprint, rank, offset, disable_tqdm, desc, cache_only) 2390 else: -> 2391 writer.write(example) 2392 else: ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_writer.py in write(self, example, key, writer_batch_size) 367 --> 368 self.write_examples_on_file() 369 ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_writer.py in write_examples_on_file(self) 316 if not isinstance(pa_array[0], pa.lib.FloatScalar): --> 317 raise OverflowError( 318 "There was an overflow in the {}. Try to reduce writer_batch_size to have batches smaller than 2GB".format( OverflowError: There was an overflow in the <class 'pyarrow.lib.ListArray'>. Try to reduce writer_batch_size to have batches smaller than 2GB During handling of the above exception, another exception occurred: OverflowError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_16268/2456940807.py in <module> 3 #tracker = OfflineEmissionsTracker(country_iso_code="FRA", project_name='xxx'+time_stamp,output_dir='./codecarbon') 4 #tracker.start() ----> 5 process_datasets(source_datasets_paths, dataset_dir, LM_tokenizer, LMhead_model, datasets_selection=['wikipedia'], from_scratch=True, 6 clean_sentences=False, negative_sampling=False, translate=False, tokenize=False, generate_embeddings=True, concatenate_embeddings=False, 7 max_sample=10000, padding='do_not_pad', truncation=True, cpu_batch_size=1000, gpu_batch_size=2, cpu_writer_batch_size=1000, gpu_writer_batch_size=2, disable_nullable=True, num_proc=None) # ~\xxx\xxx.py in process_datasets(source_datasets_paths, dataset_dir, LM_tokenizer, LMhead_model, datasets_selection, from_scratch, clean_sentences, translate, negative_sampling, tokenize, generate_embeddings, concatenate_embeddings, max_sample, padding, truncation, cpu_batch_size, gpu_batch_size, cpu_writer_batch_size, gpu_writer_batch_size, disable_nullable, num_proc) 481 for column in tqdm(dataset.column_names, desc=f'Processing column', leave=False): 482 if "xxx_" in column: --> 483 dataset = dataset.map(lambda example : 484 {"embeddings_"+str(column).replace("translated_",""):function(input_ids=example[column], 485 token_type_ids=example[column.replace("input_ids","token_type_ids")], ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in map(self, function, with_indices, 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) 2034 2035 if num_proc is None or num_proc == 1: -> 2036 return self._map_single( 2037 function=function, 2038 with_indices=with_indices, ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in wrapper(*args, **kwargs) 501 self: "Dataset" = kwargs.pop("self") 502 # apply actual function --> 503 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 504 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 505 for dataset in datasets: ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in wrapper(*args, **kwargs) 468 } 469 # apply actual function --> 470 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 471 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 472 # re-apply format to the output ~\anaconda3\envs\xxx\lib\site-packages\datasets\fingerprint.py in wrapper(*args, **kwargs) 404 # Call actual function 405 --> 406 out = func(self, *args, **kwargs) 407 408 # Update fingerprint of in-place transforms + update in-place history of transforms ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in _map_single(self, function, with_indices, 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, new_fingerprint, rank, offset, disable_tqdm, desc, cache_only) 2425 if update_data: 2426 if writer is not None: -> 2427 writer.finalize() 2428 if tmp_file is not None: 2429 tmp_file.close() ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_writer.py in finalize(self, close_stream) 440 # Re-intializing to empty list for next batch 441 self.hkey_record = [] --> 442 self.write_examples_on_file() 443 if self.pa_writer is None: 444 if self._schema is not None: ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_writer.py in write_examples_on_file(self) 315 # This check fails with FloatArrays with nans, which is not what we want, so account for that: 316 if not isinstance(pa_array[0], pa.lib.FloatScalar): --> 317 raise OverflowError( 318 "There was an overflow in the {}. Try to reduce writer_batch_size to have batches smaller than 2GB".format( 319 type(pa_array) OverflowError: There was an overflow in the <class 'pyarrow.lib.ListArray'>. Try to reduce writer_batch_size to have batches smaller than 2GB ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.13.3 - Platform: Windows-10-10.0.19042-SP0 - Python version: 3.8.11 - PyArrow version: 3.0.0 ##Next steps Testing on Linux. @albertvillanova I am very unsure on why you tagged me here. I am not a maintainer of the Datasets library and have no idea how to help you.
[ -1.3111408948898315, -0.9018009305000305, -0.5220432877540588, 1.5846108198165894, -0.1323675662279129, -1.1428461074829102, 0.22946959733963013, -0.9254502654075623, 1.5601636171340942, -0.9610655307769775, 0.31086525321006775, -1.4772238731384277, 0.06510502099990845, -0.6179060339927673, -0.5666400194168091, -0.8172217011451721, -0.24111469089984894, -0.5509207844734192, 1.2107572555541992, 2.3075344562530518, 1.419454574584961, -1.2838189601898193, 2.805748462677002, 0.9382346868515015, -0.2513939440250397, -0.900237500667572, 0.45658501982688904, 0.06874764710664749, -1.3566051721572876, -0.40835508704185486, -0.9284236431121826, -0.20029063522815704, -0.6996954083442688, -0.5018917918205261, -0.1334933042526245, 0.41722697019577026, -0.31322821974754333, -0.4025272727012634, -0.3703726828098297, -0.7090391516685486, 0.6158791184425354, -0.39884713292121887, 0.6270517110824585, -0.31665006279945374, 1.832263708114624, -0.5779015421867371, 0.43860065937042236, 0.6048818230628967, 1.1177879571914673, 0.22994062304496765, -0.030449822545051575, 0.3056044578552246, 0.18136058747768402, -0.05276396498084068, 0.7140637040138245, 1.314292550086975, 0.7756487131118774, 0.5930070877075195, 0.7259011268615723, -2.0809216499328613, 1.3346449136734009, -0.9163885116577148, 0.39658060669898987, 1.3597601652145386, -1.1324247121810913, 0.5653756260871887, -1.793566107749939, -0.16385917365550995, 0.42556729912757874, -2.3565306663513184, 0.3268454968929291, -1.3179044723510742, -0.6999371647834778, 1.0129655599594116, 0.31049925088882446, -1.2103557586669922, -0.08673643320798874, -0.4752832353115082, 1.1530954837799072, 0.43782734870910645, 0.9300393462181091, -1.7386424541473389, 0.05308304727077484, -0.3219519257545471, 0.30795976519584656, -1.3227274417877197, -1.5132110118865967, 0.5383220314979553, 0.6336873769760132, 0.6397206783294678, -0.06354617327451706, 1.1677391529083252, -1.07400381565094, 0.7956643104553223, -0.9498832821846008, -1.7713196277618408, -1.4379379749298096, -2.5195960998535156, -2.2318174839019775, 0.6107348799705505, -0.27577048540115356, -0.47673460841178894, 2.159017562866211, -1.0865510702133179, -1.622563362121582, 1.069175362586975, 0.08117622137069702, -0.13833580911159515, 2.38611102104187, 0.1903383433818817, -0.9356324672698975, 0.5574452877044678, -0.9388256669044495, 0.5606613755226135, -0.4064168632030487, 1.3481519222259521, 0.43474000692367554, -1.1565685272216797, 1.6680554151535034, -0.4102782607078552, 0.35886797308921814, -0.8740506768226624, -0.412041038274765, -0.6198643445968628, 0.10178758203983307, 2.0885169506073, -0.15811967849731445, 1.4330179691314697, -0.21319074928760529, -1.2582299709320068, -1.4982304573059082, 0.9600117206573486, 0.4246074855327606, -0.7346600294113159, 0.34417328238487244, -0.33661600947380066, 0.1642743945121765, 0.11041107028722763, 1.0642783641815186, 1.3720909357070923, 0.7813665866851807, -0.27022865414619446, -0.7681993246078491, -0.02443922683596611, -0.2379813939332962, -0.5455806851387024, -1.75465726852417, -0.28607845306396484, -0.07196350395679474, 0.609825074672699, -1.2464797496795654, 1.8482304811477661, 0.9597029685974121, 1.843437671661377, 1.012960433959961, -0.4608301818370819, 1.4855303764343262, 0.1761516034603119, 1.8386378288269043, -0.3003373146057129, 0.8275532126426697, -0.5361388325691223, -1.201317548751831, 0.6913304328918457, -0.1647428423166275, -1.896549105644226, -0.40087994933128357, -0.7311331033706665, -0.09813297539949417, -0.9991328716278076, 1.0162891149520874, -0.26691684126853943, -1.4640178680419922, 0.25360700488090515, -0.6482425928115845, 0.14811986684799194, -1.3718169927597046, 0.49807125329971313, 0.7026700973510742, -0.6587766408920288, 0.11853915452957153, -0.523038387298584, -1.104565143585205, -0.819532573223114, 0.30223581194877625, 1.742804765701294, -0.6007044911384583, 0.83430016040802, 1.1161142587661743, -0.6986352801322937, -0.1302143931388855, 0.5592595934867859, -0.21039122343063354, 0.8727553486824036, -1.0091285705566406, -0.5537859201431274, 1.080904483795166, -0.2356947958469391, -0.6149828433990479, 1.394829511642456, 0.8048202991485596, -0.8843030333518982, -0.2600008249282837, -0.15619297325611115, -0.8618993759155273, 0.23782949149608612, -1.5233951807022095, -0.021152649074792862, 0.49905192852020264, -1.546398639678955, -0.5273090600967407, 0.009966022334992886, 1.3637282848358154, -0.1314779669046402, 1.4516044855117798, -0.20076142251491547, -0.0554315447807312, -0.39761626720428467, -0.3007197976112366, 0.13588474690914154, 0.0027852635830640793, -0.6303250789642334, 0.22393149137496948, -0.804378867149353, 0.02904444932937622, 1.4478784799575806, 0.195698082447052, 0.047797203063964844, 0.4018509089946747, 1.1827881336212158, 0.3126196265220642, -0.3245917558670044, -0.9250212907791138, -1.4019546508789062, 1.6626933813095093, -1.6545724868774414, 2.1438920497894287, 0.9506746530532837, 0.06380118429660797, -1.7799988985061646, -1.7404382228851318, 1.3920173645019531, 1.140976905822754, 2.553600549697876, 0.6261525750160217, 0.40730440616607666, -0.929707407951355, -0.7109766602516174, 0.3395868241786957, -0.9213522672653198, -1.0123966932296753, 0.2403557151556015, 2.322159767150879, 1.8118152618408203, -0.24898149073123932, -0.11071887612342834, -0.972771406173706, 1.371533989906311, -0.16942128539085388, 0.23209300637245178, 1.8042305707931519, -0.2668602466583252, -1.0771249532699585, 1.201375961303711, -2.5689034461975098, 0.1263159215450287, 1.9566264152526855, 0.4796310067176819, 0.1764780730009079, -1.1771981716156006, -0.8111626505851746, -0.12147590517997742, -0.6271914839744568, -1.317366600036621, 0.19326698780059814, -0.28835394978523254, -0.6557284593582153, -1.334155797958374, 0.1970767080783844, -1.1427842378616333, -1.634827733039856, 0.1904504895210266, 1.930485486984253, 2.0713908672332764, -0.7939350605010986, 1.5122122764587402, -0.37027662992477417, 0.2504538595676422, 1.1205302476882935, 1.3628649711608887, 3.1422178745269775, 1.976006269454956, -1.320726990699768, 0.6010459065437317, -0.1366835981607437, -0.48031726479530334, 1.0791306495666504, -1.0993621349334717, 1.1895227432250977, -0.11497874557971954, -1.280631184577942, -1.2746556997299194, 0.9146208167076111, 0.5589928030967712, -0.110111303627491, -0.48896604776382446, 1.118200659751892, 0.1816953420639038, 1.484669804573059, 0.5840650200843811, -0.3086353540420532, 0.5568447113037109, -0.37283816933631897, -0.41657522320747375, 1.6390122175216675, 0.05954809486865997, -1.2068597078323364, -2.152107000350952, -0.03188636153936386, -0.9464424848556519, 0.0951029360294342, -0.8606800436973572, -1.1460661888122559, 1.6820257902145386, 0.44674432277679443, -0.9452566504478455, -0.0929911732673645, -0.26730599999427795, -0.745177686214447, 2.552445650100708, -1.3443424701690674, -0.278164803981781, -1.0132789611816406, -0.7080764174461365, 1.4984240531921387, -1.2174677848815918, -0.3153441548347473, -0.9942498207092285, -0.5381923317909241, -1.1667486429214478, -0.34491798281669617, -0.0806458592414856, -0.770892858505249, 0.8120357394218445, 0.08604919910430908, -1.3687024116516113, -0.4684341549873352, -0.9119982123374939, 0.9111743569374084, -0.15271928906440735, 0.03918473795056343, 1.6152089834213257, 0.15411412715911865, -0.4746294617652893, 0.851268470287323, 1.1652144193649292, 0.520420491695404, -0.5135039687156677, 0.5272728800773621, -0.6477094292640686, 0.43784570693969727, -1.1330140829086304, 0.4427846372127533, -3.0222549438476562, 0.6247192621231079, 0.02858053520321846, 0.02576826512813568, -0.12268869578838348, -1.2684154510498047, 1.0240185260772705, 2.466158628463745, -0.9216187596321106, 0.6676902770996094, 0.29110637307167053, 1.2474344968795776, -1.7019004821777344, 0.2272954285144806, -0.5732198357582092, 1.8354281187057495, 0.1447174996137619, 1.2508710622787476, -0.6006008386611938, -2.598325729370117, 0.414152592420578, -1.1579713821411133, -1.0373084545135498, 0.935195803642273, -0.7446427941322327, 0.09242524206638336, -1.1508718729019165, -0.3720162808895111, -0.8845564723014832, -1.1278616189956665, 0.5907845497131348, 0.2409256249666214, 0.545863687992096, -0.66740483045578, 0.2972601354122162, -2.263646364212036, -1.1109027862548828, -0.07321767508983612, -0.8139554858207703, 0.37977832555770874, -0.42636027932167053, 0.7209715843200684, -0.09464561194181442, -0.07859659194946289, 0.3050742447376251, 1.5736192464828491, 3.0462822914123535, -0.02319863811135292, 0.417934387922287, -0.24131149053573608, -0.952599048614502, 1.5860881805419922, 0.8648500442504883, -0.20125064253807068, -0.6638711094856262, -1.2119736671447754, 1.2519010305404663, 1.5875412225723267, 0.9567592144012451, 0.0546259805560112, -0.9710776805877686, -0.7805432081222534, -0.01883465237915516, 0.21513131260871887, 0.35316964983940125, 1.1500751972198486, 0.23822341859340668, 0.12248782813549042, 1.3337055444717407, 1.1022223234176636, -0.49368390440940857, 0.2959258258342743, -0.9177963733673096, -0.44463565945625305, 0.45428240299224854, 0.3626682460308075, -0.15426021814346313, 0.03803744912147522, -1.051495909690857, -0.1456664353609085, -0.19615496695041656, -0.7963034510612488, -0.6148815155029297, -0.4272826313972473, -0.40578487515449524, 1.7291898727416992, -0.017236508429050446, -0.5179837346076965, 0.003427322953939438, -0.954210102558136, -0.21479959785938263, -1.2300132513046265, 0.33686357736587524, -0.053032319992780685, -0.1054171621799469, -0.18319502472877502, 1.8431445360183716, -0.8236573934555054, -2.2802085876464844, 0.18628297746181488, 0.17374545335769653, -0.13673444092273712, 0.14965984225273132, 1.868461012840271, 0.45638957619667053, 1.2855652570724487, 1.4086792469024658, 1.1000570058822632, -0.6118388772010803, -1.3814921379089355, 0.8066396117210388, 1.0498846769332886, -1.4216268062591553, 0.878595769405365, -0.04683244600892067, -0.5232158899307251, 0.4552047550678253, 1.2052292823791504, 0.5185707211494446, -1.9782594442367554, 0.8197011351585388, -1.258694052696228, 0.9648240208625793, 0.9260618686676025, 0.6007192134857178, 0.2572517991065979, 0.9354239106178284, -1.266617774963379, -1.0145050287246704, -0.4465791583061218, -0.7258315086364746, 1.867764949798584, -0.3448573648929596, 0.4649708867073059, -0.3529256284236908, -1.3657090663909912, 0.25785893201828003, 0.6278202533721924, 0.24307183921337128, -0.4674375057220459, 0.7993223071098328, -0.7996313571929932, -1.2185519933700562, -1.34233820438385, -0.5471341609954834, -1.0918915271759033, -0.9447329044342041, 1.0204769372940063, 0.752998411655426, 0.2181505709886551, 1.9820979833602905, 0.7718991637229919, 0.2005893737077713, -2.6558985710144043, 0.7575790286064148, 0.2672092318534851, -0.030619725584983826, 0.8536710143089294, 0.34971481561660767, 1.121183156967163, 0.12883779406547546, 0.47605159878730774, -2.668212890625, 2.4982104301452637, -0.219363734126091, 0.6984831094741821, 0.03556309640407562, -0.023285485804080963, 1.1118539571762085, 0.7070507407188416, 0.5309914946556091, -0.8167049288749695, 0.7589116096496582, -0.608158528804779, 1.2916902303695679, 0.8150724172592163, -0.8163124918937683, -0.06503436714410782, 1.0258302688598633, 0.2959195077419281, -0.6154404878616333, -0.8669460415840149, -1.100756049156189, 0.7937387228012085, 1.8176380395889282, 0.26471447944641113, 0.07767093181610107, 0.6998472213745117, 0.6491535902023315, -1.2487825155258179, -0.013850878924131393, -0.5854206085205078, -0.7793592810630798, 1.7664048671722412, 1.9823857545852661, -0.1775505691766739, -0.15844248235225677, -0.5558217167854309, -1.4971939325332642, 0.9359604120254517, -0.06037823483347893, 0.13969987630844116, 0.7291511297225952, -0.654088020324707, 0.8535528779029846, 0.9602854251861572, 0.7926957607269287, 0.41160106658935547, 0.07580108940601349, 0.48350226879119873, -0.5117291212081909, -1.2454357147216797, -0.05194588005542755, -1.112897276878357, -2.795607566833496, 0.4526745676994324, -0.11006487160921097, -1.2651900053024292, 0.14466051757335663, -0.9613205790519714, 0.7768802046775818, -0.5316604375839233, -1.1669089794158936, -1.3213037252426147, 0.015432971529662609, -0.19694571197032928, 0.816418468952179, -1.6194041967391968, -0.06334216147661209, 1.174515962600708, 0.9574850797653198, -0.5822288990020752, 1.0355972051620483, 0.15924766659736633, 1.0959761142730713, 1.0091382265090942, -0.3293404281139374, 0.5201330780982971, 0.037940751761198044, -1.3801476955413818, 0.2777252793312073, 1.3672983646392822, 0.13662579655647278, 1.594710111618042, -0.4628361761569977, -0.15969765186309814, 0.3278871476650238, -0.3220447897911072, -0.5012613534927368, -0.6956030130386353, 0.5136536955833435, -0.11101027578115463, -0.9263575673103333, -0.12885461747646332, 0.018086113035678864, -0.14270783960819244, 0.12672370672225952, -1.471829891204834, 0.04253271594643593, -0.5339295268058777, -0.6835664510726929, -1.399673581123352, 0.012838221155107021, 1.322303056716919, -0.7189786434173584, -0.1730160266160965, 0.4333721101284027, 0.2318798452615738, 0.5736175775527954, 0.7236551642417908, -0.8234993815422058, -0.31017908453941345, 0.03299304470419884, -0.43074023723602295, 0.4291034936904907, 1.4213652610778809, -0.2982726991176605, -0.8496718406677246, 0.38573354482650757, -0.1799299716949463, 0.2127983272075653, 1.9657366275787354, -0.040356237441301346, -0.8740481734275818, 0.27548426389694214, -0.8617303967475891, 1.990302562713623, 1.6055998802185059, 1.3306877613067627, -0.36709731817245483, -0.6720405220985413, 0.5516355037689209, -0.5870090126991272, -0.3925110101699829, 0.8514040112495422, 0.5287380814552307, -0.26302260160446167, -1.4774761199951172, 0.7735276818275452, 1.2723838090896606, -0.7365754246711731, -0.8732390403747559, 0.12213733792304993, -0.5178099870681763, 1.1169074773788452, 0.696831464767456, 0.2646655738353729, 0.3751184642314911, 1.6780756711959839, 0.7889546155929565, -0.688448965549469, 0.5993762612342834, 0.3539383113384247, -0.18473058938980103, -2.018181085586548, -1.2548580169677734, 0.29440534114837646, -0.7053906321525574, -1.4941314458847046, 1.5010849237442017, -1.0712026357650757, -1.0966169834136963, 0.6260229349136353, 0.06354761123657227, 1.2370123863220215, 0.3422819674015045, 1.5933541059494019, 1.9013335704803467, 0.6977774500846863, 0.410600483417511, 1.0196360349655151, -0.24860896170139313, -0.3873912990093231, 1.6627382040023804, -0.5357372164726257, 0.5076513290405273, 1.1252223253250122, -0.1421024054288864, -1.1588382720947266, -0.8138543963432312, -1.3748605251312256, -0.799498438835144, 1.156335711479187, 0.19813011586666107, -0.941210150718689, 0.36499008536338806, 1.5719881057739258, -0.08177348971366882, -0.1720583587884903, 0.8020190000534058, 0.33833232522010803, -0.727594792842865, -0.021957237273454666, -1.028978943824768, 0.5981408953666687, -0.3488340675830841, -0.47372081875801086, 0.1382032185792923, 0.5909088253974915, 1.2362349033355713, 0.18169930577278137, 0.19538909196853638, 1.436097502708435, -1.2597006559371948, 1.2199523448944092, -1.0180094242095947, 0.4407657980918884, -2.334550619125366, 1.5421838760375977, -0.9165788292884827, 1.9358644485473633, -2.733191728591919, 0.6553370356559753, -0.44091248512268066, -0.48830848932266235, 0.22798636555671692, -0.23297998309135437, 0.09739641100168228, -0.1106100007891655, -1.1184567213058472, -0.047879163175821304, -0.6844562888145447, 0.3960065245628357, 1.1801304817199707, 1.251031517982483, -1.0780361890792847, 0.018612805753946304, -1.65264093875885, -0.13460886478424072, -0.5958733558654785, 0.2101694494485855, -1.8861308097839355, -0.34312546253204346, -1.9904916286468506, -2.3363101482391357, -1.128010630607605, -0.8933387398719788, 1.3182626962661743, 0.1796167641878128, -0.8025006651878357, 1.2707277536392212, -0.4455081820487976, -1.6589913368225098, 0.9972852468490601, -2.0678794384002686 ]
https://github.com/huggingface/datasets/issues/3112
OverflowError: There was an overflow in the <class 'pyarrow.lib.ListArray'>. Try to reduce writer_batch_size to have batches smaller than 2GB
Ok got it, tensor full of NaNs, cf. ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_writer.py in write_examples_on_file(self) 315 # This check fails with FloatArrays with nans, which is not what we want, so account for that:
## Describe the bug Despite having batches way under 2Gb when running `datasets.map()`, after processing correctly the data of the first batch without fuss and irrespective of writer_batch_size (say 2,4,8,16,32,64 and 128 in my case), it returns the following error : > OverflowError: There was an overflow in the <class 'pyarrow.lib.ListArray'>. Try to reduce writer_batch_size to have batches smaller than 2GB Note that I always run `batch_size=writer_batch_size` : ## Steps to reproduce the bug ```python datasets.map(lambda example : {"column_name" : function(arguments)}, batched=False, remove_columns = datasets.column_names, batch_size=batch_size, writer_batch_size=batch_size, disable_nullable=True, num_proc=None, desc="blablabla") ``` ## Introspecting CUDA memory during bug Placed within `function(arguments)` the following statement to introspect memory usage, merely a little over 1/4 of 2Gb `print(torch.cuda.memory_summary(device=device, abbreviated=False))` > |===========================================================================| | PyTorch CUDA memory summary, device ID 0 | |---------------------------------------------------------------------------| | CUDA OOMs: 0 | cudaMalloc retries: 0 | |===========================================================================| | Metric | Cur Usage | Peak Usage | Tot Alloc | Tot Freed | |---------------------------------------------------------------------------| | Allocated memory | 541418 KB | 545725 KB | 555695 KB | 14276 KB | | from large pool | 540672 KB | 544431 KB | 544431 KB | 3759 KB | | from small pool | 746 KB | 1714 KB | 11264 KB | 10517 KB | |---------------------------------------------------------------------------| | Active memory | 541418 KB | 545725 KB | 555695 KB | 14276 KB | | from large pool | 540672 KB | 544431 KB | 544431 KB | 3759 KB | | from small pool | 746 KB | 1714 KB | 11264 KB | 10517 KB | |---------------------------------------------------------------------------| | GPU reserved memory | 598016 KB | 598016 KB | 598016 KB | 0 B | | from large pool | 595968 KB | 595968 KB | 595968 KB | 0 B | | from small pool | 2048 KB | 2048 KB | 2048 KB | 0 B | |---------------------------------------------------------------------------| | Non-releasable memory | 36117 KB | 52292 KB | 274275 KB | 238158 KB | | from large pool | 34816 KB | 51537 KB | 261713 KB | 226897 KB | | from small pool | 1301 KB | 2045 KB | 12562 KB | 11261 KB | |---------------------------------------------------------------------------| | Allocations | 198 | 224 | 478 | 280 | | from large pool | 74 | 75 | 75 | 1 | | from small pool | 124 | 150 | 403 | 279 | |---------------------------------------------------------------------------| | Active allocs | 198 | 224 | 478 | 280 | | from large pool | 74 | 75 | 75 | 1 | | from small pool | 124 | 150 | 403 | 279 | |---------------------------------------------------------------------------| | GPU reserved segments | 21 | 21 | 21 | 0 | | from large pool | 20 | 20 | 20 | 0 | | from small pool | 1 | 1 | 1 | 0 | |---------------------------------------------------------------------------| | Non-releasable allocs | 18 | 23 | 166 | 148 | | from large pool | 17 | 18 | 19 | 2 | | from small pool | 1 | 6 | 147 | 146 | |===========================================================================| ## Expected results Efficiently process the datasets and write it down to disk. ## Actual results -------------------------------------------------------------------------- OverflowError Traceback (most recent call last) ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in _map_single(self, function, with_indices, 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, new_fingerprint, rank, offset, disable_tqdm, desc, cache_only) 2390 else: -> 2391 writer.write(example) 2392 else: ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_writer.py in write(self, example, key, writer_batch_size) 367 --> 368 self.write_examples_on_file() 369 ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_writer.py in write_examples_on_file(self) 316 if not isinstance(pa_array[0], pa.lib.FloatScalar): --> 317 raise OverflowError( 318 "There was an overflow in the {}. Try to reduce writer_batch_size to have batches smaller than 2GB".format( OverflowError: There was an overflow in the <class 'pyarrow.lib.ListArray'>. Try to reduce writer_batch_size to have batches smaller than 2GB During handling of the above exception, another exception occurred: OverflowError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_16268/2456940807.py in <module> 3 #tracker = OfflineEmissionsTracker(country_iso_code="FRA", project_name='xxx'+time_stamp,output_dir='./codecarbon') 4 #tracker.start() ----> 5 process_datasets(source_datasets_paths, dataset_dir, LM_tokenizer, LMhead_model, datasets_selection=['wikipedia'], from_scratch=True, 6 clean_sentences=False, negative_sampling=False, translate=False, tokenize=False, generate_embeddings=True, concatenate_embeddings=False, 7 max_sample=10000, padding='do_not_pad', truncation=True, cpu_batch_size=1000, gpu_batch_size=2, cpu_writer_batch_size=1000, gpu_writer_batch_size=2, disable_nullable=True, num_proc=None) # ~\xxx\xxx.py in process_datasets(source_datasets_paths, dataset_dir, LM_tokenizer, LMhead_model, datasets_selection, from_scratch, clean_sentences, translate, negative_sampling, tokenize, generate_embeddings, concatenate_embeddings, max_sample, padding, truncation, cpu_batch_size, gpu_batch_size, cpu_writer_batch_size, gpu_writer_batch_size, disable_nullable, num_proc) 481 for column in tqdm(dataset.column_names, desc=f'Processing column', leave=False): 482 if "xxx_" in column: --> 483 dataset = dataset.map(lambda example : 484 {"embeddings_"+str(column).replace("translated_",""):function(input_ids=example[column], 485 token_type_ids=example[column.replace("input_ids","token_type_ids")], ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in map(self, function, with_indices, 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) 2034 2035 if num_proc is None or num_proc == 1: -> 2036 return self._map_single( 2037 function=function, 2038 with_indices=with_indices, ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in wrapper(*args, **kwargs) 501 self: "Dataset" = kwargs.pop("self") 502 # apply actual function --> 503 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 504 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 505 for dataset in datasets: ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in wrapper(*args, **kwargs) 468 } 469 # apply actual function --> 470 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 471 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 472 # re-apply format to the output ~\anaconda3\envs\xxx\lib\site-packages\datasets\fingerprint.py in wrapper(*args, **kwargs) 404 # Call actual function 405 --> 406 out = func(self, *args, **kwargs) 407 408 # Update fingerprint of in-place transforms + update in-place history of transforms ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in _map_single(self, function, with_indices, 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, new_fingerprint, rank, offset, disable_tqdm, desc, cache_only) 2425 if update_data: 2426 if writer is not None: -> 2427 writer.finalize() 2428 if tmp_file is not None: 2429 tmp_file.close() ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_writer.py in finalize(self, close_stream) 440 # Re-intializing to empty list for next batch 441 self.hkey_record = [] --> 442 self.write_examples_on_file() 443 if self.pa_writer is None: 444 if self._schema is not None: ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_writer.py in write_examples_on_file(self) 315 # This check fails with FloatArrays with nans, which is not what we want, so account for that: 316 if not isinstance(pa_array[0], pa.lib.FloatScalar): --> 317 raise OverflowError( 318 "There was an overflow in the {}. Try to reduce writer_batch_size to have batches smaller than 2GB".format( 319 type(pa_array) OverflowError: There was an overflow in the <class 'pyarrow.lib.ListArray'>. Try to reduce writer_batch_size to have batches smaller than 2GB ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.13.3 - Platform: Windows-10-10.0.19042-SP0 - Python version: 3.8.11 - PyArrow version: 3.0.0 ##Next steps Testing on Linux. @albertvillanova
1,166
30
OverflowError: There was an overflow in the <class 'pyarrow.lib.ListArray'>. Try to reduce writer_batch_size to have batches smaller than 2GB ## Describe the bug Despite having batches way under 2Gb when running `datasets.map()`, after processing correctly the data of the first batch without fuss and irrespective of writer_batch_size (say 2,4,8,16,32,64 and 128 in my case), it returns the following error : > OverflowError: There was an overflow in the <class 'pyarrow.lib.ListArray'>. Try to reduce writer_batch_size to have batches smaller than 2GB Note that I always run `batch_size=writer_batch_size` : ## Steps to reproduce the bug ```python datasets.map(lambda example : {"column_name" : function(arguments)}, batched=False, remove_columns = datasets.column_names, batch_size=batch_size, writer_batch_size=batch_size, disable_nullable=True, num_proc=None, desc="blablabla") ``` ## Introspecting CUDA memory during bug Placed within `function(arguments)` the following statement to introspect memory usage, merely a little over 1/4 of 2Gb `print(torch.cuda.memory_summary(device=device, abbreviated=False))` > |===========================================================================| | PyTorch CUDA memory summary, device ID 0 | |---------------------------------------------------------------------------| | CUDA OOMs: 0 | cudaMalloc retries: 0 | |===========================================================================| | Metric | Cur Usage | Peak Usage | Tot Alloc | Tot Freed | |---------------------------------------------------------------------------| | Allocated memory | 541418 KB | 545725 KB | 555695 KB | 14276 KB | | from large pool | 540672 KB | 544431 KB | 544431 KB | 3759 KB | | from small pool | 746 KB | 1714 KB | 11264 KB | 10517 KB | |---------------------------------------------------------------------------| | Active memory | 541418 KB | 545725 KB | 555695 KB | 14276 KB | | from large pool | 540672 KB | 544431 KB | 544431 KB | 3759 KB | | from small pool | 746 KB | 1714 KB | 11264 KB | 10517 KB | |---------------------------------------------------------------------------| | GPU reserved memory | 598016 KB | 598016 KB | 598016 KB | 0 B | | from large pool | 595968 KB | 595968 KB | 595968 KB | 0 B | | from small pool | 2048 KB | 2048 KB | 2048 KB | 0 B | |---------------------------------------------------------------------------| | Non-releasable memory | 36117 KB | 52292 KB | 274275 KB | 238158 KB | | from large pool | 34816 KB | 51537 KB | 261713 KB | 226897 KB | | from small pool | 1301 KB | 2045 KB | 12562 KB | 11261 KB | |---------------------------------------------------------------------------| | Allocations | 198 | 224 | 478 | 280 | | from large pool | 74 | 75 | 75 | 1 | | from small pool | 124 | 150 | 403 | 279 | |---------------------------------------------------------------------------| | Active allocs | 198 | 224 | 478 | 280 | | from large pool | 74 | 75 | 75 | 1 | | from small pool | 124 | 150 | 403 | 279 | |---------------------------------------------------------------------------| | GPU reserved segments | 21 | 21 | 21 | 0 | | from large pool | 20 | 20 | 20 | 0 | | from small pool | 1 | 1 | 1 | 0 | |---------------------------------------------------------------------------| | Non-releasable allocs | 18 | 23 | 166 | 148 | | from large pool | 17 | 18 | 19 | 2 | | from small pool | 1 | 6 | 147 | 146 | |===========================================================================| ## Expected results Efficiently process the datasets and write it down to disk. ## Actual results -------------------------------------------------------------------------- OverflowError Traceback (most recent call last) ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in _map_single(self, function, with_indices, 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, new_fingerprint, rank, offset, disable_tqdm, desc, cache_only) 2390 else: -> 2391 writer.write(example) 2392 else: ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_writer.py in write(self, example, key, writer_batch_size) 367 --> 368 self.write_examples_on_file() 369 ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_writer.py in write_examples_on_file(self) 316 if not isinstance(pa_array[0], pa.lib.FloatScalar): --> 317 raise OverflowError( 318 "There was an overflow in the {}. Try to reduce writer_batch_size to have batches smaller than 2GB".format( OverflowError: There was an overflow in the <class 'pyarrow.lib.ListArray'>. Try to reduce writer_batch_size to have batches smaller than 2GB During handling of the above exception, another exception occurred: OverflowError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_16268/2456940807.py in <module> 3 #tracker = OfflineEmissionsTracker(country_iso_code="FRA", project_name='xxx'+time_stamp,output_dir='./codecarbon') 4 #tracker.start() ----> 5 process_datasets(source_datasets_paths, dataset_dir, LM_tokenizer, LMhead_model, datasets_selection=['wikipedia'], from_scratch=True, 6 clean_sentences=False, negative_sampling=False, translate=False, tokenize=False, generate_embeddings=True, concatenate_embeddings=False, 7 max_sample=10000, padding='do_not_pad', truncation=True, cpu_batch_size=1000, gpu_batch_size=2, cpu_writer_batch_size=1000, gpu_writer_batch_size=2, disable_nullable=True, num_proc=None) # ~\xxx\xxx.py in process_datasets(source_datasets_paths, dataset_dir, LM_tokenizer, LMhead_model, datasets_selection, from_scratch, clean_sentences, translate, negative_sampling, tokenize, generate_embeddings, concatenate_embeddings, max_sample, padding, truncation, cpu_batch_size, gpu_batch_size, cpu_writer_batch_size, gpu_writer_batch_size, disable_nullable, num_proc) 481 for column in tqdm(dataset.column_names, desc=f'Processing column', leave=False): 482 if "xxx_" in column: --> 483 dataset = dataset.map(lambda example : 484 {"embeddings_"+str(column).replace("translated_",""):function(input_ids=example[column], 485 token_type_ids=example[column.replace("input_ids","token_type_ids")], ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in map(self, function, with_indices, 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) 2034 2035 if num_proc is None or num_proc == 1: -> 2036 return self._map_single( 2037 function=function, 2038 with_indices=with_indices, ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in wrapper(*args, **kwargs) 501 self: "Dataset" = kwargs.pop("self") 502 # apply actual function --> 503 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 504 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 505 for dataset in datasets: ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in wrapper(*args, **kwargs) 468 } 469 # apply actual function --> 470 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 471 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 472 # re-apply format to the output ~\anaconda3\envs\xxx\lib\site-packages\datasets\fingerprint.py in wrapper(*args, **kwargs) 404 # Call actual function 405 --> 406 out = func(self, *args, **kwargs) 407 408 # Update fingerprint of in-place transforms + update in-place history of transforms ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_dataset.py in _map_single(self, function, with_indices, 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, new_fingerprint, rank, offset, disable_tqdm, desc, cache_only) 2425 if update_data: 2426 if writer is not None: -> 2427 writer.finalize() 2428 if tmp_file is not None: 2429 tmp_file.close() ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_writer.py in finalize(self, close_stream) 440 # Re-intializing to empty list for next batch 441 self.hkey_record = [] --> 442 self.write_examples_on_file() 443 if self.pa_writer is None: 444 if self._schema is not None: ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_writer.py in write_examples_on_file(self) 315 # This check fails with FloatArrays with nans, which is not what we want, so account for that: 316 if not isinstance(pa_array[0], pa.lib.FloatScalar): --> 317 raise OverflowError( 318 "There was an overflow in the {}. Try to reduce writer_batch_size to have batches smaller than 2GB".format( 319 type(pa_array) OverflowError: There was an overflow in the <class 'pyarrow.lib.ListArray'>. Try to reduce writer_batch_size to have batches smaller than 2GB ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.13.3 - Platform: Windows-10-10.0.19042-SP0 - Python version: 3.8.11 - PyArrow version: 3.0.0 ##Next steps Testing on Linux. @albertvillanova Ok got it, tensor full of NaNs, cf. ~\anaconda3\envs\xxx\lib\site-packages\datasets\arrow_writer.py in write_examples_on_file(self) 315 # This check fails with FloatArrays with nans, which is not what we want, so account for that:
[ -1.3111408948898315, -0.9018009305000305, -0.5220432877540588, 1.5846108198165894, -0.1323675662279129, -1.1428461074829102, 0.22946959733963013, -0.9254502654075623, 1.5601636171340942, -0.9610655307769775, 0.31086525321006775, -1.4772238731384277, 0.06510502099990845, -0.6179060339927673, -0.5666400194168091, -0.8172217011451721, -0.24111469089984894, -0.5509207844734192, 1.2107572555541992, 2.3075344562530518, 1.419454574584961, -1.2838189601898193, 2.805748462677002, 0.9382346868515015, -0.2513939440250397, -0.900237500667572, 0.45658501982688904, 0.06874764710664749, -1.3566051721572876, -0.40835508704185486, -0.9284236431121826, -0.20029063522815704, -0.6996954083442688, -0.5018917918205261, -0.1334933042526245, 0.41722697019577026, -0.31322821974754333, -0.4025272727012634, -0.3703726828098297, -0.7090391516685486, 0.6158791184425354, -0.39884713292121887, 0.6270517110824585, -0.31665006279945374, 1.832263708114624, -0.5779015421867371, 0.43860065937042236, 0.6048818230628967, 1.1177879571914673, 0.22994062304496765, -0.030449822545051575, 0.3056044578552246, 0.18136058747768402, -0.05276396498084068, 0.7140637040138245, 1.314292550086975, 0.7756487131118774, 0.5930070877075195, 0.7259011268615723, -2.0809216499328613, 1.3346449136734009, -0.9163885116577148, 0.39658060669898987, 1.3597601652145386, -1.1324247121810913, 0.5653756260871887, -1.793566107749939, -0.16385917365550995, 0.42556729912757874, -2.3565306663513184, 0.3268454968929291, -1.3179044723510742, -0.6999371647834778, 1.0129655599594116, 0.31049925088882446, -1.2103557586669922, -0.08673643320798874, -0.4752832353115082, 1.1530954837799072, 0.43782734870910645, 0.9300393462181091, -1.7386424541473389, 0.05308304727077484, -0.3219519257545471, 0.30795976519584656, -1.3227274417877197, -1.5132110118865967, 0.5383220314979553, 0.6336873769760132, 0.6397206783294678, -0.06354617327451706, 1.1677391529083252, -1.07400381565094, 0.7956643104553223, -0.9498832821846008, -1.7713196277618408, -1.4379379749298096, -2.5195960998535156, -2.2318174839019775, 0.6107348799705505, -0.27577048540115356, -0.47673460841178894, 2.159017562866211, -1.0865510702133179, -1.622563362121582, 1.069175362586975, 0.08117622137069702, -0.13833580911159515, 2.38611102104187, 0.1903383433818817, -0.9356324672698975, 0.5574452877044678, -0.9388256669044495, 0.5606613755226135, -0.4064168632030487, 1.3481519222259521, 0.43474000692367554, -1.1565685272216797, 1.6680554151535034, -0.4102782607078552, 0.35886797308921814, -0.8740506768226624, -0.412041038274765, -0.6198643445968628, 0.10178758203983307, 2.0885169506073, -0.15811967849731445, 1.4330179691314697, -0.21319074928760529, -1.2582299709320068, -1.4982304573059082, 0.9600117206573486, 0.4246074855327606, -0.7346600294113159, 0.34417328238487244, -0.33661600947380066, 0.1642743945121765, 0.11041107028722763, 1.0642783641815186, 1.3720909357070923, 0.7813665866851807, -0.27022865414619446, -0.7681993246078491, -0.02443922683596611, -0.2379813939332962, -0.5455806851387024, -1.75465726852417, -0.28607845306396484, -0.07196350395679474, 0.609825074672699, -1.2464797496795654, 1.8482304811477661, 0.9597029685974121, 1.843437671661377, 1.012960433959961, -0.4608301818370819, 1.4855303764343262, 0.1761516034603119, 1.8386378288269043, -0.3003373146057129, 0.8275532126426697, -0.5361388325691223, -1.201317548751831, 0.6913304328918457, -0.1647428423166275, -1.896549105644226, -0.40087994933128357, -0.7311331033706665, -0.09813297539949417, -0.9991328716278076, 1.0162891149520874, -0.26691684126853943, -1.4640178680419922, 0.25360700488090515, -0.6482425928115845, 0.14811986684799194, -1.3718169927597046, 0.49807125329971313, 0.7026700973510742, -0.6587766408920288, 0.11853915452957153, -0.523038387298584, -1.104565143585205, -0.819532573223114, 0.30223581194877625, 1.742804765701294, -0.6007044911384583, 0.83430016040802, 1.1161142587661743, -0.6986352801322937, -0.1302143931388855, 0.5592595934867859, -0.21039122343063354, 0.8727553486824036, -1.0091285705566406, -0.5537859201431274, 1.080904483795166, -0.2356947958469391, -0.6149828433990479, 1.394829511642456, 0.8048202991485596, -0.8843030333518982, -0.2600008249282837, -0.15619297325611115, -0.8618993759155273, 0.23782949149608612, -1.5233951807022095, -0.021152649074792862, 0.49905192852020264, -1.546398639678955, -0.5273090600967407, 0.009966022334992886, 1.3637282848358154, -0.1314779669046402, 1.4516044855117798, -0.20076142251491547, -0.0554315447807312, -0.39761626720428467, -0.3007197976112366, 0.13588474690914154, 0.0027852635830640793, -0.6303250789642334, 0.22393149137496948, -0.804378867149353, 0.02904444932937622, 1.4478784799575806, 0.195698082447052, 0.047797203063964844, 0.4018509089946747, 1.1827881336212158, 0.3126196265220642, -0.3245917558670044, -0.9250212907791138, -1.4019546508789062, 1.6626933813095093, -1.6545724868774414, 2.1438920497894287, 0.9506746530532837, 0.06380118429660797, -1.7799988985061646, -1.7404382228851318, 1.3920173645019531, 1.140976905822754, 2.553600549697876, 0.6261525750160217, 0.40730440616607666, -0.929707407951355, -0.7109766602516174, 0.3395868241786957, -0.9213522672653198, -1.0123966932296753, 0.2403557151556015, 2.322159767150879, 1.8118152618408203, -0.24898149073123932, -0.11071887612342834, -0.972771406173706, 1.371533989906311, -0.16942128539085388, 0.23209300637245178, 1.8042305707931519, -0.2668602466583252, -1.0771249532699585, 1.201375961303711, -2.5689034461975098, 0.1263159215450287, 1.9566264152526855, 0.4796310067176819, 0.1764780730009079, -1.1771981716156006, -0.8111626505851746, -0.12147590517997742, -0.6271914839744568, -1.317366600036621, 0.19326698780059814, -0.28835394978523254, -0.6557284593582153, -1.334155797958374, 0.1970767080783844, -1.1427842378616333, -1.634827733039856, 0.1904504895210266, 1.930485486984253, 2.0713908672332764, -0.7939350605010986, 1.5122122764587402, -0.37027662992477417, 0.2504538595676422, 1.1205302476882935, 1.3628649711608887, 3.1422178745269775, 1.976006269454956, -1.320726990699768, 0.6010459065437317, -0.1366835981607437, -0.48031726479530334, 1.0791306495666504, -1.0993621349334717, 1.1895227432250977, -0.11497874557971954, -1.280631184577942, -1.2746556997299194, 0.9146208167076111, 0.5589928030967712, -0.110111303627491, -0.48896604776382446, 1.118200659751892, 0.1816953420639038, 1.484669804573059, 0.5840650200843811, -0.3086353540420532, 0.5568447113037109, -0.37283816933631897, -0.41657522320747375, 1.6390122175216675, 0.05954809486865997, -1.2068597078323364, -2.152107000350952, -0.03188636153936386, -0.9464424848556519, 0.0951029360294342, -0.8606800436973572, -1.1460661888122559, 1.6820257902145386, 0.44674432277679443, -0.9452566504478455, -0.0929911732673645, -0.26730599999427795, -0.745177686214447, 2.552445650100708, -1.3443424701690674, -0.278164803981781, -1.0132789611816406, -0.7080764174461365, 1.4984240531921387, -1.2174677848815918, -0.3153441548347473, -0.9942498207092285, -0.5381923317909241, -1.1667486429214478, -0.34491798281669617, -0.0806458592414856, -0.770892858505249, 0.8120357394218445, 0.08604919910430908, -1.3687024116516113, -0.4684341549873352, -0.9119982123374939, 0.9111743569374084, -0.15271928906440735, 0.03918473795056343, 1.6152089834213257, 0.15411412715911865, -0.4746294617652893, 0.851268470287323, 1.1652144193649292, 0.520420491695404, -0.5135039687156677, 0.5272728800773621, -0.6477094292640686, 0.43784570693969727, -1.1330140829086304, 0.4427846372127533, -3.0222549438476562, 0.6247192621231079, 0.02858053520321846, 0.02576826512813568, -0.12268869578838348, -1.2684154510498047, 1.0240185260772705, 2.466158628463745, -0.9216187596321106, 0.6676902770996094, 0.29110637307167053, 1.2474344968795776, -1.7019004821777344, 0.2272954285144806, -0.5732198357582092, 1.8354281187057495, 0.1447174996137619, 1.2508710622787476, -0.6006008386611938, -2.598325729370117, 0.414152592420578, -1.1579713821411133, -1.0373084545135498, 0.935195803642273, -0.7446427941322327, 0.09242524206638336, -1.1508718729019165, -0.3720162808895111, -0.8845564723014832, -1.1278616189956665, 0.5907845497131348, 0.2409256249666214, 0.545863687992096, -0.66740483045578, 0.2972601354122162, -2.263646364212036, -1.1109027862548828, -0.07321767508983612, -0.8139554858207703, 0.37977832555770874, -0.42636027932167053, 0.7209715843200684, -0.09464561194181442, -0.07859659194946289, 0.3050742447376251, 1.5736192464828491, 3.0462822914123535, -0.02319863811135292, 0.417934387922287, -0.24131149053573608, -0.952599048614502, 1.5860881805419922, 0.8648500442504883, -0.20125064253807068, -0.6638711094856262, -1.2119736671447754, 1.2519010305404663, 1.5875412225723267, 0.9567592144012451, 0.0546259805560112, -0.9710776805877686, -0.7805432081222534, -0.01883465237915516, 0.21513131260871887, 0.35316964983940125, 1.1500751972198486, 0.23822341859340668, 0.12248782813549042, 1.3337055444717407, 1.1022223234176636, -0.49368390440940857, 0.2959258258342743, -0.9177963733673096, -0.44463565945625305, 0.45428240299224854, 0.3626682460308075, -0.15426021814346313, 0.03803744912147522, -1.051495909690857, -0.1456664353609085, -0.19615496695041656, -0.7963034510612488, -0.6148815155029297, -0.4272826313972473, -0.40578487515449524, 1.7291898727416992, -0.017236508429050446, -0.5179837346076965, 0.003427322953939438, -0.954210102558136, -0.21479959785938263, -1.2300132513046265, 0.33686357736587524, -0.053032319992780685, -0.1054171621799469, -0.18319502472877502, 1.8431445360183716, -0.8236573934555054, -2.2802085876464844, 0.18628297746181488, 0.17374545335769653, -0.13673444092273712, 0.14965984225273132, 1.868461012840271, 0.45638957619667053, 1.2855652570724487, 1.4086792469024658, 1.1000570058822632, -0.6118388772010803, -1.3814921379089355, 0.8066396117210388, 1.0498846769332886, -1.4216268062591553, 0.878595769405365, -0.04683244600892067, -0.5232158899307251, 0.4552047550678253, 1.2052292823791504, 0.5185707211494446, -1.9782594442367554, 0.8197011351585388, -1.258694052696228, 0.9648240208625793, 0.9260618686676025, 0.6007192134857178, 0.2572517991065979, 0.9354239106178284, -1.266617774963379, -1.0145050287246704, -0.4465791583061218, -0.7258315086364746, 1.867764949798584, -0.3448573648929596, 0.4649708867073059, -0.3529256284236908, -1.3657090663909912, 0.25785893201828003, 0.6278202533721924, 0.24307183921337128, -0.4674375057220459, 0.7993223071098328, -0.7996313571929932, -1.2185519933700562, -1.34233820438385, -0.5471341609954834, -1.0918915271759033, -0.9447329044342041, 1.0204769372940063, 0.752998411655426, 0.2181505709886551, 1.9820979833602905, 0.7718991637229919, 0.2005893737077713, -2.6558985710144043, 0.7575790286064148, 0.2672092318534851, -0.030619725584983826, 0.8536710143089294, 0.34971481561660767, 1.121183156967163, 0.12883779406547546, 0.47605159878730774, -2.668212890625, 2.4982104301452637, -0.219363734126091, 0.6984831094741821, 0.03556309640407562, -0.023285485804080963, 1.1118539571762085, 0.7070507407188416, 0.5309914946556091, -0.8167049288749695, 0.7589116096496582, -0.608158528804779, 1.2916902303695679, 0.8150724172592163, -0.8163124918937683, -0.06503436714410782, 1.0258302688598633, 0.2959195077419281, -0.6154404878616333, -0.8669460415840149, -1.100756049156189, 0.7937387228012085, 1.8176380395889282, 0.26471447944641113, 0.07767093181610107, 0.6998472213745117, 0.6491535902023315, -1.2487825155258179, -0.013850878924131393, -0.5854206085205078, -0.7793592810630798, 1.7664048671722412, 1.9823857545852661, -0.1775505691766739, -0.15844248235225677, -0.5558217167854309, -1.4971939325332642, 0.9359604120254517, -0.06037823483347893, 0.13969987630844116, 0.7291511297225952, -0.654088020324707, 0.8535528779029846, 0.9602854251861572, 0.7926957607269287, 0.41160106658935547, 0.07580108940601349, 0.48350226879119873, -0.5117291212081909, -1.2454357147216797, -0.05194588005542755, -1.112897276878357, -2.795607566833496, 0.4526745676994324, -0.11006487160921097, -1.2651900053024292, 0.14466051757335663, -0.9613205790519714, 0.7768802046775818, -0.5316604375839233, -1.1669089794158936, -1.3213037252426147, 0.015432971529662609, -0.19694571197032928, 0.816418468952179, -1.6194041967391968, -0.06334216147661209, 1.174515962600708, 0.9574850797653198, -0.5822288990020752, 1.0355972051620483, 0.15924766659736633, 1.0959761142730713, 1.0091382265090942, -0.3293404281139374, 0.5201330780982971, 0.037940751761198044, -1.3801476955413818, 0.2777252793312073, 1.3672983646392822, 0.13662579655647278, 1.594710111618042, -0.4628361761569977, -0.15969765186309814, 0.3278871476650238, -0.3220447897911072, -0.5012613534927368, -0.6956030130386353, 0.5136536955833435, -0.11101027578115463, -0.9263575673103333, -0.12885461747646332, 0.018086113035678864, -0.14270783960819244, 0.12672370672225952, -1.471829891204834, 0.04253271594643593, -0.5339295268058777, -0.6835664510726929, -1.399673581123352, 0.012838221155107021, 1.322303056716919, -0.7189786434173584, -0.1730160266160965, 0.4333721101284027, 0.2318798452615738, 0.5736175775527954, 0.7236551642417908, -0.8234993815422058, -0.31017908453941345, 0.03299304470419884, -0.43074023723602295, 0.4291034936904907, 1.4213652610778809, -0.2982726991176605, -0.8496718406677246, 0.38573354482650757, -0.1799299716949463, 0.2127983272075653, 1.9657366275787354, -0.040356237441301346, -0.8740481734275818, 0.27548426389694214, -0.8617303967475891, 1.990302562713623, 1.6055998802185059, 1.3306877613067627, -0.36709731817245483, -0.6720405220985413, 0.5516355037689209, -0.5870090126991272, -0.3925110101699829, 0.8514040112495422, 0.5287380814552307, -0.26302260160446167, -1.4774761199951172, 0.7735276818275452, 1.2723838090896606, -0.7365754246711731, -0.8732390403747559, 0.12213733792304993, -0.5178099870681763, 1.1169074773788452, 0.696831464767456, 0.2646655738353729, 0.3751184642314911, 1.6780756711959839, 0.7889546155929565, -0.688448965549469, 0.5993762612342834, 0.3539383113384247, -0.18473058938980103, -2.018181085586548, -1.2548580169677734, 0.29440534114837646, -0.7053906321525574, -1.4941314458847046, 1.5010849237442017, -1.0712026357650757, -1.0966169834136963, 0.6260229349136353, 0.06354761123657227, 1.2370123863220215, 0.3422819674015045, 1.5933541059494019, 1.9013335704803467, 0.6977774500846863, 0.410600483417511, 1.0196360349655151, -0.24860896170139313, -0.3873912990093231, 1.6627382040023804, -0.5357372164726257, 0.5076513290405273, 1.1252223253250122, -0.1421024054288864, -1.1588382720947266, -0.8138543963432312, -1.3748605251312256, -0.799498438835144, 1.156335711479187, 0.19813011586666107, -0.941210150718689, 0.36499008536338806, 1.5719881057739258, -0.08177348971366882, -0.1720583587884903, 0.8020190000534058, 0.33833232522010803, -0.727594792842865, -0.021957237273454666, -1.028978943824768, 0.5981408953666687, -0.3488340675830841, -0.47372081875801086, 0.1382032185792923, 0.5909088253974915, 1.2362349033355713, 0.18169930577278137, 0.19538909196853638, 1.436097502708435, -1.2597006559371948, 1.2199523448944092, -1.0180094242095947, 0.4407657980918884, -2.334550619125366, 1.5421838760375977, -0.9165788292884827, 1.9358644485473633, -2.733191728591919, 0.6553370356559753, -0.44091248512268066, -0.48830848932266235, 0.22798636555671692, -0.23297998309135437, 0.09739641100168228, -0.1106100007891655, -1.1184567213058472, -0.047879163175821304, -0.6844562888145447, 0.3960065245628357, 1.1801304817199707, 1.251031517982483, -1.0780361890792847, 0.018612805753946304, -1.65264093875885, -0.13460886478424072, -0.5958733558654785, 0.2101694494485855, -1.8861308097839355, -0.34312546253204346, -1.9904916286468506, -2.3363101482391357, -1.128010630607605, -0.8933387398719788, 1.3182626962661743, 0.1796167641878128, -0.8025006651878357, 1.2707277536392212, -0.4455081820487976, -1.6589913368225098, 0.9972852468490601, -2.0678794384002686 ]