id
int64
599M
3.26B
number
int64
1
7.7k
title
stringlengths
1
290
body
stringlengths
0
228k
state
stringclasses
2 values
html_url
stringlengths
46
51
created_at
timestamp[s]date
2020-04-14 10:18:02
2025-07-23 08:04:53
updated_at
timestamp[s]date
2020-04-27 16:04:17
2025-07-23 18:53:44
closed_at
timestamp[s]date
2020-04-14 12:01:40
2025-07-23 16:44:42
user
dict
labels
listlengths
0
4
is_pull_request
bool
2 classes
comments
listlengths
0
0
1,190,025,878
4,083
Add SacreBLEU Metric Card
null
closed
https://github.com/huggingface/datasets/pull/4083
2022-04-01T16:24:56
2022-04-12T20:45:00
2022-04-12T20:38:40
{ "login": "emibaylor", "id": 27527747, "type": "User" }
[]
true
[]
1,189,965,845
4,082
Add chrF(++) Metric Card
null
closed
https://github.com/huggingface/datasets/pull/4082
2022-04-01T15:32:12
2022-04-12T20:43:55
2022-04-12T20:38:06
{ "login": "emibaylor", "id": 27527747, "type": "User" }
[]
true
[]
1,189,916,472
4,081
Close parquet writer properly in `push_to_hub`
We don’t call writer.close(), which causes https://github.com/huggingface/datasets/issues/4077. It can happen that we upload the file before the writer is garbage collected and writes the footer. I fixed this by explicitly closing the parquet writer. Close https://github.com/huggingface/datasets/issues/4077.
closed
https://github.com/huggingface/datasets/pull/4081
2022-04-01T14:58:50
2022-07-14T19:22:06
2022-04-01T16:16:19
{ "login": "lhoestq", "id": 42851186, "type": "User" }
[]
true
[]
1,189,667,296
4,080
NonMatchingChecksumError for downloading conll2012_ontonotesv5 dataset
## Steps to reproduce the bug ```python datasets.load_dataset("conll2012_ontonotesv5", "english_v12") ``` ## Actual results ``` Downloading builder script: 32.2kB [00:00, 9.72MB/s] Downloading metadata: 20.0kB [00:00, 10.4MB/s] Downloading and preparing dataset conll2012_ontonotesv5/english_v12 (download: 174.83 MiB, generated: 204.29 MiB, post-processed: Unknown size , total: 379.12 MiB) to ... Traceback (most recent call last): [315/390] File "/home/yisiang/lgtn/conll2012/run.py", line 86, in <module> train() File "/home/yisiang/lgtn/conll2012/run.py", line 65, in train trainer.fit(model, datamodule=dm) File "/home/yisiang/miniconda3/envs/ai/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 740, in fit self._call_and_handle_interrupt( File "/home/yisiang/miniconda3/envs/ai/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 685, in _call_and_handle_inte rrupt return trainer_fn(*args, **kwargs) File "/home/yisiang/miniconda3/envs/ai/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 777, in _fit_impl self._run(model, ckpt_path=ckpt_path) File "/home/yisiang/miniconda3/envs/ai/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 1131, in _run self._data_connector.prepare_data() File "/home/yisiang/miniconda3/envs/ai/lib/python3.9/site-packages/pytorch_lightning/trainer/connectors/data_connector.py", line 154, in pre pare_data self.trainer.datamodule.prepare_data() File "/home/yisiang/miniconda3/envs/ai/lib/python3.9/site-packages/pytorch_lightning/core/datamodule.py", line 474, in wrapped_fn fn(*args, **kwargs) File "/home/yisiang/lgtn/_abstract_task/data.py", line 43, in prepare_data raw_dsets = datasets.load_dataset(**load_dataset_kwargs) File "/home/yisiang/miniconda3/envs/ai/lib/python3.9/site-packages/datasets/load.py", line 1687, in load_dataset builder_instance.download_and_prepare( File "/home/yisiang/miniconda3/envs/ai/lib/python3.9/site-packages/datasets/builder.py", line 605, in download_and_prepare self._download_and_prepare( File "/home/yisiang/miniconda3/envs/ai/lib/python3.9/site-packages/datasets/builder.py", line 1104, in _download_and_prepare super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) File "/home/yisiang/miniconda3/envs/ai/lib/python3.9/site-packages/datasets/builder.py", line 676, in _download_and_prepare verify_checksums( File "/home/yisiang/miniconda3/envs/ai/lib/python3.9/site-packages/datasets/utils/info_utils.py", line 40, in verify_checksums raise NonMatchingChecksumError(error_msg + str(bad_urls)) datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://md-datasets-cache-zipfiles-prod.s3.eu-west-1.amazonaws.com/zmycy7t9h9-1.zip'] ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.0.0
closed
https://github.com/huggingface/datasets/issues/4080
2022-04-01T11:34:28
2022-04-01T13:59:10
2022-04-01T13:59:10
{ "login": "richarddwang", "id": 17963619, "type": "User" }
[ { "name": "duplicate", "color": "cfd3d7" }, { "name": "dataset bug", "color": "2edb81" } ]
false
[]
1,189,521,576
4,079
Increase max retries for GitHub datasets
As GitHub recurrently raises connectivity issues, this PR increases the number of max retries to request GitHub datasets, as previously done for GitHub metrics: - #4063 Note that this is a temporary solution, while we decide when and how to load GitHub datasets from the Hub: - #4059 Fix #2048 Related to: - #4051 - #3210 - #2787 - #2075 - #2036 CC: @lhoestq
closed
https://github.com/huggingface/datasets/pull/4079
2022-04-01T09:34:03
2022-04-01T15:32:40
2022-04-01T15:27:11
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,189,513,572
4,078
Fix GithubMetricModuleFactory instantiation with None download_config
Recent PR: - #4063 introduced a potential bug if `GithubMetricModuleFactory` is instantiated with None `download_config`. This PR add instantiation tests and fix that potential issue. CC: @lhoestq
closed
https://github.com/huggingface/datasets/pull/4078
2022-04-01T09:26:58
2022-04-01T14:44:51
2022-04-01T14:39:27
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,189,467,585
4,077
ArrowInvalid: Parquet magic bytes not found in footer. Either the file is corrupted or this is not a parquet file.
## Describe the bug When uploading a relatively large image dataset of > 1GB, reloading doesn't work for me, even though pushing to the hub went just fine. Basically, I do: ``` from datasets import load_dataset dataset = load_dataset("imagefolder", data_files="path_to_my_files") dataset.push_to_hub("dataset_name") # works fine, no errors reloaded_dataset = load_dataset("dataset_name") ``` and it returns: ``` /usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowInvalid: Parquet magic bytes not found in footer. Either the file is corrupted or this is not a parquet file. ``` I created a Colab notebook to reproduce my error: https://colab.research.google.com/drive/141LJCcM2XyqprPY83nIQ-Zk3BbxWeahq?usp=sharing
closed
https://github.com/huggingface/datasets/issues/4077
2022-04-01T08:49:13
2022-04-01T16:16:19
2022-04-01T16:16:19
{ "login": "NielsRogge", "id": 48327001, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,188,478,867
4,076
Add ROUGE Metric Card
Add ROUGE metric card. I've left the 'Values from popular papers' section empty for the time being because I don't know the summarization literature very well and am therefore not sure which paper(s) to pull from (note that the original rouge paper does not seem to present specific values, just correlations with human judgements). Any suggestions on which paper(s) to pull from would be helpful! :)
closed
https://github.com/huggingface/datasets/pull/4076
2022-03-31T18:34:34
2022-04-12T20:43:45
2022-04-12T20:37:38
{ "login": "emibaylor", "id": 27527747, "type": "User" }
[]
true
[]
1,188,462,162
4,075
Add CCAgT dataset
## Adding a Dataset - **Name:** CCAgT dataset: Images of Cervical Cells with AgNOR Stain Technique - **Description:** The dataset contains 2540 images (1600x1200 where each pixel is 0.111μm×0.111μm) from three different slides, having at least one nucleus per image. These images are from fields belonging to a sample cervical slide, colored with silver-stained, a method known as Argyrophilic Nucleolar Organizer Regions (AgNOR). - **Paper:** https://doi.org/10.1109/cbms49503.2020.00110 - **Data:** https://arquivos.ufsc.br/d/373be2177a33426a9e6c/ or https://drive.google.com/drive/u/4/folders/1TBpYCv6S1ydASLauSzcsvO7Wc5O-WUw0 - **Motivation:** This is a unique dataset (because of the stain), for a major health problem, cervical cancer, with real data. Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md). Hi, this is a public version of the dataset that I have been working on, soon we will have another version of this dataset. But until this new version goes out, I thought I would add this dataset here, if it makes sense for the repository. You can assign the task to me if possible
closed
https://github.com/huggingface/datasets/issues/4075
2022-03-31T18:20:28
2022-07-06T19:03:42
2022-07-06T19:03:42
{ "login": "johnnv1", "id": 20444345, "type": "User" }
[ { "name": "dataset request", "color": "e99695" }, { "name": "vision", "color": "bfdadc" } ]
false
[]
1,188,449,142
4,074
Error in google/xtreme_s dataset card
**Link:** https://huggingface.co/datasets/google/xtreme_s Not a big deal but Hungarian is considered an Eastern European language, together with Serbian, Slovak, Slovenian (all correctly categorized; Slovenia is mostly to the West of Hungary, by the way).
closed
https://github.com/huggingface/datasets/issues/4074
2022-03-31T18:07:45
2022-04-01T08:12:56
2022-04-01T08:12:56
{ "login": "wranai", "id": 1048544, "type": "User" }
[ { "name": "documentation", "color": "0075ca" }, { "name": "dataset bug", "color": "2edb81" } ]
false
[]
1,188,364,711
4,073
Create a metric card for Competition MATH
Proposing metric card for Competition MATH
closed
https://github.com/huggingface/datasets/pull/4073
2022-03-31T16:48:59
2022-04-01T19:02:39
2022-04-01T18:57:13
{ "login": "sashavor", "id": 14205986, "type": "User" }
[]
true
[]
1,188,266,410
4,072
Add installation instructions to image_process doc
This PR adds the installation instructions for the Image feature to the image process doc.
closed
https://github.com/huggingface/datasets/pull/4072
2022-03-31T15:29:37
2022-03-31T17:05:46
2022-03-31T17:00:19
{ "login": "mariosasko", "id": 47462742, "type": "User" }
[]
true
[]
1,187,587,683
4,071
Loading issue for xuyeliu/notebookCDG dataset
## Dataset viewer issue for '*xuyeliu/notebookCDG*' **Link:** *[link to the dataset viewer page](https://huggingface.co/datasets/xuyeliu/notebookCDG)* *Couldn't load the xuyeliu/notebookCDG with provided scripts: * ``` from datasets import load_dataset dataset = load_dataset("xuyeliu/notebookCDG/dataset_notebook.pkl") ``` I get an error message as follows: FileNotFoundError: Couldn't find a dataset script at /home/code_documentation/code/xuyeliu/notebookCDG/notebookCDG.py or any data file in the same directory. Couldn't find 'xuyeliu/notebookCDG' on the Hugging Face Hub either: FileNotFoundError: Unable to resolve any data file that matches ['**train*'] in dataset repository xuyeliu/notebookCDG with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip'] Am I the one who added this dataset ? No
closed
https://github.com/huggingface/datasets/issues/4071
2022-03-31T06:36:29
2022-03-31T08:17:01
2022-03-31T08:16:16
{ "login": "Jun-jie-Huang", "id": 46160972, "type": "User" }
[ { "name": "dataset bug", "color": "2edb81" } ]
false
[]
1,186,810,205
4,070
Create metric card for seqeval
Proposing metric card for seqeval. Not sure which values to report for Popular papers though.
closed
https://github.com/huggingface/datasets/pull/4070
2022-03-30T18:08:01
2022-04-01T19:02:58
2022-04-01T18:57:25
{ "login": "sashavor", "id": 14205986, "type": "User" }
[]
true
[]
1,186,790,578
4,069
Add support for metadata files to `imagefolder`
This PR adds support for metadata files to `imagefolder` to add an ability to specify image fields other than `image` and `label`, which are inferred from the directory structure in the loaded dataset. To be parsed as an image metadata file, a file should be named `"info.csv"` and should have the following structure: ``` image_id,some_col1_name,some_col2_name rel/path/to/image1.jpg,image1_col1_value,image1_col2_value rel/path/to/image2.jpg,image2_col1_value,image2_col2_value ... ``` This is how the resolution works: ``` - path/to/imagefolder/directory - info.csv - 10.jpg # referenced as 10.jpg in "info.csv" - Cat - 0.jpg # referenced as Cat/0.jpg in "info.csv" - 1.jpg # referenced as Cat/1.jpg in "info.csv" - Dog - 0.jpg # referenced as Dog/0.jpg in "info.csv" - 1.jpg # referenced as Dog/1.jpg in "info.csv" ``` Open questions: 1. IMO it makes more sense to store image metadata as JSON Lines than CSV. CSV is sufficient for textual metadata but not the best for representing bounding boxes, for instance. Also, JSON Lines is more strict, which is good in this case (CSV supports various delimiters, the header line is optional, etc., so it's easier to enforce rules on JSON Lines that it's on CSV) 2. A better name for the `image_id` column, which contains image identifiers? Maybe `image_file` or `image_filename`? 3. WDYT about making `with_metadata=True` the default behavior if the loaded repo/directory contains an `info.csv` file? An example repository: https://huggingface.co/datasets/mariosasko/PetImages. Can be loaded by installing `datasets` from the PR branch and running `load_dataset("mariosasko/PetImages", with_metadata=True)`. cc: @abhishekkrthakur (this PR should address https://huggingface.slack.com/archives/C02JB9L6JKF/p1645450017434029?thread_ts=1645157416.389499&cid=C02JB9L6JKF) TODOs: - [x] Test - [x] Metadata file nesting ``` - path/to/imagefolder/directory - info.csv - 10.jpg - Cat - info.csv # should have higher precedence in this directory than the top-level info.csv, but we choose the first "eligible" metadata file currently - 0.jpg - 1.jpg ```
closed
https://github.com/huggingface/datasets/pull/4069
2022-03-30T17:47:51
2022-05-03T12:49:00
2022-05-03T12:42:16
{ "login": "mariosasko", "id": 47462742, "type": "User" }
[]
true
[]
1,186,765,422
4,068
Improve out of bounds error message
In 1.18.4 with https://github.com/huggingface/datasets/pull/3719 we introduced an error message for users using `select` with out of bounds indices. The message ended up being confusing for some users because it mentioned negative indices, which is not the main use case. I replaced it with a message that is very similar to the one you get with you try to access a list with an out-of-range index.
closed
https://github.com/huggingface/datasets/pull/4068
2022-03-30T17:22:10
2022-03-31T08:39:08
2022-03-31T08:33:57
{ "login": "lhoestq", "id": 42851186, "type": "User" }
[]
true
[]
1,186,731,905
4,067
Update datasets task tags to align tags with models
**Requires https://github.com/huggingface/datasets/pull/4066 to be merged first** Following https://github.com/huggingface/datasets/pull/4066 we need to update many dataset tags to use the new ones. This PR takes case of this and is quite big - feel free to review only certain tags if you don't want to spend too much time on it. Note that the CI will never be green for this PR, because many dataset cards have missing tags or sections, and fixing them is out of scope of this PR (the CI on master will be green anyway)
closed
https://github.com/huggingface/datasets/pull/4067
2022-03-30T16:49:32
2022-04-13T17:37:27
2022-04-13T17:31:11
{ "login": "lhoestq", "id": 42851186, "type": "User" }
[]
true
[]
1,186,728,104
4,066
Tasks alignment with models
I updated our `tasks.json` file with the new task taxonomy that is aligned with models. The rule that defines a task is the following: **Two tasks are different if and only if the steps of their pipelines** are different, i.e. if they can’t reasonably be implemented using the same coherent code (level of granularity/complexity of the code to be defined - ideally I’d like to say “HF user’s level”) - this is the same definition in `transformers` I will update the tags of all the datasets in this repository [in another PR](https://github.com/huggingface/datasets/pull/4067) for readability. Main changes: - conditional-text-generation is split between summarization, translation, text-generation and text2text-generation - speech-processing is split into automatic-speech-recognition, audio-classification, etc. - structure-prediction is renamed token-classification - abstractive-qa now belongs to text2text-generation Here is just a simplified YAML dump of `tasks.json`: ```yaml audio-classification: - keyword-spotting - speaker-identification - speaker-intent-classification - emotion-recognition - speaker-language-identification audio-to-audio: [] automatic-speech-recognition: [] conversational: - dialogue-generation feature-extraction: [] fill-mask: - slot-filling - masked-language-modeling image-classification: - multi-label-image-classification - multi-class-image-classification image-segmentation: - instance-segmentation - semantic-segmentation - panoptic-segmentation image-to-text: - image-captioning multiple-choice: - multiple-choice-qa - multiple-choice-coreference-resolution object-detection: - face-detection - vehicle-detection question-answering: - extractive-qa - open-domain-qa - closed-domain-qa sentence-similarity: [] tabular-classification: [] tabular-to-text: - rdf-to-text summarization: - news-articles-summarization - news-articles-headline-generation table-to-text: [] table-question-answering: [] text-classification: - acceptability-classification - entity-linking-classification - fact-checking - intent-classification - multi-class-classification - multi-label-classification - natural-language-inference - semantic-similarity-classification - sentiment-classification - topic-classification - semantic-similarity-scoring - sentiment-scoring - sentiment-analysis - hate-speech-detection - text-scoring text-generation: - dialogue-modeling - language-modeling text-retrieval: - document-retrieval - utterance-retrieval - entity-linking-retrieval - fact-checking-retrieval text-to-image: [] text-to-tabular: - relation-extraction - semantic-role-labeling text-to-speech: [] text2text-generation: - text-simplification - explanation-generation - abstractive-qa - open-domain-abstractive-qa - closed-domain-qa - open-book-qa - closed-book-qa time-series-forecasting: - univariate-time-series-forecasting - multivariate-time-series-forecasting token-classification: - named-entity-recognition - part-of-speech-tagging - parsing - lemmatization - word-sense-disambiguation - coreference-resolution translation: [] visual-question-answering: [] voice-activity-detection: [] zero-shot-classification: [] zero-shot-image-classification: [] reinforcement-learning: [] other: [] ``` Feel free to comment and give suggestions, especially if you think we can also align this list with other projects cc @julien-c @osanseviero @severo @lewtun @yjernite @albertvillanova @mariosasko @polinaeterna
closed
https://github.com/huggingface/datasets/pull/4066
2022-03-30T16:45:56
2022-04-13T13:12:52
2022-04-08T12:20:00
{ "login": "lhoestq", "id": 42851186, "type": "User" }
[]
true
[]
1,186,722,478
4,065
Create metric card for METEOR
Proposing a metric card for METEOR
closed
https://github.com/huggingface/datasets/pull/4065
2022-03-30T16:40:30
2022-03-31T17:12:10
2022-03-31T17:07:50
{ "login": "sashavor", "id": 14205986, "type": "User" }
[]
true
[]
1,186,650,321
4,064
Contributing MedMCQA dataset
Adding MedMCQA dataset ( https://paperswithcode.com/dataset/medmcqa ) **Name**: MedMCQA **Description**: MedMCQA is a large-scale, Multiple-Choice Question Answering (MCQA) dataset designed to address real-world medical entrance exam questions. MedMCQA has more than 194k high-quality AIIMS & NEET PG entrance exam MCQs covering 2.4k healthcare topics and 21 medical subjects are collected with an average token length of 12.77 and high topical diversity. The dataset contains questions about the following topics: Anesthesia, Anatomy, Biochemistry, Dental, ENT, Forensic Medicine (FM), Obstetrics and Gynecology (O&G), Medicine, Microbiology, Ophthalmology, Orthopedics Pathology, Pediatrics, Pharmacology, Physiology, Psychiatry, Radiology Skin, Preventive & Social Medicine (PSM), and Surgery **Code**: https://github.com/medmcqa/medmcqa All files are at place : **a dataset script** : medmcqa.py **a dataset card with tags and information** : README.md. **a metadata file** : dataset_infos.json **a dummy-data file** : Please help to generate this file, I was facing ` raise JSONDecodeError("Extra data", s, end)` error
closed
https://github.com/huggingface/datasets/pull/4064
2022-03-30T15:42:47
2022-05-06T09:40:40
2022-05-06T08:42:56
{ "login": "monk1337", "id": 17107749, "type": "User" }
[]
true
[]
1,186,611,368
4,063
Increase max retries for GitHub metrics
As GitHub recurrently raises connectivity issues, this PR increases the number of max retries to request GitHub metrics. Related to: - #3134 Also related to: - #4059
closed
https://github.com/huggingface/datasets/pull/4063
2022-03-30T15:12:48
2022-03-31T14:42:52
2022-03-31T14:37:47
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,186,330,732
4,062
Loading mozilla-foundation/common_voice_7_0 dataset failed
## Describe the bug I wanted to load `mozilla-foundation/common_voice_7_0` dataset with `fi` language and `test` split from datasets on Colab/Kaggle notebook, but I am getting an error `JSONDecodeError: [Errno Expecting value] Not Found: 0` while loading it. The bug seems to affect other languages and splits too than just the `fi` and `test` split. ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("mozilla-foundation/common_voice_7_0", "fi", split="test", use_auth_token="YOUR TOKEN") ``` ## Expected results load `mozilla-foundation/common_voice_7_0` dataset succesfully ## Actual results ``` JSONDecodeError Traceback (most recent call last) /opt/conda/lib/python3.7/site-packages/requests/models.py in json(self, **kwargs) 909 try: --> 910 return complexjson.loads(self.text, **kwargs) 911 except JSONDecodeError as e: /opt/conda/lib/python3.7/site-packages/simplejson/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, use_decimal, **kw) 524 and not use_decimal and not kw): --> 525 return _default_decoder.decode(s) 526 if cls is None: /opt/conda/lib/python3.7/site-packages/simplejson/decoder.py in decode(self, s, _w, _PY3) 369 s = str(s, self.encoding) --> 370 obj, end = self.raw_decode(s) 371 end = _w(s, end).end() /opt/conda/lib/python3.7/site-packages/simplejson/decoder.py in raw_decode(self, s, idx, _w, _PY3) 399 idx += 3 --> 400 return self.scan_once(s, idx=_w(s, idx).end()) JSONDecodeError: Expecting value: line 1 column 1 (char 0) During handling of the above exception, another exception occurred: JSONDecodeError Traceback (most recent call last) /tmp/ipykernel_358/370980805.py in <module> 1 # load Common Voice 7.0 dataset from Huggingface with Finnish "test" split ----> 2 test_dataset = load_dataset("mozilla-foundation/common_voice_7_0", "fi", split="test", use_auth_token=True) /opt/conda/lib/python3.7/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1690 ignore_verifications=ignore_verifications, 1691 try_from_hf_gcs=try_from_hf_gcs, -> 1692 use_auth_token=use_auth_token, 1693 ) 1694 /opt/conda/lib/python3.7/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 604 if not downloaded_from_gcs: 605 self._download_and_prepare( --> 606 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 607 ) 608 # Sync info /opt/conda/lib/python3.7/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos) 1102 1103 def _download_and_prepare(self, dl_manager, verify_infos): -> 1104 super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) 1105 1106 def _get_examples_iterable_for_split(self, split_generator: SplitGenerator) -> ExamplesIterable: /opt/conda/lib/python3.7/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 670 split_dict = SplitDict(dataset_name=self.name) 671 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) --> 672 split_generators = self._split_generators(dl_manager, **split_generators_kwargs) 673 674 # Checksums verification ~/.cache/huggingface/modules/datasets_modules/datasets/mozilla-foundation--common_voice_7_0/fe20cac47c166e25b1f096ab661832e3da7cf298ed4a91dcaa1343ad972d175b/common_voice_7_0.py in _split_generators(self, dl_manager) 151 152 self._log_download(self.config.name, bundle_version, hf_auth_token) --> 153 archive = dl_manager.download(self._get_bundle_url(self.config.name, bundle_url_template)) 154 155 if self.config.version < datasets.Version("5.0.0"): ~/.cache/huggingface/modules/datasets_modules/datasets/mozilla-foundation--common_voice_7_0/fe20cac47c166e25b1f096ab661832e3da7cf298ed4a91dcaa1343ad972d175b/common_voice_7_0.py in _get_bundle_url(self, locale, url_template) 130 path = urllib.parse.quote(path.encode("utf-8"), safe="~()*!.'") 131 use_cdn = self.config.size_bytes < 20 * 1024 * 1024 * 1024 --> 132 response = requests.get(f"{_API_URL}/bucket/dataset/{path}/{use_cdn}", timeout=10.0).json() 133 return response["url"] 134 /opt/conda/lib/python3.7/site-packages/requests/models.py in json(self, **kwargs) 915 raise RequestsJSONDecodeError(e.message) 916 else: --> 917 raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) 918 919 @property JSONDecodeError: [Errno Expecting value] Not Found: 0 ``` ## Environment info - `datasets` version: 2.0.0 - Platform: Linux-5.10.90+-x86_64-with-debian-bullseye-sid - Python version: 3.7.12 - PyArrow version: 5.0.0 - Pandas version: 1.3.5
closed
https://github.com/huggingface/datasets/issues/4062
2022-03-30T11:39:41
2024-06-09T12:12:46
2022-03-31T08:18:04
{ "login": "aapot", "id": 19529125, "type": "User" }
[ { "name": "dataset bug", "color": "2edb81" } ]
false
[]
1,186,317,071
4,061
Loading cnn_dailymail dataset failed
## Describe the bug I wanted to load cnn_dailymail dataset from huggingface datasets on jupyter lab, but I am getting an error ` NotADirectoryError:[Errno20] Not a directory ` while loading it. ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset('cnn_dailymail', '3.0.0') ``` ## Expected results load `cnn_dailymail` dataset succesfully ## Actual results failed to load and get error > NotADirectoryError: [Errno 20] Not a directory ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` 1.8.0: - Platform: Ubuntu-20.04 - Python version: 3.9.10 - PyArrow version: 3.0.0
closed
https://github.com/huggingface/datasets/issues/4061
2022-03-30T11:29:02
2022-03-30T13:36:14
2022-03-30T13:36:14
{ "login": "Arij-Aladel", "id": 68355048, "type": "User" }
[ { "name": "bug", "color": "d73a4a" }, { "name": "duplicate", "color": "cfd3d7" } ]
false
[]
1,186,281,033
4,060
Deprecate canonical Multilingual Librispeech
Deprecate canonical Multilingual Librispeech in favor of [the community one](https://huggingface.co/datasets/facebook/multilingual_librispeech) which supports streaming. However, there is a problem regarding new ASR template schema: since it's changed, I guess all community datasets that use this template do not work with new version of the library, including MLS. Should we somehow notify users about that or is it possible to change this line ourselves? For MLS specifically, I cannot change the code directly as I'm not the member of the Facebook org. Hm, and the code should be change after the release, no?
closed
https://github.com/huggingface/datasets/pull/4060
2022-03-30T10:56:56
2022-04-01T12:54:05
2022-04-01T12:48:51
{ "login": "polinaeterna", "id": 16348744, "type": "User" }
[]
true
[]
1,186,149,949
4,059
Load GitHub datasets from Hub
We have recurrently had connection errors when requesting GitHub because sometimes the site is not available. This PR requests the Hub instead, once all GitHub datasets are mirrored on the Hub. Fix #2048 Related to: - #4051 - #3210 - #2787 - #2075 - #2036
closed
https://github.com/huggingface/datasets/pull/4059
2022-03-30T09:21:56
2022-09-16T12:43:26
2022-09-16T12:40:43
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,185,611,600
4,058
Updated annotations for nli_tr dataset
This PR adds annotation tags for `nli_tr` dataset so that the dataset can be searchable wrt. relevant query parameters. The annotations in this PR are based on the existing annotations of `snli` and `multi_nli` datasets as `nli_tr` is a machine-generated extension of those datasets. This PR is intended only for updating the annotation labels but a followup PR will focus on updating the missing sections in the `README.md` as well. Thanks for all your time to review it.
closed
https://github.com/huggingface/datasets/pull/4058
2022-03-29T23:46:59
2022-04-12T20:55:12
2022-04-12T10:37:22
{ "login": "e-budur", "id": 2246791, "type": "User" }
[]
true
[]
1,185,442,001
4,057
`load_dataset` consumes too much memory for audio + tar archives
## Description `load_dataset` consumes more and more memory until it's killed, even though it's made with a generator. I'm adding a loading script for a new dataset, made up of ~15s audio coming from a tar file. Tried setting `DEFAULT_WRITER_BATCH_SIZE = 1` as per the discussion in #741 but the problem persists. ## Steps to reproduce the bug Here's my implementation of `_generate_examples`: ```python class MyDatasetBuilder(datasets.GeneratorBasedBuilder): DEFAULT_WRITER_BATCH_SIZE = 1 ... def _split_generators(self, dl_manager): archive_path = dl_manager.download(_DL_URLS[self.config.name]) return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, gen_kwargs={ "audio_tarfile_path": archive_path["audio_tarfile"] }, ), ] def _generate_examples(self, audio_tarfile_path): key = 0 with tarfile.open(audio_tarfile_path, mode="r|") as audio_tarfile: for audio_tarinfo in audio_tarfile: audio_name = audio_tarinfo.name audio_file_obj = audio_tarfile.extractfile(audio_tarinfo) yield key, {"audio": {"path": audio_name, "bytes": audio_file_obj.read()}} key += 1 ``` I then try to load via `ds = load_dataset('./datasets/my_new_dataset', writer_batch_size=1)`, and memory usage grows until all 8GB of my machine are taken and process is killed (`Killed`). Also tried an untarred version of this using `os.walk` but the same happened. I created a script to confirm that one can safely go through such a generator, which runs just fine with memory <500MB at all times. ```python import tarfile def generate_examples(): audio_tarfile = tarfile.open("audios.tar", mode="r|") key = 0 for audio_tarinfo in audio_tarfile: audio_name = audio_tarinfo.name audio_file_obj = audio_tarfile.extractfile(audio_tarinfo) yield key, {"audio": {"path": audio_name, "bytes": audio_file_obj.read()}} key += 1 if __name__ == "__main__": examples = generate_examples() for example in examples: pass ``` ## Expected results Memory consumption should be similar to the non-huggingface script. ## Actual results Process is killed after consuming too much memory. ## Environment info - `datasets` version: 2.0.1.dev0 - Platform: Linux-4.19.0-20-cloud-amd64-x86_64-with-debian-10.12 - Python version: 3.7.12 - PyArrow version: 6.0.1 - Pandas version: 1.3.5
closed
https://github.com/huggingface/datasets/issues/4057
2022-03-29T21:38:55
2022-08-16T10:22:55
2022-08-16T10:22:55
{ "login": "JFCeron", "id": 50839826, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,185,155,775
4,056
Unexpected behavior of _TempDirWithCustomCleanup
## Describe the bug This is not 100% a bug in `datasets`, but behavior that surprised me and I think this could be made more robust on the `datasets`side. When using `datasets.disable_caching()`, cache files are written to a temporary directory. This directory should be based on the environment variable TMPDIR. I want to set TMPDIR at runtime using os.ENVIRON["TMPDIR"] = something, but depending on other imported modules this can fail to take effect. ## Steps to reproduce the bug `_TempDirWithCustomCleanup` relies on `tempfile` to generate a path to a temporary directory. However, `tempfile` generates the path only once. This can be a problem when trying to set TMPDIR at runtime whenever other code imports `tempfile` first and does something unexpected. For example (after too much trial and error) I found out that a different part of the code base I work with defines a class `PatchedDataCollatorForLanguageModeling(transformers.DataCollatorForLanguageModeling)` based on a `transformers` class. This import is enough to trigger `tempfile` to generate `tempfile` to generate a temporary path and leading to the wrong path being cached in `tempfile.tempdir`. ## Suggestion: I could file this also as bug with `transformers`, but I think fixing this on the datasets would be much more robust: Datasets could recompute the temporary path once (technically possible via `tempfile._get_default_tempdir` or resetting the global variable `tempfile.tmpdir` to None) before setting its own global `_TEMP_DIR_FOR_TEMP_CACHE_FILES`.
open
https://github.com/huggingface/datasets/issues/4056
2022-03-29T16:58:22
2022-03-30T15:08:04
null
{ "login": "JonasGeiping", "id": 22680696, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,184,976,292
4,055
[DO NOT MERGE] Test doc-builder
This is a test PR to ensure the changes in https://github.com/huggingface/doc-builder/pull/164 don't break anything in `datasets`
closed
https://github.com/huggingface/datasets/pull/4055
2022-03-29T14:39:02
2022-03-30T12:31:14
2022-03-30T12:25:52
{ "login": "lewtun", "id": 26859204, "type": "User" }
[]
true
[]
1,184,575,368
4,054
Support float data types in pearsonr/spearmanr metrics
Fix #4053.
closed
https://github.com/huggingface/datasets/pull/4054
2022-03-29T09:29:10
2022-03-29T14:07:59
2022-03-29T14:02:20
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,184,500,378
4,053
Modify datatype from `int32` to `float` for pearsonr, spearmanr.
**Is your feature request related to a problem? Please describe.** - Now [Pearsonr](https://github.com/huggingface/datasets/blob/master/metrics/pearsonr/pearsonr.py) and [Spearmanr](https://github.com/huggingface/datasets/blob/master/metrics/spearmanr/spearmanr.py) both get input data as 'int32'. **Describe the solution you'd like** - Considering that those metrics are widely used for the STS task(labels are in 'float' data type), it would be better to modify datatype from 'int32' to 'float' for getting exact values of similarity.
closed
https://github.com/huggingface/datasets/issues/4053
2022-03-29T08:27:41
2022-03-29T14:02:20
2022-03-29T14:02:20
{ "login": "woodywarhol9", "id": 86637320, "type": "User" }
[ { "name": "enhancement", "color": "a2eeef" } ]
false
[]
1,184,447,977
4,052
metric = metric_cls( TypeError: 'NoneType' object is not callable
Hi, friend. I meet a problem. When I run the code: `metric = load_metric('glue', 'rte')` There is a problem raising: `metric = metric_cls( TypeError: 'NoneType' object is not callable ` I don't know why. Thanks for your help!
closed
https://github.com/huggingface/datasets/issues/4052
2022-03-29T07:43:08
2022-03-29T14:06:01
2022-03-29T14:06:01
{ "login": "klyuhang9", "id": 39409233, "type": "User" }
[]
false
[]
1,184,400,179
4,051
ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/2.0.0/datasets/glue/glue.py
Hi, I meet a problem. When I run the code: `dataset = load_dataset('glue','sst2')` There is a issue raising: ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/2.0.0/datasets/glue/glue.py I don't know why; it is ok when I use Google Chrome to view this url. Thanks for your help!
closed
https://github.com/huggingface/datasets/issues/4051
2022-03-29T07:00:31
2022-05-08T07:27:32
2022-03-29T08:29:25
{ "login": "klyuhang9", "id": 39409233, "type": "User" }
[]
false
[]
1,184,346,501
4,050
Add RVL-CDIP dataset
Resolves #2762 Dataset Request : Add RVL-CDIP dataset [#2762](https://github.com/huggingface/datasets/issues/2762) This PR adds the RVL-CDIP dataset. The dataset contains Google Drive link for download and wasn't getting downloaded automatically, so I have provided manual_download_instructions. - I have added the dummy_data.zip as well. Needed inputs on how I can run the real data and the dummy data tests for datasets with manual download ? Inputs and suggestions for improvement are welcome. Thank you.
closed
https://github.com/huggingface/datasets/pull/4050
2022-03-29T06:00:02
2022-04-22T09:55:07
2022-04-21T17:15:41
{ "login": "dnaveenr", "id": 17746528, "type": "User" }
[]
true
[]
1,183,832,893
4,049
Create metric card for the Code Eval metric
Creating initial Code Eval metric card
closed
https://github.com/huggingface/datasets/pull/4049
2022-03-28T18:34:23
2022-03-29T13:38:12
2022-03-29T13:32:50
{ "login": "sashavor", "id": 14205986, "type": "User" }
[]
true
[]
1,183,804,576
4,048
Split size error on `amazon_us_reviews` / `PC_v1_00` dataset
## Describe the bug When downloading this subset as of 3-28-2022 you will encounter a split size error after the dataset is extracted. The extracted dataset has roughly ~6m rows while the split expects <1m. Upon digging a little deeper, I downloaded the raw files from `https://s3.amazonaws.com/amazon-reviews-pds/tsv/amazon_reviews_us_PC_v1_00.tsv.gz` and extracted them. A line count via `wc -l` confirms the ~6m number that we see and the data looks valid at a glance (I did not check for duplicate rows). My guess is this file has either been updated in place or there is a bug in the dataset metadata. Happy to submit a PR and fix this up if turns out to be a metadata issue but wanted to get some other :eyes: on it first. ## Steps to reproduce the bug ```python load_dataset('amazon_us_reviews', 'PC_v1_00') ``` ## Expected results Dataset is downloaded and extracted successfully. ## Actual results An split size exception is thrown. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.0.0 - Platform: Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 7.0.0 - Pandas version: 1.4.1
closed
https://github.com/huggingface/datasets/issues/4048
2022-03-28T18:12:04
2022-04-08T12:29:30
2022-04-08T12:29:30
{ "login": "trentonstrong", "id": 191985, "type": "User" }
[ { "name": "bug", "color": "d73a4a" }, { "name": "good first issue", "color": "7057ff" } ]
false
[]
1,183,789,237
4,047
Dataset.unique(column: str) -> ArrowNotImplementedError
## Describe the bug I'm trying to use `unique()` function, but it fails ## Steps to reproduce the bug 1. Get dataset 2. Call `unique` 3. Error # Sample code to reproduce the bug ```python !pip show datasets from datasets import load_dataset dataset = load_dataset('wikiann', 'en') dataset['train'].column_names dataset['train'].unique(dataset['train'].column_names[0]) ``` ## Expected results It would be nice to actually see unique items ## Actual results Error: ```python --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) [<ipython-input-10-5e0de07ed42c>](https://s0qyv2vjaji-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20220324-060046-RC00_436956229#) in <module>() 6 7 dataset['train'].column_names ----> 8 dataset['train'].unique(dataset['train'].column_names[0]) 5 frames /usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowNotImplementedError: Function unique has no kernel matching input types (array[list<item: string>]) ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.0.0 - Platform: Google Collab - Python version: 3.7.13 - PyArrow version: 6.0.1
closed
https://github.com/huggingface/datasets/issues/4047
2022-03-28T17:59:32
2022-04-01T18:24:57
2022-04-01T18:24:57
{ "login": "orkenstein", "id": 1461936, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,183,723,360
4,046
Create metric card for XNLI
Proposing a metric card for XNLI
closed
https://github.com/huggingface/datasets/pull/4046
2022-03-28T16:57:58
2022-03-29T13:32:59
2022-03-29T13:27:30
{ "login": "sashavor", "id": 14205986, "type": "User" }
[]
true
[]
1,183,661,091
4,045
Fix CLI dummy data generation
PR: - #3868 broke the CLI dummy data generation. Fix #4044.
closed
https://github.com/huggingface/datasets/pull/4045
2022-03-28T16:09:15
2022-03-31T15:04:12
2022-03-31T14:59:06
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,183,658,942
4,044
CLI dummy data generation is broken
## Describe the bug We get a TypeError when running CLI dummy data generation: ```shell datasets-cli dummy_data datasets/<your-dataset-folder> --auto_generate ``` gives: ``` File ".../huggingface/datasets/src/datasets/commands/dummy_data.py", line 361, in _autogenerate_dummy_data dataset_builder._prepare_split(split_generator) TypeError: _prepare_split() missing 1 required positional argument: 'check_duplicate_keys' ```
closed
https://github.com/huggingface/datasets/issues/4044
2022-03-28T16:07:37
2022-03-31T14:59:06
2022-03-31T14:59:06
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,183,624,475
4,043
Create metric card for CUAD
Proposing a CUAD metric card
closed
https://github.com/huggingface/datasets/pull/4043
2022-03-28T15:38:58
2022-03-29T15:20:56
2022-03-29T15:15:19
{ "login": "sashavor", "id": 14205986, "type": "User" }
[]
true
[]
1,183,599,461
4,041
Add support for IIIF in datasets
This is a feature request for support for IIIF in `datasets`. Apologies for the long issue. I have also used a different format to the usual feature request since I think that makes more sense but happy to use the standard template if preferred. ## What is [IIIF](https://iiif.io/)? IIIF (International Image Interoperability Framework) > is a set of open standards for delivering high-quality, attributed digital objects online at scale. It’s also an international community developing and implementing the IIIF APIs. IIIF is backed by a consortium of leading cultural institutions. The tl;dr is that IIIF provides various specifications for implementing useful functionality for: - Institutions to make available images for various use cases - Users to have a consistent way of interacting/requesting these images - For developers to have a common standard for developing tools for working with IIIF images that will work across all institutions that implement a particular IIIF standard (for example the image viewer for the BNF can also work for the Library of Congress if they both use IIIF). Some institutions that various levels of support IIF include: The British Library, Internet Archive, Library of Congress, Wikidata. There are also many smaller institutions that have IIIF support. An incomplete list can be found here: https://iiif.io/guides/finding_resources/ ## IIIF APIs IIIF consists of a number of APIs which could be integrated with datasets. I think the most obvious candidate for inclusion would be the [Image API](https://iiif.io/api/image/3.0/) ### IIIF Image API The Image API https://iiif.io/api/image/3.0/ is likely the most suitable first candidate for integration with datasets. The Image API offers a consistent protocol for requesting images via a URL: ```{scheme}://{server}{/prefix}/{identifier}/{region}/{size}/{rotation}/{quality}.{format}``` A concrete example of this: ```https://stacks.stanford.edu/image/iiif/hg676jb4964%2F0380_796-44/full/full/0/default.jpg``` As you can see the scheme offers a number of options that can be specified in the URL, for example, size. Using the example URL we return: ![](https://stacks.stanford.edu/image/iiif/hg676jb4964%2F0380_796-44/full/full/0/default.jpg) We can change the size to request a size of 250 by 250, this is done by changing the size from `full` to `250,250` i.e. switching the URL to `https://stacks.stanford.edu/image/iiif/hg676jb4964%2F0380_796-44/full/250,250/0/default.jpg` ![](https://stacks.stanford.edu/image/iiif/hg676jb4964%2F0380_796-44/full/250,250/0/default.jpg) We can also request the image with max width 250, max height 250 whilst maintaining the aspect ratio using `!w,h`. i.e. change the url to `https://stacks.stanford.edu/image/iiif/hg676jb4964%2F0380_796-44/full/!250,250/0/default.jpg` ![](https://stacks.stanford.edu/image/iiif/hg676jb4964%2F0380_796-44/full/!250,250/0/default.jpg) A full overview of the options for size can be found here: https://iiif.io/api/image/3.0/#42-size ## Why would/could this be useful for datasets? There are a few reasons why support for the IIIF Image API could be useful. Broadly the ability to have more control over how an image is returned from a server is useful for many ML workflows: - images can be requested in the right size, this prevents having to download/stream large images when the actual desired size is much smaller - can select a subset of an image: it is possible to select a sub-region of an image, this could be useful for example when you already have a bounding box for a subset of an image and then want to use this subset of an image for another task. For example, https://github.com/Living-with-machines/nnanno uses IIIF to request parts of a newspaper image that have been detected as 'photograph', 'illustration' etc for downstream use. - options for quality, rotation, the format can all be encoded in the URL request. These may become particularly useful when pre-training models on large image datasets where the cost of downloading images with 1600 pixel width when you actually want 240 has a larger impact. ## What could this look like in datasets? I think there are various ways in which support for IIIF could potentially be included in `datasets`. These suggestions aren't fully fleshed out but hopefully, give a sense of possible approaches that match existing `datasets` methods in their approach. ### Use through datasets scripts Loading images via URL is already supported. There are a few possible 'extras' that could be included when using IIIF. One option is to leverage the IIIF protocol in datasets scripts, i.e. the dataset script can expose the IIIF options via the dataset script: ```python ds = load_dataset("iiif_dataset", image_size="250,250", fmt="jpg") ``` This is already possible. The approach to parsing the IIIF URLs would be left to the person creating the dataset script. ### Support through dataset scripts (with some datasets support) This is similar to the above but `datasets` would offer some way of saying this is a iiif URL and then expose the options associated with IIIF images automatically. i.e. if you did something like: ```python features = {"label": ClassLabel(names=['dog','cat']), "url": datasets.IIIFURL()} ``` inside your loading script, you would automatically have exposed `size`, `fmt` etc. options when loading the dataset. ### Other possible integrations Some other possible pseudocode ways that a user could interact with IIIF URLs: The ability to cast to an `IIIFImage` feature type: ``` ds.cast_column('url', IIIFImage, download=False) ``` The ability to specify some options associated with IIIF urls. ``` ds = ds.set_iiif_options(column='url', size="250,250") ``` I think all of these would rely on having an `IIIFImage` feature type - this would be a little bit of a Frankenstein between a `string` and `datasets.Image`. I think most of the actual image behaviour would be exactly the same as `datasets.Image`, the difference would be that the underlying URL could be modified in various ways. ## prerequisite requirements There are a few pre-requisites that I can anticipate. This doesn't cover a full implementation of IIIF support which would have different requirements depending on the approach taken to implementing IIIF. Some of these features would be useful independently of adding IIIF support: ### support for handling failed images loaded via a URL (or a specific IIIFImage feature). Working with images via web requests will inevitably return the odd failed request. If these images are then requests and don't return it would be useful to have a `None` returned instead of an error. For example, when using `push_to_hub` `datasets` will try and include the image but currently fails with bad URLs. ```python from datasets import Dataset import datasets urls = ['https://stacks.stanford.edu/image/iiif/hg676jb4964%2F0380_796-44/full/!250,250/0/default.jpg']*3 urls.append("badurl.com/image.jpg") data = {"url":urls} ds = Dataset.from_dict(data) ds = ds.cast_column('url', datasets.Image()) ds[3]['url'] ``` returns a `FileNotFoundError`, for streaming large datasets of images using their URLs it could be useful to have `None` returned instead. This has implications for the actual training loop i.e. you now need to somehow skip those examples because of this it might not be desirable to support this. ### Caching support Since IIIF requests images via a URL it would be great to have a way of not requesting the images multiple times. This is tracked in https://github.com/huggingface/datasets/issues/3142 and I think this would also be very desirable to have here particularly as one of the primary use cases of IIIF may be to do unsupervised pre-training on large datasets of IIIF URLs. ### Support for Parsing IIIF URLs This gets closer to the actual implementation. Here the requirement would be some way for `datasets` to parse a URL that the users specify is an IIIF URL. An example of a Python library that does this: https://github.com/Princeton-CDH/piffle. I also have a rough version that uses `dataclasses` which I can share. ## Why it might not be worthwhile/suitable for datasets There are some reasons that this might not be worth implementing: - currently, IIIF is mainly used by cultural heritage organizations (museums, archives etc.) The adoption of IIIF in this sector has been growing but it's possible that adoption won't be extended to other industries which may also be a source of image data for training ML models. - It may end up being better to leave this to the user. It would for example be possible for someone to write map functions to change an IIIF URL to the correct size etc. Adding direct support for IIIF in datasets may potentially not be worth the trouble. - The impact of different approaches to doing image scaling can impact the downstream model's performance, see: https://twitter.com/wightmanr/status/1479528581466243073?s=20. Since different IIIF image servers may implement different approaches to resizing images this could have a downstream impact on model performance. think this is something that could be flagged to the end-user in the documentation. This probably also falls into general "gotchas" that probably aren't the `datasets` libraries' role to protect users from. Some of the requirements outlined above would be useful for images anyway. These could be implemented prior to a final decision about whether IIIF support could/should be added to datasets. ## Suggested next steps: I realise this is a long and slightly open-ended issue. I am happy to clarify/answer questions on IIIF and possible integrations. If the prerequisite requirements seem worth exploring/are better explored in their own issues let me know and I can open new issues for those.
open
https://github.com/huggingface/datasets/issues/4041
2022-03-28T15:19:25
2022-04-05T18:20:53
null
{ "login": "davanstrien", "id": 8995957, "type": "User" }
[ { "name": "enhancement", "color": "a2eeef" } ]
false
[]
1,183,468,927
4,039
Support streaming xcopa dataset
null
closed
https://github.com/huggingface/datasets/pull/4039
2022-03-28T13:45:55
2022-03-28T16:26:48
2022-03-28T16:21:46
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,183,189,827
4,038
[DO NOT MERGE] Test doc-builder with skipped installation feature
This PR is just for testing that we can build PR docs with changes made on the [`skip-install-for-real`](https://github.com/huggingface/doc-builder/tree/skip-install-for-real) branch of `doc-builder`.
closed
https://github.com/huggingface/datasets/pull/4038
2022-03-28T09:58:31
2023-09-24T10:01:05
2022-03-28T12:29:09
{ "login": "lewtun", "id": 26859204, "type": "User" }
[]
true
[]
1,183,144,486
4,037
Error while building documentation
## Describe the bug Documentation building is failing: - https://github.com/huggingface/datasets/runs/5716300989?check_suite_focus=true ``` ValueError: There was an error when converting ../datasets/docs/source/package_reference/main_classes.mdx to the MDX format. Unable to find datasets.filesystems.S3FileSystem in datasets. Make sure the path to that object is correct. ```
closed
https://github.com/huggingface/datasets/issues/4037
2022-03-28T09:22:44
2022-03-28T10:01:52
2022-03-28T10:00:48
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,183,126,893
4,036
Fix building of documentation
Documentation building is failing: - https://github.com/huggingface/datasets/runs/5716300989?check_suite_focus=true ``` ValueError: There was an error when converting ../datasets/docs/source/package_reference/main_classes.mdx to the MDX format. Unable to find datasets.filesystems.S3FileSystem in datasets. Make sure the path to that object is correct. ``` Fix #4037.
closed
https://github.com/huggingface/datasets/pull/4036
2022-03-28T09:09:12
2023-09-24T09:55:34
2022-03-28T11:13:22
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,183,067,456
4,035
Add zero_division argument to precision and recall metrics
Fix #4025.
closed
https://github.com/huggingface/datasets/pull/4035
2022-03-28T08:19:14
2022-03-28T09:53:07
2022-03-28T09:53:06
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,183,033,285
4,034
Fix null checksum in xcopa dataset
null
closed
https://github.com/huggingface/datasets/pull/4034
2022-03-28T07:48:14
2022-03-28T08:06:14
2022-03-28T08:06:14
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,182,984,445
4,033
Fix checksum error in cats_vs_dogs dataset
Recent PR updated the metadata JSON file of cats_vs_dogs dataset: - #3878 However, that new JSON file contains a None checksum. This PR fixes it. Fix #4032.
closed
https://github.com/huggingface/datasets/pull/4033
2022-03-28T07:01:25
2022-03-28T07:49:39
2022-03-28T07:44:24
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,182,595,697
4,032
can't download cats_vs_dogs dataset
## Describe the bug can't download cats_vs_dogs dataset. error: Checksums didn't match for dataset source files ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("cats_vs_dogs") ``` ## Expected results loaded successfully. ## Actual results NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://download.microsoft.com/download/3/E/1/3E1C3F21-ECDB-4869-8368-6DEBA77B919F/kagglecatsanddogs_3367a.zip'] ## Environment info fresh google colab notebook
closed
https://github.com/huggingface/datasets/issues/4032
2022-03-27T17:05:39
2022-03-28T07:44:24
2022-03-28T07:44:24
{ "login": "RRaphaell", "id": 74569835, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,182,415,124
4,031
Cannot load the dataset conll2012_ontonotesv5
## Describe the bug Cannot load the dataset conll2012_ontonotesv5 ## Steps to reproduce the bug ```python # Sample code to reproduce the bug from datasets import load_dataset dataset = load_dataset('conll2012_ontonotesv5', 'english_v4', split="test") print(dataset) ``` ## Expected results The datasets should be downloaded successfully ## Actual results raise NonMatchingChecksumError(error_msg + str(bad_urls)) datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://md-datasets-cache-zipfiles-prod.s3.eu-west-1.amazonaws.com/zmycy7t9h9-1.zip'] ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.0.0 - Platform: Linux-5.4.0-88-generic-x86_64-with-glibc2.31 - Python version: 3.9.7 - PyArrow version: 7.0.0
closed
https://github.com/huggingface/datasets/issues/4031
2022-03-27T07:38:23
2022-03-28T06:58:31
2022-03-28T06:31:18
{ "login": "cathyxl", "id": 8326473, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,182,157,056
4,030
Use a constant for the articles regex in SQuAD v2
The main reason for doing this is to be able to change the articles list if using another language, for example. It's not the most elegant solution but at least it makes the metric more extensible with no drawbacks. BTW, what could be the best way to make this more generic (i.e., SQuAD in other languages)? Maybe receive a regex as an optional param, with the current value as the default? Similarly for SQuAD v1 (can't they re-use code?).
closed
https://github.com/huggingface/datasets/pull/4030
2022-03-26T23:06:30
2022-04-12T16:30:45
2022-04-12T11:00:24
{ "login": "bryant1410", "id": 3905501, "type": "User" }
[]
true
[]
1,181,057,011
4,029
Add FAISS .range_search() method for retrieving all texts from dataset above similarity threshold
**Is your feature request related to a problem? Please describe.** I would like to retrieve all texts from a dataset, which are semantically similar to a specific input text (query), above a certain (cosine) similarity threshold. My dataset is very large (Wikipedia), so I need to use Datasets and FAISS for this. I would like to be able to repeat many different queries on the dataset quickly. **Describe the solution you'd like** dataset objects currently have the .get_nearest_examples() method for text retrieval via FAISS. But this only allows retrieving a specific number of K texts instead of everything above a specified similarity threshold. It would be great if HF Datasets would also support the FAISS method .range_search() for retrieving texts above a certain similarity threshold. see details here: https://github.com/facebookresearch/faiss/issues/1273 **Describe alternatives you've considered** I've considered using native FAISS, but doing this via HF datasets would be better. My assumption is that Dataset features like dataset streaming make it easier to work with large datasets **Additional context** The concrete use-case is: I have a large dataset (wikipedia) and I would like to retrieve all paragraphs which are similar to a query. I will use sentence-transformers for encoding the texts.
closed
https://github.com/huggingface/datasets/issues/4029
2022-03-25T17:31:33
2022-05-06T08:35:52
2022-05-06T08:35:52
{ "login": "MoritzLaurer", "id": 41862082, "type": "User" }
[ { "name": "enhancement", "color": "a2eeef" } ]
false
[]
1,181,022,675
4,028
Fix docs on audio feature installation
This PR: - Removes the explicit installation of `librosa` (this is installed with `pip install datasets[audio]` - Adds the warning for Linux users to install manually the non-Python package `libsndfile` - Explains that the installation of `torchaudio` is only necessary to support loading audio datasets containing MP3 audio files Related to #4000.
closed
https://github.com/huggingface/datasets/pull/4028
2022-03-25T16:55:11
2022-03-31T16:20:47
2022-03-31T16:15:20
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,180,991,344
4,027
ElasticSearch Indexing example: TypeError: __init__() missing 1 required positional argument: 'scheme'
## Describe the bug I am following the example in the documentation for elastic search step by step (on google colab): https://huggingface.co/docs/datasets/faiss_es#elasticsearch ``` from datasets import load_dataset squad = load_dataset('crime_and_punish', split='train[:1000]') ``` When I run the line: `squad.add_elasticsearch_index("context", host="localhost", port="9200")` I get the error: `TypeError: __init__() missing 1 required positional argument: 'scheme'` ## Expected results No error message ## Actual results ``` TypeError Traceback (most recent call last) [<ipython-input-23-9205593edef3>](https://localhost:8080/#) in <module>() 1 import elasticsearch ----> 2 squad.add_elasticsearch_index("text", host="localhost", port="9200") 6 frames [/usr/local/lib/python3.7/dist-packages/elasticsearch/_sync/client/utils.py](https://localhost:8080/#) in host_mapping_to_node_config(host) 209 options["path_prefix"] = options.pop("url_prefix") 210 --> 211 return NodeConfig(**options) # type: ignore 212 213 TypeError: __init__() missing 1 required positional argument: 'scheme' ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.0 - Platform: Linux, Google Colab - Python version: Google Colab (probably 3.7) - PyArrow version: ?
closed
https://github.com/huggingface/datasets/issues/4027
2022-03-25T16:22:28
2022-04-07T10:29:52
2022-03-28T07:58:56
{ "login": "MoritzLaurer", "id": 41862082, "type": "User" }
[ { "name": "bug", "color": "d73a4a" }, { "name": "duplicate", "color": "cfd3d7" } ]
false
[]
1,180,968,774
4,026
Support streaming xtreme dataset for bucc18 config
Support streaming xtreme dataset for bucc18 config.
closed
https://github.com/huggingface/datasets/pull/4026
2022-03-25T16:00:40
2022-03-25T16:26:50
2022-03-25T16:21:52
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,180,963,105
4,025
Missing argument in precision/recall
**Is your feature request related to a problem? Please describe.** [`sklearn.metrics.precision_score`](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.precision_score.html) accepts an argument `zero_division`, but it is not available in [precision Metric](https://github.com/huggingface/datasets/blob/master/metrics/precision/precision.py#L117) Same issue is present for Recall. **Describe the solution you'd like** Support for **kwargs or adding a new field for `zero_division`. **Describe alternatives you've considered** I could filter the warnings myself, but that is not ideal. **Additional context** I can make the requested changes if this is approved.
closed
https://github.com/huggingface/datasets/issues/4025
2022-03-25T15:55:52
2022-03-28T09:53:06
2022-03-28T09:53:06
{ "login": "Dref360", "id": 8976546, "type": "User" }
[ { "name": "enhancement", "color": "a2eeef" } ]
false
[]
1,180,951,817
4,024
Doc: image_process small tip
I've added a small tip in the `image_process` doc
closed
https://github.com/huggingface/datasets/pull/4024
2022-03-25T15:44:32
2022-03-31T15:35:35
2022-03-31T15:30:20
{ "login": "FrancescoSaverioZuppichini", "id": 15908060, "type": "User" }
[]
true
[]
1,180,840,399
4,023
Replace yahoo_answers_topics data url
I replaced the Google Drive URL of the dataset by the FastAI one, since we've had some issues with Google Drive.
closed
https://github.com/huggingface/datasets/pull/4023
2022-03-25T14:08:57
2022-03-28T10:12:56
2022-03-28T10:07:52
{ "login": "lhoestq", "id": 42851186, "type": "User" }
[]
true
[]
1,180,816,682
4,022
Replace dbpedia_14 data url
I replaced the Google Drive URL of the dataset by the FastAI one, since we've had some issues with Google Drive.
closed
https://github.com/huggingface/datasets/pull/4022
2022-03-25T13:47:21
2022-03-25T15:03:37
2022-03-25T14:58:49
{ "login": "lhoestq", "id": 42851186, "type": "User" }
[]
true
[]
1,180,805,092
4,021
Fix `map` remove_columns on empty dataset
On an empty dataset, the `remove_columns` parameter of `map` currently doesn't actually remove the columns: ```python >>> ds = datasets.load_dataset("glue", "rte") >>> ds_filtered = ds.filter(lambda x: x["label"] != -1) >>> ds_mapped = ds_filtered.map(lambda x: x, remove_columns=["label"]) >>> print(repr(ds_mapped.column_names)) { 'train': ['sentence1', 'sentence2', 'idx'], 'validation': ['sentence1', 'sentence2', 'idx'], 'test': ['sentence1', 'sentence2', 'label', 'idx'] } ``` I fixed this error and updated the tests
closed
https://github.com/huggingface/datasets/pull/4021
2022-03-25T13:36:29
2022-03-29T13:41:31
2022-03-29T13:35:44
{ "login": "lhoestq", "id": 42851186, "type": "User" }
[]
true
[]
1,180,636,754
4,020
Replace amazon_polarity data URL
I replaced the Google Drive URL of the dataset by the FastAI one, since we've had some issues with Google Drive.
closed
https://github.com/huggingface/datasets/pull/4020
2022-03-25T10:50:57
2022-03-25T15:02:36
2022-03-25T14:57:41
{ "login": "lhoestq", "id": 42851186, "type": "User" }
[]
true
[]
1,180,628,293
4,019
Make yelp_polarity streamable
It was using `dl_manager.download_and_extract` on a TAR archive, which is not supported in streaming mode. I replaced this by `dl_manager.iter_archive`
closed
https://github.com/huggingface/datasets/pull/4019
2022-03-25T10:42:51
2022-03-25T15:02:19
2022-03-25T14:57:16
{ "login": "lhoestq", "id": 42851186, "type": "User" }
[]
true
[]
1,180,622,816
4,018
Replace yelp_review_full data url
I replaced the Google Drive URL of the Yelp review dataset by the FastAI one, since we've had some issues with Google Drive. Close https://github.com/huggingface/datasets/issues/4005
closed
https://github.com/huggingface/datasets/pull/4018
2022-03-25T10:37:18
2022-03-25T15:01:02
2022-03-25T14:56:10
{ "login": "lhoestq", "id": 42851186, "type": "User" }
[]
true
[]
1,180,595,160
4,017
Support streaming scan dataset
null
closed
https://github.com/huggingface/datasets/pull/4017
2022-03-25T10:11:28
2022-03-25T12:08:55
2022-03-25T12:03:52
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,180,557,828
4,016
Support streaming blimp dataset
null
closed
https://github.com/huggingface/datasets/pull/4016
2022-03-25T09:39:10
2022-03-25T11:19:18
2022-03-25T11:14:13
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,180,510,856
4,015
Can not correctly parse the classes with imagefolder
## Describe the bug I try to load my own image dataset with imagefolder, but the parsing of classes is incorrect. ## Steps to reproduce the bug I organized my dataset (ImageNet) in the following structure: ``` - imagenet/ - train/ - n01440764/ - ILSVRC2012_val_00000293.jpg - ...... - n01695060/ - ...... - val/ - n01440764/ - n01695060/ - ...... ``` At first, I followed the instructions from the Huggingface [example](https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification#using-your-own-data) to load my data as: ``` from datasets import load_dataset data_files = {'train': 'imagenet/train', 'val': 'imagenet/val'} ds = load_dataset("nateraw/image-folder", data_files=data_files, task="image-classification") ``` but it resulted following error (I mask my personal path as <PERSONAL_PATH>): ``` FileNotFoundError: Unable to find 'https://huggingface.co/datasets/nateraw/image-folder/resolve/main/imagenet/train' at <PERSONAL_PATH>/ImageNet/https:/huggingface.co/datasets/nateraw/image-folder/resolve/main ``` Next, I followed a recent issue #3960 to load data as: ``` from datasets import load_dataset data_files = {'train': ['imagenet/train/**'], 'val': ['imagenet/val/**']} ds = load_dataset("imagefolder", data_files=data_files, task="image-classification") ``` and the data can be loaded without error as: (I copy val folder to train folder for illustration) ``` >>> ds DatasetDict({ train: Dataset({ features: ['image', 'labels'], num_rows: 50000 }) val: Dataset({ features: ['image', 'labels'], num_rows: 50000 }) }) ``` However, the parsed classes is wrong (should be 1000 classes): ``` >>> ds["train"].features {'image': Image(decode=True, id=None), 'labels': ClassLabel(num_classes=1, names=['val'], id=None)} ``` ## Expected results I expect that the "labels" in ds["train"].features should contain 1000 classes. ## Actual results The "labels" in ds["train"].features contains only 1 wrong class. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.0.0 - Platform: Ubuntu 18.04 - Python version: Python 3.7.12 - PyArrow version: 7.0.0
closed
https://github.com/huggingface/datasets/issues/4015
2022-03-25T08:51:17
2022-03-28T01:02:03
2022-03-25T09:27:56
{ "login": "YiSyuanChen", "id": 21264909, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,180,481,229
4,014
Support streaming id_clickbait dataset
null
closed
https://github.com/huggingface/datasets/pull/4014
2022-03-25T08:18:28
2022-03-25T08:58:31
2022-03-25T08:53:32
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,180,427,174
4,013
Cannot preview "hazal/Turkish-Biomedical-corpus-trM"
## Dataset viewer issue for '*hazal/Turkish-Biomedical-corpus-trM' **Link:** *https://huggingface.co/datasets/hazal/Turkish-Biomedical-corpus-trM* *I cannot see the dataset preview.* ``` Server Error Status code: 400 Exception: HTTPError Message: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/hazal/Turkish-Biomedical-corpus-trM?full=true ``` Am I the one who added this dataset ? Yes
closed
https://github.com/huggingface/datasets/issues/4013
2022-03-25T07:12:02
2022-04-04T08:05:01
2022-03-25T14:16:11
{ "login": "hazalturkmen", "id": 42860397, "type": "User" }
[]
false
[]
1,180,350,083
4,012
Rename wer to cer
wer variable changed to cer in README file
closed
https://github.com/huggingface/datasets/pull/4012
2022-03-25T05:06:05
2022-03-28T13:57:25
2022-03-28T13:57:25
{ "login": "pmgautam", "id": 28428143, "type": "User" }
[]
true
[]
1,179,885,965
4,011
Fix SQuAD v2 metric docs on `references` format
`references` it's not a list of dictionaries but a dictionary that has a list in its values.
closed
https://github.com/huggingface/datasets/pull/4011
2022-03-24T18:27:10
2023-07-11T09:35:46
2023-07-11T09:35:15
{ "login": "bryant1410", "id": 3905501, "type": "User" }
[ { "name": "transfer-to-evaluate", "color": "E3165C" } ]
true
[]
1,179,848,036
4,010
Fix None issue with Sequence of dict
`Features.encode_example` currently fails if it contains a sequence if dict like `Sequence({"subcolumn": Value("int32")})` and if `None` is passed instead of the dict. ```python File "/Users/quentinlhoest/Desktop/hf/datasets/src/datasets/features/features.py", line 1310, in encode_example return encode_nested_example(self, example) File "/Users/quentinlhoest/Desktop/hf/datasets/src/datasets/features/features.py", line 973, in encode_nested_example return {k: encode_nested_example(sub_schema, sub_obj) for k, (sub_schema, sub_obj) in zip_dict(schema, obj)} File "/Users/quentinlhoest/Desktop/hf/datasets/src/datasets/features/features.py", line 973, in <dictcomp> return {k: encode_nested_example(sub_schema, sub_obj) for k, (sub_schema, sub_obj) in zip_dict(schema, obj)} File "/Users/quentinlhoest/Desktop/hf/datasets/src/datasets/features/features.py", line 998, in encode_nested_example for k, (sub_schema, sub_objs) in zip_dict(schema.feature, obj): File "/Users/quentinlhoest/Desktop/hf/datasets/src/datasets/utils/py_utils.py", line 207, in zip_dict yield key, tuple(d[key] for d in dicts) File "/Users/quentinlhoest/Desktop/hf/datasets/src/datasets/utils/py_utils.py", line 207, in <genexpr> yield key, tuple(d[key] for d in dicts) TypeError: 'NoneType' object is not subscriptable ``` I fixed this issue and updated the tests (this case was missing in the tests)
closed
https://github.com/huggingface/datasets/pull/4010
2022-03-24T17:58:59
2022-03-28T10:13:53
2022-03-28T10:08:40
{ "login": "lhoestq", "id": 42851186, "type": "User" }
[]
true
[]
1,179,658,611
4,009
AMI load_dataset error: sndfile library not found
## Describe the bug Getting error message when loading AMI dataset. ## Steps to reproduce the bug `python3 -c "from datasets import load_dataset; print(load_dataset('ami', 'headset-single', split='validation')[0])" ` ## Expected results A clear and concise description of the expected results. ## Actual results Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/neo/.virtualenvs/hubert/lib/python3.7/site-packages/datasets/load.py", line 1707, in load_dataset use_auth_token=use_auth_token, File "/home/neo/.virtualenvs/hubert/lib/python3.7/site-packages/datasets/builder.py", line 595, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/neo/.virtualenvs/hubert/lib/python3.7/site-packages/datasets/builder.py", line 690, in _download_and_prepare ) from None OSError: Cannot find data file. Original error: sndfile library not found ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3 - Platform: Linux-4.19.0-18-cloud-amd64-x86_64-with-debian-10.11 - Python version: 3.7.3 - PyArrow version: 7.0.0
closed
https://github.com/huggingface/datasets/issues/4009
2022-03-24T15:13:38
2022-03-24T15:46:38
2022-03-24T15:17:29
{ "login": "i-am-neo", "id": 102043285, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,179,591,068
4,008
Support streaming daily_dialog dataset
null
closed
https://github.com/huggingface/datasets/pull/4008
2022-03-24T14:23:23
2022-03-24T15:29:01
2022-03-24T14:46:58
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,179,381,021
4,007
set_format does not work with multi dimension tensor
## Describe the bug set_format only transforms the last dimension of a multi-dimension list to tensor ## Steps to reproduce the bug ```python import torch from datasets import Dataset ds = Dataset.from_dict({"A": [torch.rand((2, 2))]}) # ds = Dataset.from_dict({"A": [np.random.rand(2, 2)]}) # => same result ds = ds.with_format("torch") print(ds[0]) ``` ## Expected results ``` {'A': [tensor([[0.6689, 0.1516], [0.1403, 0.5567]])]} ``` ## Actual results ``` {'A': [tensor([0.6689, 0.1516]), tensor([0.1403, 0.5567])]} ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - datasets version: 2.0.0 - Platform: Mac OSX - Python version: 3.8.12 - PyArrow version: 7.0.0
closed
https://github.com/huggingface/datasets/issues/4007
2022-03-24T11:27:43
2022-03-30T07:28:57
2022-03-24T14:39:29
{ "login": "phihung", "id": 5902432, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,179,367,195
4,006
Use audio feature in ASR task template
The AutomaticSpeechRecognition task template is outdated: it still uses the file path column as input instead of the audio column. I changed that and updated all the datasets as well as the tests. The only community dataset that will need to be updated is `facebook/multilingual_librispeech`. It has almost zero usage unfortunately (probably because users load the duplicate `multilingual_librispeech` directly instead), but it means we can update it. (this makes me think that we should deprecate `multilingual_librispeech` it and redirect users to `facebook/multilingual_librispeech`). This PR is also useful for the AudioFolder in https://github.com/huggingface/datasets/pull/3963
closed
https://github.com/huggingface/datasets/pull/4006
2022-03-24T11:15:22
2022-03-24T17:19:29
2022-03-24T16:48:02
{ "login": "lhoestq", "id": 42851186, "type": "User" }
[]
true
[]
1,179,365,663
4,005
Yelp not working
## Dataset viewer issue for '*name of the dataset*' **Link:** https://huggingface.co/datasets/yelp_review_full/viewer/yelp_review_full/train Doesn't work: ``` Server error Status code: 400 Exception: Error Message: line contains NULL ``` Am I the one who added this dataset ? No A seamingly copy of the dataset: https://huggingface.co/datasets/SetFit/yelp_review_full works . The original one: https://huggingface.co/datasets/yelp_review_full has > 20K downloads.
closed
https://github.com/huggingface/datasets/issues/4005
2022-03-24T11:14:00
2022-03-25T14:59:57
2022-03-25T14:56:10
{ "login": "patrickvonplaten", "id": 23423619, "type": "User" }
[]
false
[]
1,179,320,795
4,004
ASSIN 2 dataset: replace broken Google Drive _URLS by links on github
Closes #4003 . Fixes checksum error. Replaces Google Drive urls by the files hosted here: [Multilingual Transformer Ensembles for Portuguese Natural Language Tasks](https://github.com/ruanchaves/assin)
closed
https://github.com/huggingface/datasets/pull/4004
2022-03-24T10:37:39
2022-03-28T14:01:46
2022-03-28T13:56:39
{ "login": "ruanchaves", "id": 14352388, "type": "User" }
[]
true
[]
1,179,286,877
4,003
ASSIN2 dataset checksum bug
## Describe the bug Checksum error after trying to load the [ASSIN 2 dataset](https://huggingface.co/datasets/assin2). `NonMatchingChecksumError` triggered by calling `load_dataset("assin2")`. Similar to #3952 , #3942 , #3941 , etc. ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) [<ipython-input-13-c664a92ad5e7>](https://localhost:8080/#) in <module>() ----> 1 load_dataset('assin2') 4 frames [/usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py](https://localhost:8080/#) in verify_checksums(expected_checksums, recorded_checksums, verification_name) 38 if len(bad_urls) > 0: 39 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 40 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 41 logger.info("All the checksums matched successfully" + for_verification_name) 42 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://drive.google.com/u/0/uc?id=1Q9j1a83CuKzsHCGaNulSkNxBm7Dkn7Ln&export=download'] ``` ## Steps to reproduce the bug ```python from datasets import load_dataset load_dataset("assin2") ``` ## Expected results Load the dataset. ## Actual results The dataset won't load. ## Environment info - `datasets` version: 2.0.1.dev0 - Platform: Google Colab - Python version: 3.7.12 - PyArrow version: 6.0.1
closed
https://github.com/huggingface/datasets/issues/4003
2022-03-24T10:08:50
2022-04-27T14:14:45
2022-03-28T13:56:39
{ "login": "ruanchaves", "id": 14352388, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,179,263,787
4,002
Support streaming conll2012_ontonotesv5 dataset
Use another URL whit a single ZIP file (instead of previous one with a ZIP file inside another ZIP file).
closed
https://github.com/huggingface/datasets/pull/4002
2022-03-24T09:49:56
2022-03-24T10:53:41
2022-03-24T10:48:47
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,179,231,418
4,001
How to use generate this multitask dataset for SQUAD? I am getting a value error.
## Dataset viewer issue for 'squad_multitask*' **Link:** https://huggingface.co/datasets/vershasaxena91/squad_multitask *short description of the issue* I am trying to generate the multitask dataset for squad dataset. However, gives the error in dataset explorer as well as my local machine. I tried the command: dataset = load_dataset("vershasaxena91/squad_multitask", 'highlight_qg_format') Error: Status code: 400 Exception: TypeError Message: argument of type 'Value' is not iterable Kindly advice.
closed
https://github.com/huggingface/datasets/issues/4001
2022-03-24T09:21:51
2022-03-26T09:48:21
2022-03-26T03:35:43
{ "login": "gsk1692", "id": 1963097, "type": "User" }
[]
false
[]
1,178,844,616
4,000
load_dataset error: sndfile library not found
## Describe the bug Can't load ami dataset ## Steps to reproduce the bug ``` python3 -c "from datasets import load_dataset; print(load_dataset('ami', 'headset-single', split='validation')[0])" ``` ## Expected results ## Actual results Downloading and preparing dataset ami/headset-single (download: 10.71 GiB, generated: 49.99 MiB, post-processed: Unknown size, total: 10.76 GiB) to /home/neo/.cache/huggingface/datasets/ami/headset-single/1.6.2/2accdf810f7c0585f78f4bcfa47684fbb980e35d29ecf126e6906dbecb872d9e... AMI corpus cannot be downloaded using multi-processing. Setting number of downloaded processes `num_proc` to 1. 100%|██████████████████████████████████████████████████████| 136/136 [00:00<00:00, 36004.88it/s] 100%|█████████████████████████████████████████████████████████| 136/136 [00:01<00:00, 79.10it/s] 100%|████████████████████████████████████████████████████████| 18/18 [00:00<00:00, 25343.23it/s] 100%|█████████████████████████████████████████████████████████| 18/18 [00:00<00:00, 2874.78it/s] 100%|████████████████████████████████████████████████████████| 16/16 [00:00<00:00, 27950.38it/s] 100%|█████████████████████████████████████████████████████████| 16/16 [00:00<00:00, 2892.25it/s] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/neo/.virtualenvs/hubert/lib/python3.7/site-packages/datasets/load.py", line 1707, in load_dataset use_auth_token=use_auth_token, File "/home/neo/.virtualenvs/hubert/lib/python3.7/site-packages/datasets/builder.py", line 595, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/neo/.virtualenvs/hubert/lib/python3.7/site-packages/datasets/builder.py", line 690, in _download_and_prepare ) from None OSError: Cannot find data file. Original error: sndfile library not found ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3 - Platform: Linux-4.19.0-18-cloud-amd64-x86_64-with-debian-10.11 - Python version: 3.7.3 - PyArrow version: 7.0.0
closed
https://github.com/huggingface/datasets/issues/4000
2022-03-24T01:52:32
2022-03-25T17:53:33
2022-03-25T17:53:33
{ "login": "i-am-neo", "id": 102043285, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,178,685,280
3,999
Docs maintenance
This PR links some functions to the API reference. These functions previously only showed up in code format because the path to the actual API was incorrect.
closed
https://github.com/huggingface/datasets/pull/3999
2022-03-23T21:27:33
2022-03-30T17:01:45
2022-03-30T16:56:38
{ "login": "stevhliu", "id": 59462357, "type": "User" }
[ { "name": "documentation", "color": "0075ca" } ]
true
[]
1,178,631,986
3,998
Fix Audio.encode_example() when writing an array
Closes #3996
closed
https://github.com/huggingface/datasets/pull/3998
2022-03-23T20:32:13
2022-03-29T14:21:44
2022-03-29T14:16:13
{ "login": "polinaeterna", "id": 16348744, "type": "User" }
[]
true
[]
1,178,566,568
3,997
Sync Features dictionaries
This PR adds a wrapper to the `Features` class to keep the secondary dict, `_column_requires_decoding`, aligned with the main dict (as discussed in https://github.com/huggingface/datasets/pull/3723#discussion_r806912731). A more elegant approach would be to subclass `UserDict` and override `__setitem__` and `__delitem__`, but this PR doesn't implement it for the following reasons: * it requires replacing all occurrences of `isinstance(obj, dict)` with `isinstance(obj, Mapping)`, which is five times slower than `isinstance(obj, dict)` on my machine, in `features.py` * is a breaking change, i.e., `isinstance(Features(...), dict)` would return `False` after it * IMO, it makes sense to be consistent in the user-facing API and subclass either `dict` or `UserDict`. The problem with the latter is that it can't be used for `DatasetDict` because `DatasetDict` exposes the `data` property, which is also used by `UserDict`, so this would result in a collision.
closed
https://github.com/huggingface/datasets/pull/3997
2022-03-23T19:23:51
2022-04-13T15:52:27
2022-04-13T15:46:19
{ "login": "mariosasko", "id": 47462742, "type": "User" }
[]
true
[]
1,178,415,905
3,996
Audio.encode_example() throws an error when writing example from array
## Describe the bug When trying to do `Audio().encode_example()` with preexisting array (see [this line](https://github.com/huggingface/datasets/blob/master/src/datasets/features/audio.py#L73)), `sf.write()` throws you an error: `TypeError: No format specified and unable to get format from file extension: <_io.BytesIO object at 0x7f4218c0db30>` ## Steps to reproduce the bug ### Sample code to reproduce the bug ```python # download sample file !wget https://huggingface.co/datasets/polinaeterna/test_encode_example/resolve/main/common_voice_vi_21824030.mp3 arr, sr = librosa.load("common_voice_vi_21824030.mp3") Audio().encode_example({ "path": "common_voice_vi_21824030.mp3", "array": arr, "sampling_rate":sr }) ``` ## Expected results An encoded example (`{"bytes": b'....', "path": 'path'}`) ## Actual results ```python TypeError Traceback (most recent call last) Input In [3], in <module> 1 arr, sr = librosa.load("common_voice_vi_21824030.mp3") ----> 3 Audio().encode_example({ 4 "path": "common_voice_vi_21824030.mp3", 5 "array": arr, 6 "sampling_rate":sr 7 }) File ~/workspace/datasets/src/datasets/features/audio.py:75, in Audio.encode_example(self, value) 73 elif isinstance(value, dict) and "array" in value: 74 buffer = BytesIO() ---> 75 sf.write(buffer, value["array"], value["sampling_rate"]) 76 return {"bytes": buffer.getvalue(), "path": value.get("path")} 77 elif value.get("bytes") is not None or value.get("path") is not None: File ~/miniconda3/envs/datasets/lib/python3.8/site-packages/soundfile.py:314, in write(file, data, samplerate, subtype, endian, format, closefd) 312 else: 313 channels = data.shape[1] --> 314 with SoundFile(file, 'w', samplerate, channels, 315 subtype, endian, format, closefd) as f: 316 f.write(data) File ~/miniconda3/envs/datasets/lib/python3.8/site-packages/soundfile.py:627, in SoundFile.__init__(self, file, mode, samplerate, channels, subtype, endian, format, closefd) 625 mode_int = _check_mode(mode) 626 self._mode = mode --> 627 self._info = _create_info_struct(file, mode, samplerate, channels, 628 format, subtype, endian) 629 self._file = self._open(file, mode_int, closefd) 630 if set(mode).issuperset('r+') and self.seekable(): 631 # Move write position to 0 (like in Python file objects) File ~/miniconda3/envs/datasets/lib/python3.8/site-packages/soundfile.py:1416, in _create_info_struct(file, mode, samplerate, channels, format, subtype, endian) 1414 original_format = format 1415 if format is None: -> 1416 format = _get_format_from_filename(file, mode) 1417 assert isinstance(format, (_unicode, str)) 1418 else: File ~/miniconda3/envs/datasets/lib/python3.8/site-packages/soundfile.py:1457, in _get_format_from_filename(file, mode) 1455 pass 1456 if format.upper() not in _formats and 'r' not in mode: -> 1457 raise TypeError("No format specified and unable to get format from " 1458 "file extension: {0!r}".format(file)) 1459 return format TypeError: No format specified and unable to get format from file extension: <_io.BytesIO object at 0x7fd8daf88180> ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets master - Platform: Ubuntu 20.04 - Python version: python 3.8.12 - PyArrow version: 6.0.1 ## Solution I guess we just need to add `format` arg in [this line](https://github.com/huggingface/datasets/blob/master/src/datasets/features/audio.py#L75) like this: ```python sf.write(buffer, value["array"], value["sampling_rate"], format="wav") ``` BTW discovered this when trying to decode audio in mp3 format without torchaudio (would be useful for TensorFlow users), like this: ```python from datasets import load_dataset, Features, Audio ds = load_dataset("common_voice", "vi", split="test") ds = ds.remove_columns("audio") ds.select(range(3)) # 3 samples just for testing def load_mp3_with_librosa(example): arr, sr = librosa.load(example["path"]) example["audio"] = { "path": example["path"], "array": arr, "sampling_rate": sr } return example updated_dataset = ds.map(lambda example: load_mp3_with_librosa(example), features=Features( {"audio": Audio(decode=False)} )) ``` @lhoestq @mariosasko @albertvillanova am I right in my logic? do we agree that we can set wav as the format? 🤗
closed
https://github.com/huggingface/datasets/issues/3996
2022-03-23T17:11:47
2022-03-29T14:16:13
2022-03-29T14:16:13
{ "login": "polinaeterna", "id": 16348744, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,178,232,623
3,995
Close `PIL.Image` file handler in `Image.decode_example`
Closes the file handler of the PIL image object in `Image.decode_example` to avoid the `Too many open files` error. To pass [the image equality checks](https://app.circleci.com/pipelines/github/huggingface/datasets/10774/workflows/d56670e6-16bb-4c64-b601-a152c5acf5ed/jobs/65825) in CI, `Image.decode_example` calls `image.load()` regardless of how the image object is created (not only for the `PIL.Image.open(local_path)` case). This is needed because `load()` sets the `readonly` attribute of a `PIL.Image` object to 0 (it's 1 after `PIL.Image.open(file_like)`), and in the older PIL versions (only fixed on main), that attribute is considered in `PIL.Image.__eq__`. More info can be found here: https://github.com/python-pillow/Pillow/issues/5926. Fix #3985
closed
https://github.com/huggingface/datasets/pull/3995
2022-03-23T14:51:48
2022-03-23T18:24:52
2022-03-23T18:19:27
{ "login": "mariosasko", "id": 47462742, "type": "User" }
[]
true
[]
1,178,211,138
3,994
Change audio column from string path to Audio feature in ASR task
Will fix #3990
closed
https://github.com/huggingface/datasets/pull/3994
2022-03-23T14:34:52
2022-03-23T15:43:43
2022-03-23T15:43:43
{ "login": "polinaeterna", "id": 16348744, "type": "User" }
[]
true
[]
1,178,201,495
3,993
Streaming dataset + interleave + DataLoader hangs with multiple workers
## Describe the bug Interleaving multiple iterable datasets that use `load_dataset` on streaming mode hangs when passed to `torch.utils.data.DataLoader` with multiple workers. ## Steps to reproduce the bug ```python from datasets import interleave_datasets, load_dataset from torch.utils.data import DataLoader en_dataset = load_dataset('oscar', "unshuffled_deduplicated_en", split='train', streaming=True) fr_dataset = load_dataset('oscar', "unshuffled_deduplicated_fr", split='train', streaming=True) it_dataset = load_dataset('oscar', "unshuffled_deduplicated_it", split='train', streaming=True) de_dataset = load_dataset('oscar', "unshuffled_deduplicated_de", split='train', streaming=True) multilingual_dataset = interleave_datasets([en_dataset, fr_dataset, de_dataset, it_dataset]) multilingual_dataset = multilingual_dataset.with_format('torch') next(iter(multilingual_dataset)) # works fairly fast dataloader = DataLoader(multilingual_dataset, batch_size=8, num_workers=4) for batch in dataloader: print(len(batch)) # prints nothing after 30 min of waiting dataloader = DataLoader(multilingual_dataset, batch_size=8, num_workers=0) for batch in dataloader: print(len(batch)) # prints right away ``` ## Expected results It should be able to iterate the dataset with multiple workers. ## Actual results Prints with results with `next(iter(multilingual_dataset)) ` and `num_workers=0` but it prints nothing with `num_workers=4` or any number above 0. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.0.1.dev0 - `pytorch` version: 1.10.0+cu113 - Python version: 3.7 - PyArrow version: 6.0.1
open
https://github.com/huggingface/datasets/issues/3993
2022-03-23T14:27:29
2023-02-28T14:14:24
null
{ "login": "jpilaul", "id": 614861, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,177,946,153
3,992
Image column is not decoded in map when using with with_transform
## Describe the bug Image column is not _decoded_ in **map** when using with `with_transform` ## Steps to reproduce the bug ```python from datasets import Image, Dataset def add_C(batch): batch["C"] = batch["A"] return batch ds = Dataset.from_dict({"A": ["image.png"]}).cast_column("A", Image()) ds = ds.with_transform(lambda x: x) # <= This line causes the problem ds = ds.map(add_C, batched=True) print(ds[0]) ``` ## Expected results ``` {'C': <PIL.PngImagePlugin.PngImageFile>, ...} ``` ## Actual results ``` {'C': {'bytes': None, 'path': 'image.png'}, ...} ``` If we remove the `with_transform` line, we get the expected result. ## Environment info - `datasets` version: 2.0.0 - Platform: Mac OSX - Python version: 3.8.12 - PyArrow version: 7.0.0
closed
https://github.com/huggingface/datasets/issues/3992
2022-03-23T10:51:13
2022-12-13T16:59:06
2022-12-13T16:59:06
{ "login": "phihung", "id": 5902432, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,177,362,901
3,991
Add Lung Image Database Consortium image collection (LIDC-IDRI) dataset
## Adding a Dataset - **Name:** *Lung Image Database Consortium image collection (LIDC-IDRI)* - **Description:** *Consists of diagnostic and lung cancer screening thoracic computed tomography (CT) scans with marked-up annotated lesions. It is a web-accessible international resource for development, training, and evaluation of computer-assisted diagnostic (CAD) methods for lung cancer detection and diagnosis. Initiated by the National Cancer Institute (NCI), further advanced by the Foundation for the National Institutes of Health (FNIH), and accompanied by the Food and Drug Administration (FDA) through active participation, this public-private partnership demonstrates the success of a consortium founded on a consensus-based process.* - **Data:** *[link to the Github repository or current dataset location](https://wiki.cancerimagingarchive.net/display/Public/LIDC-IDRI)* - **Motivation:** *Key dataset in the healthcare community* Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md). FYI @osanseviero @abidlabs
open
https://github.com/huggingface/datasets/issues/3991
2022-03-22T22:16:05
2022-03-23T12:57:16
null
{ "login": "omarespejel", "id": 4755430, "type": "User" }
[ { "name": "dataset request", "color": "e99695" }, { "name": "vision", "color": "bfdadc" } ]
false
[]
1,176,976,247
3,990
Improve AutomaticSpeechRecognition task template
**Is your feature request related to a problem? Please describe.** [AutomaticSpeechRecognition task template](https://github.com/huggingface/datasets/blob/master/src/datasets/tasks/automatic_speech_recognition.py) is outdated as it uses path to audiofile as an audio column instead of a Audio feature itself (I guess it's because Audio feature didn't exist at the time this template was created). **Describe the solution you'd like** Change audio columns from string path to Audio feature.
closed
https://github.com/huggingface/datasets/issues/3990
2022-03-22T15:41:08
2022-03-23T17:12:40
2022-03-23T17:12:40
{ "login": "polinaeterna", "id": 16348744, "type": "User" }
[ { "name": "enhancement", "color": "a2eeef" } ]
false
[]
1,176,955,078
3,989
Remove old wikipedia leftovers
After updating Wikipedia dataset, remove old wikipedia leftovers from doc.
closed
https://github.com/huggingface/datasets/pull/3989
2022-03-22T15:25:46
2022-03-31T15:35:26
2022-03-31T15:30:16
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,176,858,540
3,988
More consistent references in docs
Aligns the internal references with style discussed in https://github.com/huggingface/datasets/pull/3980. cc @stevhliu
closed
https://github.com/huggingface/datasets/pull/3988
2022-03-22T14:18:41
2022-03-22T17:06:32
2022-03-22T16:50:44
{ "login": "mariosasko", "id": 47462742, "type": "User" }
[]
true
[]
1,176,481,659
3,987
Fix Faiss custom_index device
Currently, if both `custom_index` and `device` are passed to `FaissIndex`, `device` is silently ignored. This PR fixes this by raising a ValueError if both arguments are passed. Alternatively, the `custom_index` could be transferred to the target `device`.
closed
https://github.com/huggingface/datasets/pull/3987
2022-03-22T09:11:24
2022-03-24T12:18:59
2022-03-24T12:14:12
{ "login": "albertvillanova", "id": 8515462, "type": "User" }
[]
true
[]
1,176,429,565
3,986
Dataset loads indefinitely after modifying default cache path (~/.cache/huggingface)
## Describe the bug Dataset loads indefinitely after modifying cache path (~/.cache/huggingface) If none of the environment variables are set, this custom dataset loads fine ( json-based dataset with custom dataset load script) ** Update: Transformer modules faces the same issue as well during loading ## A clear and concise description of what the bug is. Issue: - Dataset loading stalls / freezes indefinitely when HF_HOME is changed to a custom directory - No error code, had to terminate the process - There are some files created in the cache directory: ``` custom_cache_dir | -- modules | -- __init__.py | -- datasets_modules | -- __init__.py | -- datasets | -- __init__.py | -- script.py (Dataset loading script) | -- script.lock ``` There's no error nor any logs thrown so I'm out of ideas of how to to debug this. The custom dataset works fine if the default ~/.cache dir is used, but unfortunately it's out of space and we do not have permissions to modify the disk. ## Steps to reproduce the bug What I've tried: - Modifying HF_HOME (https://github.com/huggingface/transformers/issues/8703) - Modifying HF_DATASETS_CACHE (https://huggingface.co/docs/datasets/v1.12.0/cache.html) - Modifying cache_dir param during runtime ```python >>> from datasets import load_dataset >>> dataset = load_dataset('test_dataset', cache_dir='/path/to/new/cache') ``` - Disabling dataset cache ```python >>> from datasets import set_caching_enabled >>> set_caching_enabled(False) ``` ## Expected results Datasets should load / cache as usual with the only exception that cache directory is different ## Actual results Any actions taken above to change the cache directory results in loading indefinitely without terminating. ## Environment info - `transformers` version: 4.18.0.dev0 - Platform: Linux-4.15.0-54-generic-x86_64-with-glibc2.10 - Python version: 3.8.8 - Huggingface_hub version: 0.4.0 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): 2.4.1 (False) - Flax version (CPU?/GPU?/TPU?): not installed (NA) - Jax version: not installed - JaxLib version: not installed - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No
open
https://github.com/huggingface/datasets/issues/3986
2022-03-22T08:23:21
2023-03-06T16:55:04
null
{ "login": "kelvinAI", "id": 10686779, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,175,982,937
3,985
[image feature] Too many files open error when image feature is returned as a path
## Describe the bug PR in context: #3967. If I load the dataset in this PR (TextVQA), and do a simple list comprehension on the dataset, I get `Too many open files error`. This is happening due to the way we are loading the image feature when a str path is returned from the `_generate_examples`. Specifically at https://github.com/huggingface/datasets/blob/508eb4ab5d52f590baa677b4f64b1cc069139f7b/src/datasets/features/image.py#L110, we are open the file handle to the image but never closing it. This in my understanding is causing the issue. ## Steps to reproduce the bug Pull the PR locally and run the following code ```python from datasets import load_dataset dataset = load_dataset("./datasets/textvqa")["train"] data = [item for item in dataset] # Error happens ``` ## Expected results List comprehension should work smoothly ## Actual results `Too many open files error` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.0.1.dev0 - Platform: macOS-12.2-arm64-arm-64bit - Python version: 3.10.0 - PyArrow version: 7.0.0 - Pandas version: 1.4.1
closed
https://github.com/huggingface/datasets/issues/3985
2022-03-21T21:54:05
2022-03-23T18:19:27
2022-03-23T18:19:27
{ "login": "apsdehal", "id": 3616806, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,175,822,117
3,984
Local and automatic tests fail
## Describe the bug Running the tests from CircleCI on a PR or locally fails, even with no changes. Tests seem to fail on `test_metric_common.py` ## Steps to reproduce the bug ```shell git clone https://huggingface/datasets.git cd datasets ``` ```python python -m pip install -e . pytest ``` ## Expected results All tests passing ## Actual results ``` tests/test_metric_common.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../.pyenv/versions/3.8.5/lib/python3.8/doctest.py:1336: in __run exec(compile(example.source, filename, "single", <doctest datasets_modules.metrics.ter.c0cfb5adedac7eb15ffa47bba6a70fabd80f3eb906ee508abf5e1906285d1155.ter.Ter[3]>:1: in <module> ??? ../datasets/src/datasets/metric.py:430: in compute output = self._compute(**inputs, **compute_kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Metric(name: "ter", features: {'predictions': Value(dtype='string', id='sequence'), 'references': Sequence(feature=Val...ences=references) >>> print(results) {'score': 0.0, 'num_edits': 0, 'ref_length': 6.5} """, stored examples: 0) predictions = ['hello there general kenobi', 'foo bar foobar'] references = [['hello there general kenobi', 'hello there !'], ['foo bar foobar', 'foo bar foobar']] normalized = False, no_punct = False, asian_support = False, case_sensitive = False def _compute( self, predictions, references, normalized: bool = False, no_punct: bool = False, asian_support: bool = False, case_sensitive: bool = False, ): references_per_prediction = len(references[0]) if any(len(refs) != references_per_prediction for refs in references): raise ValueError("Sacrebleu requires the same number of references for each prediction") transformed_references = [[refs[i] for refs in references] for i in range(references_per_prediction)] > sb_ter = TER(normalized, no_punct, asian_support, case_sensitive) E TypeError: __init__() takes 2 positional arguments but 5 were given /tmp/pytest-of-markussagen/pytest-1/cache/modules/datasets_modules/metrics/ter/c0cfb5adedac7eb15ffa47bba6a70fabd80f3eb906ee508abf5e1906285d1155/ter.py:130: TypeError ------------------------------ Captured stdout call ------------------------------- Trying: predictions = ["hello there general kenobi", "foo bar foobar"] Expecting nothing ok Trying: references = [["hello there general kenobi", "hello there !"], ["foo bar foobar", "foo bar foobar"]] Expecting nothing ok Trying: ter = datasets.load_metric("ter") Expecting nothing ok Trying: results = ter.compute(predictions=predictions, references=references) Expecting nothing ================================ warnings summary ================================= ../.pyenv/versions/3.8.5/envs/huggingface/lib/python3.8/site-packages/hdfs/config.py:15 /home/markussagen/.pyenv/versions/3.8.5/envs/huggingface/lib/python3.8/site-packages/hdfs/config.py:15: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses from imp import load_source ../datasets/src/datasets/commands/test.py:35 /home/markussagen/datasets/src/datasets/commands/test.py:35: PytestCollectionWarning: cannot collect test class 'TestCommand' because it has a __init__ constructor (from: tests/commands/test_test.py) class TestCommand(BaseDatasetsCLICommand): tests/commands/test_test.py:33 /home/markussagen/mydataset/tests/commands/test_test.py:33: PytestCollectionWarning: cannot collect test class 'TestCommandArgs' because it has a __new__ constructor (from: tests/commands/test_test.py) class TestCommandArgs: tests/test_arrow_dataset.py: 760 warnings tests/test_formatting.py: 60 warnings tests/test_search.py: 31 warnings tests/features/test_array_xd.py: 117 warnings /home/markussagen/datasets/src/datasets/formatting/formatting.py:197: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations (isinstance(x, np.ndarray) and (x.dtype == np.object or x.shape != array[0].shape)) tests/test_arrow_dataset.py: 154 warnings tests/features/test_array_xd.py: 1 warning /home/markussagen/datasets/src/datasets/formatting/formatting.py:201: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations return np.array(array, copy=False, **{**self.np_array_kwargs, "dtype": np.object}) tests/test_arrow_dataset.py: 60 warnings /home/markussagen/datasets/src/datasets/arrow_dataset.py:3105: DeprecationWarning: `np.str` is a deprecated alias for the builtin `str`. To silence this warning, use `str` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.str_` here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations elif np.issubdtype(values.dtype, np.str): tests/test_arrow_dataset.py: 138 warnings tests/test_formatting.py: 21 warnings /home/markussagen/datasets/src/datasets/formatting/tf_formatter.py:69: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations data_struct.dtype == np.object tests/test_arrow_dataset.py: 240 warnings tests/test_formatting.py: 20 warnings /home/markussagen/datasets/src/datasets/formatting/torch_formatter.py:49: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations if data_struct.dtype == np.object: # pytorch tensors cannot be instantied from an array of objects tests/test_arrow_dataset.py: 12 warnings tests/test_search.py: 2 warnings tests/features/test_array_xd.py: 6 warnings tests/features/test_image.py: 4 warnings /home/markussagen/datasets/src/datasets/features/features.py:1129: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations [0] + [len(arr) for arr in l_arr], dtype=np.object tests/test_dataset_common.py::LocalDatasetTest::test_builder_class_banking77 /tmp/pytest-of-markussagen/pytest-1/cache/modules/datasets_modules/datasets/banking77/aec0289529599d4572d76ab00c8944cb84f88410ad0c9e7da26189d31f62a55b/banking77.py:24: DeprecationWarning: invalid escape sequence \~ _CITATION = """\ tests/test_dataset_common.py::LocalDatasetTest::test_builder_class_universal_dependencies /tmp/pytest-of-markussagen/pytest-1/cache/modules/datasets_modules/datasets/universal_dependencies/065e728dfe9a8371434a6e87132c2386a6eacab1a076d3a12aa417b994e6ef7d/universal_dependencies.py:6: DeprecationWarning: invalid escape sequence \= _CITATION = """\ tests/test_filesystem.py: 105 warnings /home/markussagen/.pyenv/versions/3.8.5/envs/huggingface/lib/python3.8/site-packages/responses/__init__.py:398: DeprecationWarning: stream argument is deprecated. Use stream parameter in request directly warn( tests/test_formatting.py::FormatterTest::test_jax_formatter tests/test_formatting.py::FormatterTest::test_jax_formatter tests/test_formatting.py::FormatterTest::test_jax_formatter tests/test_formatting.py::FormatterTest::test_jax_formatter tests/test_formatting.py::FormatterTest::test_jax_formatter_np_array_kwargs tests/test_formatting.py::FormatterTest::test_jax_formatter_np_array_kwargs tests/test_formatting.py::FormatterTest::test_jax_formatter_np_array_kwargs tests/test_formatting.py::FormatterTest::test_jax_formatter_np_array_kwargs /home/markussagen/datasets/src/datasets/formatting/jax_formatter.py:57: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations if data_struct.dtype == np.object: # jax arrays cannot be instantied from an array of objects tests/test_formatting.py::FormatterTest::test_jax_formatter tests/test_formatting.py::FormatterTest::test_jax_formatter tests/test_formatting.py::FormatterTest::test_jax_formatter /home/markussagen/.pyenv/versions/3.8.5/envs/huggingface/lib/python3.8/site-packages/jax/_src/numpy/lax_numpy.py:3567: UserWarning: Explicitly requested dtype <class 'jax._src.numpy.lax_numpy.int64'> requested in array is not available, and will be truncated to dtype int32. To enable more dtypes, set the jax_enable_x64 configuration option or the JAX_ENABLE_X64 shell environment variable. See https://github.com/google/jax#current-gotchas for more. lax._check_user_dtype_supported(dtype, "array") tests/test_metric_common.py::LocalMetricTest::test_load_metric_frugalscore /home/markussagen/.pyenv/versions/3.8.5/envs/huggingface/lib/python3.8/site-packages/apscheduler/util.py:95: PytzUsageWarning: The zone attribute is specific to pytz's interface; please migrate to a new time zone provider. For more details on how to do so, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html if obj.zone == 'local': tests/test_upstream_hub.py::TestPushToHub::test_push_dataset_to_hub_custom_features _audio /home/markussagen/.pyenv/versions/3.8.5/envs/huggingface/lib/python3.8/site-packages/librosa/core/constantq.py:1059: DeprecationWarning: `np.complex` is a deprecated alias for the builtin `complex`. To silence this warning, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations dtype=np.complex, tests/features/test_array_xd.py::test_array_xd_with_none /home/markussagen/mydataset/tests/features/test_array_xd.py:338: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations assert isinstance(arr, np.ndarray) and arr.dtype == np.object and arr.shape == (3,) -- Docs: https://docs.pytest.org/en/stable/warnings.html ============================= short test summary info ============================= FAILED tests/test_metric_common.py::LocalMetricTest::test_load_metric_bleurt - I... FAILED tests/test_metric_common.py::LocalMetricTest::test_load_metric_chrf - Att... FAILED tests/test_metric_common.py::LocalMetricTest::test_load_metric_code_eval FAILED tests/test_metric_common.py::LocalMetricTest::test_load_metric_comet - Im... FAILED tests/test_metric_common.py::LocalMetricTest::test_load_metric_competition_math FAILED tests/test_metric_common.py::LocalMetricTest::test_load_metric_coval - Im... FAILED tests/test_metric_common.py::LocalMetricTest::test_load_metric_frugalscore FAILED tests/test_metric_common.py::LocalMetricTest::test_load_metric_perplexity FAILED tests/test_metric_common.py::LocalMetricTest::test_load_metric_ter - Type... ``` ## Environment info - `datasets` version: 2.0.1.dev0 - Platform: Linux-5.16.11-76051611-generic-x86_64-with-glibc2.33 - Python version: 3.8.5 - PyArrow version: 5.0.0
closed
https://github.com/huggingface/datasets/issues/3984
2022-03-21T19:07:37
2023-07-25T15:18:40
2023-07-25T15:18:40
{ "login": "MarkusSagen", "id": 20767068, "type": "User" }
[ { "name": "bug", "color": "d73a4a" } ]
false
[]
1,175,759,412
3,983
Infinitely attempting lock
I am trying to run one of the examples of the `transformers` repo, which makes use of `datasets`. Important to note is that I am trying to run this via a Databricks notebook, and all the files reside in the Databricks Filesystem (DBFS). ``` %sh python /dbfs/transformers/examples/pytorch/summarization/run_summarization.py \ --model_name_or_path t5-small \ --do_train \ --do_eval \ --dataset_name cnn_dailymail \ --dataset_config "3.0.0" \ --source_prefix "summarize: " \ --output_dir /dbfs/transformers/tmp/tst-summarization \ --per_device_train_batch_size=4 \ --per_device_eval_batch_size=4 \ --overwrite_output_dir \ --predict_with_generate \ --log_level debug \ --cache_dir /dbfs/transformers/cache ``` All goes well until acquiring a lock -- ``` 03/21/2022 17:53:19 - DEBUG - datasets.utils.filelock - Attempting to acquire lock 140386484514192 on /dbfs/transformers/cache/_dbfs_transformers_cache_cnn_dailymail_3.0.0_3.0.0_3cb851bf7cf5826e45d49db2863f627cba583cbc32342df7349dfe6c38060234.lock 03/21/2022 17:53:19 - DEBUG - datasets.utils.filelock - Lock 140386484514192 not acquired on /dbfs/transformers/cache/_dbfs_transformers_cache_cnn_dailymail_3.0.0_3.0.0_3cb851bf7cf5826e45d49db2863f627cba583cbc32342df7349dfe6c38060234.lock, waiting 0.05 seconds ... 03/21/2022 17:53:20 - DEBUG - datasets.utils.filelock - Attempting to acquire lock 140386484514192 on /dbfs/transformers/cache/_dbfs_transformers_cache_cnn_dailymail_3.0.0_3.0.0_3cb851bf7cf5826e45d49db2863f627cba583cbc32342df7349dfe6c38060234.lock 03/21/2022 17:53:20 - DEBUG - datasets.utils.filelock - Lock 140386484514192 not acquired on /dbfs/transformers/cache/_dbfs_transformers_cache_cnn_dailymail_3.0.0_3.0.0_3cb851bf7cf5826e45d49db2863f627cba583cbc32342df7349dfe6c38060234.lock, waiting 0.05 seconds ... 03/21/2022 17:53:20 - DEBUG - datasets.utils.filelock - Attempting to acquire lock 140386484514192 on /dbfs/transformers/cache/_dbfs_transformers_cache_cnn_dailymail_3.0.0_3.0.0_3cb851bf7cf5826e45d49db2863f627cba583cbc32342df7349dfe6c38060234.lock 03/21/2022 17:53:20 - DEBUG - datasets.utils.filelock - Lock 140386484514192 not acquired on /dbfs/transformers/cache/_dbfs_transformers_cache_cnn_dailymail_3.0.0_3.0.0_3cb851bf7cf5826e45d49db2863f627cba583cbc32342df7349dfe6c38060234.lock, waiting 0.05 seconds ... 03/21/2022 17:53:20 - DEBUG - datasets.utils.filelock - Attempting to acquire lock 140386484514192 on /dbfs/transformers/cache/_dbfs_transformers_cache_cnn_dailymail_3.0.0_3.0.0_3cb851bf7cf5826e45d49db2863f627cba583cbc32342df7349dfe6c38060234.lock 03/21/2022 17:53:20 - DEBUG - datasets.utils.filelock - Lock 140386484514192 not acquired on /dbfs/transformers/cache/_dbfs_transformers_cache_cnn_dailymail_3.0.0_3.0.0_3cb851bf7cf5826e45d49db2863f627cba583cbc32342df7349dfe6c38060234.lock, waiting 0.05 seconds ... 03/21/2022 17:53:20 - DEBUG - datasets.utils.filelock - Attempting to acquire lock 140386484514192 on /dbfs/transformers/cache/_dbfs_transformers_cache_cnn_dailymail_3.0.0_3.0.0_3cb851bf7cf5826e45d49db2863f627cba583cbc32342df7349dfe6c38060234.lock 03/21/2022 17:53:20 - DEBUG - datasets.utils.filelock - Lock 140386484514192 not acquired on /dbfs/transformers/cache/_dbfs_transformers_cache_cnn_dailymail_3.0.0_3.0.0_3cb851bf7cf5826e45d49db2863f627cba583cbc32342df7349dfe6c38060234.lock, waiting 0.05 seconds ... 03/21/2022 17:53:20 - DEBUG - datasets.utils.filelock - Attempting to acquire lock 140386484514192 on /dbfs/transformers/cache/_dbfs_transformers_cache_cnn_dailymail_3.0.0_3.0.0_3cb851bf7cf5826e45d49db2863f627cba583cbc32342df7349dfe6c38060234.lock 03/21/2022 17:53:20 - DEBUG - datasets.utils.filelock - Lock 140386484514192 not acquired on /dbfs/transformers/cache/_dbfs_transformers_cache_cnn_dailymail_3.0.0_3.0.0_3cb851bf7cf5826e45d49db2863f627cba583cbc32342df7349dfe6c38060234.lock, waiting 0.05 seconds ... ``` and so on. I imagine this has to do with DBFS -- is there a way to tackle this?
closed
https://github.com/huggingface/datasets/issues/3983
2022-03-21T18:11:57
2024-05-09T08:24:34
2022-05-06T16:12:18
{ "login": "jyrr", "id": 11869652, "type": "User" }
[]
false
[]
1,175,478,099
3,982
Exclude Google Drive tests of the CI
These tests make the CI spam the Google Drive API, the CI now gets banned by Google Drive very often. I think we can just skip these tests from the CI for now. In the future we could have a CI job that runs only once a day or once a week for such cases cc @albertvillanova @mariosasko @severo Close #3415 ![image](https://user-images.githubusercontent.com/42851186/159283608-fdeca1ac-b57f-4fa3-bf09-6fa5361c494f.png)
closed
https://github.com/huggingface/datasets/pull/3982
2022-03-21T14:34:16
2022-03-31T16:38:02
2022-03-21T14:51:35
{ "login": "lhoestq", "id": 42851186, "type": "User" }
[]
true
[]