id
int64
953M
3.35B
number
int64
2.72k
7.75k
title
stringlengths
1
290
state
stringclasses
2 values
created_at
timestamp[s]date
2021-07-26 12:21:17
2025-08-23 00:18:43
updated_at
timestamp[s]date
2021-07-26 13:27:59
2025-08-23 12:34:39
closed_at
timestamp[s]date
2021-07-26 13:27:59
2025-08-20 16:35:55
html_url
stringlengths
49
51
pull_request
dict
user_login
stringlengths
3
26
is_pull_request
bool
2 classes
comments
listlengths
0
30
1,139,398,442
3,729
Wrong number of examples when loading a text dataset
closed
2022-02-16T01:13:31
2022-03-15T16:16:09
2022-03-15T16:16:09
https://github.com/huggingface/datasets/issues/3729
null
kg-nlp
false
[ "Hi @kg-nlp, thanks for reporting.\r\n\r\nThat is weird... I guess we would need some sample data file where this behavior appears to reproduce the bug for further investigation... ", "ok, I found the reason why that two results are not same.\r\nthere is /u2029 in the text, the datasets will split sentence according to the /u2029,but when I use open function will not do that .\r\nso I want to know which function shell do that\r\nthanks" ]
1,139,303,614
3,728
VoxPopuli
closed
2022-02-15T23:04:55
2022-02-16T18:49:12
2022-02-16T18:49:12
https://github.com/huggingface/datasets/issues/3728
null
VictorSanh
false
[ "duplicate of https://github.com/huggingface/datasets/issues/2300" ]
1,138,979,732
3,727
Patch all module attributes in its namespace
closed
2022-02-15T17:12:27
2022-02-17T17:06:18
2022-02-17T17:06:17
https://github.com/huggingface/datasets/pull/3727
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3727", "html_url": "https://github.com/huggingface/datasets/pull/3727", "diff_url": "https://github.com/huggingface/datasets/pull/3727.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3727.patch", "merged_at": "2022-02-17T17:06:17" }
albertvillanova
true
[]
1,138,870,362
3,726
Use config pandas version in CSV dataset builder
closed
2022-02-15T15:47:49
2022-02-15T16:55:45
2022-02-15T16:55:44
https://github.com/huggingface/datasets/pull/3726
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3726", "html_url": "https://github.com/huggingface/datasets/pull/3726", "diff_url": "https://github.com/huggingface/datasets/pull/3726.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3726.patch", "merged_at": "2022-02-15T16:55:44" }
albertvillanova
true
[]
1,138,835,625
3,725
Pin pandas to avoid bug in streaming mode
closed
2022-02-15T15:21:00
2022-02-15T15:52:38
2022-02-15T15:52:37
https://github.com/huggingface/datasets/pull/3725
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3725", "html_url": "https://github.com/huggingface/datasets/pull/3725", "diff_url": "https://github.com/huggingface/datasets/pull/3725.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3725.patch", "merged_at": "2022-02-15T15:52:37" }
albertvillanova
true
[]
1,138,827,681
3,724
Bug while streaming CSV dataset with pandas 1.4
closed
2022-02-15T15:16:19
2022-02-15T16:55:44
2022-02-15T16:55:44
https://github.com/huggingface/datasets/issues/3724
null
albertvillanova
false
[]
1,138,789,493
3,723
Fix flatten of complex feature types
closed
2022-02-15T14:45:33
2022-03-18T17:32:26
2022-03-18T17:28:14
https://github.com/huggingface/datasets/pull/3723
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3723", "html_url": "https://github.com/huggingface/datasets/pull/3723", "diff_url": "https://github.com/huggingface/datasets/pull/3723.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3723.patch", "merged_at": "2022-03-18T17:28:13" }
mariosasko
true
[ "Apparently the merge brought back some tests that use `flatten_()` that we removed recently", "_The documentation is not available anymore as the PR was closed or merged._" ]
1,138,770,211
3,722
added electricity load diagram dataset
closed
2022-02-15T14:29:29
2022-02-16T18:53:21
2022-02-16T18:48:07
https://github.com/huggingface/datasets/pull/3722
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3722", "html_url": "https://github.com/huggingface/datasets/pull/3722", "diff_url": "https://github.com/huggingface/datasets/pull/3722.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3722.patch", "merged_at": "2022-02-16T18:48:07" }
kashif
true
[]
1,137,617,108
3,721
Multi-GPU support for `FaissIndex`
closed
2022-02-14T17:26:51
2022-03-07T16:28:57
2022-03-07T16:28:56
https://github.com/huggingface/datasets/pull/3721
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3721", "html_url": "https://github.com/huggingface/datasets/pull/3721", "diff_url": "https://github.com/huggingface/datasets/pull/3721.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3721.patch", "merged_at": "2022-03-07T16:28:56" }
rentruewang
true
[ "Any love?", "Hi, any update?", "@albertvillanova Sorry for bothering you again, quick follow up: is there anything else you want me to add / modify?", "Hi @rentruewang , we updated the documentation on `master`, could you merge `master` into your branch please ?", "@lhoestq I've merge `huggingface/datasets/master` into this PR. Please review. Thanks! 🤗\r\n\r\nEdit: Umm... I was experimenting with what renaming a branch would do to a pull request. Please ignore the `closed this PR` down below. 🤗" ]
1,137,537,080
3,720
Builder Configuration Update Required on Common Voice Dataset
closed
2022-02-14T16:21:41
2024-04-28T18:03:08
2024-04-28T18:03:08
https://github.com/huggingface/datasets/issues/3720
null
aasem
false
[ "Hi @aasem, thanks for reporting.\r\n\r\nPlease note that currently Commom Voice is hosted on our Hub as a community dataset by the Mozilla Foundation. See all Common Voice versions here: https://huggingface.co/mozilla-foundation\r\n\r\nMaybe we should add an explaining note in our \"legacy\" Common Voice canonical script? What do you think @lhoestq @mariosasko ?", "Thank you, @albertvillanova, for the quick response. I am not sure about the exact flow but I guess adding the following lines under the `_Languages` dictionary definition in [common_voice.py](https://github.com/huggingface/datasets/blob/master/datasets/common_voice/common_voice.py) might resolve the issue. I guess the dataset is recently made available so the file needs updating.\r\n\r\n```\r\n\"ur\": {\r\n \"Language\": \"Urdu\",\r\n \"Date\": \"2022-01-19\",\r\n \"Size\": \"68 MB\",\r\n \"Version\": \"ur_3h_2022-01-19\",\r\n \"Validated_Hr_Total\": 1,\r\n \"Overall_Hr_Total\": 3,\r\n \"Number_Of_Voice\": 48,\r\n },\r\n```\r\n", "@aasem for compliance reasons, we are no longer updating the `common_voice.py` script.\r\n\r\nWe agreed with Mozilla Foundation to use their community datasets instead, which will ask you to accept their terms of use:\r\n```\r\nYou need to share your contact information to access this dataset.\r\n\r\nThis repository is publicly accessible, but you have to register to access its content — don't worry, it's just one click!\r\n\r\nBy clicking on “Access repository” below, you accept that your contact information (email address and username) can be shared with the repository authors. This will let the authors get in touch for instance if some parts of the repository's contents need to be taken down for licensing reasons.\r\n\r\nBy clicking on “Access repository” below, you also agree to not attempt to determine the identity of speakers in the Common Voice dataset.\r\n\r\nYou will immediately be granted access to the contents of the dataset. \r\n```\r\n\r\nIn order to use e.g. their Common Voice dataset version 8.0, please:\r\n- First visit their dataset page: https://huggingface.co/datasets/mozilla-foundation/common_voice_8_0\r\n- Accept their term of use by clicking \"Access repository\"\r\n- You can then load their dataset with:\r\n ```python\r\n load_dataset(\"mozilla-foundation/common_voice_8_0\", \"ur\", split=\"train+validation\")\r\n ```", "@albertvillanova \r\n>Maybe we should add an explaining note in our \"legacy\" Common Voice canonical script?\r\n\r\nYes, I agree we should have a deprecation notice in the canonical script to redirect users to the new script.", "@albertvillanova, \r\nI now get the following error after downloading my access token from the huggingface and passing it to `load_dataset` call:\r\n\r\n`AttributeError: 'DownloadManager' object has no attribute 'download_config'`\r\n\r\nAny quick pointer on how it might be resolved?", "@aasem What version of `datasets` are you using? We renamed that attribute from `_download_config` to `download_conig` fairly recently, so updating to the newest version should resolve the issue:\r\n```\r\npip install -U datasets\r\n```", "Thanks a lot, @mariosasko. That completely resolved the issue. " ]
1,137,237,622
3,719
Check if indices values in `Dataset.select` are within bounds
closed
2022-02-14T12:31:41
2022-02-14T19:19:22
2022-02-14T19:19:22
https://github.com/huggingface/datasets/pull/3719
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3719", "html_url": "https://github.com/huggingface/datasets/pull/3719", "diff_url": "https://github.com/huggingface/datasets/pull/3719.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3719.patch", "merged_at": "2022-02-14T19:19:21" }
mariosasko
true
[]
1,137,196,388
3,718
Fix Evidence Infer Treatment dataset
closed
2022-02-14T11:58:07
2022-02-14T13:21:45
2022-02-14T13:21:44
https://github.com/huggingface/datasets/pull/3718
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3718", "html_url": "https://github.com/huggingface/datasets/pull/3718", "diff_url": "https://github.com/huggingface/datasets/pull/3718.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3718.patch", "merged_at": "2022-02-14T13:21:43" }
albertvillanova
true
[]
1,137,183,015
3,717
wrong condition in `Features ClassLabel encode_example`
closed
2022-02-14T11:44:35
2022-02-14T15:09:36
2022-02-14T15:07:43
https://github.com/huggingface/datasets/issues/3717
null
Tudyx
false
[ "Hi @Tudyx, \r\n\r\nPlease note that in Python, the boolean NOT operator (`not`) has lower precedence than comparison operators (`<=`, `<`), thus the expression you mention is equivalent to:\r\n```python\r\n not (-1 <= example_data < self.num_classes)\r\n```\r\n\r\nAlso note that as expected, the exception is raised if:\r\n- `example_data < -1`\r\n- or `example_data >= self.num_classes`\r\n\r\nThe raise of the exception is expected when `example_data` equals 4 and `self.num_classes` equals 4 too." ]
1,136,831,092
3,716
`FaissIndex` to support multiple GPU and `custom_index`
closed
2022-02-14T06:21:43
2022-03-07T16:28:56
2022-03-07T16:28:56
https://github.com/huggingface/datasets/issues/3716
null
rentruewang
false
[ "Hi @rentruewang, thansk for reporting and for your PR!!! We should definitely support this. ", "@albertvillanova Great! :)" ]
1,136,107,879
3,715
Fix bugs in msr_sqa dataset
closed
2022-02-13T16:37:30
2022-10-03T09:10:02
2022-10-03T09:08:06
https://github.com/huggingface/datasets/pull/3715
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3715", "html_url": "https://github.com/huggingface/datasets/pull/3715", "diff_url": "https://github.com/huggingface/datasets/pull/3715.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3715.patch", "merged_at": "2022-10-03T09:08:06" }
Timothyxxx
true
[ "It shows below when I run test:\r\n\r\nFAILED tests/test_dataset_common.py::LocalDatasetTest::test_load_dataset_all_configs_msr_sqa - ValueError: Unknown split \"validation\". Should be one of ['train', 'test'].\r\n\r\nIt make no sense for me😂. \r\n", "@albertvillanova Does this PR has some additional fixes compared to https://github.com/huggingface/datasets/pull/3771 or we can close it?", "@mariosasko besides the fix of the DuplicatedKeysError, this PR:\r\n- changes the reading of one of the files: use pandas instead of splitting by comma\r\n- changes the splits: modifying train and adding validation\r\n- adds some extra logic in the processing of the data: adding a new field \"question_and_history\"\r\n\r\nWe should decide whether validating these additional changes.\r\n- for example, if we accept as pertinent the addition of the field \"question_and_history\", this should be added as feature to the info, and the matadata should be regenerated...", "Hi guys, anything we can do to fix that bug👀? @mariosasko @albertvillanova @lhoestq ", "_The documentation is not available anymore as the PR was closed or merged._" ]
1,136,105,530
3,714
tatoeba_mt: File not found error and key error
closed
2022-02-13T16:35:45
2022-02-13T20:44:04
2022-02-13T20:44:04
https://github.com/huggingface/datasets/issues/3714
null
jorgtied
false
[ "Looks like I solved my problems ..." ]
1,135,692,572
3,713
Rm sphinx doc
closed
2022-02-13T11:26:31
2022-02-17T10:18:46
2022-02-17T10:12:09
https://github.com/huggingface/datasets/pull/3713
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3713", "html_url": "https://github.com/huggingface/datasets/pull/3713", "diff_url": "https://github.com/huggingface/datasets/pull/3713.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3713.patch", "merged_at": null }
mishig25
true
[ "Thanks for pushing this :)\r\nOne minor comment regarding the PR itself - I noticed that some changes are coming from the upstream master, this might be due to a rebase. Would be nice if this PR doesn't include them for readabily, feel free to open a new one if necessary", "Closing in favour https://github.com/huggingface/datasets/pull/3741" ]
1,134,252,505
3,712
Fix the error of msr_sqa dataset
closed
2022-02-12T16:27:54
2022-02-13T11:21:05
2022-02-13T11:21:05
https://github.com/huggingface/datasets/pull/3712
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3712", "html_url": "https://github.com/huggingface/datasets/pull/3712", "diff_url": "https://github.com/huggingface/datasets/pull/3712.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3712.patch", "merged_at": null }
Timothyxxx
true
[]
1,134,050,545
3,711
Fix the error of _load_table_data function in msr_sqa dataset
closed
2022-02-12T13:20:53
2022-02-12T13:30:43
2022-02-12T13:30:43
https://github.com/huggingface/datasets/pull/3711
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3711", "html_url": "https://github.com/huggingface/datasets/pull/3711", "diff_url": "https://github.com/huggingface/datasets/pull/3711.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3711.patch", "merged_at": null }
Timothyxxx
true
[]
1,133,955,393
3,710
Fix CI code quality issue
closed
2022-02-12T12:05:39
2022-02-12T12:58:05
2022-02-12T12:58:04
https://github.com/huggingface/datasets/pull/3710
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3710", "html_url": "https://github.com/huggingface/datasets/pull/3710", "diff_url": "https://github.com/huggingface/datasets/pull/3710.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3710.patch", "merged_at": "2022-02-12T12:58:04" }
albertvillanova
true
[]
1,132,997,904
3,709
Set base path to hub url for canonical datasets
closed
2022-02-11T19:23:20
2022-02-16T14:02:28
2022-02-16T14:02:27
https://github.com/huggingface/datasets/pull/3709
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3709", "html_url": "https://github.com/huggingface/datasets/pull/3709", "diff_url": "https://github.com/huggingface/datasets/pull/3709.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3709.patch", "merged_at": "2022-02-16T14:02:27" }
lhoestq
true
[ "If we agree to have data files in a dedicated directory \"data/\" then we should be fine. You're right we should not try to edit a dataset script from the repository directly, but from github, in order to avoid conflicts" ]
1,132,968,402
3,708
Loading JSON gets stuck with many workers/threads
open
2022-02-11T18:50:48
2023-06-16T11:24:12
null
https://github.com/huggingface/datasets/issues/3708
null
lvwerra
false
[ "Hi ! Note that it does `block_size *= 2` until `block_size > len(batch)`, so it doesn't loop indefinitely. What do you mean by \"get stuck indefinitely\" then ? Is this the actual call to `paj.read_json` that hangs ?\r\n\r\n> increasing the `chunksize` argument decreases the chance of getting stuck\r\n\r\nCould you share the values of chunksize that you're using to observe this ? And maybe the order of magnitude of number of bytes per line of JSON ?", "To clarify, I don't think it loops indefinitely but the `paj.read_json` gets stuck after the first try. That's why I think it could be an issue with a lock somewhere. \r\n\r\nUsing `load_dataset(..., chunksize=40<<20)` worked without errors.", "@lhoestq I encountered another related issue. I use load_dataset() for my json data and set_transform() for preprocessing. But it hangs at the end of the epoch if `dataloader_num_workers>=1`. It appears to be working fine with num_worker=0, but it's slow.\r\n```\r\ntrain_dataset = datasets.load_dataset(\"json\", \r\n data_files=corpus_jsonl_path,\r\n keep_in_memory=False,\r\n cache_dir=model_args.cache_dir,\r\n streaming=False)\r\ntrain_dataset.set_transform(psg_parse_fn)\r\n```\r\n", "I couldn't I think your problem is unrelated to this issue @memray\r\nIndeed this issue discusses a bug when doing `load_dataset`, while your case has to do with the dataloader in a multiprocessing setup. Can you open a new issue and provide more details (share your env and what psg_parse_fn does) ?", "I also encountered a similar issue when loading a 190GB dataset of jsonl files (255 files with less than 1Gb) where it got stuck for over 20h at tables generation (fig below), increasing the `chunksize` with `load_dataset(..., chunksize=40<<20)` fixed the issue\r\n\r\n<img width=\"560\" alt=\"image\" src=\"https://user-images.githubusercontent.com/44069155/195605603-548a106e-7ad3-4269-8cdd-2ad3e975bf16.png\">\r\n", "> @lhoestq I encountered another related issue. I use load_dataset() for my json data and set_transform() for preprocessing. But it hangs at the end of the epoch if `dataloader_num_workers>=1`. It appears to be working fine with num_worker=0, but it's slow.\r\n> \r\n> ```\r\n> train_dataset = datasets.load_dataset(\"json\", \r\n> data_files=corpus_jsonl_path,\r\n> keep_in_memory=False,\r\n> cache_dir=model_args.cache_dir,\r\n> streaming=False)\r\n> train_dataset.set_transform(psg_parse_fn)\r\n> ```\r\n\r\nIn case people also get this problem, I found a way to fix it by adding `persistent_workers=True` when initializing DataLoader, like:\r\n`train_loader = DataLoader(\r\n train_dataset,\r\n batch_size=self._train_batch_size,\r\n sampler=train_sampler,\r\n collate_fn=data_collator,\r\n num_workers=self.args.dataloader_num_workers,\r\n persistent_workers=True\r\n )`\r\n\r\nThe error was `CUDA error: initialization error Exception raised from insert_events at ../c10/cuda/CUDACachingAllocator.cpp:1266` after the 1st epoch, I guess it's because the data_loader worker is killed after each epoch and the data supply is cut off. This error only occurs when num_workers>1.\r\n\r\n\r\n", "I can confirm the issue using datasets (2.12.0) with the following code and Accelerate (0.20.3) env:\r\n\r\n````\r\ntrainDataloader = DataLoader(trainSplit, batch_size=args.train_batch_size, shuffle=True)\r\nevalDataloader = DataLoader(validSplit, batch_size=args.valid_batch_size) // Here is where it gets stuck.\r\n````\r\n````\r\n- `Accelerate` version: 0.20.3\r\n- Platform: Linux-5.4.0-150-generic-x86_64-with-glibc2.29\r\n- Python version: 3.8.10\r\n- Numpy version: 1.24.3\r\n- PyTorch version (GPU?): 2.0.1+cu117 (True)\r\n- PyTorch XPU available: False\r\n- System RAM: 503.28 GB\r\n- GPU type: Tesla V100-SXM2-32GB\r\n- `Accelerate` default config:\r\n\t- compute_environment: LOCAL_MACHINE\r\n\t- distributed_type: MULTI_GPU\r\n\t- mixed_precision: fp16\r\n\t- use_cpu: False\r\n\t- num_processes: 2\r\n\t- machine_rank: 0\r\n\t- num_machines: 1\r\n\t- gpu_ids: 0,1\r\n\t- rdzv_backend: static\r\n\t- same_network: True\r\n\t- main_training_function: main\r\n\t- downcast_bf16: no\r\n\t- tpu_use_cluster: False\r\n\t- tpu_use_sudo: False\r\n\t- tpu_env: []\r\n````\r\n\r\nNotable that with Accelerate configured for one GPU only, **it doesn't get stuck.** \r\n\r\nThe suggestion made by @memray worked in my case. This is how it was applied: \r\n````\r\ntrainDataloader = DataLoader(trainSplit, batch_size=args.train_batch_size, shuffle=True, num_workers=2, persistent_workers=True)\r\nevalDataloader = DataLoader(validSplit, batch_size=args.valid_batch_size, num_workers=2, persistent_workers=True)\r\n````\r\n", "I think your issue is related to `accelerate`, feel free to open an issue there: https://github.com/huggingface/accelerate/issues\r\n\r\n`Dataset` objects generally work fine with the torch DataLoader, idk what `accelerate` does that could make it get stuck." ]
1,132,741,903
3,707
`.select`: unexpected behavior with `indices`
closed
2022-02-11T15:20:01
2022-02-14T19:19:21
2022-02-14T19:19:21
https://github.com/huggingface/datasets/issues/3707
null
gabegma
false
[ "Hi! Currently, we compute the final index as `index % len(dset)`. I agree this behavior is somewhat unexpected and that it would be more appropriate to raise an error instead (this is what `df.iloc` in Pandas does, for instance).\r\n\r\n@albertvillanova @lhoestq wdyt?", "I agree. I think `index % len(dset)` was used to support negative indices.\r\n\r\nI think this needs to be fixed in `datasets.formatting.formatting._check_valid_index_key` if I'm not mistaken" ]
1,132,218,874
3,706
Unable to load dataset 'big_patent'
closed
2022-02-11T09:48:34
2022-02-14T15:26:03
2022-02-14T15:26:03
https://github.com/huggingface/datasets/issues/3706
null
ankitk2109
false
[ "Hi @ankitk2109,\r\n\r\nHave you tried passing the split name with the keyword `split=`? See e.g. an example in our Quick Start docs: https://huggingface.co/docs/datasets/quickstart.html#load-the-dataset-and-model\r\n```python\r\n ds = load_dataset(\"big_patent\", \"d\", split=\"validation\")", "Hi @albertvillanova,\r\n\r\nThanks for your response.\r\n\r\nYes, I tried the `split='validation'` as well. But getting the same issue. ", "I'm sorry, but I can't reproduce your problem:\r\n```python\r\nIn [5]: ds = load_dataset(\"big_patent\", \"d\", split=\"validation\")\r\nDownloading and preparing dataset big_patent/d (download: 6.01 GiB, generated: 169.61 MiB, post-processed: Unknown size, total: 6.17 GiB) to .../.cache/big_patent/d/1.0.0/bdefa7c0b39fba8bba1c6331b70b738e30d63c8ad4567f983ce315a5fef6131c...\r\nDownloading data: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.45G/6.45G [27:36<00:00, 3.89MB/s]\r\nExtracting data files: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [03:18<00:00, 66.08s/it]\r\nDataset big_patent downloaded and prepared to .../.cache/big_patent/d/1.0.0/bdefa7c0b39fba8bba1c6331b70b738e30d63c8ad4567f983ce315a5fef6131c. Subsequent calls will reuse this data. \r\n\r\nIn [6]: ds\r\nOut[6]: \r\nDataset({\r\n features: ['description', 'abstract'],\r\n num_rows: 565\r\n})\r\n", "Maybe you had a connection issue while downloading the file and this was corrupted?\r\nOur cache system uses the file you downloaded first time.\r\nIf so, you could try forcing redownload of the file with:\r\n```python\r\nds = load_dataset(\"big_patent\", \"d\", split=\"validation\", download_mode=\"force_redownload\")", "I am able to download the dataset with ``` download_mode=\"force_redownload\"```. As you mentioned it was an issue with the cached version which was failed earlier due to a network issue. I am closing the issue now, once again thank you." ]
1,132,053,226
3,705
Raise informative error when loading a save_to_disk dataset
closed
2022-02-11T08:21:03
2022-02-11T22:56:40
2022-02-11T22:56:39
https://github.com/huggingface/datasets/pull/3705
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3705", "html_url": "https://github.com/huggingface/datasets/pull/3705", "diff_url": "https://github.com/huggingface/datasets/pull/3705.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3705.patch", "merged_at": "2022-02-11T22:56:39" }
albertvillanova
true
[]
1,132,042,631
3,704
OSCAR-2109 datasets are misaligned and truncated
closed
2022-02-11T08:14:59
2022-03-17T18:01:04
2022-03-16T16:21:28
https://github.com/huggingface/datasets/issues/3704
null
adrianeboyd
false
[ "Hi @adrianeboyd, thanks for reporting.\r\n\r\nThere is indeed a bug in that community dataset:\r\nLine:\r\n```python\r\nmetadata_and_text_files = list(zip(metadata_files, text_files))\r\n``` \r\nshould be replaced with\r\n```python\r\nmetadata_and_text_files = list(zip(sorted(metadata_files), sorted(text_files)))\r\n```\r\n\r\nI am going to contact their owners (https://huggingface.co/oscar-corpus) in order to inform them about the bug.\r\n\r\nI keep you informed.", "That fix is part of it, but it's clearly not the only issue.\r\n\r\nI also already contacted the OSCAR creators, but I reported it here because it looked like huggingface members were the main authors in the git history. Is there a better place to have reported this?", "Hello,\r\n\r\nWe've had an issue that could be linked to this one here: https://github.com/oscar-corpus/corpus/issues/15.\r\n\r\nI have been spot checking the source (`.txt`/`.jsonl`) files for a while, and have not found issues, especially in the start/end of corpora (but I conceed that more integration testing would be necessary on our side).\r\n\r\nThe text and metadata files are designed to be used in sync (with `lang_part_n.txt` and `lang_meta_part_n.jsonl` working together), while staying independent from part to part, so that anyone could randomly choose a part and work with it.\r\n\r\nThe fix @albertvillanova proposed should fix the problem, as the parts will be in sync again.\r\n\r\nLet me know if you need help or more details, I'd be glad to help!", "I'm happy to move the discussion to the other repo!\r\n\r\nMerely sorting the files only **maybe** fixes the processing of the first part. If the first part contains non-unix newlines, it will still be misaligned/truncated, and all the following parts will be truncated with incorrect text offsets and metadata due the offset and newline bugs.", "Fixed:\r\n- https://huggingface.co/datasets/oscar-corpus/OSCAR-2109/commit/3cd7e95aa1799b73c5ea8afc3989635f3e19b86b", "Hi @Uinelj, This is a total noobs question but how can I integrate that bugfix into my code? I reinstalled the datasets library this time from source. Should that have fixed the issue? I am still facing the misalignment issue. Do I need to download the dataset from scratch?", "Hi, I re-downloaded the dataset and still have the problem. See: https://github.com/oscar-corpus/corpus/issues/18", "Sorry @norakassner for the late reply.\r\n\r\nThere are indeed several issues creating the misalignment, as @adrianeboyd cleverly pointed out:\r\n- https://huggingface.co/datasets/oscar-corpus/OSCAR-2109/commit/3cd7e95aa1799b73c5ea8afc3989635f3e19b86b fixed one of them\r\n- but there are still others to be fixed", "Normally, the issues should be fixed now:\r\n- Fix offset initialization for each file: https://huggingface.co/datasets/oscar-corpus/OSCAR-2109/commit/1ad9b7bfe00798a9258a923b887bb1c8d732b833\r\n- Disable default universal newline support: https://huggingface.co/datasets/oscar-corpus/OSCAR-2109/commit/0c2f307d3167f03632f502af361ac6c3c393f510\r\n\r\nFeel free to reopen if you find additional misalignments/truncations.\r\n\r\nCC: @adrianeboyd @norakassner @Uinelj ", "Thanks for the updates!\r\n\r\nThe purist in me would still like to have the rstrip not strip additional characters from the original text (unicode whitespace mainly in practice, I think), but the differences are extremely small in practice and it doesn't actually matter for my current task:\r\n\r\n```python\r\ntext = \"\".join([text_f.readline() for _ in range(meta[\"nb_sentences\"])]).rstrip(\"\\n\")\r\n```" ]
1,131,882,772
3,703
ImportError: To be able to use this metric, you need to install the following dependencies['seqeval'] using 'pip install seqeval' for instance'
closed
2022-02-11T06:38:42
2023-07-11T09:31:59
2023-07-11T09:31:59
https://github.com/huggingface/datasets/issues/3703
null
zhangyifei1
false
[ "![图片](https://user-images.githubusercontent.com/28425091/153547502-6bb0938d-788b-4857-b946-c3cf08fefce4.png)\r\nMy datasets version", "![图片](https://user-images.githubusercontent.com/28425091/153547587-f4677166-af9b-44a0-95ad-b6dba873978a.png)\r\n", "Hi! Some of our metrics require additional dependencies to work. In your case, simply installing the `seqeval` package with `pip install seqeval` should resolve the issue.", "> Hi! Some of our metrics require additional dependencies to work. In your case, simply installing the `seqeval` package with `pip install seqeval` should resolve the issue.\r\nI installed seqeval, but still reported the same error. That's too bad.\r\n", "> > Hi! Some of our metrics require additional dependencies to work. In your case, simply installing the `seqeval` package with `pip install seqeval` should resolve the issue.\r\n> > I installed seqeval, but still reported the same error. That's too bad.\r\n\r\nSame issue here. What should I do to fix this error? Please help! Thank you.", "I tried to install **seqeval** package through anaconda instead of pip:\r\n`conda install -c conda-forge seqeval`\r\nIt worked for me!", "I can run it through the following steps:\r\n![image](https://user-images.githubusercontent.com/69563759/159264511-1e252a4e-c8c8-44ab-b7bc-b4aac609bd9e.png)\r\nThank you for answering for me!", "just change the file name seqeval.py to myseqeval.py", "Metrics are deprecated in `datasets` and `evaluate` should be used instead: https://github.com/huggingface/evaluate" ]
1,130,666,707
3,702
Update data URL of lm1b dataset
closed
2022-02-10T18:46:30
2022-09-23T11:52:39
2022-09-23T11:52:39
https://github.com/huggingface/datasets/pull/3702
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3702", "html_url": "https://github.com/huggingface/datasets/pull/3702", "diff_url": "https://github.com/huggingface/datasets/pull/3702.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3702.patch", "merged_at": null }
yazdanbakhsh
true
[ "Hi ! I'm getting some 503 from both the http and https addresses. Do you think we could host this data somewhere else ? (please check if there is a license and if it allows redistribution)", "Both HTTP and HTTPS links are working now.\r\n\r\nWe are closing this PR." ]
1,130,498,738
3,701
Pin ElasticSearch
closed
2022-02-10T17:15:26
2022-02-10T17:31:13
2022-02-10T17:31:12
https://github.com/huggingface/datasets/pull/3701
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3701", "html_url": "https://github.com/huggingface/datasets/pull/3701", "diff_url": "https://github.com/huggingface/datasets/pull/3701.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3701.patch", "merged_at": "2022-02-10T17:31:12" }
lhoestq
true
[]
1,130,200,593
3,699
Add dev-only config to Natural Questions dataset
closed
2022-02-10T14:42:24
2022-02-11T09:50:22
2022-02-11T09:50:21
https://github.com/huggingface/datasets/pull/3699
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3699", "html_url": "https://github.com/huggingface/datasets/pull/3699", "diff_url": "https://github.com/huggingface/datasets/pull/3699.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3699.patch", "merged_at": "2022-02-11T09:50:21" }
albertvillanova
true
[ "Great thanks ! I think we can fix the CI by copying the NQ folder on gcs to 0.0.3. Does that sound good ?", "I've copied the 0.0.2 folder content to 0.0.3, as suggested.\r\n\r\nI'm updating the dataset card..." ]
1,129,864,282
3,698
Add finetune-data CodeFill
closed
2022-02-10T11:12:51
2022-10-03T09:36:18
2022-10-03T09:36:18
https://github.com/huggingface/datasets/pull/3698
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3698", "html_url": "https://github.com/huggingface/datasets/pull/3698", "diff_url": "https://github.com/huggingface/datasets/pull/3698.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3698.patch", "merged_at": null }
rgismondi
true
[ "Thanks for your contribution, @rgismondi. Are you still interested in adding this dataset?\r\n\r\nWe are removing the dataset scripts from this GitHub repo and moving them to the Hugging Face Hub: https://huggingface.co/datasets\r\n\r\nWe would suggest you create this dataset there. Please, feel free to tell us if you need some help." ]
1,129,795,724
3,697
Add code-fill datasets for pretraining/finetuning/evaluating
closed
2022-02-10T10:31:48
2022-07-06T15:19:58
2022-07-06T15:19:58
https://github.com/huggingface/datasets/pull/3697
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3697", "html_url": "https://github.com/huggingface/datasets/pull/3697", "diff_url": "https://github.com/huggingface/datasets/pull/3697.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3697.patch", "merged_at": null }
rgismondi
true
[ "Hi ! Thanks for adding this dataset :)\r\n\r\nIt looks like your PR contains many changes in files that are unrelated to your changes, I think it might come from running `make style` with an outdated version of `black`. Could you try opening a new PR that only contains your additions ? (or force push to this PR)" ]
1,129,764,534
3,696
Force unique keys in newsqa dataset
closed
2022-02-10T10:09:19
2022-02-14T08:37:20
2022-02-14T08:37:19
https://github.com/huggingface/datasets/pull/3696
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3696", "html_url": "https://github.com/huggingface/datasets/pull/3696", "diff_url": "https://github.com/huggingface/datasets/pull/3696.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3696.patch", "merged_at": "2022-02-14T08:37:19" }
albertvillanova
true
[]
1,129,730,148
3,695
Fix ClassLabel to/from dict when passed names_file
closed
2022-02-10T09:47:10
2022-02-11T23:02:32
2022-02-11T23:02:31
https://github.com/huggingface/datasets/pull/3695
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3695", "html_url": "https://github.com/huggingface/datasets/pull/3695", "diff_url": "https://github.com/huggingface/datasets/pull/3695.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3695.patch", "merged_at": "2022-02-11T23:02:31" }
albertvillanova
true
[]
1,128,554,365
3,693
Standardize to `Example::`
closed
2022-02-09T13:37:13
2022-02-17T10:20:55
2022-02-17T10:20:52
https://github.com/huggingface/datasets/pull/3693
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3693", "html_url": "https://github.com/huggingface/datasets/pull/3693", "diff_url": "https://github.com/huggingface/datasets/pull/3693.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3693.patch", "merged_at": null }
mishig25
true
[ "Closing because https://github.com/huggingface/datasets/pull/3690/commits/ee0e0935d6105c1390b0e14a7622fbaad3044dbb" ]
1,128,320,004
3,692
Update data URL in pubmed dataset
closed
2022-02-09T10:06:21
2022-02-14T14:15:42
2022-02-14T14:15:41
https://github.com/huggingface/datasets/pull/3692
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3692", "html_url": "https://github.com/huggingface/datasets/pull/3692", "diff_url": "https://github.com/huggingface/datasets/pull/3692.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3692.patch", "merged_at": "2022-02-14T14:15:41" }
albertvillanova
true
[ "- I updated the previous dummy data: I just had to rename the file and its directory\r\n - the dummy data zip contains only a single file: `pubmed22n0001.xml.gz`\r\n\r\nThen I discover it fails: https://app.circleci.com/pipelines/github/huggingface/datasets/9800/workflows/173a4433-8feb-4fc6-ab9e-59762084e3e1/jobs/60437\r\n```\r\nNo such file or directory: '.../dummy_data/pubmed22n0002.xml.gz'\r\n```\r\n- it needs dummy data for all the 1114 files: \r\n `_URLs = [f\"ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed22n{i:04d}.xml.gz\" for i in range(1, 1115)]`\r\n- this confirms me that it never passed the test: these dummy data files were not present before my PR\r\n- therefore, is it really useful the data test if we just ignore it when it does not pass?\r\n\r\nIn relation with JSON metadata, I was generating the file for `pubmed` (see above) in a GCP instance: after running during ~12h without finishing, I decided to stop the process.", "Hi ! Yes I remembered we hardcoded an exception for this one:\r\nhttps://github.com/huggingface/datasets/blob/36db39c75179a0a491c69a4491f7ae7e4615e66f/src/datasets/utils/mock_download_manager.py#L174-L176\r\n\r\nThe exception was used to only require one dummy data file, feel free to update it if you want" ]
1,127,629,306
3,691
Upgrade black to version ~=22.0
closed
2022-02-08T18:45:19
2022-02-08T19:56:40
2022-02-08T19:56:39
https://github.com/huggingface/datasets/pull/3691
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3691", "html_url": "https://github.com/huggingface/datasets/pull/3691", "diff_url": "https://github.com/huggingface/datasets/pull/3691.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3691.patch", "merged_at": "2022-02-08T19:56:39" }
LysandreJik
true
[]
1,127,493,538
3,690
Update docs to new frontend/UI
closed
2022-02-08T16:38:09
2022-03-03T20:04:21
2022-03-03T20:04:20
https://github.com/huggingface/datasets/pull/3690
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3690", "html_url": "https://github.com/huggingface/datasets/pull/3690", "diff_url": "https://github.com/huggingface/datasets/pull/3690.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3690.patch", "merged_at": "2022-03-03T20:04:20" }
mishig25
true
[ "We can have the docstrings of the properties that are missing docstrings (from discussion [here](https://github.com/huggingface/doc-builder/pull/96)) here by using your new `inject_arrow_table_documentation` onthem as well ?", "@sgugger & @lhoestq could you help me with what should the `docs` section in setup.py be changed to [here](https://github.com/huggingface/datasets/blob/master/setup.py#L212-L227) ?\r\n\r\nas a reference, here is a transformers setup.py docs [section](https://github.com/huggingface/transformers/blob/master/setup.py#L304-L308)", "For now, you can put an empty list. Once the `doc-builder` is in a PyPi package (with the bug we fixed on Datasets but still waiting on the standing PR with the code switch) we can put it there.", "None of those dependencies are needed from this list?\r\n\r\n```py\r\n \"docs\": [\r\n \"docutils==0.16.0\",\r\n \"recommonmark\",\r\n \"sphinx==3.1.2\",\r\n \"sphinx-markdown-tables\",\r\n \"sphinx-rtd-theme==0.4.3\",\r\n \"sphinxext-opengraph==0.4.1\",\r\n \"sphinx-copybutton\",\r\n \"fsspec<2021.9.0\",\r\n \"s3fs\",\r\n \"sphinx-panels\",\r\n \"sphinx-inline-tabs\",\r\n \"myst-parser\",\r\n \"Markdown!=3.3.5\",\r\n ],\r\n```", "No, that was all for sphinx. The only thing needed to build the doc is a pip install of `doc-builder` (only from git right now).", "@lhoestq feel free to request reviews from other maintainers 😊", "Thanks ! @mariosasko and @albertvillanova feel free to take a look :)\r\nI can do a thorough review this afternoon", "Cool thanks ! Feel free to merge master into this branch and run `make style` to fix the python code formatting", "Love the colorful vibes here!\r\n![Screen Shot 2022-02-22 at 9 54 17 AM](https://user-images.githubusercontent.com/59462357/155193444-45e639dc-79cd-463c-98ad-1d44a6d6d385.png) ", "I just fixed the conflicts with the `master` branch :)\r\n\r\nCould you update preprod please ? Or is there a preview somewhere I can check to make sure everything is ok ?", "> Could you update preprod please ? Or is there a preview somewhere I can check to make sure everything is ok ?\r\n\r\nI'll let you know once preprod gets updated", "@lhoestq @stevhliu updated [preprod](https://moon-preprod.huggingface.co/docs/datasets/index) with the latest; please let e know if you see any errors", "One more tiny error that doesn't seem specific to Datasets (Transformers example [here](https://huggingface.co/docs/transformers/multilingual#xlm-language-embeddings)), but apostrophes and symbols aren't properly displayed in the right navbar:\r\n\r\n![Screen Shot 2022-03-02 at 8 39 10 AM](https://user-images.githubusercontent.com/59462357/156406988-27e79533-b02a-4fc2-af32-8ad84657488f.png)", "In the latest commit https://github.com/huggingface/datasets/pull/3690/commits/20bddf28b22798c309e6eb1198a716f055889e1b, I tried to reflect changes from https://github.com/huggingface/transformers/pull/15903 , however, the gh workflow is not being triggered. @lhoestq do you know why it might be the case?\r\n\r\neve though, we have \r\nhttps://github.com/huggingface/datasets/blob/20bddf28b22798c309e6eb1198a716f055889e1b/.github/workflows/build_dev_documentation.yml#L3-L7", "I removed this line to trigger the job\r\n```\r\n pull_request:\r\n```\r\n\r\nbut got this error\r\n```\r\n[Error: .github#L1](https://github.com/huggingface/datasets/commit/033fe623c556b9dbc964708b672ff9bb4896c906#annotation_2897984435)\r\na step cannot have both the `uses` and `run` keys\r\n```", "It seems to be running again, and I re-added the line I removed.\r\n\r\nNow the error is\r\n```\r\n> Run cd doc-build-dev && ...\r\nREADME.md\r\ndatasets\r\ntransformers\r\nOn branch main\r\nYour branch is up to date with 'origin/main'.\r\n\r\nnothing to commit, working tree clean\r\nError: Process completed with exit code 1.\r\n```", "@lhoestq if the CI passes, Im gonna merge this PR\r\nplease let me know if that sounds good" ]
1,127,422,478
3,689
Fix streaming for servers not supporting HTTP range requests
closed
2022-02-08T15:41:05
2022-02-10T16:51:25
2022-02-10T16:51:25
https://github.com/huggingface/datasets/pull/3689
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3689", "html_url": "https://github.com/huggingface/datasets/pull/3689", "diff_url": "https://github.com/huggingface/datasets/pull/3689.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3689.patch", "merged_at": "2022-02-10T16:51:24" }
albertvillanova
true
[ "Does it mean that huge files might end up being downloaded? It would go against the purpose of streaming, I think. At least, this fallback should be an option that could be disabled", "Yes, it is against the purpose of streaming, but streaming is not possible if the server does not allow HTTP range requests.\n\nWe have two options: either we download the file or we throw an error.", "I think we simply cannot fallback to downloading the file if streaming fails without the user being aware of it. Some options: \r\n- make the fallback optional (using an env var? or a function param)\r\n- use the fallback only if the dataset size is under some threshold (provided we have the data in the DatasetInfo) -> it's the option I use in `datasets-preview-backend` ([here](https://github.com/huggingface/datasets-preview-backend/blob/48ac19e49c19809763e8d640986bf2c3d792faed/src/datasets_preview_backend/models/typed_row.py#L40) and [here](https://github.com/huggingface/datasets-preview-backend/blob/aa86c5493b275c9e2dbae7dab7bd469da5773a41/src/datasets_preview_backend/models/split.py#L31-L37))\r\n- throw an exception and let the user decide what to do\r\n", "IMO in general we should throw an exception and ask the user to not use streaming mode in that case.\r\n\r\nYour second point is also interesting but I feel like it could be confusing for users sometimes: it doesn't feel natural that the streaming-ability should depend on the size of the file.", "Sure, I think we should just throw an exception\r\n", "Current behavior is already throwing an Exception:\r\n```\r\nValueError: Cannot seek streaming HTTP file\r\n```\r\n\r\nWe could customize the exception class and/or the exception message.", "I'm not sure we really need to change anything. I opened the issue https://github.com/huggingface/datasets/issues/3677 because discovery was streamable and is not anymore (according to my test suite in https://github.com/huggingface/datasets-preview-backend): I was not sure if it was due to some regression in the library, or to some change in the dataset itself.", "I'm wondering why it worked before and it is no longer working...", "> We could customize the exception class and/or the exception message.\r\n\r\nYup a message that says that the host doesn't support streaming because it doesn't support HTTP Range requests would be useful !", "DONE, @lhoestq. " ]
1,127,218,321
3,688
Pyarrow version error
closed
2022-02-08T12:53:59
2022-02-09T06:35:33
2022-02-09T06:35:32
https://github.com/huggingface/datasets/issues/3688
null
Zaker237
false
[ "Hi @Zaker237, thanks for reporting.\r\n\r\nThis is weird: the error you get is only thrown if the installed pyarrow version is less than 3.0.0.\r\n\r\nCould you please check that you install pyarrow in the same Python virtual environment where you installed datasets?\r\n\r\nFrom the Python command line (or terminal) where you get the error, please type:\r\n```\r\nimport pyarrow\r\nprint(pyarrow.__version__)\r\nimport datasets\r\nprint(datasets.__version__)\r\n``` ", "hi @albertvillanova i try yesterday to create a new python environement with python 7 and try it on the environement and it worked. so i think that the error was not the package but may be jupyter notebook on conda. still yet i'm not yet sure but it worked in an environment created with venv", "OK, thanks @Zaker237 for your feedback.\r\n\r\nI close this issue then. Please, feel free to reopen it if the problem arises again." ]
1,127,154,766
3,687
Can't get the text data when calling to_tf_dataset
closed
2022-02-08T11:52:10
2023-01-19T14:55:18
2023-01-19T14:55:18
https://github.com/huggingface/datasets/issues/3687
null
phrasenmaeher
false
[ "cc @Rocketknight1 ", "You are correct that `to_tf_dataset` only handles numerical columns right now, yes, though this is a limitation we might remove in future! The main reason we do this is that our models mostly do not include the tokenizer as a model layer, because it's very difficult to compile some of them in TF. So the \"normal\" Huggingface workflow is to first tokenize your dataset, and then pass tokenized tensors to the model.\r\n\r\nFor your use case, would you prefer to pass strings to the model, and use some text processing layers instead of the built-in tokenizers?", "Also tagging @gante just so he's aware, but I can handle this one!", "Thanks for the quick follow-up to my issue.\r\n\r\nFor my use-case, instead of the built-in tokenizers I wanted to use the `TextVectorization` layer to map from strings to integers. To achieve this, I came up with the following solution:\r\n\r\n```\r\nfrom datasets import load_dataset\r\nfrom transformers import DefaultDataCollator\r\nimport tensorflow as tf\r\nimport string\r\nimport re\r\nfrom tensorflow.keras.layers.experimental.preprocessing import TextVectorization\r\n\r\n#some hyper-parameters for the text-to-integer mapping\r\nmax_features = 20000\r\nembedding_dim = 128\r\nsequence_length = 210\r\n\r\ndata_collator = DefaultDataCollator(return_tensors=\"tf\")\r\ndataset = load_dataset(\"sst\", \"default\")\r\n\r\n#adapt the vectorization layer on train data only\r\nvectorize_layer.adapt(dataset[\"train\"].to_dict(batched=False)[\"sentence\"])\r\n\r\ndef prepare_features(text, label):\r\n text = tf.expand_dims(text, -1)\r\n return {\"vectorized_text\": vectorize_layer(text)[0], \"label\": tf.expand_dims(label, axis=-1)}\r\n\r\nencoded_dataset = dataset.map(lambda example: prepare_features(example[\"sentence\"], example[\"label\"]), batched=False)\r\n\r\n\r\ndef custom_standardization(input_data):\r\n lowercase = tf.strings.lower(input_data)\r\n return tf.strings.regex_replace(\r\n lowercase, f\"[{re.escape(string.punctuation)}]\", \"\"\r\n )\r\n\r\nvectorize_layer = TextVectorization(\r\n standardize=custom_standardization,\r\n max_tokens=max_features,\r\n output_mode=\"int\",\r\n output_sequence_length=sequence_length,\r\n)\r\n\r\ntrain_dataset = encoded_dataset[\"train\"].to_tf_dataset(columns=['vectorized_text'], label_cols=[\"label\"],\r\n shuffle=True, batch_size=1, collate_fn=data_collator).unbatch()\r\n#similar for the other sub-sets\r\n\r\n```\r\n\r\nSince the strings would have been mapped to integers or floats at some point, it's no drawback that this mapping is done early in the process. \r\n\r\nFor the future, however, it'd be more convenient to get the string data, since I am also inspecting the dataset (longest sentence, shortest sentence), which is more challenging when working with integer or float. For now, this can be done by calling `to_dict`.", "> For the future, however, it'd be more convenient to get the string data, since I am also inspecting the dataset (longest sentence, shortest sentence), which is more challenging when working with integer or float.\r\n\r\nYes, I agree, so let's keep this issue open.", "Going to close this now - methods like `to_tf_dataset` and `prepare_tf_dataset` now support string data, and have done for a while! If anyone sees this and is encountering issues with string data in those methods, please file a new issue!" ]
1,127,137,290
3,686
`Translation` features cannot be `flatten`ed
closed
2022-02-08T11:33:48
2022-03-18T17:28:13
2022-03-18T17:28:13
https://github.com/huggingface/datasets/issues/3686
null
SBrandeis
false
[ "Thanks for reporting, @SBrandeis! Some additional feature types that don't behave as expected when flattened: `Audio`, `Image` and `TranslationVariableLanguages`" ]
1,126,240,444
3,685
Add support for `Audio` and `Image` feature in `push_to_hub`
closed
2022-02-07T16:47:16
2022-02-14T18:14:57
2022-02-14T18:04:58
https://github.com/huggingface/datasets/pull/3685
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3685", "html_url": "https://github.com/huggingface/datasets/pull/3685", "diff_url": "https://github.com/huggingface/datasets/pull/3685.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3685.patch", "merged_at": "2022-02-14T18:04:58" }
mariosasko
true
[ "> Cool thanks !\r\n> \r\n> Also cc @patrickvonplaten @anton-l it means that when calling push_to_hub, the audio bytes are embedded in the parquet files (we don't upload the audio files themselves)\r\n\r\nJust to verify quickly the size of the dataset doesn't change in this case no? E.g. if a dataset has say 20GB in size when stored in `.mp3` format it could have up to 100GB when stored in WAV. But since we are just taking the bytes here a 20GB .mp3 dataset would also have 20GB when stored in parquet no?", "@lhoestq I've addressed your comments. Additionally, I've modified `cast_storage` to account for possible null (`None`) values.\r\n\r\n@patrickvonplaten Yes, the dataset size stays the same (at least because Parquet files are compressed).", "Feel free to merge if it's all good to you :)" ]
1,125,133,664
3,684
[fix]: iwslt2017 download urls
closed
2022-02-06T07:56:55
2022-09-22T16:20:19
2022-09-22T16:20:18
https://github.com/huggingface/datasets/pull/3684
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3684", "html_url": "https://github.com/huggingface/datasets/pull/3684", "diff_url": "https://github.com/huggingface/datasets/pull/3684.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3684.patch", "merged_at": null }
msarmi9
true
[ "Hi ! Thanks for the fix ! Do you know where this new URL comes from ?\r\n\r\nAlso we try to not use Google Drive if possible, since it has download quota limitations. Do you know if the data is available from another host than Google Drive ?", "Oh, I found it just by following the link from the [IWSLT2017 homepage](https://wit3.fbk.eu/2017-01). Not sure if it's available from another host.", "Ok cool ! I guess it's ok to use this URL for now, and we can see later if we need to change it.\r\n\r\nBefore merging, could you update the `dataset_infos.json` file by running this command please ?\r\n```\r\ndatasets-cli test ./datasets/iwslt2017 --save_infos --all_configs\r\n```", "sure thing. lmk if there's anything else i can do to help.", "just checking in. is there anything i can do to help on my end to get this merged? (the dummy data tests are failing due an incorrect path, i think)", "Thanks ! I also fixed the dummy data :)\r\n\r\nTo fix the CI, feel free to merge the `master` branch into your PR.\r\n\r\nIf you have some time, feel free to also take a look at the missing YAML tags at the top of the README.md file of this dataset:\r\n```\r\nE ValueError: The following issues have been found in the dataset cards:\r\nE YAML tags:\r\nE missing 9 required tags: 'annotations_creators', 'language_creators', 'languages', 'licenses', 'multilinguality', 'size_categories', 'source_datasets', 'task_categories', and 'task_ids'\r\n```\r\nyou can use the dataset tagging app here: https://huggingface.co/spaces/huggingface/datasets-tagging", "I guess this PR was superseded by this other:\r\n- #4481\r\n\r\nThanks for your contribution anyway, @msarmi9. " ]
1,124,458,371
3,683
added told-br (brazilian hate speech) dataset
closed
2022-02-04T17:44:32
2022-02-07T21:14:52
2022-02-07T21:14:52
https://github.com/huggingface/datasets/pull/3683
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3683", "html_url": "https://github.com/huggingface/datasets/pull/3683", "diff_url": "https://github.com/huggingface/datasets/pull/3683.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3683.patch", "merged_at": "2022-02-07T21:14:52" }
joaoaleite
true
[ "Amazing thank you ! Feel free to regenerate the `dataset_infos.json` to account for the feature type change, and then I think we'll be good to merge :)", "Great thank you ! merging :)" ]
1,124,434,330
3,682
adding told-br for toxic/abusive hatespeech detection
closed
2022-02-04T17:18:29
2022-02-07T03:23:24
2022-02-04T17:36:40
https://github.com/huggingface/datasets/pull/3682
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3682", "html_url": "https://github.com/huggingface/datasets/pull/3682", "diff_url": "https://github.com/huggingface/datasets/pull/3682.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3682.patch", "merged_at": null }
joaoaleite
true
[ "Sorry for using multiple github accounts, I didn't notice I was using my professional account to commit/push. Please consider this @JAugusto97 account as the correct one.", "Will remake the PR with the correct github account." ]
1,124,237,458
3,681
Fix TestCommand to move dataset_infos instead of copying
closed
2022-02-04T14:01:52
2023-09-24T10:00:11
2023-09-24T09:59:55
https://github.com/huggingface/datasets/pull/3681
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3681", "html_url": "https://github.com/huggingface/datasets/pull/3681", "diff_url": "https://github.com/huggingface/datasets/pull/3681.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3681.patch", "merged_at": null }
albertvillanova
true
[ "All the datasets that are loaded normally with `load_dataset`, if `dataset_infos.json` exists, have this file in the importable directory. So it's fine if we copy the file instead of moving it but it's not a big deal.\r\n\r\nAny reason to prefer moving it rather than copying it ?", "@lvwerra reported than when generating the `dataset_infos.json` for multiple dataset directories containing only JSONL files, subsequent `dataset_infos.json` files contained all previous directories as configs:\r\n- First generate metadata for dataset in dir `dir1`: dataset_infos.json contains one config for `dir1`\r\n- Then generate metadata for dataset in dir `dir2`: dataset_infos.json contains 2 configs, for `dir1` and `dir2`\r\n\r\nThe reason is that all dataset_infos.json files are first created in the same dir (the one containing the json builder) and then **copied** to the user dir.\r\n\r\nSubsequent calls of TestCommand don't replace the dataset_infos.json already present in the dir of the json builder, but append to it.\r\n\r\nMAYBE: we should just move for this use case, and copy for the other use cases? See this use case here:\r\n- #3680", "@lhoestq aren't you mentioning the case in the else clause?\r\n```python\r\nelse: # in case of a remote dataset\r\n dataset_dir = None\r\n```\r\n\r\nIn that case `dataset_infos.json` is not copied: `dataset_dir = None`", "When using the JSON loader, calling `get_imported_module_dir()` returns a path inside the pip installed packages, so we shouldn't write files in it anyway, and the dataset_infos.json file should be written directly in the user's directory instead (some users don't have write access to the pip installed packages for example).\r\n\r\nMaybe the packaged modules like `json` should override `_save_infos` to save them in the user's directory instead of next to the builder's script. What do you think ?", "Anyway as a hotfix we can just add an exception for the `json` builder for now, if the issue has to be fixed soon", "I'm closing this PR." ]
1,124,213,416
3,680
Fix TestCommand to copy dataset_infos to local dir with only data files
closed
2022-02-04T13:36:46
2022-02-08T10:32:55
2022-02-08T10:32:55
https://github.com/huggingface/datasets/pull/3680
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3680", "html_url": "https://github.com/huggingface/datasets/pull/3680", "diff_url": "https://github.com/huggingface/datasets/pull/3680.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3680.patch", "merged_at": "2022-02-08T10:32:55" }
albertvillanova
true
[]
1,124,062,133
3,679
Download datasets from a private hub
closed
2022-02-04T10:49:06
2022-02-22T11:08:07
2022-02-22T11:08:07
https://github.com/huggingface/datasets/issues/3679
null
juliensimon
false
[ "For reference:\r\nhttps://github.com/huggingface/transformers/issues/15514\r\nhttps://github.com/huggingface/huggingface_hub/issues/650", "Hi ! For information one can set the environment variable `HF_ENDPOINT` (default is `https://huggingface.co`) if they want to use a private hub.\r\n\r\nWe may need to coordinate with the other libraries to have a consistent way of changing the hub endpoint", "Yes, I tested it successfully this morning. Thanks." ]
1,123,402,426
3,678
Add code example in wikipedia card
closed
2022-02-03T18:09:02
2022-02-21T09:14:56
2022-02-04T13:21:39
https://github.com/huggingface/datasets/pull/3678
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3678", "html_url": "https://github.com/huggingface/datasets/pull/3678", "diff_url": "https://github.com/huggingface/datasets/pull/3678.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3678.patch", "merged_at": "2022-02-04T13:21:39" }
lhoestq
true
[]
1,123,192,866
3,677
Discovery cannot be streamed anymore
closed
2022-02-03T15:02:03
2022-02-10T16:51:24
2022-02-10T16:51:24
https://github.com/huggingface/datasets/issues/3677
null
severo
false
[ "Seems like a regression from https://github.com/huggingface/datasets/pull/2843\r\n\r\nOr maybe it's an issue with the hosting. I don't think so, though, because https://www.dropbox.com/s/aox84z90nyyuikz/discovery.zip seems to work as expected\r\n\r\n", "Hi @severo, thanks for reporting.\r\n\r\nSome servers do not support HTTP range requests, and those are required to stream some file formats (like ZIP in this case).\r\n\r\nLet me try to propose a workaround. " ]
1,123,096,362
3,676
`None` replaced by `[]` after first batch in map
closed
2022-02-03T13:36:48
2022-10-28T13:13:20
2022-10-28T13:13:20
https://github.com/huggingface/datasets/issues/3676
null
lhoestq
false
[ "It looks like this is because of this behavior in pyarrow:\r\n```python\r\nimport pyarrow as pa\r\n\r\narr = pa.array([None, [0]])\r\nreconstructed_arr = pa.ListArray.from_arrays(arr.offsets, arr.values)\r\nprint(reconstructed_arr.to_pylist())\r\n# [[], [0]]\r\n```\r\n\r\nIt seems that `arr.offsets` can reconstruct the array properly, but an offsets array with null values can:\r\n```python\r\nfixed_offsets = pa.array([None, 0, 1])\r\nfixed_arr = pa.ListArray.from_arrays(fixed_offsets, arr.values)\r\nprint(fixed_arr.to_pylist())\r\n# [None, [0]]\r\n\r\nprint(arr.offsets.to_pylist())\r\n# [0, 0, 1]\r\nprint(fixed_offsets.to_pylist())\r\n# [None, 0, 1]\r\n```\r\nEDIT: this is because `arr.offsets` is not enough to reconstruct the array, we also need the validity bitmap", "The offsets don't have nulls because they don't include the validity bitmap from `arr.buffers()[0]`, which is used to say which values are null and which values are non-null.\r\n\r\nThough the validity bitmap also seems to be wrong:\r\n```python\r\nbin(int(arr.buffers()[0].hex(), 16))\r\n# '0b10'\r\n# it should be 0b110 - 1 corresponds to non-null and 0 corresponds to null, if you take the bits in reverse order\r\n```\r\n\r\nSo apparently I can't even create the fixed offsets array using this.\r\n\r\nIf I understand correctly it's always missing the 1 on the left, so I can add it manually as a hack to fix the issue until this is fixed in pyarrow EDIT: actually it may be more complicated than that\r\n\r\nEDIT2: actuall it's right, it corresponds to the validity bitmap of the array of logical length 2. So if we use the offsets array, the values array, and this validity bitmap it should be possible to reconstruct the array properly", "I created an issue on Apache Arrow's JIRA: https://issues.apache.org/jira/browse/ARROW-15837", "And another one: https://issues.apache.org/jira/browse/ARROW-15839", "FYI the behavior is the same with:\r\n- `datasets` version: 1.18.3\r\n- Platform: Linux-5.8.0-50-generic-x86_64-with-debian-bullseye-sid\r\n- Python version: 3.7.11\r\n- PyArrow version: 6.0.1\r\n\r\n\r\nbut not with:\r\n- `datasets` version: 1.8.0\r\n- Platform: Linux-4.18.0-305.40.2.el8_4.x86_64-x86_64-with-redhat-8.4-Ootpa\r\n- Python version: 3.7.11\r\n- PyArrow version: 3.0.0\r\n\r\ni.e. it outputs:\r\n```py\r\n0 [None, [0]]\r\n1 [None, [0]]\r\n2 [None, [0]]\r\n3 [None, [0]]\r\n```\r\n", "Thanks for the insights @PaulLerner !\r\n\r\nI found a way to workaround this issue for the code example presented in this issue.\r\n\r\nNote that empty lists will still appear when you explicitly `cast` a list of lists that contain None values like [None, [0]] to a new feature type (e.g. to change the integer precision). In this case it will show a warning that it happened. If you don't cast anything, then the None values will be kept as expected.\r\n\r\nLet me know what you think !", "Hi! I feel like I’m missing something in your answer, *what* is the workaround? Is it fixed in some `datasets` version?", "`pa.ListArray.from_arrays` returns empty lists instead of None values. The workaround I added inside `datasets` simply consists in not using `pa.ListArray.from_arrays` :)\r\n\r\nOnce this PR [here ](https://github.com/huggingface/datasets/pull/4282)is merged, we'll release a new version of `datasets` that currectly returns the None values in the case described in this issue\r\n\r\nEDIT: released :) but let's keep this issue open because it might happen again if users change the integer precision for example" ]
1,123,078,408
3,675
Add CodeContests dataset
closed
2022-02-03T13:20:00
2022-07-20T11:07:05
2022-07-20T11:07:05
https://github.com/huggingface/datasets/issues/3675
null
mariosasko
false
[ "@mariosasko Can I take this up?", "This dataset is now available here: https://huggingface.co/datasets/deepmind/code_contests." ]
1,123,027,874
3,674
Add FrugalScore metric
closed
2022-02-03T12:28:52
2022-02-21T15:58:44
2022-02-21T15:58:44
https://github.com/huggingface/datasets/pull/3674
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3674", "html_url": "https://github.com/huggingface/datasets/pull/3674", "diff_url": "https://github.com/huggingface/datasets/pull/3674.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3674.patch", "merged_at": "2022-02-21T15:58:44" }
moussaKam
true
[ "@lhoestq \r\n\r\nThe model used by default (`moussaKam/frugalscore_tiny_bert-base_bert-score`) is a tiny model.\r\n\r\nI still want to make one modification before merging.\r\nI would like to load the model checkpoint once. Do you think it's a good idea if I load it in `_download_and_prepare`? In this case should the model name be the `self.config_name` or another variable say `self.model_name` ? ", "OK, I added a commit that loads the checkpoint in `_download_and_prepare`. Please let me know if it looks good. ", "@lhoestq is everything OK to merge? ", "I triggered the CI and it's failing, can you merge the `master` branch into yours ? It should fix the issues.\r\n\r\nAlso the doctest apparently raises an error because it outputs `{'scores': [0.6307542, 0.6449357]}` instead of `{'scores': [0.631, 0.645]}` - feel free to edit the code example in the docstring to round the scores, that should fix it", "@lhoestq hope it's OK now" ]
1,123,010,520
3,673
`load_dataset("snli")` is different from dataset viewer
closed
2022-02-03T12:10:43
2022-02-16T11:22:31
2022-02-11T17:01:21
https://github.com/huggingface/datasets/issues/3673
null
pietrolesci
false
[ "Yes, we decided to replace the encoded label with the corresponding label when possible in the dataset viewer. But\r\n1. maybe it's the wrong default\r\n2. we could find a way to show both (with a switch, or showing both ie. `0 (neutral)`).\r\n", "Hi @severo,\r\n\r\nThanks for clarifying. \r\n\r\nI think this default is a bit counterintuitive for the user. However, this is a personal opinion that might not be general. I think it is nice to have the actual (non-encoded) labels in the viewer. On the other hand, it would be nice to match what the user sees with what they get when they download a dataset. I don't know - I can see the difficulty of choosing a default :)\r\nMaybe having non-encoded labels as a default can be useful?\r\n\r\nAnyway, I think the issue has been addressed. Thanks a lot for your super-quick answer!\r\n\r\n ", "Thanks for the 👍 in https://github.com/huggingface/datasets/issues/3673#issuecomment-1029008349 @mariosasko @gary149 @pietrolesci, but as I proposed various solutions, it's not clear to me which you prefer. Could you write your preferences as a comment?\r\n\r\n_(note for myself: one idea per comment in the future)_", "As I am working with seq2seq, I prefer having the label in string form rather than numeric. So the viewer is fine and the underlying dataset should be \"decoded\" (from int to str). In this way, the user does not have to search for a mapping `int -> original name` (even though is trivial to find, I reckon). Also, encoding labels is rather easy.\r\n\r\nI hope this is useful", "I like the idea of \"0 (neutral)\". The label name can even be greyed to make it clear that it's not part of the actual item in the dataset, it's just the meaning.", "I like @lhoestq's idea of having grayed-out labels.", "Proposals by @gary149. Which one do you prefer? Please vote with the thumbs\r\n\r\n- 👍 \r\n\r\n ![image](https://user-images.githubusercontent.com/1676121/152387949-883c7d7e-a9f3-48aa-bff9-11a691555e6e.png)\r\n\r\n- 👎 \r\n\r\n ![image (1)](https://user-images.githubusercontent.com/1676121/152388061-32d95e42-cade-4ae4-9a77-7365e7b72b8f.png)\r\n\r\n", "I like Option 1 better as it shows clearly what the user is downloading", "Thanks! ", "It's [live](https://huggingface.co/datasets/glue/viewer/cola/train):\r\n\r\n<img width=\"1126\" alt=\"Capture d’écran 2022-02-14 à 10 26 03\" src=\"https://user-images.githubusercontent.com/1676121/153836716-25f6205b-96af-42d8-880a-7c09cb24c420.png\">\r\n\r\nThanks all for the help to improve the UI!", "Love it ! thanks :)" ]
1,122,980,556
3,672
Prioritize `module.builder_kwargs` over defaults in `TestCommand`
closed
2022-02-03T11:38:42
2022-02-04T12:37:20
2022-02-04T12:37:19
https://github.com/huggingface/datasets/pull/3672
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3672", "html_url": "https://github.com/huggingface/datasets/pull/3672", "diff_url": "https://github.com/huggingface/datasets/pull/3672.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3672.patch", "merged_at": "2022-02-04T12:37:19" }
lvwerra
true
[]
1,122,864,253
3,671
Give an estimate of the dataset size in DatasetInfo
open
2022-02-03T09:47:10
2022-02-03T09:47:10
null
https://github.com/huggingface/datasets/issues/3671
null
severo
false
[]
1,122,439,827
3,670
feat: 🎸 generate info if dataset_infos.json does not exist
closed
2022-02-02T22:11:56
2022-02-21T15:57:11
2022-02-21T15:57:10
https://github.com/huggingface/datasets/pull/3670
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3670", "html_url": "https://github.com/huggingface/datasets/pull/3670", "diff_url": "https://github.com/huggingface/datasets/pull/3670.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3670.patch", "merged_at": "2022-02-21T15:57:10" }
severo
true
[ "It's a first attempt at solving https://github.com/huggingface/datasets/issues/3013.", "I only kept these ones:\r\n```\r\n path: str,\r\n data_files: Optional[Union[Dict, List, str]] = None,\r\n download_config: Optional[DownloadConfig] = None,\r\n download_mode: Optional[GenerateMode] = None,\r\n revision: Optional[Union[str, Version]] = None,\r\n use_auth_token: Optional[Union[bool, str]] = None,\r\n **config_kwargs,\r\n```\r\n\r\nLet me know if it's better for you now !\r\n\r\n(note that there's no breaking change since the ones that are removed can be passed as config_kwargs if you really want)", "(https://github.com/huggingface/datasets/pull/3670/commits/5636911880ea4306c27c7f5825fa3f9427ccc2b6 and https://github.com/huggingface/datasets/pull/3670/commits/07c3f0800dd34dfebb9674ad46c67a907b08ded8 -> I has forgotten to update black in my venv)" ]
1,122,335,622
3,669
Common voice validated partition
closed
2022-02-02T20:04:43
2022-02-08T17:26:52
2022-02-08T17:23:12
https://github.com/huggingface/datasets/pull/3669
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3669", "html_url": "https://github.com/huggingface/datasets/pull/3669", "diff_url": "https://github.com/huggingface/datasets/pull/3669.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3669.patch", "merged_at": "2022-02-08T17:23:12" }
shalymin-amzn
true
[ "Hi @patrickvonplaten - could you please advise whether this would be a welcomed change, and if so, who I consult regarding the unit-tests?", "I'd be happy with adding this change. @anton-l @lhoestq - what do you think?", "Cool ! I just fixed the tests by adding a dummy `validated.tsv` file in the dummy data archive of common_voice\r\n\r\nI wonder if you should separate the train/valid/test configuration from the validated/invalidated configuration of the splits ? \r\nIn particular having `validated` along with the train/valid/test splits could be a bit weird since it comprises them. We can do that if you think it makes more sense. Otherwise it's also good as it is right now :)\r\n", "Thanks! I think that there are 2 cases for using the validated partition: 1) trainset = {validated - dev - test}, dev and test as they come; 2) train, dev, and test sampled from validated manually with the desired ratios.\r\nIn either case, I think that it's quite a big change on the HF interface part, so could as well be taken care of in the client code. Or is it not? (In which case, what's the most compact way to implement this?)", "What's important IMO is to let the users as much flexibility as they need - so we try to not do too much regarding splits to not constrain users. So I guess the way it is right now is ok. Can you confirm that it's ok @patrickvonplaten and that it won't break some speech training script out there ?", "@lhoestq all split names are explicit in our example scripts, so this shouldn't break anything, feel free to merge :)\r\nI'll go ahead and add this to the official `mozilla-foundation` datasets as well ", "Good for me! This has no real down-sides IMO and surely won't break any training scripts." ]
1,122,261,736
3,668
Couldn't cast array of type string error with cast_column
closed
2022-02-02T18:33:29
2022-07-19T13:36:24
2022-07-19T13:36:24
https://github.com/huggingface/datasets/issues/3668
null
R4ZZ3
false
[ "Hi ! I wasn't able to reproduce the error, are you still experiencing this ? I tried calling `cast_column` on a string column containing paths.\r\n\r\nIf you manage to share a reproducible code example that would be perfect", "Hi,\r\n\r\nI think my team mate got this solved. Clolsing it for now and will reopen if I experience this again.\r\nThanks :) ", "Hi @R4ZZ3,\r\n\r\nIf it is not too much of a bother, can you please help me how to resolve this error? I am exactly getting the same error where I am going as per the documentation guideline:\r\n\r\n`my_audio_dataset = my_audio_dataset.cast_column(\"audio_paths\", Audio())`\r\n\r\nwhere `\"audio_paths\"` is a dataset column (feature) having strings of absolute paths to mp3 files of the dataset.\r\n\r\n", "I was having the same issue with this code:\r\n\r\n```\r\ndataset = dataset.map(\r\n lambda batch: {\"full_path\" : os.path.join(self.data_path, batch[\"path\"])},\r\n num_procs = 4\r\n)\r\nmy_audio_dataset = dataset.cast_column(\"full_path\", Audio(sampling_rate=16_000))\r\n```\r\n\r\nRemoving the \"num_procs\" argument fixed it somehow.\r\nUsing a mac with m1 chip", "Hi @Hubert-Bonisseur, I think this will be fixed by https://github.com/huggingface/datasets/pull/4614" ]
1,122,060,630
3,667
Process .opus files with torchaudio
closed
2022-02-02T15:23:14
2022-02-04T15:29:38
2022-02-04T15:29:38
https://github.com/huggingface/datasets/pull/3667
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3667", "html_url": "https://github.com/huggingface/datasets/pull/3667", "diff_url": "https://github.com/huggingface/datasets/pull/3667.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3667.patch", "merged_at": null }
polinaeterna
true
[ "Note that torchaudio is maybe less practical to use for TF or JAX users.\r\nThis is not in the scope of this PR, but in the future if we manage to find a way to let the user control the decoding it would be nice", "> Note that torchaudio is maybe less practical to use for TF or JAX users. This is not in the scope of this PR, but in the future if we manage to find a way to let the user control the decoding it would be nice\r\n\r\n@lhoestq so maybe don't do this PR? :) if it doesn't work anyway with an opened file, only with path", "Yes as discussed offline there seems to be issues with torchaudio on opened files. Feel free to close this PR if it's better to stick with soundfile because of that", "We should be able to remove torchaudio, which has torch as a hard dependency, soon and use only soundfile for decoding: https://github.com/bastibe/python-soundfile/issues/252#issuecomment-1000246773 (opus + mp3 support is on the way)." ]
1,122,058,894
3,666
process .opus files (for Multilingual Spoken Words)
closed
2022-02-02T15:21:48
2022-02-22T10:04:03
2022-02-22T10:03:53
https://github.com/huggingface/datasets/pull/3666
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3666", "html_url": "https://github.com/huggingface/datasets/pull/3666", "diff_url": "https://github.com/huggingface/datasets/pull/3666.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3666.patch", "merged_at": "2022-02-22T10:03:53" }
polinaeterna
true
[ "@lhoestq I still have problems with processing `.opus` files with `soundfile` so I actually cannot fully check that it works but it should... Maybe this should be investigated in case of someone else would also have problems with that.\r\n\r\nAlso, as the data is in a private repo on the hub (before we come to a decision about audio data privacy), the needed checks cannot be done right now.", "@lhoestq I check the data redownloading for configs sharing the same languages, you were right: the data is downloaded once for each language. But samples are generated from scratch each time. Is it a supposed behavior? ", "> But samples are generated from scratch each time. Is it a supposed behavior?\r\n\r\nYea that's the way it works right now, because we generate one arrow file per configuration. Since changing the languages creates a new configuration, then it generates a new arrow file." ]
1,121,753,385
3,665
Fix MP3 resampling when a dataset's audio files have different sampling rates
closed
2022-02-02T10:31:45
2022-02-02T10:52:26
2022-02-02T10:52:26
https://github.com/huggingface/datasets/pull/3665
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3665", "html_url": "https://github.com/huggingface/datasets/pull/3665", "diff_url": "https://github.com/huggingface/datasets/pull/3665.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3665.patch", "merged_at": "2022-02-02T10:52:25" }
lhoestq
true
[]
1,121,233,301
3,664
[WIP] Return local paths to Common Voice
closed
2022-02-01T21:48:27
2022-02-22T09:14:06
2022-02-22T09:14:06
https://github.com/huggingface/datasets/pull/3664
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3664", "html_url": "https://github.com/huggingface/datasets/pull/3664", "diff_url": "https://github.com/huggingface/datasets/pull/3664.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3664.patch", "merged_at": null }
anton-l
true
[ "Cool thanks for giving it a try @anton-l ! \r\n\r\nWould be very much in favor of having \"real\" paths to the audio files again for non-streaming use cases. At the same time it would be nice to make the audio data loading script as understandable as possible so that the community can easily add audio datasets in the future by looking at this one as an example. Think if it's clear for a contributor how to add an audio datasets script that works for the standard non-streaming case while it is easy to extend it afterwards to a streaming dataset script, then this would be perfect", "@anton-l @patrickvonplaten @lhoestq Is it possible somehow to provide this logic inside the library instead of a loading script so that we don't need to completely rewrite all the scripts for audio datasets and users don't have to care about two different loading approaches in the same script? 🤔 ", "> @anton-l @patrickvonplaten @lhoestq Is it possible somehow to provide this logic inside the library instead of a loading script so that we don't need to completely rewrite all the scripts for audio datasets and users don't have to care about two different loading approaches in the same script? thinking\r\n\r\nNot sure @lhoestq - what do you think? \r\n\r\nNow that we've corrected the previous resampling bug, think this one here is of high importance. @lhoestq - what do you think how we should proceed here? ", "> @anton-l @patrickvonplaten @lhoestq Is it possible somehow to provide this logic inside the library instead of a loading script so that we don't need to completely rewrite all the scripts for audio datasets and users don't have to care about two different loading approaches in the same script? 🤔\r\n\r\nYes let's do this :)\r\n\r\nMaybe we can change the behavior of `DownloadManager.iter_archive` back to extracting the TAR archive locally, and return an iterable of (local path, file obj). And the `StreamingDownloadManager.iter_archive` can return an iterable of (relative path inside the archive, file obj) ?\r\n\r\nIn this case, a dataset would need to have something like this:\r\n```python\r\nfor path, f in files:\r\n yield id_, {\"audio\": {\"path\": path, \"bytes\": f.read() if not is_local_file(path) else None}}\r\n```\r\n\r\nAlternatively, we can allow this if we consider that `Audio.encode_example` sets the \"bytes\" field to `None` automatically if `path` is a local path:\r\n```python\r\nfor path, f in files:\r\n yield id_, {\"audio\": {\"path\": path, \"bytes\": f.read()}}\r\n```\r\nNote that in this case the file is read for nothing though (maybe it's not a big deal ?)\r\n\r\nLet me know if it sounds good to you and what you'd prefer !", "@lhoestq I'm very much in favor of your first aproach! With the full paths returned I think we won't even need to mess with `os.path.join` vs `\"/\".join()\"` and other local/streaming differences 👍 ", "@lhoestq I also like the idea and favor your first approach to avoid an unnecessary read and make yielding faster.", "Looks cool - thanks for working on this. I just feel strongly about `path` being an absolute `path` that exist and can be inspected in the non-streaming case :-) For streaming=True IMO it's absolutely fine if we only have access to the bytes", "Hi ! I started implementing this but I noticed that returning an absolute path is breaking for many datasets that do things like\r\n```python\r\nfor path, f in files:\r\n if path.startswith(data_dir):\r\n ...\r\n```\r\nso I think I will have to add a parameter to `iter_archive` like `extract_locally=True` to avoid the breaking change, does that sound good to you ?\r\n\r\nThis makes me also think that in streaming mode it could also return a local path too, if we think that writing and deleting temporary files on-the-fly while iterating over the streaming dataset is ok.", "@lhoestq I think it is a good idea to rollback to extracting the archives locally in non-streaming mode, as far as (as you mentioned) we do not store the bytes in the Arrow file for those cases to avoid \"doubling\" the disk space usage.\r\n\r\nOn the other hand, I don't like:\r\n- neither the possibility to avoid extracting locally in non-streaming: the behavior should be consistent; thus we always extract in non-streaming\r\n - which could be the criterium to decide whether an archive should or should not be extracted? Just because I want to make a condition on path.startswith?\r\n- nor the option to download/delete temporary files in streaming (see discussion here: https://github.com/huggingface/datasets/pull/3689#issuecomment-1032858345)\r\n\r\nUnfortunately, in order to fix the datasets that are breaking after the rollback, I would suggest fixing their scripts so that the paths are handled more robustly (considering that they can be absolute or relative).", "I agree with Albert, fixing all of the audio datasets isn't too big of a deal (yet). I can help with those if needed :)", "Ok cool ! I'm completely rolling it back then", "Alright I did the rollback and now you can get local paths :)\r\nFeel free to try it out and let me know if it's good for you", "I'll fix the CI tomorrow x)", "Ok according to the CI there around 60+ datasets to fix", "> fixing all of the audio datasets isn't too big of a deal (yet). I can help with those if needed :)\r\n\r\nI can help with them too :)\r\n", "Here is the full list to keep track of things:\r\n\r\n- [x] air_dialogue\r\n- [x] id_nergrit_corpus\r\n- [ ] id_newspapers_2018\r\n- [x] imdb\r\n- [ ] indic_glue\r\n- [ ] inquisitive_qg\r\n- [x] klue\r\n- [x] lama\r\n- [x] lex_glue\r\n- [ ] lm1b\r\n- [x] amazon_polarity\r\n- [ ] mac_morpho\r\n- [ ] math_dataset\r\n- [ ] md_gender_bias\r\n- [ ] mdd\r\n- [ ] assin\r\n- [ ] atomic\r\n- [ ] babi_qa\r\n- [ ] mlqa\r\n- [ ] mocha\r\n- [ ] blended_skill_talk\r\n- [ ] capes\r\n- [ ] cbt\r\n- [ ] newsgroup\r\n- [ ] cifar10\r\n- [ ] cifar100\r\n- [ ] norec\r\n- [ ] ohsumed\r\n- [ ] code_x_glue_cc_clone_detection_poj104\r\n- [x] openslr\r\n- [ ] orange_sum\r\n- [ ] paws\r\n- [ ] paws-x\r\n- [ ] cppe-5\r\n- [ ] polyglot_ner\r\n- [ ] dbrd\r\n- [ ] empathetic_dialogues\r\n- [ ] eraser_multi_rc\r\n- [ ] flores\r\n- [ ] flue\r\n- [ ] food101\r\n- [ ] py_ast\r\n- [ ] qasc\r\n- [ ] qasper\r\n- [ ] race\r\n- [ ] reuters21578\r\n- [ ] ropes\r\n- [ ] rotten_tomatoes\r\n- [x] vivos\r\n- [ ] wi_locness\r\n- [ ] wiki_movies\r\n- [ ] wikiann\r\n- [ ] wmt20_mlqe_task1\r\n- [ ] wmt20_mlqe_task2\r\n- [ ] wmt20_mlqe_task3\r\n- [ ] scicite\r\n- [ ] xsum\r\n- [ ] scielo\r\n- [ ] scifact\r\n- [ ] setimes\r\n- [ ] social_bias_frames\r\n- [ ] sogou_news\r\n- [x] speech_commands\r\n- [ ] ted_hrlr\r\n- [ ] ted_multi\r\n- [ ] tlc\r\n- [ ] turku_ner_corpus\r\n\r\n", "I'll do my best to fix as many as possible tomorrow :)", "the audio datasets are fixed if I didn't forget anything :)\r\n\r\nbtw what are we gonna do with the community ones that would be broken after the fix?", "Closing in favor of https://github.com/huggingface/datasets/pull/3736" ]
1,121,067,647
3,663
[Audio] Path of Common Voice cannot be used for audio loading anymore
closed
2022-02-01T18:40:10
2022-09-21T15:03:09
2022-09-21T14:56:22
https://github.com/huggingface/datasets/issues/3663
null
patrickvonplaten
false
[ "Having talked to @lhoestq, I see that this feature is no longer supported. \r\n\r\nI really don't think this was a good idea. It is a major breaking change and one for which we don't even have a working solution at the moment, which is bad for PyTorch as we don't want to force people to have `datasets` decode audio files automatically, but **really** bad for Tensorflow and Flax where we **currently cannot** even use `datasets` to load `.mp3` files - e.g. `common_voice` doesn't work anymore in a TF training script. Note this worked perfectly fine before making the change (think it was done [here](https://github.com/huggingface/datasets/pull/3290) no?)\r\n\r\nIMO, it's really important to think about a solution here and I strongly favor to make a difference here between loading a dataset in streaming mode and in non-streaming mode, so that in non-streaming mode the actual downloaded file is displayed. It's really crucial for people to be able to analyse the original files IMO when the dataset is not downloaded in streaming mode. \r\n\r\nThere are the following reasons why it is paramount to have access to the **original** audio file in my opinion (in non-streaming mode):\r\n- There are a wide variety of different libraries to load audio data with varying support on different platforms. For me it was quite clear that there is simply to single good library to load audio files for all platforms - so we have to leave the option to the user to decide which loading to use.\r\n- We had support for audio datasets a long time before streaming audio was possible. There were quite some versions where we advertised **everywhere** to load the audio from the path name (and there are many places where we still do even though it's not possible anymore). To give some examples:\r\n - Official example of TF Wav2Vec2: https://github.com/huggingface/transformers/blob/f427e750490b486944cc9be3c99834ad5cf78b57/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1423 Wav2Vec2 is as important for speech as BERT is for NLP - so it's **very** important. The official example currently doesn't work and we don't even have a workaround for it for MP3 files at the moment. Same goes for Flax.\r\n - The most downloaded non-nlp checkpoint: https://huggingface.co/facebook/wav2vec2-base-960h#usage has a usage example which doesn't work anymore with the current datasets implementation. I'll update this now, but we have >1000 wav2vec2 checkpoints on the Hub and we can't update all the model cards.\r\n => This is a big breaking change with no current solution. For `transformers` breaking changes are one of the biggest complaints.\r\n- Similar to this we also shouldn't assume that there is only one resampling method for Audio. I think it's good to have one offered automatically by `datasets`, but we have to leave the user the freedom to choose her/his own resampling as well. Resampling can take very different filtering windows and other parameters which are currently somewhat hardcoded in `datasets`, which users might very well want to change.\r\n\r\n\r\n=> IMO, it's a **very** big priority to again have the correct absolute path in non-streaming mode. The other solution of providing a path-like object derived from the bytes stocked in the `.array` file is not nearly as user-friendly, but better than nothing. ", "Agree that we need to have access to the original sound files. Few days ago I was looking for these original files because I suspected there is bug in the audio resampling (confirmed in https://github.com/huggingface/datasets/issues/3662) and I want to do my own resampling to workaround the bug, which is now not possible anymore due to the unavailability of the original files.", "@patrickvonplaten \r\n> The other solution of providing a path-like object derived from the bytes stocked in the .array file is not nearly as user-friendly, but better than nothing\r\n\r\nJust to clarify, here you describe the approach that uses the `Audio.decode` attribute to access the underlying bytes?\r\n\r\n> The official example currently doesn't work and we don't even have a workaround for it for MP3 files at the moment\r\n\r\nI'd assume this is because we use `sox_io` as a backend for decoding. However, soon we should be able to use `soundfile`, which supports path-like objects, for MP3 (https://github.com/huggingface/datasets/pull/3667#issuecomment-1030090627).\r\n\r\nYour concern is reasonable, but there are situations where we can only serve bytes (see https://github.com/huggingface/datasets/pull/3685 for instance). IMO it makes sense to fix the affected datasets for now, but I don't think we should care too much whether we rely on local paths or bytes after soundfile adds support for MP3 as long as our examples work (shouldn't be too hard to update the `map_to_array` functions) and we properly document how to access the underlying path/bytes for custom decoding (via `ds.cast_column(\"audio\", Audio(decode=False))`).\r\n", "Related to this discussion: in https://github.com/huggingface/datasets/pull/3664#issuecomment-1031866858 I propose how we could change `iter_archive` to work for streaming and also return local paths (as it used too !). I'd love your opinions on this", "> @patrickvonplaten\r\n> \r\n> > The other solution of providing a path-like object derived from the bytes stocked in the .array file is not nearly as user-friendly, but better than nothing\r\n> \r\n> Just to clarify, here you describe the approach that uses the `Audio.decode` attribute to access the underlying bytes?\r\n\r\nYes! \r\n\r\n> \r\n> > The official example currently doesn't work and we don't even have a workaround for it for MP3 files at the moment\r\n> \r\n> I'd assume this is because we use `sox_io` as a backend for decoding. However, soon we should be able to use `soundfile`, which supports path-like objects, for MP3 ([#3667 (comment)](https://github.com/huggingface/datasets/pull/3667#issuecomment-1030090627)). \r\n> Your concern is reasonable, but there are situations where we can only serve bytes (see #3685 for instance). IMO it makes sense to fix the affected datasets for now, but I don't think we should care too much whether we rely on local paths or bytes after soundfile adds support for MP3 as long as our examples work (shouldn't be too hard to update the `map_to_array` functions) and we properly document how to access the underlying path/bytes for custom decoding (via `ds.cast_column(\"audio\", Audio(decode=False))`).\r\n\r\nYes this might be, but I highly doubt that `soundfile` is the go-to library for audio then. @anton-l and I have tried out a bunch of different audio loading libraries (`soundfile`, `librosa`, `torchaudio`, pure `ffmpeg`, `audioread`, ...). One thing that was pretty clear to me is that there is just no \"de-facto standard\" library and they all have pros and cons. None of the libraries really supports \"batch\"-ed audio loading. Some depend on PyTorch. `torchaudio` is 100x faster (really!) than `librosa's` fallback on MP3. `torchaudio` often has problems with multi-proessing, ... Also we should keep in mind that resampling is similarly not as simple as reading a text file. It's a pretty complex signal processing transform and people very well might want to use special filters, etc...at the moment we just hard-code `torchaudio's` or `librosa's` default filter when doing resampling.\r\n\r\n=> All this to say that we **should definitely** care about whether we rely on local paths or bytes IMO. We don't want to loose all users that are forced to use `datasets` decoding or resampling or have to built a very much not intuitive way of loading bytes into a numpy array. It's much more intuitive to be able to inspect a local file. I feel pretty strongly about this and am happy to also jump on a call. Keeping libraries flexible and lean as well as exposing internals is very important IMO (this philosophy has worked quite well so far with Transformers).\r\n\r\n", "Thanks a lot for the very detailed explanation. Now everything makes much more sense.", "From https://github.com/huggingface/datasets/pull/3736 the Common Voice dataset now gives access to the local audio files as before", "I understand the argument that it is bad to have a breaking change. How to deal with the introduction of breaking changes is a topic of its own and not sure how you want to deal with that (or is the policy this is never allowed, and there must be a `load_dataset_v2` or so if you really want to introduce a breaking change?).\r\n\r\nRegardless of whether it is a breaking change, however, I don't see the other arguments.\r\n\r\n> but **really** bad for Tensorflow and Flax where we **currently cannot** even use `datasets` to load `.mp3` files\r\n\r\nI don't exactly understand this. Why not?\r\n\r\nWhy does the HF dataset on-the-fly decoding mechanism not work? Why is it anyway specific to PyTorch or TensorFlow? Isn't this independent?\r\n\r\nBut even if you just provide the raw bytes to TF, on TF you could just use sth like `tfio.audio.decode_mp3` or `tf.audio.decode_ogg` or `tfio.audio.decode_flac`?\r\n\r\n> There are the following reasons why it is paramount to have access to the original audio file in my opinion ...\r\n\r\nI don't really understand the arguments (despite that it maybe breaks existing code). You anyway have the original audio files but it is just embedded in the dataset? I don't really know about any library which cannot also load the audio from memory (i.e. from the dataset).\r\n\r\nBtw, on librosa being slow for decoding audio files, I saw that as well, so we have this comment RETURNN:\r\n\r\n> Don't use librosa.load which internally uses audioread which would use Gstreamer as a backend which has multiple issues:\r\n> https://github.com/beetbox/audioread/issues/62\r\n> https://github.com/beetbox/audioread/issues/63\r\n> Instead, use PySoundFile (soundfile), which is also faster. See here for discussions:\r\n> https://github.com/beetbox/audioread/issues/64\r\n> https://github.com/librosa/librosa/issues/681\r\n\r\nResampling is also a separate aspect, which is also less straightforward and with different compromises between speed and quality. So there the different tradeoffs and different implementations can make a difference.\r\n\r\nHowever, I don't see how this is related to the question whether there should be the raw bytes inside the dataset or as separate local files.\r\n", "Thanks for your comments here @albertz - cool to get your input! \r\n\r\nAnswering a bit here between the lines:\r\n\r\n> I understand the argument that it is bad to have a breaking change. How to deal with the introduction of breaking changes is a topic of its own and not sure how you want to deal with that (or is the policy this is never allowed, and there must be a `load_dataset_v2` or so if you really want to introduce a breaking change?).\r\n> \r\n> Regardless of whether it is a breaking change, however, I don't see the other arguments.\r\n> \r\n> > but **really** bad for Tensorflow and Flax where we **currently cannot** even use `datasets` to load `.mp3` files\r\n> \r\n> I don't exactly understand this. Why not?\r\n\r\n> Why does the HF dataset on-the-fly decoding mechanism not work? Why is it anyway specific to PyTorch or TensorFlow? Isn't this independent?\r\n\r\nThe problem with decoding on the fly is that we currently rely on `torchaudio` for this now which relies on `torch` which is not necessarily something people would like to install when using `tensorflow` or `flax`. Therefore we cannot just rely on people using the decoding on the fly method. We just didn't find a library that is ML framework independent and fast enough for all formats. `torchaudio` is currently in our opinion by far the best here.\r\n\r\nSo for TF and Flax it's important that users can load audio files or bytes they way the want to - this might become less important if we find (or make) a good library with few dependencies that is fast for all kinds of platforms / use cases.\r\n\r\n\r\nNow the question is whether it's better to store audio data as a path to a file or as raw bytes I guess.\\\r\nMy main arguments for storing the audio data as a path to a file is pretty much all about users experience - I don't really expect our users to understand the inner workings of datasets:\r\n\r\n- 1. It's not straightforward to know which function to use to decode it - not all `load_audio(...)` or `read_audio(...)` work on raw bytes. E.g. Looking at https://pytorch.org/audio/stable/torchaudio.html?highlight=load#torchaudio.load one would not see directly how to load raw bytes . There are also some functions of other libraries which only work on files which would require the user to save the bytes as a file first before being able to load it.\r\n- 2. It's difficult to see which format the bytes are coming from (mp3, ogg, ...) - guess this could be remedied by adding the format to each sample though\r\n- 3. It is a bit scary IMO to see raw bytes for users. Overall, I think it's better to leave the data in it's raw form as this way it's much easier for people to play around with the audio files, less need to read docs because people don't worry about what happened to the audio files (are the bytes already resampled?)\r\n\r\nBut the argument that the audio should be loadable directly from memory is good - haven't thought about this too much. \r\nI guess it's still very much possible for the user to do this:\r\n\r\n```python\r\ndef save_as_bytes:\r\n batch[\"bytes\"] = read_in_bytes_from_file(batch[\"file\"])\\\r\n os.remove(batch[\"file\"])\r\n\r\nds = ds.map(save_as_bytes)\r\n\r\nds.save_to_disk(...)\r\n```\r\n\r\nGuess the question is more a bit about what should be the default case?", "> The problem with decoding on the fly is that we currently rely on `torchaudio` for this now which relies on `torch` which is not necessarily something people would like to install when using `tensorflow` or `flax`. Therefore we cannot just rely on people using the decoding on the fly method. We just didn't find a library that is ML framework independent and fast enough for all formats. `torchaudio` is currently in our opinion by far the best here.\r\n\r\nBut how is this relevant for this issue here? I thought this issue here is about having the (correct) path in the dataset or having raw bytes in the dataset.\r\n\r\nHow did TF users use it at all then? Or they just do not use on-the-fly decoding? I did not even notice this problem (maybe because I had `torchaudio` installed). But what do they use instead?\r\n\r\nBut as I outlined before, they could just use `tfio.audio.decode_flac` and co, where it would be more natural if you already provide the raw bytes.\r\n\r\n> Looking at https://pytorch.org/audio/stable/torchaudio.html?highlight=load#torchaudio.load one would not see directly how to load raw bytes\r\n\r\nI was not really familiar with `torchaudio`. It seems that they really don't provide an easy/direct API to operate on raw bytes. Which is very strange and unfortunate because as far as I can see, all the underlying backend libraries (e.g. soundfile) easily allow that. So I would say that this is the fault of `torchaudio` then. But despite, if you anyway use `torchaudio` with `soundfile` backend, why not just use `soundfile` directly. It's very simple to use and crossplatform.\r\n\r\nBut ok, now we are just discussing how to handle the on-the-fly decoding. I still think this is a separate issue and having raw bytes in the dataset instead of local files should just be fine as well.\r\n\r\n\r\n> It is a bit scary IMO to see raw bytes for users.\r\n\r\nI think nobody who writes code is scared by seeing the raw bytes content of a binary file. :)\r\n\r\n\r\n> I guess it's still very much possible for the user to do this:\r\n> \r\n> ```python\r\n> def save_as_bytes:\r\n> batch[\"bytes\"] = read_in_bytes_from_file(batch[\"file\"])\\\r\n> os.remove(batch[\"file\"])\r\n> \r\n> ds = ds.map(save_as_bytes)\r\n> \r\n> ds.save_to_disk(...)\r\n> ```\r\n\r\nIn https://github.com/huggingface/datasets/pull/4184#issuecomment-1105191639, you said/proposed that this `map` is not needed anymore and `save_to_disk` could do it automatically (maybe via some option)?\r\n\r\n> Guess the question is more a bit about what should be the default case?\r\n\r\nYea this is up to you. I'm happy as long as we can get it the way we want easily and this is a well supported use case. :)\r\n", "> In https://github.com/huggingface/datasets/pull/4184#issuecomment-1105191639, you said/proposed that this map is not needed anymore and save_to_disk could do it automatically (maybe via some option)?\r\n\r\nYes! Should be super easy now see discussion here: https://github.com/rwth-i6/i6_core/issues/257#issuecomment-1105494468\r\n\r\nThanks for the super useful input :-)", "Despite the comments that this has been fixed, I am finding the exact same problem is occurring again (with datasets version 2.3.2)", "> Despite the comments that this has been fixed, I am finding the exact same problem is occurring again (with datasets version 2.3.2)\r\n\r\nIt appears downgrading to torchaudio 0.11.0 fixed this problem.", "@DCNemesis, sorry which problem exactly is occuring again? Also cc @lhoestq @polinaeterna here", "@patrickvonplaten @lhoestq @polinaeterna I was unable to load audio from Common Voice using 🤗 with the current version of torchaudio, but downgrading to torchaudio 0.11.0 fixed it. This is probably more of a torch problem than a Hugging Face problem.", "@DCNemesis that's interesting, could you please share the error message if you still can access it? ", "@polinaeterna I believe it is the same exact error as above. It occurs on other .mp3 sources as well, but the problem is with torchaudio > 0.11.0. I've created a short colab notebook that reproduces the error, and the fix here: https://colab.research.google.com/drive/18wsuwdHwBPN3JkcnhEtk8MUYqF9swuWZ?usp=sharing", "Hi @DCNemesis,\r\n\r\nYour issue was slightly different from the original one in this issue page. Yours seems related to a change in the backend used by `torchaudio` (`ffmpeg` instead of `sox`). Refer to the issue page here:\r\n- #4776\r\n\r\nNormally, it should be circumvented with the patch made by @polinaeterna in:\r\n- #4923", "I think the original issue reported here was already fixed by:\r\n- #3736\r\n\r\nOtherwise, feel free to reopen." ]
1,121,024,403
3,662
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates
closed
2022-02-01T17:55:04
2022-02-02T10:52:25
2022-02-02T10:52:25
https://github.com/huggingface/datasets/issues/3662
null
lhoestq
false
[ "Thanks @lhoestq for finding the reason of incorrect resampling. This issue affects all languages which have sound files with different sampling rates such as Turkish and Luganda.", "@cahya-wirawan - do you know how many languages have different sampling rates in Common Voice? I'm quite surprised to see this for multiple languages actually", "@cahya-wirawan, I can reproduce the problem for Common Voice 7 for Turkish. Here a script you can use:\r\n\r\n\r\n```python\r\n#!/usr/bin/env python3\r\nfrom datasets import load_dataset\r\nimport torchaudio\r\nfrom io import BytesIO\r\nfrom datasets import Audio\r\nfrom collections import Counter\r\nimport sys\r\n\r\nds_name = str(sys.argv[1])\r\nlang = str(sys.argv[2])\r\n\r\nds = load_dataset(ds_name, lang, split=\"train\", use_auth_token=True)\r\nds = ds.cast_column(\"audio\", Audio(decode=False))\r\n\r\nall_sampling_rates = []\r\n\r\n\r\ndef print_sampling_rate(x):\r\n x, sr = torchaudio.load(BytesIO(x[\"audio\"][\"bytes\"]), format=\"mp3\")\r\n all_sampling_rates.append(sr)\r\n\r\nds.map(print_sampling_rate)\r\n\r\n\r\nprint(Counter(all_sampling_rates))\r\n```\r\n\r\ncan be run with:\r\n\r\n```bash\r\npython run.py mozilla-foundation/common_voice_7_0 tr\r\n```\r\n\r\nFor CV 6.1 all samples seem to have the same audio", "It actually shows that many more samples are in 32kHz format than it 48kHz which is unexpected. Thanks a lot for flagging! Will contact Common Voice about this as well", "I only checked the CV 7.0 for Turkish, Luganda and Indonesian, they have audio files with difference sampling rates, and all of them are affected by this issue. Percentage of incorrect resampling as follow, Turkish: 9.1%, Luganda: 88.2% and Indonesian: 64.1%.\r\nI checked it using the original CV files. I check the original sampling rates and the length of audio array of each files and compare it with the length of audio array (and the sampling rate which is always 48kHz) from mozilla-foundation/common_voice_7_0 datasets. if the length of audio array from dataset is not equal to 48kHz/original sampling rate * length of audio array of the original audio file then it is affected,", "Ok wow, thanks a lot for checking this - you've found a pretty big bug :sweat_smile: It seems like **a lot** more datasets are actually affected than I original thought. We'll try to solve this as soon as possible and make an announcement tomorrow." ]
1,121,000,251
3,661
Remove unnecessary 'r' arg in
closed
2022-02-01T17:29:27
2022-02-07T16:57:27
2022-02-07T16:02:42
https://github.com/huggingface/datasets/pull/3661
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3661", "html_url": "https://github.com/huggingface/datasets/pull/3661", "diff_url": "https://github.com/huggingface/datasets/pull/3661.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3661.patch", "merged_at": "2022-02-07T16:02:42" }
bryant1410
true
[ "The CI failure is only because of the datasets is missing some sections in their cards - we can ignore that since it's unrelated to this PR" ]
1,120,982,671
3,660
Change HTTP links to HTTPS
open
2022-02-01T17:12:51
2022-09-21T15:16:32
null
https://github.com/huggingface/datasets/pull/3660
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3660", "html_url": "https://github.com/huggingface/datasets/pull/3660", "diff_url": "https://github.com/huggingface/datasets/pull/3660.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3660.patch", "merged_at": null }
bryant1410
true
[]
1,120,913,672
3,659
push_to_hub but preview not working
closed
2022-02-01T16:23:57
2022-02-09T08:00:37
2022-02-09T08:00:37
https://github.com/huggingface/datasets/issues/3659
null
thomas-happify
false
[ "Hi @thomas-happify, please note that the preview may take some time before rendering the data.\r\n\r\nI've seen it is already working.\r\n\r\nI close this issue. Please feel free to reopen it if the problem arises again." ]
1,120,880,395
3,658
Dataset viewer issue for *P3*
closed
2022-02-01T15:57:56
2023-09-25T12:16:21
2023-09-25T12:16:21
https://github.com/huggingface/datasets/issues/3658
null
jeffistyping
false
[ "The error is now:\r\n\r\n```\r\nStatus code: 400\r\nException: Status400Error\r\nMessage: this dataset is not supported for now.\r\n```\r\n\r\nWe've disabled the dataset viewer for several big datasets like this one. We hope being able to reenable it soon.", "The list of splits cannot be obtained. cc @huggingface/datasets ", "```\r\nError code: SplitsNamesError\r\nException: SplitsNotFoundError\r\nMessage: The split names could not be parsed from the dataset config.\r\nTraceback: Traceback (most recent call last):\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py\", line 354, in get_dataset_config_info\r\n for split_generator in builder._split_generators(\r\n File \"/tmp/modules-cache/datasets_modules/datasets/bigscience--P3/12c0badfecad4564ecb8a6f81b5d0559656f269f08b13c59c93283f3a84134ba/P3.py\", line 154, in _split_generators\r\n data_dir = dl_manager.download_and_extract(_URLs)\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py\", line 944, in download_and_extract\r\n return self.extract(self.download(url_or_urls))\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py\", line 907, in extract\r\n urlpaths = map_nested(self._extract, path_or_paths, map_tuple=True)\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py\", line 393, in map_nested\r\n mapped = [\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py\", line 394, in <listcomp>\r\n _single_map_nested((function, obj, types, None, True, None))\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py\", line 346, in _single_map_nested\r\n return {k: _single_map_nested((function, v, types, None, True, None)) for k, v in pbar}\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py\", line 346, in <dictcomp>\r\n return {k: _single_map_nested((function, v, types, None, True, None)) for k, v in pbar}\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py\", line 346, in _single_map_nested\r\n return {k: _single_map_nested((function, v, types, None, True, None)) for k, v in pbar}\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py\", line 346, in <dictcomp>\r\n return {k: _single_map_nested((function, v, types, None, True, None)) for k, v in pbar}\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py\", line 330, in _single_map_nested\r\n return function(data_struct)\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py\", line 912, in _extract\r\n protocol = _get_extraction_protocol(urlpath, use_auth_token=self.download_config.use_auth_token)\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py\", line 402, in _get_extraction_protocol\r\n return _get_extraction_protocol_with_magic_number(f)\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py\", line 367, in _get_extraction_protocol_with_magic_number\r\n magic_number = f.read(MAGIC_NUMBER_MAX_LENGTH)\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/implementations/http.py\", line 574, in read\r\n return super().read(length)\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/spec.py\", line 1575, in read\r\n out = self.cache._fetch(self.loc, self.loc + length)\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/caching.py\", line 377, in _fetch\r\n self.cache = self.fetcher(start, bend)\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/asyn.py\", line 111, in wrapper\r\n return sync(self.loop, func, *args, **kwargs)\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/asyn.py\", line 96, in sync\r\n raise return_result\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/asyn.py\", line 53, in _runner\r\n result[0] = await coro\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/implementations/http.py\", line 616, in async_fetch_range\r\n out = await r.read()\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/aiohttp/client_reqrep.py\", line 1036, in read\r\n self._body = await self.content.read()\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/aiohttp/streams.py\", line 375, in read\r\n block = await self.readany()\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/aiohttp/streams.py\", line 397, in readany\r\n await self._wait(\"readany\")\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/aiohttp/streams.py\", line 304, in _wait\r\n await waiter\r\n aiohttp.client_exceptions.ClientPayloadError: Response payload is not completed\r\n \r\n The above exception was the direct cause of the following exception:\r\n \r\n Traceback (most recent call last):\r\n File \"/src/services/worker/src/worker/responses/splits.py\", line 75, in get_splits_response\r\n split_full_names = get_dataset_split_full_names(dataset, hf_token)\r\n File \"/src/services/worker/src/worker/responses/splits.py\", line 35, in get_dataset_split_full_names\r\n return [\r\n File \"/src/services/worker/src/worker/responses/splits.py\", line 38, in <listcomp>\r\n for split in get_dataset_split_names(dataset, config, use_auth_token=hf_token)\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py\", line 404, in get_dataset_split_names\r\n info = get_dataset_config_info(\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py\", line 359, in get_dataset_config_info\r\n raise SplitsNotFoundError(\"The split names could not be parsed from the dataset config.\") from err\r\n datasets.inspect.SplitsNotFoundError: The split names could not be parsed from the dataset config.\r\n```", "Closing in favor of https://huggingface.co/datasets/bigscience/P3/discussions/6 and https://github.com/huggingface/datasets-server/issues/1689" ]
1,120,602,620
3,657
Extend dataset builder for streaming in `get_dataset_split_names`
closed
2022-02-01T12:21:24
2022-02-03T22:49:06
2022-02-02T11:22:01
https://github.com/huggingface/datasets/pull/3657
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3657", "html_url": "https://github.com/huggingface/datasets/pull/3657", "diff_url": "https://github.com/huggingface/datasets/pull/3657.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3657.patch", "merged_at": "2022-02-02T11:22:01" }
mariosasko
true
[ "I'm impatient to see if it has an impact on the number of valid datasets for the dataset viewer. For the record, today:\r\n\r\n<img width=\"660\" alt=\"Capture d’écran 2022-02-01 à 14 32 19\" src=\"https://user-images.githubusercontent.com/1676121/151977579-b5a239d9-6662-4aeb-bfd1-eef6b8249991.png\">\r\n", "This is now available in `datasets` 1.18.3 :)", "I'm on it https://github.com/huggingface/datasets-preview-backend/issues/130\r\n", "The result:\r\n<img width=\"671\" alt=\"Capture d’écran 2022-02-03 à 23 45 55\" src=\"https://user-images.githubusercontent.com/1676121/152442169-bfdac643-9a00-4901-bfa7-1d60a1679d4b.png\">\r\n\r\nNot very different. Maybe it fixed issues in the community datasets... But I'm not 100% the two states are comparable (datasets have been created, or updated, meanwhile)" ]
1,120,510,823
3,656
checksum error subjqa dataset
closed
2022-02-01T10:53:33
2022-02-10T10:56:59
2022-02-10T10:56:38
https://github.com/huggingface/datasets/issues/3656
null
RensDimmendaal
false
[ "Hi @RensDimmendaal, \r\n\r\nI'm sorry but I can't reproduce your bug:\r\n```python\r\nIn [1]: from datasets import load_dataset\r\n ...: ds = load_dataset(\"subjqa\", \"electronics\")\r\nDownloading builder script: 9.15kB [00:00, 4.10MB/s] \r\nDownloading metadata: 17.7kB [00:00, 8.51MB/s] \r\nDownloading and preparing dataset subjqa/electronics (download: 10.86 MiB, generated: 3.01 MiB, post-processed: Unknown size, total: 13.86 MiB) to .../.cache/huggingface/datasets/subjqa/electronics/1.1.0/e5588f9298ff2d70686a00cc377e4bdccf4e32287459e3c6baf2dc5ab57fe7fd...\r\nDownloading data: 11.4MB [00:03, 3.50MB/s]\r\nDataset subjqa downloaded and prepared to .../.cache/huggingface/datasets/subjqa/electronics/1.1.0/e5588f9298ff2d70686a00cc377e4bdccf4e32287459e3c6baf2dc5ab57fe7fd. Subsequent calls will reuse this data.\r\n100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 605.09it/s]\r\n\r\nIn [2]: ds\r\nOut[2]: \r\nDatasetDict({\r\n train: Dataset({\r\n features: ['domain', 'nn_mod', 'nn_asp', 'query_mod', 'query_asp', 'q_reviews_id', 'question_subj_level', 'ques_subj_score', 'is_ques_subjective', 'review_id', 'id', 'title', 'context', 'question', 'answers'],\r\n num_rows: 1295\r\n })\r\n test: Dataset({\r\n features: ['domain', 'nn_mod', 'nn_asp', 'query_mod', 'query_asp', 'q_reviews_id', 'question_subj_level', 'ques_subj_score', 'is_ques_subjective', 'review_id', 'id', 'title', 'context', 'question', 'answers'],\r\n num_rows: 358\r\n })\r\n validation: Dataset({\r\n features: ['domain', 'nn_mod', 'nn_asp', 'query_mod', 'query_asp', 'q_reviews_id', 'question_subj_level', 'ques_subj_score', 'is_ques_subjective', 'review_id', 'id', 'title', 'context', 'question', 'answers'],\r\n num_rows: 255\r\n })\r\n})\r\n```\r\n\r\nCould you please try again and see if the problem persists?\r\n\r\nIf that is the case, you can circumvent the issue by passing `ignore_verifications`:\r\n```python\r\nds = load_dataset(\"subjqa\", \"electronics\", ignore_verifications=True)", "Thanks checking!\r\n\r\nYou're totally right. I don't know what's changed, but I'm glad it's working now!\r\n\r\n" ]
1,119,801,077
3,655
Pubmed dataset not reachable
closed
2022-01-31T18:45:47
2022-12-19T19:18:10
2022-02-14T14:15:41
https://github.com/huggingface/datasets/issues/3655
null
abhi-mosaic
false
[ "Hi @abhi-mosaic, thanks for reporting.\r\n\r\nI'm looking at it... ", "also hitting this issue", "Hey @albertvillanova, sorry to reopen this... I can confirm that on `master` branch the dataset is downloadable now but it is still broken in streaming mode:\r\n\r\n```python\r\n >>> import datasets\r\n >>> pubmed_train = datasets.load_dataset('pubmed', split='train', streaming=True)\r\n >>> next(iter(pubmed_train))\r\n```\r\n```\r\n No such file or directory: 'gzip://pubmed22n0001.xml::ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed22n0001.xml.gz'\r\n```\r\n", "Hi @abhi-mosaic, would you mind opening another issue for this new problem?\r\n\r\nFirst issue (already solved) was a ConnectionError due to the yearly update release of PubMed: we fixed it by updating the URLs from year 2021 to year 2022.\r\n\r\nHowever this is another problem: to make pubmed streamable. Please note that NOT all our datastes are streamable: we are making streamable more and more of them... but this is an on-going process...\r\n\r\nThanks.", "@albertvillanova \r\nWhen I tried below codes, I got the similar error\r\n\r\n```\r\n\r\ndataset=load_dataset(\"pubmed\",split=\"train\")\r\n\r\nCouldn't reach ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0601.xml.gz\r\n```", "@y-rok you need to update `datasets`:\r\n```shell\r\npip install -U datasets\r\n```" ]
1,119,717,475
3,654
Better TQDM output
closed
2022-01-31T17:22:43
2022-02-03T15:55:34
2022-02-03T15:55:33
https://github.com/huggingface/datasets/pull/3654
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3654", "html_url": "https://github.com/huggingface/datasets/pull/3654", "diff_url": "https://github.com/huggingface/datasets/pull/3654.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3654.patch", "merged_at": "2022-02-03T15:55:33" }
mariosasko
true
[ "@lhoestq I've created a notebook for you to see the difference: https://colab.research.google.com/drive/1by3EqnoKvC2p-yKW4lPDGOFOZHyGVyeQ?usp=sharing.\r\n\r\nFeel free to suggest better descriptions for the progress bars. \r\n\r\nIf everything looks good, think we can merge." ]
1,119,186,952
3,653
`to_json` in multiprocessing fashion sometimes deadlock
open
2022-01-31T09:35:07
2022-01-31T09:35:07
null
https://github.com/huggingface/datasets/issues/3653
null
thomasw21
false
[]
1,118,808,738
3,652
sp. Columbia => Colombia
closed
2022-01-31T00:41:03
2022-02-09T16:55:25
2022-01-31T08:29:07
https://github.com/huggingface/datasets/pull/3652
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3652", "html_url": "https://github.com/huggingface/datasets/pull/3652", "diff_url": "https://github.com/huggingface/datasets/pull/3652.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3652.patch", "merged_at": "2022-01-31T08:29:07" }
serapio
true
[ "The original openslr site mixed both names https://openslr.org/72/ :-)", "Yeah, I filed the issue to have it fixed there last year, but it looks like they missed a few." ]
1,118,597,647
3,651
Update link in wiki_bio dataset
closed
2022-01-30T16:28:54
2022-01-31T14:50:48
2022-01-31T08:38:09
https://github.com/huggingface/datasets/pull/3651
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3651", "html_url": "https://github.com/huggingface/datasets/pull/3651", "diff_url": "https://github.com/huggingface/datasets/pull/3651.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3651.patch", "merged_at": "2022-01-31T08:38:09" }
jxmorris12
true
[ "> all the tests pass, but I'm still not able to import the dataset\r\n\r\nSince it's not merged on `master` yet, you have to provide the path to your local `wiki_bio.py` to use it.\r\nIndeed the library downloads the dataset files from `master` if you have a dev installation of the library.\r\n\r\nI agree it would be nice to change that, and use the local dataset scripts from the `datasets` directory - it feels definitely more natural.", "Cool, thanks for your help and I agree!" ]
1,118,537,429
3,650
Allow 'to_json' to run in unordered fashion in order to lower memory footprint
closed
2022-01-30T13:23:19
2023-09-25T06:28:51
2023-09-24T16:45:48
https://github.com/huggingface/datasets/pull/3650
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3650", "html_url": "https://github.com/huggingface/datasets/pull/3650", "diff_url": "https://github.com/huggingface/datasets/pull/3650.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3650.patch", "merged_at": null }
thomasw21
true
[ "Hi @thomasw21, I remember suggesting `imap_unordered` to @lhoestq at that time to speed up `to_json` further but after trying `pool_imap` on multiple datasets (>9GB) , memory utilisation was almost constant and we decided to go ahead with that only. \r\n\r\n1. Did you try this without `gzip`? Because `gzip` feature was introduced recently and I didn't check multi_proc thing with `gzip`. One thing I know is that `gzip` is slow in our implementation than `zip` (it's a WIP #3551) \r\n2. You can try reducing your batch size, this can also help in avoiding OOM errors!", "Thanks @bhavitvyamalik ! I see. I'm not sure this PR actually fixes things for me either (I ended up reducing the num_proc/batch_size to lower it). It does allow the process to run for longer, but I think the reason why it was waiting is that one of the process crashes .... Unfortunately I was working on a setup with a low RAM/cpu core ratio. I'm actually very surprised that it doesn't change memory utilization, otherwise I don't see the purpose of `imap_unordered` existing. I think it's main purpose are when you have high variance in samples (in terms of bytes), which causes unecessary accumulation in `imap`\r\n 1. Did not try without `gzip`\r\n 2. Yeah or `num_proc`", "Can you please try without `gzip` to see how it performs? If it works fine then we can improve `gzip` from our side (I'm already working on it)", "I'll be busy for next few weeks on another project, will do as soon as I have some bandwidth.\r\n", "Should we close this PR?", "Yes we can close this PR if considered unneeded." ]
1,117,502,250
3,649
Add IGLUE dataset
open
2022-01-28T14:59:41
2022-01-28T15:02:35
null
https://github.com/huggingface/datasets/issues/3649
null
lewtun
false
[]
1,117,465,505
3,648
Fix Windows CI: bump python to 3.7
closed
2022-01-28T14:24:54
2022-01-28T14:40:39
2022-01-28T14:40:39
https://github.com/huggingface/datasets/pull/3648
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3648", "html_url": "https://github.com/huggingface/datasets/pull/3648", "diff_url": "https://github.com/huggingface/datasets/pull/3648.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3648.patch", "merged_at": "2022-01-28T14:40:39" }
lhoestq
true
[]
1,117,383,675
3,647
Fix `add_column` on datasets with indices mapping
closed
2022-01-28T13:06:29
2022-01-28T15:35:58
2022-01-28T15:35:58
https://github.com/huggingface/datasets/pull/3647
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3647", "html_url": "https://github.com/huggingface/datasets/pull/3647", "diff_url": "https://github.com/huggingface/datasets/pull/3647.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3647.patch", "merged_at": "2022-01-28T15:35:57" }
mariosasko
true
[ "Sure, let's include this in today's release.", "Cool ! The windows CI should be fixed on master now, feel free to merge :)" ]
1,116,544,627
3,646
Fix streaming datasets that are not reset correctly
closed
2022-01-27T17:21:02
2022-01-28T16:34:29
2022-01-28T16:34:28
https://github.com/huggingface/datasets/pull/3646
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3646", "html_url": "https://github.com/huggingface/datasets/pull/3646", "diff_url": "https://github.com/huggingface/datasets/pull/3646.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3646.patch", "merged_at": "2022-01-28T16:34:28" }
lhoestq
true
[ "Works smoothly with the `transformers.Trainer` class now, thank you!" ]
1,116,541,298
3,645
Streaming dataset based on dl_manager.iter_archive/iter_files are not reset correctly
closed
2022-01-27T17:17:41
2022-01-28T16:34:28
2022-01-28T16:34:28
https://github.com/huggingface/datasets/issues/3645
null
lhoestq
false
[]
1,116,519,670
3,644
Add a GROUP BY operator
open
2022-01-27T16:57:54
2025-01-28T11:39:48
null
https://github.com/huggingface/datasets/issues/3644
null
felix-schneider
false
[ "Hi ! At the moment you can use `to_pandas()` to get a pandas DataFrame that supports `group_by` operations (make sure your dataset fits in memory though)\r\n\r\nWe use Arrow as a back-end for `datasets` and it doesn't have native group by (see https://github.com/apache/arrow/issues/2189) unfortunately.\r\n\r\nI just drafted what it could look like to have `group_by` in `datasets`:\r\n```python\r\nfrom datasets import concatenate_datasets\r\n\r\ndef group_by(d, col, join): \r\n \"\"\"from: https://github.com/huggingface/datasets/issues/3644\"\"\"\r\n # Get the indices of each group\r\n groups = {key: [] for key in d.unique(col)} \r\n def create_groups_indices(key, i): \r\n groups[key].append(i) \r\n d.map(create_groups_indices, with_indices=True, input_columns=col) \r\n # Get one dataset object per group\r\n groups = {key: d.select(indices) for key, indices in groups.items()} \r\n # Apply join function\r\n groups = {\r\n key: dataset_group.map(join, batched=True, batch_size=len(dataset_group), remove_columns=d.column_names)\r\n for key, dataset_group in groups.items()\r\n } \r\n # Return concatenation of all the joined groups\r\n return concatenate_datasets(groups.values())\r\n```\r\n\r\nexample of usage:\r\n```python\r\n\r\ndef join(batch): \r\n # take the batch of all the examples of a group, and return a batch with one aggregated example\r\n # (we could aggregate examples into several rows instead of one, if you want)\r\n return {\"total\": [batch[\"i\"]]} \r\n\r\nd = Dataset.from_dict({\r\n \"i\": [i for i in range(50)],\r\n \"group_key\": [i % 4 for i in range(50)],\r\n})\r\nprint(group_by(d, \"group_key\", join))\r\n# total\r\n# 0 [0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48]\r\n# 1 [1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49]\r\n# 2 [2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46]\r\n# 3 [3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47]\r\n```\r\n\r\nLet me know if that helps !\r\n\r\ncc @albertvillanova @mariosasko for visibility", "@lhoestq As of PyArrow 7.0.0, `pa.Table` has the [`group_by` method](https://arrow.apache.org/docs/python/generated/pyarrow.Table.html#pyarrow.Table.group_by), so we should also consider using that function for grouping. ", "Any update on this?", "You can use https://github.com/mariosasko/datasets_sql by @mariosasko to go group by operations using SQL queries", "Hi, I have a similar issue as OP but the suggested solutions do not work for my case. Basically, I process documents through a model to extract the last_hidden_state, using the \"map\" method on a Dataset object, but would like to average the result over a categorical column at the end (i.e. groupby this column).\r\n- A to_pandas() saturates the memory, although it gives me the desired result through a .groupby().apply(np.mean, axis=0) on a smaller use-case,\r\n- The solution posted on Feb 4 is much too slow,\r\n- datasets_sql seems to not like the fact that I'm averaging np.arrays.\r\nSo I'm kinda out of \"non brute force\" options... Any help appreciated", "> Hi, I have a similar issue as OP but the suggested solutions do not work for my case. Basically, I process documents through a model to extract the last_hidden_state, using the \"map\" method on a Dataset object, but would like to average the result over a categorical column at the end (i.e. groupby this column).\r\n \r\nIf you haven't yet, you could explore using [Polars](https://www.pola.rs/) for this. It's a new DataFrame library written in Rust with Python bindings. It is Pandas like it in many ways ,but does have some biggish differences in syntax/approach so it's definitely not a drop-in replacement. \r\n\r\nPolar's also uses Arrow as a backend but also supports out-of-memory operations; in this case, it's probably easiest to write out your dataset to parquet and then use the polar's `scan_parquet` method (this will lazily read from the parquet file). The thing you get back from that is a `LazyDataFrame` i.e. nothing is loaded into memory until you specify a query and call a `collect` method. \r\n\r\nExample below of doing a groupby on a dataset which definitely wouldn't fit into memory on my machine:\r\n\r\n```\r\nfrom datasets import load_dataset\r\nimport polars as pl\r\n\r\nds = load_dataset(\"blbooks\")\r\nds['train'].to_parquet(\"test.parquet\")\r\ndf = pl.scan_parquet(\"test.parquet\")\r\ndf.groupby('date').agg([pl.count()]).collect()\r\n```\r\n\r\n>datasets_sql seems to not like the fact that I'm averaging np.arrays.\r\n\r\nI am not certain how Polars will handle this either. It does have NumPy support (https://pola-rs.github.io/polars-book/user-guide/howcani/interop/numpy.html) but I assume Polars will need to have at least enough memory in each group you want to average over so you may still end up needing more memory depending on the size of your dataset/groups. \r\n\r\n\r\n", "Hi @davanstrien , thanks a lot, I didn't know about this library and the answer works! I need to try it on the full dataset now, but I'm hopeful. Here's what my code looks like:\r\n```\r\nlist_size = 768\r\ndf.groupby(\"date\").agg(\r\n pl.concat_list(\r\n [\r\n pl.col(\"hidden_state\")\r\n .arr.slice(n, 1)\r\n .arr.first()\r\n .mean()\r\n for n in range(0, list_size)\r\n ]\r\n ).collect()\r\n```\r\n\r\nFor some reasons, the following code was giving me a \"mean() got unexpected argument 'axis'\":\r\n```\r\ndf2 = df.groupby('date').agg(\r\n pl.col(\"hidden_state\").map(np.mean).alias(\"average_hidden_state\")\r\n).collect()\r\n\r\n```\r\n\r\nEDIT: The solution works on my large dataset, the memory does not crash and the time is reasonable, thanks a lot again!", "@jeremylhour glad this worked for you :) ", "I find this functionality missing in my workflow as well and the workarounds with SQL and Polars unsatisfying. Since PyArrow has exposed this functionality, I hope this soon makes it into a release. (:", "Any update on this feature? ", "We added a proper Polars integration at #3334 if it can help:\r\n```python\r\n>>> from datasets import load_dataset\r\n>>> ds = load_dataset(\"TheBritishLibrary/blbooks\", \"1700_1799\", split=\"train\")\r\n>>> ds.to_polars().groupby('date').len()\r\n┌─────────────────────┬──────┐\r\n│ date ┆ len │\r\n│ --- ┆ --- │\r\n│ datetime[ms] ┆ u32 │\r\n╞═════════════════════╪══════╡\r\n│ 1796-01-01 00:00:00 ┆ 5831 │\r\n│ 1775-01-01 00:00:00 ┆ 4697 │\r\n│ 1749-01-01 00:00:00 ┆ 1118 │\r\n│ 1740-01-01 00:00:00 ┆ 713 │\r\n│ 1714-01-01 00:00:00 ┆ 865 │\r\n│ … ┆ … │\r\n│ 1795-01-01 00:00:00 ┆ 5930 │\r\n│ 1754-01-01 00:00:00 ┆ 1373 │\r\n│ 1780-01-01 00:00:00 ┆ 1970 │\r\n│ 1734-01-01 00:00:00 ┆ 1047 │\r\n│ 1719-01-01 00:00:00 ┆ 1235 │\r\n└─────────────────────┴──────┘\r\n```\r\n", "Umm... did any responses GET REQUESTS? I cannot understand why 'integrations' are mentioned.", "@lhoestq so does `to_polars` work with memory mapping? Because to_pandas doesn't, does it?", "According to the [polars docs](https://docs.pola.rs/api/python/dev/reference/api/polars.from_arrow.html):\n\n> This operation will be zero copy for the most part. Types that are not supported by Polars may be cast to the closest supported type.\n\nwhich means that for the most part the memory mapped data is not copied, so yes it works with memory mapping :)" ]
1,116,417,428
3,643
Fix sem_eval_2018_task_1 download location
closed
2022-01-27T15:45:00
2022-02-04T15:15:26
2022-02-04T15:15:26
https://github.com/huggingface/datasets/pull/3643
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3643", "html_url": "https://github.com/huggingface/datasets/pull/3643", "diff_url": "https://github.com/huggingface/datasets/pull/3643.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3643.patch", "merged_at": "2022-02-04T15:15:26" }
maxpel
true
[ "I fixed those two things, the two remaining failing checks seem to be due to some dependency missing in the tests." ]
1,116,306,986
3,642
Fix dataset slicing with negative bounds when indices mapping is not `None`
closed
2022-01-27T14:45:53
2022-01-27T18:16:23
2022-01-27T18:16:22
https://github.com/huggingface/datasets/pull/3642
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3642", "html_url": "https://github.com/huggingface/datasets/pull/3642", "diff_url": "https://github.com/huggingface/datasets/pull/3642.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3642.patch", "merged_at": "2022-01-27T18:16:22" }
mariosasko
true
[]
1,116,284,268
3,641
Fix numpy rngs when seed is None
closed
2022-01-27T14:29:09
2022-01-27T18:16:08
2022-01-27T18:16:07
https://github.com/huggingface/datasets/pull/3641
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3641", "html_url": "https://github.com/huggingface/datasets/pull/3641", "diff_url": "https://github.com/huggingface/datasets/pull/3641.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3641.patch", "merged_at": "2022-01-27T18:16:07" }
mariosasko
true
[]
1,116,133,769
3,640
Issues with custom dataset in Wav2Vec2
closed
2022-01-27T12:09:05
2022-01-27T12:29:48
2022-01-27T12:29:48
https://github.com/huggingface/datasets/issues/3640
null
peregilk
false
[ "Closed and moved to transformers." ]
1,116,021,420
3,639
same value of precision, recall, f1 score at each epoch for classification task.
closed
2022-01-27T10:14:16
2022-02-24T09:02:18
2022-02-24T09:02:17
https://github.com/huggingface/datasets/issues/3639
null
Dhanachandra
false
[ "Hi @Dhanachandra, \r\n\r\nWe have tests for all our metrics and they work as expected: under the hood, we use scikit-learn implementations.\r\n\r\nMaybe the cause is somewhere else. For example:\r\n- Is it a binary or a multiclass or a multilabel classification? Default computation of these metrics is for binary classification; if you would like multiclass or multilabel, you should pass the corresponding parameters; see their documentation (e.g.: https://scikit-learn.org/stable/modules/generated/sklearn.metrics.precision_score.html) or code below:\r\n\r\nhttps://huggingface.co/docs/datasets/using_metrics.html#computing-the-metric-scores\r\n\r\n```python\r\nIn [1]: from datasets import load_metric\r\n\r\nIn [2]: precision = load_metric(\"precision\")\r\n\r\nIn [3]: print(precision.inputs_description)\r\n\r\nArgs:\r\n predictions: Predicted labels, as returned by a model.\r\n references: Ground truth labels.\r\n labels: The set of labels to include when average != 'binary', and\r\n their order if average is None. Labels present in the data can\r\n be excluded, for example to calculate a multiclass average ignoring\r\n a majority negative class, while labels not present in the data will\r\n result in 0 components in a macro average. For multilabel targets,\r\n labels are column indices. By default, all labels in y_true and\r\n y_pred are used in sorted order.\r\n average: This parameter is required for multiclass/multilabel targets.\r\n If None, the scores for each class are returned. Otherwise, this\r\n determines the type of averaging performed on the data:\r\n binary: Only report results for the class specified by pos_label.\r\n This is applicable only if targets (y_{true,pred}) are binary.\r\n micro: Calculate metrics globally by counting the total true positives,\r\n false negatives and false positives.\r\n macro: Calculate metrics for each label, and find their unweighted mean.\r\n This does not take label imbalance into account.\r\n weighted: Calculate metrics for each label, and find their average\r\n weighted by support (the number of true instances for each label).\r\n This alters ‘macro’ to account for label imbalance; it can result\r\n in an F-score that is not between precision and recall.\r\n samples: Calculate metrics for each instance, and find their average\r\n (only meaningful for multilabel classification).\r\n sample_weight: Sample weights.\r\n\r\nReturns:\r\n precision: Precision score.\r\n\r\nExamples:\r\n\r\n >>> precision_metric = datasets.load_metric(\"precision\")\r\n >>> results = precision_metric.compute(references=[0, 1], predictions=[0, 1])\r\n >>> print(results)\r\n {'precision': 1.0}\r\n\r\n >>> predictions = [0, 2, 1, 0, 0, 1]\r\n >>> references = [0, 1, 2, 0, 1, 2]\r\n >>> results = precision_metric.compute(predictions=predictions, references=references, average='macro')\r\n >>> print(results)\r\n {'precision': 0.2222222222222222}\r\n >>> results = precision_metric.compute(predictions=predictions, references=references, average='micro')\r\n >>> print(results)\r\n {'precision': 0.3333333333333333}\r\n >>> results = precision_metric.compute(predictions=predictions, references=references, average='weighted')\r\n >>> print(results)\r\n {'precision': 0.2222222222222222}\r\n >>> results = precision_metric.compute(predictions=predictions, references=references, average=None)\r\n >>> print(results)\r\n {'precision': array([0.66666667, 0. , 0. ])}\r\n```\r\n" ]
1,115,725,703
3,638
AutoTokenizer hash value got change after datasets.map
open
2022-01-27T03:19:03
2024-03-11T13:56:15
null
https://github.com/huggingface/datasets/issues/3638
null
tshu-w
false
[ "This issue was original reported at https://github.com/huggingface/transformers/issues/14931 and It seems like this issue also occur with other AutoClass like AutoFeatureExtractor.", "Thanks for moving the issue here !\r\n\r\nI wasn't able to reproduce the issue on my env (the hashes stay the same):\r\n```\r\n- `transformers` version: 1.15.0\r\n- `tokenizers` version: 0.10.3\r\n- `datasets` version: 1.18.1\r\n- `dill` version: 0.3.4\r\n- Platform: Linux-4.19.0-18-cloud-amd64-x86_64-with-debian-10.11\r\n- Python version: 3.7.10\r\n- PyArrow version: 6.0.1\r\n```\r\nHowever I was able to reproduce it on Google Colab (the hashes end up different):\r\n```\r\n- `transformers` version: 1.15.0\r\n- `tokenizers` version: 0.10.3\r\n- `datasets` version: 1.18.1\r\n- `dill` version: 0.3.4\r\n- Platform: Linux-5.4.144+-x86_64-with-Ubuntu-18.04-bionic\r\n- Python version: 3.7.12\r\n- PyArrow version: 3.0.0\r\n```\r\nI'll investigate why it doesn't work properly on Google Colab :)", "I found the issue: the tokenizer has something inside it that changes.\r\n\r\nBefore the call, `tokenizer._tokenizer.truncation` is None, and after the call it changes to this for some reason:\r\n```\r\n{'max_length': 512, 'strategy': 'longest_first', 'stride': 0}\r\n```\r\n\r\nDoes anybody know why calling the tokenizer would change its state this way ? cc @Narsil @SaulLu maybe ?", "`tokenizer.encode(..)` does not accept argument like max_length, strategy or stride.\r\n\r\nIn `tokenizers` you have to modify the tokenizer state by setting various `TruncationParams` (and/or `PaddingParams`).\r\nHowever, since this is modifying the state, you need to mutably borrow the tokenizer (a rust concept). The key principle is that there can ever be only 1 mutable borrow at a time during the span of the tokenizer lifecycle.\r\n\r\nBecause of this, if `transformers` blindly set `TruncationParams` and `PaddingParams` on every call, it would cause the tokenizer to crash (or make the various threads accessing it hang, which is not necessarily better).\r\n\r\nIn order to avoid that, we decided to handle it this way : https://github.com/huggingface/transformers/pull/12550 . \r\n\r\nWhich should explain the state of the tokenizer being modified (hence its hash).\r\n\r\nNow for a temporary solution, simply encoding once with the tokenizer should give it it's proper hash (since by default the tokenizer doesn't have this state, looks at the first encoding call, and creates it).\r\n\r\nWe could try and set these 2 dicts at initialization time, but it wouldn't work if a user modified the tokenizer state later\r\n```python\r\ntokenizer = AutoTokenizer.from_pretrained(..)\r\ntokenizer.truncation_side = \"left\"\r\n# Now we have a difference between `tokenizer._tokenizer.truncation` and `tokenizer.truncation_side`\r\n```\r\nIf we wanted to fix it correctly it would mean mapping every assignation to it's proper location on `tokenizer.{padding/truncation}`\r\n\r\nI think it's important to note that we cannot guarantee a tokenizer' hash remains the same if *any* of those parameters are modified through the `.map` function.\r\n\r\nEdit: Another option would be to override the default __hash__ function, but I don't know if there's a sound implementation that could fit.", "Thanks a lot for the explanation !\r\nI think if we set these 2 dicts at initialization time it would be amazing already\r\n\r\nShall we open an issue in `transformers` to ask for these dictionaries to be set when the tokenizer is instantiated ?\r\n\r\n> Edit: Another option would be to override the default hash function, but I don't know if there's a sound implementation that could fit.\r\n\r\nIn `datasets` we can easily have custom hashing for objects of the other HF libraries if we want. For example we ignore the cache some tokenizers have. However in this specific case it touches parameters that may change the behavior of the tokenizer itself. I'm not sure the logic that determines how a tokenizer behaves should be in `datasets`", "A hack we could have in the `datasets` lib would be to call the tokenizer before hashing it in order to set all its parameters correctly - but it sounds a lot like a hack and I'm not sure this can work in the long run", "Fully agree with everything you said. \r\n\r\nI think the best course of action is creating an issue in `transformers`. I can start the work on this.\r\nI think the code changes are fairly simple. Making a sound test + not breaking other stuff might be different :D", "It should be noted that this problem also occurs in other AutoClasses, such as AutoFeatureExtractor, so I don't think handling it in Datasets is a long-term practice either.", "> I think the best course of action is creating an issue in `transformers`. I can start the work on this.\r\n\r\n@Narsil Hi, I reopen this issue in `transformers` https://github.com/huggingface/transformers/issues/14931", "Here is @Narsil comment from https://github.com/huggingface/transformers/issues/14931#issuecomment-1074981569\r\n> # TL;DR\r\n> Call the function once on a dummy example beforehand will fix it.\r\n> \r\n> ```python\r\n> tokenizer(\"Some\", \"test\", truncation=True)\r\n> ```\r\n> \r\n> # Long answer\r\n> If I remember the last status, it's hard doing anything, since the call itself\r\n> \r\n> ```python\r\n> tokenizer(example[\"sentence1\"], example[\"sentence2\"], truncation=True)\r\n> ```\r\n> \r\n> will modify the tokenizer. It's the `truncation=True` that modifies the tokenizer to put it into truncation mode if you will. Calling the tokenizer once with that argument would fix the cache.\r\n> \r\n> Finding a fix that :\r\n> \r\n> * Doesn't imply a huge chunk of work on `tokenizers` (with potential loss of performance, and breaking backward compatibility)\r\n> * Doesn't imply `datasets` running a first pass of the loop\r\n> * Doesn't imply `datasets` looking at the map function itself\r\n> * Uses a sound `hash` for this object in `datasets`.\r\n> \r\n> is IIRC impossible for this use case.\r\n> \r\n> I can explain a bit more why the first option is not desirable.\r\n> \r\n> In order to \"fix\" this for tokenizers, we would need to make `tokenizer(..)` purely without side effects. This means that the \"options\" of tokenization (like `truncation` and `padding` at least) would have\r\n", "For me this workaround only works if I don't pass the `num_proc=X` argument to `datasets.map`", "Is there an easy solution for setting both num_proc and padding/truncation for fast tokenizer or caching just not a thing in this case? " ]
1,115,526,438
3,637
[TypeError: Couldn't cast array of type] Cannot load dataset in v1.18
closed
2022-01-26T21:38:02
2022-02-09T16:15:53
2022-02-09T16:15:53
https://github.com/huggingface/datasets/issues/3637
null
lewtun
false
[ "Hi @lewtun!\r\n \r\nThis one was tricky to debug. Initially, I tought there is a bug in the recently-added (by @lhoestq ) `cast_array_to_feature` function because `git bisect` points to the https://github.com/huggingface/datasets/commit/6ca96c707502e0689f9b58d94f46d871fa5a3c9c commit. Then, I noticed that the feature tpye of the `dialogue` field is `list`, which explains why you didn't get an error in earlier versions. Is there a specific reason why you use `list` instead of `Sequence` in the script? Maybe to avoid turning list of dicts to dicts of lists as it's done by `Sequence` for compatibility with TFDS or for performance reasons? If the field was `Sequence`, you would get an error in `encode_nested_example` because **the scripts yields some additional (nested) columns which are not specified in the `features` dictionary**. Previously, these additional columns would've been ignored by PyArrow (1), but now we have a check for them (2).\r\n(1) See PyArrow behavior:\r\n```\r\n>>> pa.array([{\"a\": 2, \"b\": 3}], type=pa.struct({\"a\": pa.int32()})) # pyarrow ignores the extra column\r\n-- is_valid: all not null\r\n-- child 0 type: int32\r\n [\r\n 2\r\n ]\r\n ```\r\n\r\n(2) Check:\r\nhttps://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/table.py#L1059\r\n\r\nThe fix is very simple: just add the missing columns to the _EMPTY_BELIEF_STATE list:\r\n```python\r\n_EMPTY_BELIEF_STATE.extend(['通用-产品类别', '火车-舱位档次', '通用-系列', '通用-价格区间', '通用-品牌'])\r\n```", "Hey @mariosasko, thank you so much for figuring this one out - it certainly looks like a tricky bug 😱 ! I don't think there's a specific reason to use `list` instead of `Sequence` with the script, but I'll let the dataset creators know to see if your suggestion is acceptable.\r\n\r\nThank you again!", "Thanks, this was indeed the fix! Would it make sense to produce a more informative error message in such cases? \r\n\r\nThe issue can be closed. \r\n\r\n" ]
1,115,362,702
3,636
Update index.rst
closed
2022-01-26T18:43:09
2022-01-26T18:44:55
2022-01-26T18:44:54
https://github.com/huggingface/datasets/pull/3636
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3636", "html_url": "https://github.com/huggingface/datasets/pull/3636", "diff_url": "https://github.com/huggingface/datasets/pull/3636.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3636.patch", "merged_at": "2022-01-26T18:44:54" }
VioletteLepercq
true
[]
1,115,333,219
3,635
Make `ted_talks_iwslt` dataset streamable
closed
2022-01-26T18:07:56
2022-10-04T09:36:23
2022-10-03T09:44:47
https://github.com/huggingface/datasets/pull/3635
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3635", "html_url": "https://github.com/huggingface/datasets/pull/3635", "diff_url": "https://github.com/huggingface/datasets/pull/3635.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3635.patch", "merged_at": null }
mariosasko
true
[ "Thanks for adding this @mariosasko! It worked for me when running it with a local data file, however, when using the file on Google Drive I get the following error:\r\n```Python\r\nds = load_dataset(\"./ted_talks_iwslt\",\"eu_ca_2014\", streaming=True, split=\"train\", use_auth_token=True)\r\nnext(iter(ds))\r\n```\r\n```\r\n---------------------------------------------------------------------------\r\nClientResponseError Traceback (most recent call last)\r\nFile ~/git/bigscience-datasets/env/lib/python3.9/site-packages/fsspec/implementations/http.py:383, in HTTPFileSystem._info(self, url, **kwargs)\r\n 381 try:\r\n 382 info.update(\r\n--> 383 await _file_info(\r\n 384 url,\r\n 385 size_policy=policy,\r\n 386 session=session,\r\n 387 **self.kwargs,\r\n 388 **kwargs,\r\n 389 )\r\n 390 )\r\n 391 if info.get(\"size\") is not None:\r\n\r\nFile ~/git/bigscience-datasets/env/lib/python3.9/site-packages/fsspec/implementations/http.py:734, in _file_info(url, session, size_policy, **kwargs)\r\n 733 async with r:\r\n--> 734 r.raise_for_status()\r\n 736 # TODO:\r\n 737 # recognise lack of 'Accept-Ranges',\r\n 738 # or 'Accept-Ranges': 'none' (not 'bytes')\r\n 739 # to mean streaming only, no random access => return None\r\n\r\nFile ~/git/bigscience-datasets/env/lib/python3.9/site-packages/aiohttp/client_reqrep.py:1004, in ClientResponse.raise_for_status(self)\r\n 1003 self.release()\r\n-> 1004 raise ClientResponseError(\r\n 1005 self.request_info,\r\n 1006 self.history,\r\n 1007 status=self.status,\r\n 1008 message=self.reason,\r\n 1009 headers=self.headers,\r\n 1010 )\r\n\r\nClientResponseError: 403, message='Forbidden', url=URL('https://drive.google.com/u/0/uc?id=1Cz1Un9p8Xn9IpEMMrg2kXSDt0dnjxc4z&export=download&confirm=1RJz')\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nFileNotFoundError Traceback (most recent call last)\r\nInput In [9], in <module>\r\n 1 iterable = iter(ds)\r\n 2 for i in range(10):\r\n----> 3 item = next(iterable)\r\n 4 print(item['text'][:10], item['meta'])\r\n\r\nFile ~/git/bigscience-datasets/env/lib/python3.9/site-packages/datasets/iterable_dataset.py:341, in IterableDataset.__iter__(self)\r\n 340 def __iter__(self):\r\n--> 341 for key, example in self._iter():\r\n 342 if self.features:\r\n 343 # we encode the example for ClassLabel feature types for example\r\n 344 encoded_example = self.features.encode_example(example)\r\n\r\nFile ~/git/bigscience-datasets/env/lib/python3.9/site-packages/datasets/iterable_dataset.py:338, in IterableDataset._iter(self)\r\n 336 else:\r\n 337 ex_iterable = self._ex_iterable\r\n--> 338 yield from ex_iterable\r\n\r\nFile ~/git/bigscience-datasets/env/lib/python3.9/site-packages/datasets/iterable_dataset.py:78, in ExamplesIterable.__iter__(self)\r\n 77 def __iter__(self):\r\n---> 78 for key, example in self.generate_examples_fn(**self.kwargs):\r\n 79 yield key, example\r\n\r\nFile ~/.cache/huggingface/modules/datasets_modules/datasets/lm_en_ted_talks_iwslt/756148758e86e64a350f9b320744a2bd5ed5cff74f7df620763a2b5e1a45e6c6/lm_en_ted_talks_iwslt.py:118, in TedTalksIWSLT._generate_examples(self, files)\r\n 116 for _LANG in _LANG_CODES:\r\n 117 source_file_path = _YEAR_FOLDER[year] + \"/ted_\" + _LANG + _YEAR[year] + \".zip\"\r\n--> 118 for path, file in files:\r\n 119 if path.endswith(source_file_path):\r\n 120 source_talks, _ = parse_zip_file(path, file.read())\r\n\r\nFile ~/git/bigscience-datasets/env/lib/python3.9/site-packages/datasets/utils/streaming_download_manager.py:596, in StreamingDownloadManager.iter_archive(self, urlpath_or_buf)\r\n 594 yield from _iter_archive(urlpath_or_buf)\r\n 595 else:\r\n--> 596 with xopen(urlpath_or_buf, \"rb\", use_auth_token=self.download_config.use_auth_token) as f:\r\n 597 yield from _iter_archive(f)\r\n\r\nFile ~/git/bigscience-datasets/env/lib/python3.9/site-packages/datasets/utils/streaming_download_manager.py:296, in xopen(file, mode, use_auth_token, *args, **kwargs)\r\n 294 new_kwargs = {}\r\n 295 kwargs = {**kwargs, **new_kwargs}\r\n--> 296 file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open()\r\n 297 _add_retries_to_file_obj_read_method(file_obj)\r\n 298 return file_obj\r\n\r\nFile ~/git/bigscience-datasets/env/lib/python3.9/site-packages/fsspec/core.py:140, in OpenFile.open(self)\r\n 132 def open(self):\r\n 133 \"\"\"Materialise this as a real open file without context\r\n 134 \r\n 135 The file should be explicitly closed to avoid enclosed file\r\n (...)\r\n 138 been deleted; but a with-context is better style.\r\n 139 \"\"\"\r\n--> 140 out = self.__enter__()\r\n 141 closer = out.close\r\n 142 fobjects = self.fobjects.copy()[:-1]\r\n\r\nFile ~/git/bigscience-datasets/env/lib/python3.9/site-packages/fsspec/core.py:103, in OpenFile.__enter__(self)\r\n 100 def __enter__(self):\r\n 101 mode = self.mode.replace(\"t\", \"\").replace(\"b\", \"\") + \"b\"\r\n--> 103 f = self.fs.open(self.path, mode=mode)\r\n 105 self.fobjects = [f]\r\n 107 if self.compression is not None:\r\n\r\nFile ~/git/bigscience-datasets/env/lib/python3.9/site-packages/fsspec/spec.py:1009, in AbstractFileSystem.open(self, path, mode, block_size, cache_options, compression, **kwargs)\r\n 1007 else:\r\n 1008 ac = kwargs.pop(\"autocommit\", not self._intrans)\r\n-> 1009 f = self._open(\r\n 1010 path,\r\n 1011 mode=mode,\r\n 1012 block_size=block_size,\r\n 1013 autocommit=ac,\r\n 1014 cache_options=cache_options,\r\n 1015 **kwargs,\r\n 1016 )\r\n 1017 if compression is not None:\r\n 1018 from fsspec.compression import compr\r\n\r\nFile ~/git/bigscience-datasets/env/lib/python3.9/site-packages/fsspec/implementations/http.py:343, in HTTPFileSystem._open(self, path, mode, block_size, autocommit, cache_type, cache_options, size, **kwargs)\r\n 341 kw[\"asynchronous\"] = self.asynchronous\r\n 342 kw.update(kwargs)\r\n--> 343 size = size or self.info(path, **kwargs)[\"size\"]\r\n 344 session = sync(self.loop, self.set_session)\r\n 345 if block_size and size:\r\n\r\nFile ~/git/bigscience-datasets/env/lib/python3.9/site-packages/fsspec/asyn.py:91, in sync_wrapper.<locals>.wrapper(*args, **kwargs)\r\n 88 @functools.wraps(func)\r\n 89 def wrapper(*args, **kwargs):\r\n 90 self = obj or args[0]\r\n---> 91 return sync(self.loop, func, *args, **kwargs)\r\n\r\nFile ~/git/bigscience-datasets/env/lib/python3.9/site-packages/fsspec/asyn.py:71, in sync(loop, func, timeout, *args, **kwargs)\r\n 69 raise FSTimeoutError from return_result\r\n 70 elif isinstance(return_result, BaseException):\r\n---> 71 raise return_result\r\n 72 else:\r\n 73 return return_result\r\n\r\nFile ~/git/bigscience-datasets/env/lib/python3.9/site-packages/fsspec/asyn.py:25, in _runner(event, coro, result, timeout)\r\n 23 coro = asyncio.wait_for(coro, timeout=timeout)\r\n 24 try:\r\n---> 25 result[0] = await coro\r\n 26 except Exception as ex:\r\n 27 result[0] = ex\r\n\r\nFile ~/git/bigscience-datasets/env/lib/python3.9/site-packages/fsspec/implementations/http.py:396, in HTTPFileSystem._info(self, url, **kwargs)\r\n 393 except Exception as exc:\r\n 394 if policy == \"get\":\r\n 395 # If get failed, then raise a FileNotFoundError\r\n--> 396 raise FileNotFoundError(url) from exc\r\n 397 logger.debug(str(exc))\r\n 399 return {\"name\": url, \"size\": None, **info, \"type\": \"file\"}\r\n\r\nFileNotFoundError: https://drive.google.com/u/0/uc?id=1Cz1Un9p8Xn9IpEMMrg2kXSDt0dnjxc4z&export=download&confirm=1RJz\r\n```", "Thanks @mariosasko.\r\n\r\nTo make this dataset streamable, we should first host the data on the Hub instead of current Google Drive. Do you know if their license allows to do so? ", "This dataset is licensed under [cc-by-nc-4.0](https://creativecommons.org/licenses/by-nc/4.0/), so I think it should be" ]
1,115,133,279
3,634
Dataset.shuffle(seed=None) gives fixed row permutation
closed
2022-01-26T15:13:08
2022-01-27T18:16:07
2022-01-27T18:16:07
https://github.com/huggingface/datasets/issues/3634
null
elisno
false
[ "I'm not sure if this is expected behavior.\r\n\r\nAm I supposed to work with a copy of the dataset, i.e. `shuffled_dataset = data.shuffle(seed=None)`?\r\n\r\n```diff\r\nimport datasets\r\n\r\n# Some toy example\r\ndata = datasets.Dataset.from_dict(\r\n {\"feature\": [1, 2, 3, 4, 5], \"label\": [\"a\", \"b\", \"c\", \"d\", \"e\"]}\r\n)\r\n\r\n+shuffled_data = data.shuffle(seed=None)\r\n\r\n# Doesn't work as expected\r\nprint(\"Shuffle dataset\")\r\nfor _ in range(3):\r\n+ shuffled_data = shuffled_data.shuffle(seed=None)\r\n+ print(shuffled_data[:])\r\n- print(data.shuffle(seed=None)[:])\r\n\r\n# This seems to work with pandas\r\nprint(\"\\nShuffle via pandas\")\r\nfor _ in range(3):\r\n df = data.to_pandas().sample(frac=1.0)\r\n print(datasets.Dataset.from_pandas(df, preserve_index=False)[:])\r\n\r\n```\r\n\r\nor provide a `generator` instead?\r\n\r\n```diff\r\nimport datasets\r\n+from numpy.random import default_rng\r\n\r\n# Some toy example\r\ndata = datasets.Dataset.from_dict(\r\n {\"feature\": [1, 2, 3, 4, 5], \"label\": [\"a\", \"b\", \"c\", \"d\", \"e\"]}\r\n)\r\n\r\n+rng = default_rng()\r\n\r\n# Doesn't work as expected\r\nprint(\"Shuffle dataset\")\r\nfor _ in range(3):\r\n+ print(data.shuffle(generator=rng)[:])\r\n- print(data.shuffle(seed=None)[:])\r\n\r\n# This seems to work with pandas\r\nprint(\"\\nShuffle via pandas\")\r\nfor _ in range(3):\r\n df = data.to_pandas().sample(frac=1.0)\r\n print(datasets.Dataset.from_pandas(df, preserve_index=False)[:])\r\n\r\n```", "Hi! Thanks for reporting! Yes, this is not expected behavior. I've opened a PR with the fix." ]
1,115,040,174
3,633
Mirror canonical datasets in prod
closed
2022-01-26T13:49:37
2022-01-26T13:56:21
2022-01-26T13:56:21
https://github.com/huggingface/datasets/pull/3633
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3633", "html_url": "https://github.com/huggingface/datasets/pull/3633", "diff_url": "https://github.com/huggingface/datasets/pull/3633.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3633.patch", "merged_at": "2022-01-26T13:56:21" }
lhoestq
true
[]
1,115,027,185
3,632
Adding CC-100: Monolingual Datasets from Web Crawl Data (Datasets links are invalid)
closed
2022-01-26T13:35:37
2022-02-10T06:58:11
2022-02-10T06:58:11
https://github.com/huggingface/datasets/issues/3632
null
AnzorGozalishvili
false
[ "Hi @AnzorGozalishvili,\r\n\r\nMaybe their site was temporarily down, but it seems to work fine now.\r\n\r\nCould you please try again and confirm if the problem persists? ", "Hi @albertvillanova \r\nI checked and it works. \r\nIt seems that it was really temporarily down.\r\nThanks!" ]
1,114,833,662
3,631
Labels conflict when loading a local CSV file.
closed
2022-01-26T10:00:33
2022-02-11T23:02:31
2022-02-11T23:02:31
https://github.com/huggingface/datasets/issues/3631
null
pichljan
false
[ "Hi @pichljan, thanks for reporting.\r\n\r\nThis should be fixed. I'm looking at it. " ]
1,114,578,625
3,630
DuplicatedKeysError of NewsQA dataset
closed
2022-01-26T03:05:49
2022-02-14T08:37:19
2022-02-14T08:37:19
https://github.com/huggingface/datasets/issues/3630
null
StevenTang1998
false
[ "Thanks for reporting, @StevenTang1998.\r\n\r\nI'm fixing it. " ]
1,113,971,575
3,629
Fix Hub repos update when there's a new release
closed
2022-01-25T14:39:45
2022-01-25T14:55:46
2022-01-25T14:55:46
https://github.com/huggingface/datasets/pull/3629
{ "url": "https://api.github.com/repos/huggingface/datasets/pulls/3629", "html_url": "https://github.com/huggingface/datasets/pull/3629", "diff_url": "https://github.com/huggingface/datasets/pull/3629.diff", "patch_url": "https://github.com/huggingface/datasets/pull/3629.patch", "merged_at": "2022-01-25T14:55:46" }
lhoestq
true
[]
1,113,930,644
3,628
Dataset Card Creator drops information for "Additional Information" Section
open
2022-01-25T14:06:17
2022-01-25T14:09:01
null
https://github.com/huggingface/datasets/issues/3628
null
dennlinger
false
[]