url
stringlengths
61
61
repository_url
stringclasses
1 value
labels_url
stringlengths
75
75
comments_url
stringlengths
70
70
events_url
stringlengths
68
68
html_url
stringlengths
51
51
id
int64
1.92B
2.7B
node_id
stringlengths
18
18
number
int64
6.27k
7.3k
title
stringlengths
2
150
user
dict
labels
listlengths
0
2
state
stringclasses
2 values
locked
bool
1 class
assignee
dict
assignees
listlengths
0
1
milestone
null
comments
sequencelengths
0
23
created_at
timestamp[ns]
updated_at
int64
1.7k
1.73k
closed_at
timestamp[ns]
author_association
stringclasses
4 values
active_lock_reason
null
body
stringlengths
3
47.9k
closed_by
dict
reactions
dict
timeline_url
stringlengths
70
70
performed_via_github_app
null
state_reason
stringclasses
3 values
draft
null
pull_request
null
is_pull_request
bool
1 class
time_to_close
float64
0
0
https://api.github.com/repos/huggingface/datasets/issues/6891
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6891/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6891/comments
https://api.github.com/repos/huggingface/datasets/issues/6891/events
https://github.com/huggingface/datasets/issues/6891
2,291,118,869
I_kwDODunzps6Ij7MV
6,891
Unable to load JSON saved using `to_json`
{ "avatar_url": "https://avatars.githubusercontent.com/u/39432636?v=4", "events_url": "https://api.github.com/users/DarshanDeshpande/events{/privacy}", "followers_url": "https://api.github.com/users/DarshanDeshpande/followers", "following_url": "https://api.github.com/users/DarshanDeshpande/following{/other_user}", "gists_url": "https://api.github.com/users/DarshanDeshpande/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/DarshanDeshpande", "id": 39432636, "login": "DarshanDeshpande", "node_id": "MDQ6VXNlcjM5NDMyNjM2", "organizations_url": "https://api.github.com/users/DarshanDeshpande/orgs", "received_events_url": "https://api.github.com/users/DarshanDeshpande/received_events", "repos_url": "https://api.github.com/users/DarshanDeshpande/repos", "site_admin": false, "starred_url": "https://api.github.com/users/DarshanDeshpande/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DarshanDeshpande/subscriptions", "type": "User", "url": "https://api.github.com/users/DarshanDeshpande", "user_view_type": "public" }
[]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[ "Hi @DarshanDeshpande,\r\n\r\nPlease note that the default format of the method `Dataset.to_json` is [JSON-Lines](https://jsonlines.org/): it passes `orient=\"records\", lines=True` to `pandas.DataFrame.to_json`. This format is specially useful for large datasets, since unlike regular JSON files, it does not require loading all the data into memory at once, but can be done iteratively by batches.\r\n\r\nIn order to read this file using the `json` library, you should parse line by line:\r\n```python\r\nwith open(\"full_dataset.json\", \"r\") as f:\r\n data = [json.loads(line) for line in f]\r\nlen(data)\r\n```\r\nMaybe we should explain this better in our docs.", "Now we explain this better in out docs:\r\n- #6895" ]
1970-01-01T00:00:00.000001
1,715
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug Datasets stored in the JSON format cannot be loaded using `json.load()` ### Steps to reproduce the bug ``` import json from datasets import load_dataset dataset = load_dataset("squad") train_dataset, test_dataset = dataset["train"], dataset["validation"] test_dataset.to_json("full_dataset.json") # This works loaded_test = load_dataset("json", data_files="full_dataset.json") # This fails loaded_test = json.load(open("full_dataset.json", "r")) ``` ### Expected behavior The JSON should be correctly formatted when writing so that it can be loaded using `json.load()`. ### Environment info Colab: https://colab.research.google.com/drive/1st1iStFUVgu9ZPvnzSzL4vDeYWDwYpUm?usp=sharing
{ "avatar_url": "https://avatars.githubusercontent.com/u/39432636?v=4", "events_url": "https://api.github.com/users/DarshanDeshpande/events{/privacy}", "followers_url": "https://api.github.com/users/DarshanDeshpande/followers", "following_url": "https://api.github.com/users/DarshanDeshpande/following{/other_user}", "gists_url": "https://api.github.com/users/DarshanDeshpande/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/DarshanDeshpande", "id": 39432636, "login": "DarshanDeshpande", "node_id": "MDQ6VXNlcjM5NDMyNjM2", "organizations_url": "https://api.github.com/users/DarshanDeshpande/orgs", "received_events_url": "https://api.github.com/users/DarshanDeshpande/received_events", "repos_url": "https://api.github.com/users/DarshanDeshpande/repos", "site_admin": false, "starred_url": "https://api.github.com/users/DarshanDeshpande/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DarshanDeshpande/subscriptions", "type": "User", "url": "https://api.github.com/users/DarshanDeshpande", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6891/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6891/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6890
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6890/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6890/comments
https://api.github.com/repos/huggingface/datasets/issues/6890/events
https://github.com/huggingface/datasets/issues/6890
2,288,699,041
I_kwDODunzps6Iasah
6,890
add `with_transform` and/or `set_transform` to IterableDataset
{ "avatar_url": "https://avatars.githubusercontent.com/u/70411813?v=4", "events_url": "https://api.github.com/users/not-lain/events{/privacy}", "followers_url": "https://api.github.com/users/not-lain/followers", "following_url": "https://api.github.com/users/not-lain/following{/other_user}", "gists_url": "https://api.github.com/users/not-lain/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/not-lain", "id": 70411813, "login": "not-lain", "node_id": "MDQ6VXNlcjcwNDExODEz", "organizations_url": "https://api.github.com/users/not-lain/orgs", "received_events_url": "https://api.github.com/users/not-lain/received_events", "repos_url": "https://api.github.com/users/not-lain/repos", "site_admin": false, "starred_url": "https://api.github.com/users/not-lain/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/not-lain/subscriptions", "type": "User", "url": "https://api.github.com/users/not-lain", "user_view_type": "public" }
[ { "color": "a2eeef", "default": true, "description": "New feature or request", "id": 1935892871, "name": "enhancement", "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement" } ]
open
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,715
null
NONE
null
### Feature request when working with a really large dataset it would save us a lot of time (and compute resources) to use either with_transform or the set_transform from the Dataset class instead of waiting for the entire dataset to map ### Motivation don't want to wait for a really long dataset to map, this would give IterableDataset an extra advantage over the Dataset class. reducing time and resources ### Your contribution I am a little busy with my job search lately, but would post about this feature in my social media. Apologies again (dad going to kick me out soon), if I ever have some free time I will contribute to making this a reality, but that's going to be hard     / (┬┬﹏┬┬)\
null
{ "+1": 3, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 3, "url": "https://api.github.com/repos/huggingface/datasets/issues/6890/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6890/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6887
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6887/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6887/comments
https://api.github.com/repos/huggingface/datasets/issues/6887/events
https://github.com/huggingface/datasets/issues/6887
2,286,786,396
I_kwDODunzps6ITZdc
6,887
FAISS load to None
{ "avatar_url": "https://avatars.githubusercontent.com/u/40418544?v=4", "events_url": "https://api.github.com/users/brainer3220/events{/privacy}", "followers_url": "https://api.github.com/users/brainer3220/followers", "following_url": "https://api.github.com/users/brainer3220/following{/other_user}", "gists_url": "https://api.github.com/users/brainer3220/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/brainer3220", "id": 40418544, "login": "brainer3220", "node_id": "MDQ6VXNlcjQwNDE4NTQ0", "organizations_url": "https://api.github.com/users/brainer3220/orgs", "received_events_url": "https://api.github.com/users/brainer3220/received_events", "repos_url": "https://api.github.com/users/brainer3220/repos", "site_admin": false, "starred_url": "https://api.github.com/users/brainer3220/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/brainer3220/subscriptions", "type": "User", "url": "https://api.github.com/users/brainer3220", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "Hello,\r\n\r\nI'm not sure I understand. \r\nThe return value of `ds.load_faiss_index` is None as expected.\r\n\r\nI see that loading an Index on a dataset that doesn't have an `embedding` column doesn't raise an Issue. Is that the issue?\r\n\r\nSo `ds` doesn't have an `embedding` column, but we load an index that looks for it. But this will raise an issue only when calling `ds.search`." ]
1970-01-01T00:00:00.000001
1,715
null
NONE
null
### Describe the bug I've use FAISS with Datasets and save to FAISS. Then load to save FAISS then no error, then ds to None ```python ds.load_faiss_index('embeddings', 'my_index.faiss') ``` ### Steps to reproduce the bug # 1. ```python ds_with_embeddings = ds.map(lambda example: {'embeddings': model(transforms(example['image']).unsqueeze(0)).squeeze()}, batch_size=64) ds_with_embeddings.add_faiss_index(column='embeddings') ds_with_embeddings.save_faiss_index('embeddings', 'index.faiss') ``` # 2. ```python ds.load_faiss_index('embeddings', 'my_index.faiss') ``` ### Expected behavior Add column in Datasets. ### Environment info Google Colab, SageMaker Notebook
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6887/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6887/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6886
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6886/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6886/comments
https://api.github.com/repos/huggingface/datasets/issues/6886/events
https://github.com/huggingface/datasets/issues/6886
2,286,328,984
I_kwDODunzps6IRpyY
6,886
load_dataset with data_dir and cache_dir set fail with not supported
{ "avatar_url": "https://avatars.githubusercontent.com/u/322496?v=4", "events_url": "https://api.github.com/users/fah/events{/privacy}", "followers_url": "https://api.github.com/users/fah/followers", "following_url": "https://api.github.com/users/fah/following{/other_user}", "gists_url": "https://api.github.com/users/fah/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/fah", "id": 322496, "login": "fah", "node_id": "MDQ6VXNlcjMyMjQ5Ng==", "organizations_url": "https://api.github.com/users/fah/orgs", "received_events_url": "https://api.github.com/users/fah/received_events", "repos_url": "https://api.github.com/users/fah/repos", "site_admin": false, "starred_url": "https://api.github.com/users/fah/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/fah/subscriptions", "type": "User", "url": "https://api.github.com/users/fah", "user_view_type": "public" }
[]
open
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,715
null
NONE
null
### Describe the bug with python 3.11 I execute: ```py from transformers import Wav2Vec2Processor, Data2VecAudioModel import torch from torch import nn from datasets import load_dataset, concatenate_datasets # load demo audio and set processor dataset_clean = load_dataset("librispeech_asr", "clean", split="validation", data_dir="data", cache_dir="cache") ``` This fails in the last line with ```log Found cached dataset librispeech_asr (file:///Users/as/Documents/Project/git/audio2vec/cache/librispeech_asr/clean-data_dir=data/2.1.0/cff5df6e7955c80a67f80e27e7e655de71c689e2d2364bece785b972acb37fe7) Traceback (most recent call last): File "/Users/as/Documents/Project/git/audio2vec/src/music2vec-v1.py", line 7, in <module> dataset_clean = load_dataset("librispeech_asr", "clean", split="validation", data_dir="data", cache_dir="cache") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/as/anaconda3/lib/python3.11/site-packages/datasets/load.py", line 1810, in load_dataset ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/as/anaconda3/lib/python3.11/site-packages/datasets/builder.py", line 1113, in as_dataset raise NotImplementedError(f"Loading a dataset cached in a {type(self._fs).__name__} is not supported.") NotImplementedError: Loading a dataset cached in a LocalFileSystem is not supported. ``` ### Steps to reproduce the bug I setup an venv with requirements.txt ```txt transformers==4.40.2 torch==2.2.2 datasets==2.16.0 fsspec==2023.9.2 ``` pip freeze is: ``` aiohttp==3.9.5 aiosignal==1.3.1 attrs==23.2.0 certifi==2024.2.2 charset-normalizer==3.3.2 datasets==2.16.0 dill==0.3.7 filelock==3.14.0 frozenlist==1.4.1 fsspec==2023.9.2 huggingface-hub==0.23.0 idna==3.7 Jinja2==3.1.4 MarkupSafe==2.1.5 mpmath==1.3.0 multidict==6.0.5 multiprocess==0.70.15 networkx==3.3 numpy==1.26.4 packaging==24.0 pandas==2.2.2 pyarrow==16.0.0 pyarrow-hotfix==0.6 python-dateutil==2.9.0.post0 pytz==2024.1 PyYAML==6.0.1 regex==2024.4.28 requests==2.31.0 safetensors==0.4.3 six==1.16.0 sympy==1.12 tokenizers==0.19.1 torch==2.2.2 tqdm==4.66.4 transformers==4.40.2 typing_extensions==4.11.0 tzdata==2024.1 urllib3==2.2.1 xxhash==3.4.1 yarl==1.9.4 ``` I execute this on a M1 Mac. ### Expected behavior I don't understand the error message. Why is "local" caching not supported. Would it possible to give some additional hint with the error message how to solve this issue? ### Environment info source .... python -u example.py
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6886/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6886/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6884
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6884/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6884/comments
https://api.github.com/repos/huggingface/datasets/issues/6884/events
https://github.com/huggingface/datasets/issues/6884
2,284,839,687
I_kwDODunzps6IL-MH
6,884
CI is broken after jax-0.4.27 release: AttributeError: 'jaxlib.xla_extension.DeviceList' object has no attribute 'device'
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "color": "d73a4a", "default": true, "description": "Something isn't working", "id": 1935892857, "name": "bug", "node_id": "MDU6TGFiZWwxOTM1ODkyODU3", "url": "https://api.github.com/repos/huggingface/datasets/labels/bug" } ]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[]
1970-01-01T00:00:00.000001
1,715
1970-01-01T00:00:00.000001
MEMBER
null
After jax-0.4.27 release (https://github.com/google/jax/releases/tag/jax-v0.4.27), our CI is broken with the error: ```Python traceback AttributeError: 'jaxlib.xla_extension.DeviceList' object has no attribute 'device'. Did you mean: 'devices'? ``` See: https://github.com/huggingface/datasets/actions/runs/8997488610/job/24715736153 ```Python traceback ___________________ FormatterTest.test_jax_formatter_device ____________________ [gw1] linux -- Python 3.10.14 /opt/hostedtoolcache/Python/3.10.14/x64/bin/python self = <tests.test_formatting.FormatterTest testMethod=test_jax_formatter_device> @require_jax def test_jax_formatter_device(self): import jax from datasets.formatting import JaxFormatter pa_table = self._create_dummy_table() device = jax.devices()[0] formatter = JaxFormatter(device=str(device)) row = formatter.format_row(pa_table) > assert row["a"].device() == device E AttributeError: 'jaxlib.xla_extension.DeviceList' object has no attribute 'device'. Did you mean: 'devices'? tests/test_formatting.py:630: AttributeError ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6884/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6884/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6882
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6882/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6882/comments
https://api.github.com/repos/huggingface/datasets/issues/6882/events
https://github.com/huggingface/datasets/issues/6882
2,284,803,158
I_kwDODunzps6IL1RW
6,882
Connection Error When Using By-pass Proxies
{ "avatar_url": "https://avatars.githubusercontent.com/u/78351684?v=4", "events_url": "https://api.github.com/users/MRNOBODY-ZST/events{/privacy}", "followers_url": "https://api.github.com/users/MRNOBODY-ZST/followers", "following_url": "https://api.github.com/users/MRNOBODY-ZST/following{/other_user}", "gists_url": "https://api.github.com/users/MRNOBODY-ZST/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/MRNOBODY-ZST", "id": 78351684, "login": "MRNOBODY-ZST", "node_id": "MDQ6VXNlcjc4MzUxNjg0", "organizations_url": "https://api.github.com/users/MRNOBODY-ZST/orgs", "received_events_url": "https://api.github.com/users/MRNOBODY-ZST/received_events", "repos_url": "https://api.github.com/users/MRNOBODY-ZST/repos", "site_admin": false, "starred_url": "https://api.github.com/users/MRNOBODY-ZST/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MRNOBODY-ZST/subscriptions", "type": "User", "url": "https://api.github.com/users/MRNOBODY-ZST", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "Changing the supplier of the proxy will solve this problem, or you can visit and follow the instructions in https://hf-mirror.com " ]
1970-01-01T00:00:00.000001
1,715
null
NONE
null
### Describe the bug I'm currently using Clash for Windows as my proxy tunnel, after exporting HTTP_PROXY and HTTPS_PROXY to the port that clash provides🤔, it runs into a connection error saying "Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/2.19.1/metrics/seqeval/seqeval.py (ConnectionError(MaxRetryError("HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /huggingface/datasets/2.19.1/metrics/seqeval/seqeval.py (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f969d391870>: Failed to establish a new connection: [Errno 111] Connection refused'))")))" I have already read the documentation provided on the hugginface, but I think I didn't see the detailed instruction on how to set up proxies for this library. ### Steps to reproduce the bug 1. Turn on any proxy software like Clash / ShadosocksR etc. 2. export system varibles to the port provided by your proxy software in wsl (It's ok for other applications to use proxy expect dataset-library) 3. load any dataset from hugginface online ### Expected behavior --------------------------------------------------------------------------- ConnectionError Traceback (most recent call last) Cell In[33], [line 3](vscode-notebook-cell:?execution_count=33&line=3) [1](vscode-notebook-cell:?execution_count=33&line=1) from datasets import load_metric ----> [3](vscode-notebook-cell:?execution_count=33&line=3) metric = load_metric("seqeval") File ~/.local/lib/python3.10/site-packages/datasets/utils/deprecation_utils.py:46, in deprecated.<locals>.decorator.<locals>.wrapper(*args, **kwargs) [44](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/utils/deprecation_utils.py:44) warnings.warn(warning_msg, category=FutureWarning, stacklevel=2) [45](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/utils/deprecation_utils.py:45) _emitted_deprecation_warnings.add(func_hash) ---> [46](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/utils/deprecation_utils.py:46) return deprecated_function(*args, **kwargs) File ~/.local/lib/python3.10/site-packages/datasets/load.py:2104, in load_metric(path, config_name, process_id, num_process, cache_dir, experiment_id, keep_in_memory, download_config, download_mode, revision, trust_remote_code, **metric_init_kwargs) [2101](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/load.py:2101) warnings.filterwarnings("ignore", message=".*https://huggingface.co/docs/evaluate$", category=FutureWarning) [2103](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/load.py:2103) download_mode = DownloadMode(download_mode or DownloadMode.REUSE_DATASET_IF_EXISTS) -> [2104](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/load.py:2104) metric_module = metric_module_factory( [2105](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/load.py:2105) path, [2106](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/load.py:2106) revision=revision, [2107](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/load.py:2107) download_config=download_config, [2108](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/load.py:2108) download_mode=download_mode, [2109](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/load.py:2109) trust_remote_code=trust_remote_code, [2110](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/load.py:2110) ).module_path [2111](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/load.py:2111) metric_cls = import_main_class(metric_module, dataset=False) [2112](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/load.py:2112) metric = metric_cls( [2113](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/load.py:2113) config_name=config_name, [2114](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/load.py:2114) process_id=process_id, ... --> [633](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/utils/file_utils.py:633) raise ConnectionError(f"Couldn't reach {url} ({repr(head_error)})") [634](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/utils/file_utils.py:634) elif response is not None: [635](https://vscode-remote+wsl-002bubuntu-002d22-002e04.vscode-resource.vscode-cdn.net/home/noodle/Transformers-Tutorials/LayoutLMv3/~/.local/lib/python3.10/site-packages/datasets/utils/file_utils.py:635) raise ConnectionError(f"Couldn't reach {url} (error {response.status_code})") ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/2.19.1/metrics/seqeval/seqeval.py (SSLError(MaxRetryError("HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /huggingface/datasets/2.19.1/metrics/seqeval/seqeval.py (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1007)')))"))) ### Environment info - `datasets` version: 2.19.1 - Platform: Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 - Python version: 3.10.12 - `huggingface_hub` version: 0.23.0 - PyArrow version: 16.0.0 - Pandas version: 2.2.2 - `fsspec` version: 2024.2.0
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6882/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6882/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6881
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6881/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6881/comments
https://api.github.com/repos/huggingface/datasets/issues/6881/events
https://github.com/huggingface/datasets/issues/6881
2,284,794,009
I_kwDODunzps6ILzCZ
6,881
AttributeError: module 'PIL.Image' has no attribute 'ExifTags'
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "color": "d73a4a", "default": true, "description": "Something isn't working", "id": 1935892857, "name": "bug", "node_id": "MDU6TGFiZWwxOTM1ODkyODU3", "url": "https://api.github.com/repos/huggingface/datasets/labels/bug" } ]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[ "@albertvillanova @lhoestq just ran into it and requiring newer pillow isn't a solution as it breaks Pillow-SIMD which is behind Pillow quite a few versions but necessary for training with reasonable throughput. \r\n\r\nA couple things here... \r\n\r\n1. This can be done with a method that isn't an issue for any somewhat recent Pillow\r\n`image = ImageOps.exif_transpose(image)`\r\n\r\n2. I'd rather this not be done for me automatically. Sometimes exif data is correct, sometimes it's not. Sometimes I might want to correct the orientation, sometimes I might not. \r\n\r\nIn any case if I've preprocessed the images properly myself I don't want to incur overhead, possible further fp seeks, parsing, to load the exif that's not loaded and parsed when you just open and decode the image.", "Hi @rwightman, thanks for your feedback.\r\n\r\nFirst, as a side note comment, please note that you are depending on Pillow-SIMD and that library seems no longer maintained:\r\n- it has not been updated for more than a year: last commit to main was on June 20, 2023: https://github.com/uploadcare/pillow-simd/commit/faae977a00472275690664fe27e21df4e4e8ce07\r\n- in PyPI, the last release was more than 2 years ago, on January 4, 2022: https://pypi.org/project/Pillow-SIMD/#history\r\n\r\nIn relation with your suggestions for the `datasets` library, the changes were introduced by this PR:\r\n- #6739\r\n\r\nI agree maybe we should have given the option whether to perform this operation or not.", "@albertvillanova \r\n\r\nHuh, thought I'd just installed the current datasets when I ran into this, maybe it was behind...\r\n\r\nI'm aware the support for SIMD is a problem, but it's up to 8x faster than non SIMD Pillow and really necessary in many training situations or you have lots of idle GPUs. The current situation is unfortunate but most changes since 9.0 aren't all that important for 'decoding jpegs and resizing'" ]
1970-01-01T00:00:00.000001
1,721
1970-01-01T00:00:00.000001
MEMBER
null
When trying to load an image dataset in an old Python environment (with Pillow-8.4.0), an error is raised: ```Python traceback AttributeError: module 'PIL.Image' has no attribute 'ExifTags' ``` The error traceback: ```Python traceback ~/huggingface/datasets/src/datasets/iterable_dataset.py in __iter__(self) 1391 # `IterableDataset` automatically fills missing columns with None. 1392 # This is done with `_apply_feature_types_on_example`. -> 1393 example = _apply_feature_types_on_example( 1394 example, self.features, token_per_repo_id=self._token_per_repo_id 1395 ) ~/huggingface/datasets/src/datasets/iterable_dataset.py in _apply_feature_types_on_example(example, features, token_per_repo_id) 1080 encoded_example = features.encode_example(example) 1081 # Decode example for Audio feature, e.g. -> 1082 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id) 1083 return decoded_example 1084 ~/huggingface/datasets/src/datasets/features/features.py in decode_example(self, example, token_per_repo_id) 1974 -> 1975 return { 1976 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id) 1977 if self._column_requires_decoding[column_name] ~/huggingface/datasets/src/datasets/features/features.py in <dictcomp>(.0) 1974 1975 return { -> 1976 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id) 1977 if self._column_requires_decoding[column_name] 1978 else value ~/huggingface/datasets/src/datasets/features/features.py in decode_nested_example(schema, obj, token_per_repo_id) 1339 # we pass the token to read and decode files from private repositories in streaming mode 1340 if obj is not None and schema.decode: -> 1341 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id) 1342 return obj 1343 ~/huggingface/datasets/src/datasets/features/image.py in decode_example(self, value, token_per_repo_id) 187 image = PIL.Image.open(BytesIO(bytes_)) 188 image.load() # to avoid "Too many open files" errors --> 189 if image.getexif().get(PIL.Image.ExifTags.Base.Orientation) is not None: 190 image = PIL.ImageOps.exif_transpose(image) 191 if self.mode and self.mode != image.mode: ~/huggingface/datasets/venv/lib/python3.9/site-packages/PIL/Image.py in __getattr__(name) 75 ) 76 return categories[name] ---> 77 raise AttributeError(f"module '{__name__}' has no attribute '{name}'") 78 79 AttributeError: module 'PIL.Image' has no attribute 'ExifTags' ``` ### Environment info Since datasets 2.19.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 2, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 2, "url": "https://api.github.com/repos/huggingface/datasets/issues/6881/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6881/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6880
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6880/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6880/comments
https://api.github.com/repos/huggingface/datasets/issues/6880/events
https://github.com/huggingface/datasets/issues/6880
2,283,278,337
I_kwDODunzps6IGBAB
6,880
Webdataset: KeyError: 'png' on some datasets when streaming
{ "avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4", "events_url": "https://api.github.com/users/lhoestq/events{/privacy}", "followers_url": "https://api.github.com/users/lhoestq/followers", "following_url": "https://api.github.com/users/lhoestq/following{/other_user}", "gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lhoestq", "id": 42851186, "login": "lhoestq", "node_id": "MDQ6VXNlcjQyODUxMTg2", "organizations_url": "https://api.github.com/users/lhoestq/orgs", "received_events_url": "https://api.github.com/users/lhoestq/received_events", "repos_url": "https://api.github.com/users/lhoestq/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions", "type": "User", "url": "https://api.github.com/users/lhoestq", "user_view_type": "public" }
[]
open
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[ "The error is caused by malformed basenames of the files within the TARs:\r\n- `15_Cohen_1-s2.0-S0929664620300449-gr3_lrg-b.png` becomes `15_Cohen_1-s2` as the grouping `__key__`, and `0-S0929664620300449-gr3_lrg-b.png` as the additional key to be added to the example\r\n- whereas the intended behavior was to use `15_Cohen_1-s2.0-S0929664620300449-gr3_lrg-b` as the grouping `__key__`, and `png` as the additional key to be added to the example\r\n\r\nTo get the expected behavior, the basenames of the files within the TARs should be fixed so that they only contain a single dot, the one separating the file extension.", "I reopen it because I think we should try to give a clearer error message with a specific error code.\r\n\r\nFor now, it's hard for the user to understand where the error comes from (not everybody knows the subtleties of the webdataset filename structure).\r\n\r\n(we can transfer it to https://github.com/huggingface/dataset-viewer if it fits better there)", "same with .jpg -> https://huggingface.co/datasets/ProGamerGov/synthetic-dataset-1m-dalle3-high-quality-captions\r\n\r\n```\r\nError code: DatasetGenerationError\r\nException: DatasetGenerationError\r\nMessage: An error occurred while generating the dataset\r\nTraceback: Traceback (most recent call last):\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py\", line 1748, in _prepare_split_single\r\n for key, record in generator:\r\n File \"/src/services/worker/src/worker/job_runners/config/parquet_and_info.py\", line 818, in wrapped\r\n for item in generator(*args, **kwargs):\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/webdataset/webdataset.py\", line 109, in _generate_examples\r\n example[field_name] = {\"path\": example[\"__key__\"] + \".\" + field_name, \"bytes\": example[field_name]}\r\n KeyError: 'jpg'\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/job_runners/config/parquet_and_info.py\", line 1316, in compute_config_parquet_and_info_response\r\n parquet_operations, partial = stream_convert_to_parquet(\r\n File \"/src/services/worker/src/worker/job_runners/config/parquet_and_info.py\", line 909, in stream_convert_to_parquet\r\n builder._prepare_split(\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py\", line 1627, in _prepare_split\r\n for job_id, done, content in self._prepare_split_single(\r\n File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py\", line 1784, in _prepare_split_single\r\n raise DatasetGenerationError(\"An error occurred while generating the dataset\") from e\r\n datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset\r\n```\r\n", "More details in the spec (https://docs.google.com/document/d/18OdLjruFNX74ILmgrdiCI9J1fQZuhzzRBCHV9URWto0/edit#heading=h.hkptaq2kct2s)\r\n\r\n> The prefix of a file is all directory components of the file plus the file name component up to the first “.” in the file name.\r\n> The last extension (i.e., the portion after the last “.”) in a file name determines the file type.\r\n\r\n> Example:\r\n\timages17/image194.left.jpg\r\n\timages17/image194.right.jpg\r\n\timages17/image194.json\r\n\timages17/image12.left.jpg\r\n\timages17/image12.json\r\n\timages17/image12.right.jpg\r\n\timages3/image1459.left.jpg\r\n> \t…\r\n> When reading this with a WebDataset library, you would get the following two dictionaries back in sequence:\r\n\r\n { “__key__”: “images17/image194”, “left.jpg”: b”...”, “right.jpg”: b”...”, “json”: b”...”}\r\n { “__key__”: “images17/image12”, “left.jpg”: b”...”, “right.jpg”: b”...”, “json”: b”...”}\r\n", "OK, the issue is different in the latter case: some files are suffixed as `.jpeg`, and others as `.jpg` :)\r\n\r\nIs it a limitation of the webdataset format, or of the datasets library @lhoestq? And could we be able to give a clearer error?" ]
1970-01-01T00:00:00.000001
1,715
null
MEMBER
null
reported at https://huggingface.co/datasets/tbone5563/tar_images/discussions/1 ```python >>> from datasets import load_dataset >>> ds = load_dataset("tbone5563/tar_images") Downloading data: 100%  1.41G/1.41G [00:48<00:00, 17.2MB/s] Downloading data: 100%  619M/619M [00:11<00:00, 57.4MB/s] Generating train split:   970/0 [00:02<00:00, 534.94 examples/s] --------------------------------------------------------------------------- KeyError Traceback (most recent call last) [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1747 _time = time.time() -> 1748 for key, record in generator: 1749 if max_shard_size is not None and writer._num_bytes > max_shard_size: 7 frames [/usr/local/lib/python3.10/dist-packages/datasets/packaged_modules/webdataset/webdataset.py](https://localhost:8080/#) in _generate_examples(self, tar_paths, tar_iterators) 108 for field_name in image_field_names + audio_field_names: --> 109 example[field_name] = {"path": example["__key__"] + "." + field_name, "bytes": example[field_name]} 110 yield f"{tar_idx}_{example_idx}", example KeyError: 'png' The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) [<ipython-input-2-8e0fbb7badc9>](https://localhost:8080/#) in <cell line: 3>() 1 from datasets import load_dataset 2 ----> 3 ds = load_dataset("tbone5563/tar_images") [/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, trust_remote_code, **config_kwargs) 2607 2608 # Download and prepare data -> 2609 builder_instance.download_and_prepare( 2610 download_config=download_config, 2611 download_mode=download_mode, [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 1025 if num_proc is not None: 1026 prepare_split_kwargs["num_proc"] = num_proc -> 1027 self._download_and_prepare( 1028 dl_manager=dl_manager, 1029 verification_mode=verification_mode, [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs) 1787 1788 def _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs): -> 1789 super()._download_and_prepare( 1790 dl_manager, 1791 verification_mode, [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 1120 try: 1121 # Prepare split will record examples associated to the split -> 1122 self._prepare_split(split_generator, **prepare_split_kwargs) 1123 except OSError as e: 1124 raise OSError( [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _prepare_split(self, split_generator, check_duplicate_keys, file_format, num_proc, max_shard_size) 1625 job_id = 0 1626 with pbar: -> 1627 for job_id, done, content in self._prepare_split_single( 1628 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args 1629 ): [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1782 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1783 e = e.__context__ -> 1784 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1785 1786 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6880/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6880/timeline
null
reopened
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6879
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6879/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6879/comments
https://api.github.com/repos/huggingface/datasets/issues/6879/events
https://github.com/huggingface/datasets/issues/6879
2,282,968,259
I_kwDODunzps6IE1TD
6,879
Batched mapping does not raise an error if values for an existing column are empty
{ "avatar_url": "https://avatars.githubusercontent.com/u/208336?v=4", "events_url": "https://api.github.com/users/felix-schneider/events{/privacy}", "followers_url": "https://api.github.com/users/felix-schneider/followers", "following_url": "https://api.github.com/users/felix-schneider/following{/other_user}", "gists_url": "https://api.github.com/users/felix-schneider/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/felix-schneider", "id": 208336, "login": "felix-schneider", "node_id": "MDQ6VXNlcjIwODMzNg==", "organizations_url": "https://api.github.com/users/felix-schneider/orgs", "received_events_url": "https://api.github.com/users/felix-schneider/received_events", "repos_url": "https://api.github.com/users/felix-schneider/repos", "site_admin": false, "starred_url": "https://api.github.com/users/felix-schneider/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/felix-schneider/subscriptions", "type": "User", "url": "https://api.github.com/users/felix-schneider", "user_view_type": "public" }
[]
open
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,715
null
NONE
null
### Describe the bug Using `Dataset.map(fn, batched=True)` allows resizing the dataset by returning a dict of lists, all of which must be the same size. If they are not the same size, an error like `pyarrow.lib.ArrowInvalid: Column 1 named x expected length 1 but got length 0` is raised. This is not the case if the function returns an empty list for an existing column in the dataset. In that case, the dataset is silently resized to 0 rows. ### Steps to reproduce the bug MWE: ``` import datasets data = datasets.Dataset.from_dict({"test": [1]}) def mapping_fn(examples): return {"test": [], "y": [1]} data = data.map(mapping_fn, batched=True) print(len(data)) ``` Note that when returning `"x": []`, the error is raised correctly, also when returning `"test": [1,2]`. ### Expected behavior Expected an exception: `pyarrow.lib.ArrowInvalid: Column 1 named test expected length 1 but got length 0` or `pyarrow.lib.ArrowInvalid: Column 2 named y expected length 0 but got length 1`. Any exception would be acceptable. ### Environment info - `datasets` version: 2.19.1 - Platform: Linux-5.4.0-153-generic-x86_64-with-glibc2.31 - Python version: 3.11.8 - `huggingface_hub` version: 0.22.2 - PyArrow version: 15.0.2 - Pandas version: 2.2.1 - `fsspec` version: 2024.2.0
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6879/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6879/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6877
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6877/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6877/comments
https://api.github.com/repos/huggingface/datasets/issues/6877/events
https://github.com/huggingface/datasets/issues/6877
2,282,068,337
I_kwDODunzps6IBZlx
6,877
OSError: [Errno 24] Too many open files
{ "avatar_url": "https://avatars.githubusercontent.com/u/53355258?v=4", "events_url": "https://api.github.com/users/loicmagne/events{/privacy}", "followers_url": "https://api.github.com/users/loicmagne/followers", "following_url": "https://api.github.com/users/loicmagne/following{/other_user}", "gists_url": "https://api.github.com/users/loicmagne/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/loicmagne", "id": 53355258, "login": "loicmagne", "node_id": "MDQ6VXNlcjUzMzU1MjU4", "organizations_url": "https://api.github.com/users/loicmagne/orgs", "received_events_url": "https://api.github.com/users/loicmagne/received_events", "repos_url": "https://api.github.com/users/loicmagne/repos", "site_admin": false, "starred_url": "https://api.github.com/users/loicmagne/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/loicmagne/subscriptions", "type": "User", "url": "https://api.github.com/users/loicmagne", "user_view_type": "public" }
[ { "color": "d73a4a", "default": true, "description": "Something isn't working", "id": 1935892857, "name": "bug", "node_id": "MDU6TGFiZWwxOTM1ODkyODU3", "url": "https://api.github.com/repos/huggingface/datasets/labels/bug" } ]
closed
false
null
[]
null
[ "ulimit -n 8192 can solve this problem", "> ulimit -n 8192 can solve this problem\r\n\r\nWould there be a systematic way to do this ? The data loading is part of the [MTEB](https://github.com/embeddings-benchmark/mteb) library", "> > ulimit -n 8192 can solve this problem\r\n> \r\n> Would there be a systematic way to do this ? The data loading is part of the [MTEB](https://github.com/embeddings-benchmark/mteb) library\r\n\r\n I think we could modify the _prepare_split_single function", "I fixed it with https://github.com/huggingface/datasets/pull/6893, feel free to re-open if you're still having the issue :)", "> I fixed it with #6893, feel free to re-open if you're still having the issue :)\r\n\r\nThanks a lot!" ]
1970-01-01T00:00:00.000001
1,717
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug I am trying to load the 'default' subset of the following dataset which contains lots of files (828 per split): [https://huggingface.co/datasets/mteb/biblenlp-corpus-mmteb](https://huggingface.co/datasets/mteb/biblenlp-corpus-mmteb) When trying to load it using the `load_dataset` function I get the following error ```python >>> from datasets import load_dataset >>> d = load_dataset('mteb/biblenlp-corpus-mmteb') Downloading readme: 100%|████████████████████████████████████████████████████████████████████████| 201k/201k [00:00<00:00, 1.07MB/s] Resolving data files: 100%|█████████████████████████████████████████████████████████████████████| 828/828 [00:00<00:00, 1069.15it/s] Resolving data files: 100%|███████████████████████████████████████████████████████████████████| 828/828 [00:00<00:00, 436182.33it/s] Resolving data files: 100%|█████████████████████████████████████████████████████████████████████| 828/828 [00:00<00:00, 2228.75it/s] Resolving data files: 100%|███████████████████████████████████████████████████████████████████| 828/828 [00:00<00:00, 646478.73it/s] Resolving data files: 100%|███████████████████████████████████████████████████████████████████| 828/828 [00:00<00:00, 831032.24it/s] Resolving data files: 100%|███████████████████████████████████████████████████████████████████| 828/828 [00:00<00:00, 517645.51it/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████| 828/828 [00:33<00:00, 24.87files/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████| 828/828 [00:30<00:00, 27.48files/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████| 828/828 [00:30<00:00, 26.94files/s] Generating train split: 1571592 examples [00:03, 461438.97 examples/s] Generating test split: 11163 examples [00:00, 118190.72 examples/s] Traceback (most recent call last): File ".env/lib/python3.12/site-packages/datasets/builder.py", line 1995, in _prepare_split_single for _, table in generator: File ".env/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 99, in _generate_tables with open(file, "rb") as f: ^^^^^^^^^^^^^^^^ File ".env/lib/python3.12/site-packages/datasets/streaming.py", line 75, in wrapper return function(*args, download_config=download_config, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".env/lib/python3.12/site-packages/datasets/utils/file_utils.py", line 1224, in xopen file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".env/lib/python3.12/site-packages/fsspec/core.py", line 135, in open return self.__enter__() ^^^^^^^^^^^^^^^^ File ".env/lib/python3.12/site-packages/fsspec/core.py", line 103, in __enter__ f = self.fs.open(self.path, mode=mode) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".env/lib/python3.12/site-packages/fsspec/spec.py", line 1293, in open f = self._open( ^^^^^^^^^^^ File ".env/lib/python3.12/site-packages/datasets/filesystems/compression.py", line 81, in _open return self.file.open() ^^^^^^^^^^^^^^^^ File ".env/lib/python3.12/site-packages/fsspec/core.py", line 135, in open return self.__enter__() ^^^^^^^^^^^^^^^^ File ".env/lib/python3.12/site-packages/fsspec/core.py", line 103, in __enter__ f = self.fs.open(self.path, mode=mode) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".env/lib/python3.12/site-packages/fsspec/spec.py", line 1293, in open f = self._open( ^^^^^^^^^^^ File ".env/lib/python3.12/site-packages/fsspec/implementations/local.py", line 197, in _open return LocalFileOpener(path, mode, fs=self, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".env/lib/python3.12/site-packages/fsspec/implementations/local.py", line 322, in __init__ self._open() File ".env/lib/python3.12/site-packages/fsspec/implementations/local.py", line 327, in _open self.f = open(self.path, mode=self.mode) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ OSError: [Errno 24] Too many open files: '.cache/huggingface/datasets/downloads/3a347186abfc0f9c924dde0221d246db758c7232c0101523f04a87c17d696618' The above exception was the direct cause of the following exception: Traceback (most recent call last): File ".env/lib/python3.12/site-packages/datasets/builder.py", line 981, in incomplete_dir yield tmp_dir File ".env/lib/python3.12/site-packages/datasets/builder.py", line 1027, in download_and_prepare self._download_and_prepare( File ".env/lib/python3.12/site-packages/datasets/builder.py", line 1122, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File ".env/lib/python3.12/site-packages/datasets/builder.py", line 1882, in _prepare_split for job_id, done, content in self._prepare_split_single( File ".env/lib/python3.12/site-packages/datasets/builder.py", line 2038, in _prepare_split_single raise DatasetGenerationError("An error occurred while generating the dataset") from e datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File ".env/lib/python3.12/site-packages/datasets/load.py", line 2609, in load_dataset builder_instance.download_and_prepare( File ".env/lib/python3.12/site-packages/datasets/builder.py", line 1007, in download_and_prepare with incomplete_dir(self._output_dir) as tmp_output_dir: File "/usr/lib/python3.12/contextlib.py", line 158, in __exit__ self.gen.throw(value) File ".env/lib/python3.12/site-packages/datasets/builder.py", line 988, in incomplete_dir shutil.rmtree(tmp_dir) File "/usr/lib/python3.12/shutil.py", line 785, in rmtree _rmtree_safe_fd(fd, path, onexc) File "/usr/lib/python3.12/shutil.py", line 661, in _rmtree_safe_fd onexc(os.scandir, path, err) File "/usr/lib/python3.12/shutil.py", line 657, in _rmtree_safe_fd with os.scandir(topfd) as scandir_it: ^^^^^^^^^^^^^^^^^ OSError: [Errno 24] Too many open files: '.cache/huggingface/datasets/mteb___biblenlp-corpus-mmteb/default/0.0.0/3912ed967b0834547f35b2da9470c4976b357c9a.incomplete' ``` I looked for the maximum number of open files on my machine (Ubuntu 24.04) and it seems to be 1024, but even when I try to load a single split (`load_dataset('mteb/biblenlp-corpus-mmteb', split='train')`) I get the same error ### Steps to reproduce the bug ```python from datasets import load_dataset d = load_dataset('mteb/biblenlp-corpus-mmteb') ``` ### Expected behavior Load the dataset without error ### Environment info - `datasets` version: 2.19.0 - Platform: Linux-6.8.0-31-generic-x86_64-with-glibc2.39 - Python version: 3.12.3 - `huggingface_hub` version: 0.23.0 - PyArrow version: 16.0.0 - Pandas version: 2.2.2 - `fsspec` version: 2024.3.1
{ "avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4", "events_url": "https://api.github.com/users/lhoestq/events{/privacy}", "followers_url": "https://api.github.com/users/lhoestq/followers", "following_url": "https://api.github.com/users/lhoestq/following{/other_user}", "gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lhoestq", "id": 42851186, "login": "lhoestq", "node_id": "MDQ6VXNlcjQyODUxMTg2", "organizations_url": "https://api.github.com/users/lhoestq/orgs", "received_events_url": "https://api.github.com/users/lhoestq/received_events", "repos_url": "https://api.github.com/users/lhoestq/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions", "type": "User", "url": "https://api.github.com/users/lhoestq", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6877/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6877/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6869
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6869/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6869/comments
https://api.github.com/repos/huggingface/datasets/issues/6869/events
https://github.com/huggingface/datasets/issues/6869
2,280,048,297
I_kwDODunzps6H5sap
6,869
Download is broken for dict of dicts: FileNotFoundError
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "color": "d73a4a", "default": true, "description": "Something isn't working", "id": 1935892857, "name": "bug", "node_id": "MDU6TGFiZWwxOTM1ODkyODU3", "url": "https://api.github.com/repos/huggingface/datasets/labels/bug" } ]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[]
1970-01-01T00:00:00.000001
1,714
1970-01-01T00:00:00.000001
MEMBER
null
It seems there is a bug when downloading a dict of dicts of URLs introduced by: - #6794 ## Steps to reproduce the bug: ```python from datasets import DownloadManager dl_manager = DownloadManager() paths = dl_manager.download({"train": {"frr": "hf://datasets/wikimedia/wikipedia/20231101.frr/train-00000-of-00001.parquet"}}) ``` Stack trace: ``` --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) <ipython-input-7-0e0d76d25b09> in <module> ----> 1 paths = dl_manager.download({"train": {"frr": "hf://datasets/wikimedia/wikipedia/20231101.frr/train-00000-of-00001.parquet"}}) .../huggingface/datasets/src/datasets/download/download_manager.py in download(self, url_or_urls) 255 start_time = datetime.now() 256 with stack_multiprocessing_download_progress_bars(): --> 257 downloaded_path_or_paths = map_nested( 258 download_func, 259 url_or_urls, .../huggingface/datasets/src/datasets/utils/py_utils.py in map_nested(function, data_struct, dict_only, map_list, map_tuple, map_numpy, num_proc, parallel_min_length, batched, batch_size, types, disable_tqdm, desc) 506 batch_size = max(len(iterable) // num_proc + int(len(iterable) % num_proc > 0), 1) 507 iterable = list(iter_batched(iterable, batch_size)) --> 508 mapped = [ 509 _single_map_nested((function, obj, batched, batch_size, types, None, True, None)) 510 for obj in hf_tqdm(iterable, disable=disable_tqdm, desc=desc) .../huggingface/datasets/src/datasets/utils/py_utils.py in <listcomp>(.0) 507 iterable = list(iter_batched(iterable, batch_size)) 508 mapped = [ --> 509 _single_map_nested((function, obj, batched, batch_size, types, None, True, None)) 510 for obj in hf_tqdm(iterable, disable=disable_tqdm, desc=desc) 511 ] .../huggingface/datasets/src/datasets/utils/py_utils.py in _single_map_nested(args) 375 and all(not isinstance(v, types) for v in data_struct) 376 ): --> 377 return [mapped_item for batch in iter_batched(data_struct, batch_size) for mapped_item in function(batch)] 378 379 # Reduce logging to keep things readable in multiprocessing with tqdm .../huggingface/datasets/src/datasets/utils/py_utils.py in <listcomp>(.0) 375 and all(not isinstance(v, types) for v in data_struct) 376 ): --> 377 return [mapped_item for batch in iter_batched(data_struct, batch_size) for mapped_item in function(batch)] 378 379 # Reduce logging to keep things readable in multiprocessing with tqdm .../huggingface/datasets/src/datasets/download/download_manager.py in _download_batched(self, url_or_filenames, download_config) 311 ) 312 else: --> 313 return [ 314 self._download_single(url_or_filename, download_config=download_config) 315 for url_or_filename in url_or_filenames .../huggingface/datasets/src/datasets/download/download_manager.py in <listcomp>(.0) 312 else: 313 return [ --> 314 self._download_single(url_or_filename, download_config=download_config) 315 for url_or_filename in url_or_filenames 316 ] .../huggingface/datasets/src/datasets/download/download_manager.py in _download_single(self, url_or_filename, download_config) 321 # append the relative path to the base_path 322 url_or_filename = url_or_path_join(self._base_path, url_or_filename) --> 323 out = cached_path(url_or_filename, download_config=download_config) 324 out = tracked_str(out) 325 out.set_origin(url_or_filename) .../huggingface/datasets/src/datasets/utils/file_utils.py in cached_path(url_or_filename, download_config, **download_kwargs) 220 elif is_local_path(url_or_filename): 221 # File, but it doesn't exist. --> 222 raise FileNotFoundError(f"Local file {url_or_filename} doesn't exist") 223 else: 224 # Something unknown FileNotFoundError: Local file .../huggingface/datasets/{'frr': 'hf:/datasets/wikimedia/wikipedia/20231101.frr/train-00000-of-00001.parquet'} doesn't exist ``` Related to: - #6850
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/huggingface/datasets/issues/6869/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6869/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6868
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6868/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6868/comments
https://api.github.com/repos/huggingface/datasets/issues/6868/events
https://github.com/huggingface/datasets/issues/6868
2,279,385,159
I_kwDODunzps6H3KhH
6,868
datasets.BuilderConfig does not work.
{ "avatar_url": "https://avatars.githubusercontent.com/u/148830652?v=4", "events_url": "https://api.github.com/users/jdm4pku/events{/privacy}", "followers_url": "https://api.github.com/users/jdm4pku/followers", "following_url": "https://api.github.com/users/jdm4pku/following{/other_user}", "gists_url": "https://api.github.com/users/jdm4pku/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jdm4pku", "id": 148830652, "login": "jdm4pku", "node_id": "U_kgDOCN75vA", "organizations_url": "https://api.github.com/users/jdm4pku/orgs", "received_events_url": "https://api.github.com/users/jdm4pku/received_events", "repos_url": "https://api.github.com/users/jdm4pku/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jdm4pku/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jdm4pku/subscriptions", "type": "User", "url": "https://api.github.com/users/jdm4pku", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "I guess the issue is caused by the customization of BuilderConfig that you use from the repo [https://github.com/BeyonderXX/InstructUIE](https://github.com/BeyonderXX/InstructUIE/blob/master/src/uie_dataset.py). You should report to them.\r\n\r\nI see you already opened an issue in their repo:\r\n- https://github.com/BeyonderXX/InstructUIE/issues/40" ]
1970-01-01T00:00:00.000001
1,714
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug I custom a BuilderConfig and GeneratorBasedBuilder. Here is the code for BuilderConfig ``` class UIEConfig(datasets.BuilderConfig): def __init__( self, *args, data_dir=None, instruction_file=None, instruction_strategy=None, task_config_dir=None, num_examples=None, max_num_instances_per_task=None, max_num_instances_per_eval_task=None, over_sampling=None, **kwargs ): super().__init__(*args, **kwargs) self.data_dir = data_dir self.num_examples = num_examples self.over_sampling = over_sampling self.instructions = self._parse_instruction(instruction_file) self.task_configs = self._parse_task_config(task_config_dir) self.instruction_strategy = instruction_strategy self.max_num_instances_per_task = max_num_instances_per_task self.max_num_instances_per_eval_task = max_num_instances_per_eval_task ``` Besides, here is the code for GeneratorBasedBuilder. ``` class UIEInstructions(datasets.GeneratorBasedBuilder): VERSION = datasets.Version("2.0.0") BUILDER_CONFIG_CLASS = UIEConfig BUILDER_CONFIGS = [ UIEConfig(name="default", description="Default config for NaturalInstructions") ] DEFAULT_CONFIG_NAME = "default" ``` Here is the load_dataset ``` raw_datasets = load_dataset( os.path.join(CURRENT_DIR, "uie_dataset.py"), data_dir=data_args.data_dir, task_config_dir=data_args.task_config_dir, instruction_file=data_args.instruction_file, instruction_strategy=data_args.instruction_strategy, cache_dir=data_cache_dir, # for debug, change dataset size, otherwise open it max_num_instances_per_task=data_args.max_num_instances_per_task, max_num_instances_per_eval_task=data_args.max_num_instances_per_eval_task, num_examples=data_args.num_examples, over_sampling=data_args.over_sampling ) ``` Finally, I met the error. ``` BuilderConfig UIEConfig(name='default', version=0.0.0, data_dir=None, data_files=None, description='Default config for NaturalInstructions') doesn't have a 'task_config_dir' key. ``` I debugged the code, but I find the parameters added by me may not work. ### Steps to reproduce the bug https://github.com/BeyonderXX/InstructUIE/blob/master/src/uie_dataset.py ### Expected behavior ``` BuilderConfig UIEConfig(name='default', version=0.0.0, data_dir=None, data_files=None, description='Default config for NaturalInstructions') doesn't have a 'task_config_dir' key. ``` ### Environment info torch 2.3.0+cu118 transformers 4.40.1 python 3.8
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6868/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6868/timeline
null
not_planned
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6867
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6867/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6867/comments
https://api.github.com/repos/huggingface/datasets/issues/6867/events
https://github.com/huggingface/datasets/issues/6867
2,279,059,787
I_kwDODunzps6H17FL
6,867
Improve performance of JSON loader
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "color": "a2eeef", "default": true, "description": "New feature or request", "id": 1935892871, "name": "enhancement", "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement" } ]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[ "Thanks! Feel free to ping me for examples. May not respond immediately because we're all busy but would like to help.", "Hi @natolambert, could you please give some examples of JSON files to benchmark?\r\n\r\nPlease note that this JSON file (https://huggingface.co/datasets/allenai/reward-bench-results/blob/main/eval-set-scores/Ray2333/reward-model-Mistral-7B-instruct-Unified-Feedback.json) is not in \"records\" orient; instead it has the following structure:\r\n```json\r\n{\r\n \"chat_template\": \"tulu\",\r\n \"id\": [30, 34, 35,...],\r\n \"model\": \"Ray2333/reward-model-Mistral-7B-instruct-Unified-Feedback\",\r\n \"model_type\": \"Seq. Classifier\",\r\n \"results\": [1, 1, 1, ...],\r\n \"scores_chosen\": [4.421875, 1.8916015625, 3.8515625,...],\r\n \"scores_rejected\": [-2.416015625, -1.47265625, -0.9912109375,...],\r\n \"subset\": [\"alpacaeval-easy\", \"alpacaeval-easy\", \"alpacaeval-easy\",...]\r\n \"text_chosen\": [\"<s>[INST] How do I detail a...\",...],\r\n \"text_rejected\": [\"<s>[INST] How do I detail a...\",...]\r\n}\r\n```\r\n\r\nNote that \"records\" orient should be a list (not a dict) with each row as one item of the list:\r\n```json\r\n[\r\n {\"chat_template\": \"tulu\", \"id\": 30,... },\r\n {\"chat_template\": \"tulu\", \"id\": 34,... },\r\n ...\r\n]\r\n```", "We use a mix (which is a mess), here's an example with the records orient\r\nhttps://huggingface.co/datasets/allenai/reward-bench-results/blob/main/best-of-n/alpaca_eval/tulu-13b/OpenAssistant/oasst-rm-2.1-pythia-1.4b-epoch-2.5.json\r\n\r\nThere are more in that folder, ~40mb maybe?", "@albertvillanova here's a snippet so you don't need to click\r\n```\r\n{\r\n \"config\": \"top_p=0.9;temp=1.0\",\r\n \"dataset_details\": \"helpful_base\",\r\n \"id\": [\r\n 0,\r\n 0\r\n ],\r\n \"model\": \"allenai/tulu-2-dpo-13b\",\r\n \"scores\": 3.076171875\r\n}\r\n{\r\n \"config\": \"top_p=0.9;temp=1.0\",\r\n \"dataset_details\": \"helpful_base\",\r\n \"id\": [\r\n 0,\r\n 1\r\n ],\r\n \"model\": \"allenai/tulu-2-dpo-13b\",\r\n \"scores\": 3.87890625\r\n}\r\n{\r\n \"config\": \"top_p=0.9;temp=1.0\",\r\n \"dataset_details\": \"helpful_base\",\r\n \"id\": [\r\n 0,\r\n 2\r\n ],\r\n \"model\": \"allenai/tulu-2-dpo-13b\",\r\n \"scores\": 3.287109375\r\n}\r\n{\r\n \"config\": \"top_p=0.9;temp=1.0\",\r\n \"dataset_details\": \"helpful_base\",\r\n \"id\": [\r\n 0,\r\n 3\r\n ],\r\n \"model\": \"allenai/tulu-2-dpo-13b\",\r\n \"scores\": 1.6337890625\r\n}\r\n{\r\n \"config\": \"top_p=0.9;temp=1.0\",\r\n \"dataset_details\": \"helpful_base\",\r\n \"id\": [\r\n 0,\r\n 4\r\n ],\r\n \"model\": \"allenai/tulu-2-dpo-13b\",\r\n \"scores\": 5.27734375\r\n}\r\n{\r\n \"config\": \"top_p=0.9;temp=1.0\",\r\n \"dataset_details\": \"helpful_base\",\r\n \"id\": [\r\n 0,\r\n 5\r\n ],\r\n \"model\": \"allenai/tulu-2-dpo-13b\",\r\n \"scores\": 3.0625\r\n}\r\n{\r\n \"config\": \"top_p=0.9;temp=1.0\",\r\n \"dataset_details\": \"helpful_base\",\r\n \"id\": [\r\n 0,\r\n 6\r\n ],\r\n \"model\": \"allenai/tulu-2-dpo-13b\",\r\n \"scores\": 2.29296875\r\n}\r\n{\r\n \"config\": \"top_p=0.9;temp=1.0\",\r\n \"dataset_details\": \"helpful_base\",\r\n \"id\": [\r\n 0,\r\n 7\r\n ],\r\n \"model\": \"allenai/tulu-2-dpo-13b\",\r\n \"scores\": 6.77734375\r\n}\r\n{\r\n \"config\": \"top_p=0.9;temp=1.0\",\r\n \"dataset_details\": \"helpful_base\",\r\n \"id\": [\r\n 0,\r\n 8\r\n ],\r\n \"model\": \"allenai/tulu-2-dpo-13b\",\r\n \"scores\": 3.853515625\r\n}\r\n{\r\n \"config\": \"top_p=0.9;temp=1.0\",\r\n \"dataset_details\": \"helpful_base\",\r\n \"id\": [\r\n 0,\r\n 9\r\n ],\r\n \"model\": \"allenai/tulu-2-dpo-13b\",\r\n \"scores\": 4.86328125\r\n}\r\n{\r\n \"config\": \"top_p=0.9;temp=1.0\",\r\n \"dataset_details\": \"helpful_base\",\r\n \"id\": [\r\n 0,\r\n 10\r\n ],\r\n \"model\": \"allenai/tulu-2-dpo-13b\",\r\n \"scores\": 2.890625\r\n}\r\n{\r\n \"config\": \"top_p=0.9;temp=1.0\",\r\n \"dataset_details\": \"helpful_base\",\r\n \"id\": [\r\n 0,\r\n 11\r\n ],\r\n \"model\": \"allenai/tulu-2-dpo-13b\",\r\n \"scores\": 4.70703125\r\n}\r\n{\r\n \"config\": \"top_p=0.9;temp=1.0\",\r\n \"dataset_details\": \"helpful_base\",\r\n \"id\": [\r\n 0,\r\n 12\r\n ],\r\n \"model\": \"allenai/tulu-2-dpo-13b\",\r\n \"scores\": 4.45703125\r\n}\r\n```", "Thanks again for your feedback, @natolambert.\r\n\r\nHowever, strictly speaking, the last file is not in JSON format but in kind of JSON-Lines like format (although not properly either because there are multiple newline characters within each object). Not even pandas can read that file format.\r\n\r\nAnyway, for JSON-Lines, I would expect that `datasets` and `pandas` have the same performance for JSON Lines files, as both use `pyarrow` under the hood...\r\n\r\nA proper JSON file in records orient should be a list (a JSON array): the first character should be `[`.\r\n\r\nAnyway, I am generating a JSON file from your JSON-Lines file to test performance." ]
1970-01-01T00:00:00.000001
1,715
1970-01-01T00:00:00.000001
MEMBER
null
As reported by @natolambert, loading regular JSON files with `datasets` shows poor performance. The cause is that we use the `json` Python standard library instead of other faster libraries. See my old comment: https://github.com/huggingface/datasets/pull/2638#pullrequestreview-706983714 > There are benchmarks that compare different JSON packages, with the Standard Library one among the worst performant: > - https://github.com/ultrajson/ultrajson#benchmarks > - https://github.com/ijl/orjson#performance I remember having a discussion about this and it was decided that it was better not to include an additional dependency on a 3rd-party library. However: - We already depend on `pandas` and `pandas` depends on `ujson`: so we have an indirect dependency on `ujson` - Even if the above were not the case, we always could include `ujson` as an optional extra dependency, and check at runtime if it is installed to decide which library to use, either json or ujson
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 3, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 3, "url": "https://api.github.com/repos/huggingface/datasets/issues/6867/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6867/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6866
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6866/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6866/comments
https://api.github.com/repos/huggingface/datasets/issues/6866/events
https://github.com/huggingface/datasets/issues/6866
2,278,736,221
I_kwDODunzps6H0sFd
6,866
DataFilesNotFoundError for datasets in the open-llm-leaderboard
{ "avatar_url": "https://avatars.githubusercontent.com/u/6140840?v=4", "events_url": "https://api.github.com/users/jerome-white/events{/privacy}", "followers_url": "https://api.github.com/users/jerome-white/followers", "following_url": "https://api.github.com/users/jerome-white/following{/other_user}", "gists_url": "https://api.github.com/users/jerome-white/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jerome-white", "id": 6140840, "login": "jerome-white", "node_id": "MDQ6VXNlcjYxNDA4NDA=", "organizations_url": "https://api.github.com/users/jerome-white/orgs", "received_events_url": "https://api.github.com/users/jerome-white/received_events", "repos_url": "https://api.github.com/users/jerome-white/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jerome-white/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jerome-white/subscriptions", "type": "User", "url": "https://api.github.com/users/jerome-white", "user_view_type": "public" }
[]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[ "Potentially related:\r\n* #6864\r\n* #6850\r\n* #6848\r\n* #6819", "Hi @jerome-white, thnaks for reporting.\r\n\r\nHowever, I cannot reproduce your issue:\r\n```python\r\n>>> from datasets import get_dataset_config_names\r\n\r\n>>> get_dataset_config_names(\"open-llm-leaderboard/details_davidkim205__Rhea-72b-v0.5\")\r\n['harness_arc_challenge_25',\r\n 'harness_gsm8k_5',\r\n 'harness_hellaswag_10',\r\n 'harness_hendrycksTest_5',\r\n 'harness_hendrycksTest_abstract_algebra_5',\r\n 'harness_hendrycksTest_anatomy_5',\r\n 'harness_hendrycksTest_astronomy_5',\r\n 'harness_hendrycksTest_business_ethics_5',\r\n 'harness_hendrycksTest_clinical_knowledge_5',\r\n 'harness_hendrycksTest_college_biology_5',\r\n 'harness_hendrycksTest_college_chemistry_5',\r\n 'harness_hendrycksTest_college_computer_science_5',\r\n 'harness_hendrycksTest_college_mathematics_5',\r\n 'harness_hendrycksTest_college_medicine_5',\r\n 'harness_hendrycksTest_college_physics_5',\r\n 'harness_hendrycksTest_computer_security_5',\r\n 'harness_hendrycksTest_conceptual_physics_5',\r\n 'harness_hendrycksTest_econometrics_5',\r\n 'harness_hendrycksTest_electrical_engineering_5',\r\n 'harness_hendrycksTest_elementary_mathematics_5',\r\n 'harness_hendrycksTest_formal_logic_5',\r\n 'harness_hendrycksTest_global_facts_5',\r\n 'harness_hendrycksTest_high_school_biology_5',\r\n 'harness_hendrycksTest_high_school_chemistry_5',\r\n 'harness_hendrycksTest_high_school_computer_science_5',\r\n 'harness_hendrycksTest_high_school_european_history_5',\r\n 'harness_hendrycksTest_high_school_geography_5',\r\n 'harness_hendrycksTest_high_school_government_and_politics_5',\r\n 'harness_hendrycksTest_high_school_macroeconomics_5',\r\n 'harness_hendrycksTest_high_school_mathematics_5',\r\n 'harness_hendrycksTest_high_school_microeconomics_5',\r\n 'harness_hendrycksTest_high_school_physics_5',\r\n 'harness_hendrycksTest_high_school_psychology_5',\r\n 'harness_hendrycksTest_high_school_statistics_5',\r\n 'harness_hendrycksTest_high_school_us_history_5',\r\n 'harness_hendrycksTest_high_school_world_history_5',\r\n 'harness_hendrycksTest_human_aging_5',\r\n 'harness_hendrycksTest_human_sexuality_5',\r\n 'harness_hendrycksTest_international_law_5',\r\n 'harness_hendrycksTest_jurisprudence_5',\r\n 'harness_hendrycksTest_logical_fallacies_5',\r\n 'harness_hendrycksTest_machine_learning_5',\r\n 'harness_hendrycksTest_management_5',\r\n 'harness_hendrycksTest_marketing_5',\r\n 'harness_hendrycksTest_medical_genetics_5',\r\n 'harness_hendrycksTest_miscellaneous_5',\r\n 'harness_hendrycksTest_moral_disputes_5',\r\n 'harness_hendrycksTest_moral_scenarios_5',\r\n 'harness_hendrycksTest_nutrition_5',\r\n 'harness_hendrycksTest_philosophy_5',\r\n 'harness_hendrycksTest_prehistory_5',\r\n 'harness_hendrycksTest_professional_accounting_5',\r\n 'harness_hendrycksTest_professional_law_5',\r\n 'harness_hendrycksTest_professional_medicine_5',\r\n 'harness_hendrycksTest_professional_psychology_5',\r\n 'harness_hendrycksTest_public_relations_5',\r\n 'harness_hendrycksTest_security_studies_5',\r\n 'harness_hendrycksTest_sociology_5',\r\n 'harness_hendrycksTest_us_foreign_policy_5',\r\n 'harness_hendrycksTest_virology_5',\r\n 'harness_hendrycksTest_world_religions_5',\r\n 'harness_truthfulqa_mc_0',\r\n 'harness_winogrande_5',\r\n 'results']\r\n```\r\n\r\nMaybe it was just a temporary issue...", "> Maybe it was just a temporary issue...\r\n\r\nPerhaps. I've changed my workflow to use the hub's `HfFileSystem`, so for now this is no longer a blocker for me. I'll reopen the issue if that changes." ]
1970-01-01T00:00:00.000001
1,715
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug When trying to get config names or load any dataset within the open-llm-leaderboard ecosystem (`open-llm-leaderboard/details_`) I receive the DataFilesNotFoundError. For the last month or so I've been loading datasets from the leaderboard almost everyday; yesterday was the first time I started seeing this. ### Steps to reproduce the bug This snippet has three cells: 1. Loads the modules 2. Tries to get config names 3. Tries to load the dataset I've chosen "davidkim205"'s Rhea-72b-v0.5 model because it is one of the best performers on the leaderboard should likely have no dataset issues: ```python In [1]: from datasets import load_dataset, get_dataset_config_names In [2]: get_dataset_config_names("open-llm-leaderboard/details_davidkim205__Rhea ...: -72b-v0.5") --------------------------------------------------------------------------- DataFilesNotFoundError Traceback (most recent call last) Cell In[2], line 1 ----> 1 get_dataset_config_names("open-llm-leaderboard/details_davidkim205__Rhea-72b-v0.5") File ~/open-llm-bda/venv/lib/python3.11/site-packages/datasets/inspect.py:347, in get_dataset_config_names(path, revision, download_config, download_mode, dynamic_modules_path, data_files, **download_kwargs) 291 def get_dataset_config_names( 292 path: str, 293 revision: Optional[Union[str, Version]] = None, (...) 298 **download_kwargs, 299 ): 300 """Get the list of available config names for a particular dataset. 301 302 Args: (...) 345 ``` 346 """ --> 347 dataset_module = dataset_module_factory( 348 path, 349 revision=revision, 350 download_config=download_config, 351 download_mode=download_mode, 352 dynamic_modules_path=dynamic_modules_path, 353 data_files=data_files, 354 **download_kwargs, 355 ) 356 builder_cls = get_dataset_builder_class(dataset_module, dataset_name=os.path.basename(path)) 357 return list(builder_cls.builder_configs.keys()) or [ 358 dataset_module.builder_kwargs.get("config_name", builder_cls.DEFAULT_CONFIG_NAME or "default") 359 ] File ~/open-llm-bda/venv/lib/python3.11/site-packages/datasets/load.py:1821, in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, cache_dir, trust_remote_code, _require_default_config_name, _require_custom_configs, **download_kwargs) 1812 return LocalDatasetModuleFactoryWithScript( 1813 combined_path, 1814 download_mode=download_mode, 1815 dynamic_modules_path=dynamic_modules_path, 1816 trust_remote_code=trust_remote_code, 1817 ).get_module() 1818 elif os.path.isdir(path): 1819 return LocalDatasetModuleFactoryWithoutScript( 1820 path, data_dir=data_dir, data_files=data_files, download_mode=download_mode -> 1821 ).get_module() 1822 # Try remotely 1823 elif is_relative_path(path) and path.count("/") <= 1: File ~/open-llm-bda/venv/lib/python3.11/site-packages/datasets/load.py:1039, in LocalDatasetModuleFactoryWithoutScript.get_module(self) 1033 patterns = get_data_patterns(base_path) 1034 data_files = DataFilesDict.from_patterns( 1035 patterns, 1036 base_path=base_path, 1037 allowed_extensions=ALL_ALLOWED_EXTENSIONS, 1038 ) -> 1039 module_name, default_builder_kwargs = infer_module_for_data_files( 1040 data_files=data_files, 1041 path=self.path, 1042 ) 1043 data_files = data_files.filter_extensions(_MODULE_TO_EXTENSIONS[module_name]) 1044 # Collect metadata files if the module supports them File ~/open-llm-bda/venv/lib/python3.11/site-packages/datasets/load.py:597, in infer_module_for_data_files(data_files, path, download_config) 595 raise ValueError(f"Couldn't infer the same data file format for all splits. Got {split_modules}") 596 if not module_name: --> 597 raise DataFilesNotFoundError("No (supported) data files found" + (f" in {path}" if path else "")) 598 return module_name, default_builder_kwargs DataFilesNotFoundError: No (supported) data files found in open-llm-leaderboard/details_davidkim205__Rhea-72b-v0.5 In [3]: data = load_dataset("open-llm-leaderboard/details_davidkim205__Rhea-72b- ...: v0.5", "harness_winogrande_5") --------------------------------------------------------------------------- DataFilesNotFoundError Traceback (most recent call last) Cell In[3], line 1 ----> 1 data = load_dataset("open-llm-leaderboard/details_davidkim205__Rhea-72b-v0.5", "harness_winogrande_5") File ~/open-llm-bda/venv/lib/python3.11/site-packages/datasets/load.py:2587, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, trust_remote_code, **config_kwargs) 2582 verification_mode = VerificationMode( 2583 (verification_mode or VerificationMode.BASIC_CHECKS) if not save_infos else VerificationMode.ALL_CHECKS 2584 ) 2586 # Create a dataset builder -> 2587 builder_instance = load_dataset_builder( 2588 path=path, 2589 name=name, 2590 data_dir=data_dir, 2591 data_files=data_files, 2592 cache_dir=cache_dir, 2593 features=features, 2594 download_config=download_config, 2595 download_mode=download_mode, 2596 revision=revision, 2597 token=token, 2598 storage_options=storage_options, 2599 trust_remote_code=trust_remote_code, 2600 _require_default_config_name=name is None, 2601 **config_kwargs, 2602 ) 2604 # Return iterable dataset in case of streaming 2605 if streaming: File ~/open-llm-bda/venv/lib/python3.11/site-packages/datasets/load.py:2259, in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, token, use_auth_token, storage_options, trust_remote_code, _require_default_config_name, **config_kwargs) 2257 download_config = download_config.copy() if download_config else DownloadConfig() 2258 download_config.storage_options.update(storage_options) -> 2259 dataset_module = dataset_module_factory( 2260 path, 2261 revision=revision, 2262 download_config=download_config, 2263 download_mode=download_mode, 2264 data_dir=data_dir, 2265 data_files=data_files, 2266 cache_dir=cache_dir, 2267 trust_remote_code=trust_remote_code, 2268 _require_default_config_name=_require_default_config_name, 2269 _require_custom_configs=bool(config_kwargs), 2270 ) 2271 # Get dataset builder class from the processing script 2272 builder_kwargs = dataset_module.builder_kwargs File ~/open-llm-bda/venv/lib/python3.11/site-packages/datasets/load.py:1821, in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, cache_dir, trust_remote_code, _require_default_config_name, _require_custom_configs, **download_kwargs) 1812 return LocalDatasetModuleFactoryWithScript( 1813 combined_path, 1814 download_mode=download_mode, 1815 dynamic_modules_path=dynamic_modules_path, 1816 trust_remote_code=trust_remote_code, 1817 ).get_module() 1818 elif os.path.isdir(path): 1819 return LocalDatasetModuleFactoryWithoutScript( 1820 path, data_dir=data_dir, data_files=data_files, download_mode=download_mode -> 1821 ).get_module() 1822 # Try remotely 1823 elif is_relative_path(path) and path.count("/") <= 1: File ~/open-llm-bda/venv/lib/python3.11/site-packages/datasets/load.py:1039, in LocalDatasetModuleFactoryWithoutScript.get_module(self) 1033 patterns = get_data_patterns(base_path) 1034 data_files = DataFilesDict.from_patterns( 1035 patterns, 1036 base_path=base_path, 1037 allowed_extensions=ALL_ALLOWED_EXTENSIONS, 1038 ) -> 1039 module_name, default_builder_kwargs = infer_module_for_data_files( 1040 data_files=data_files, 1041 path=self.path, 1042 ) 1043 data_files = data_files.filter_extensions(_MODULE_TO_EXTENSIONS[module_name]) 1044 # Collect metadata files if the module supports them File ~/open-llm-bda/venv/lib/python3.11/site-packages/datasets/load.py:597, in infer_module_for_data_files(data_files, path, download_config) 595 raise ValueError(f"Couldn't infer the same data file format for all splits. Got {split_modules}") 596 if not module_name: --> 597 raise DataFilesNotFoundError("No (supported) data files found" + (f" in {path}" if path else "")) 598 return module_name, default_builder_kwargs DataFilesNotFoundError: No (supported) data files found in open-llm-leaderboard/details_davidkim205__Rhea-72b-v0.5 ``` ### Expected behavior No exceptions from `get_dataset_config_names` or `load_dataset` ### Environment info - `datasets` version: 2.19.0 - Platform: Linux-6.5.0-1018-aws-aarch64-with-glibc2.35 - Python version: 3.11.8 - `huggingface_hub` version: 0.23.0 - PyArrow version: 16.0.0 - Pandas version: 2.2.2 - `fsspec` version: 2024.3.1
{ "avatar_url": "https://avatars.githubusercontent.com/u/6140840?v=4", "events_url": "https://api.github.com/users/jerome-white/events{/privacy}", "followers_url": "https://api.github.com/users/jerome-white/followers", "following_url": "https://api.github.com/users/jerome-white/following{/other_user}", "gists_url": "https://api.github.com/users/jerome-white/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jerome-white", "id": 6140840, "login": "jerome-white", "node_id": "MDQ6VXNlcjYxNDA4NDA=", "organizations_url": "https://api.github.com/users/jerome-white/orgs", "received_events_url": "https://api.github.com/users/jerome-white/received_events", "repos_url": "https://api.github.com/users/jerome-white/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jerome-white/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jerome-white/subscriptions", "type": "User", "url": "https://api.github.com/users/jerome-white", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6866/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6866/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6865
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6865/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6865/comments
https://api.github.com/repos/huggingface/datasets/issues/6865/events
https://github.com/huggingface/datasets/issues/6865
2,277,304,832
I_kwDODunzps6HvOoA
6,865
Example on Semantic segmentation contains bug
{ "avatar_url": "https://avatars.githubusercontent.com/u/4803565?v=4", "events_url": "https://api.github.com/users/ducha-aiki/events{/privacy}", "followers_url": "https://api.github.com/users/ducha-aiki/followers", "following_url": "https://api.github.com/users/ducha-aiki/following{/other_user}", "gists_url": "https://api.github.com/users/ducha-aiki/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ducha-aiki", "id": 4803565, "login": "ducha-aiki", "node_id": "MDQ6VXNlcjQ4MDM1NjU=", "organizations_url": "https://api.github.com/users/ducha-aiki/orgs", "received_events_url": "https://api.github.com/users/ducha-aiki/received_events", "repos_url": "https://api.github.com/users/ducha-aiki/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ducha-aiki/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ducha-aiki/subscriptions", "type": "User", "url": "https://api.github.com/users/ducha-aiki", "user_view_type": "public" }
[]
open
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,714
null
NONE
null
### Describe the bug https://huggingface.co/docs/datasets/en/semantic_segmentation shows wrong example with torchvision transforms. Specifically, as one can see in screenshot below, the object boundaries have weird colors. <img width="689" alt="image" src="https://github.com/huggingface/datasets/assets/4803565/59aa0e2c-2e3e-415b-9d42-2314044c5aee"> Original example with `albumentations` is correct <img width="705" alt="image" src="https://github.com/huggingface/datasets/assets/4803565/27dbd725-cea5-4e48-ba59-7050c3ce17b3"> That is because `torch vision.transforms.Resize` interpolates with bilinear everything which is wrong when used for segmentation labels - you just cannot mix them. Overall, `torchvision.transforms` is designed for classification only and cannot be used to images and masks together, unless you write two separate branches of augmentations. The correct way would be to use `v2` version of transforms and convert the segmentation labels to https://pytorch.org/vision/main/generated/torchvision.tv_tensors.Mask.html#torchvision.tv_tensors.Mask object ### Steps to reproduce the bug Go to the website. <img width="689" alt="image" src="https://github.com/huggingface/datasets/assets/4803565/ea1276d0-d69a-48cf-b9c2-cd61217815ef"> https://huggingface.co/docs/datasets/en/semantic_segmentation ### Expected behavior Results, similar to `albumentation`. Or remove the torch vision part altogether. Or use `kornia` instead. ### Environment info Irrelevant
null
{ "+1": 2, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 2, "url": "https://api.github.com/repos/huggingface/datasets/issues/6865/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6865/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6864
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6864/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6864/comments
https://api.github.com/repos/huggingface/datasets/issues/6864/events
https://github.com/huggingface/datasets/issues/6864
2,276,986,981
I_kwDODunzps6HuBBl
6,864
Dataset 'rewardsignal/reddit_writing_prompts' doesn't exist on the Hub
{ "avatar_url": "https://avatars.githubusercontent.com/u/5783246?v=4", "events_url": "https://api.github.com/users/vinodrajendran001/events{/privacy}", "followers_url": "https://api.github.com/users/vinodrajendran001/followers", "following_url": "https://api.github.com/users/vinodrajendran001/following{/other_user}", "gists_url": "https://api.github.com/users/vinodrajendran001/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/vinodrajendran001", "id": 5783246, "login": "vinodrajendran001", "node_id": "MDQ6VXNlcjU3ODMyNDY=", "organizations_url": "https://api.github.com/users/vinodrajendran001/orgs", "received_events_url": "https://api.github.com/users/vinodrajendran001/received_events", "repos_url": "https://api.github.com/users/vinodrajendran001/repos", "site_admin": false, "starred_url": "https://api.github.com/users/vinodrajendran001/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vinodrajendran001/subscriptions", "type": "User", "url": "https://api.github.com/users/vinodrajendran001", "user_view_type": "public" }
[]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[ "Hi @vinodrajendran001, thanks for reporting.\r\n\r\nIndeed the dataset no longer exists on the Hub. The URL https://huggingface.co/datasets/rewardsignal/reddit_writing_prompts gives 404 Not Found error." ]
1970-01-01T00:00:00.000001
1,714
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug The dataset `rewardsignal/reddit_writing_prompts` is missing in Huggingface Hub. ### Steps to reproduce the bug ``` from datasets import load_dataset prompt_response_dataset = load_dataset("rewardsignal/reddit_writing_prompts", data_files="prompt_responses_full.csv", split='train[:80%]') ``` ### Expected behavior DatasetNotFoundError: Dataset 'rewardsignal/reddit_writing_prompts' doesn't exist on the Hub or cannot be accessed ### Environment info Nothing to do with versions
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6864/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6864/timeline
null
not_planned
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6863
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6863/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6863/comments
https://api.github.com/repos/huggingface/datasets/issues/6863/events
https://github.com/huggingface/datasets/issues/6863
2,276,977,534
I_kwDODunzps6Ht-t-
6,863
Revert temporary pin huggingface-hub < 0.23.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[]
1970-01-01T00:00:00.000001
1,716
1970-01-01T00:00:00.000001
MEMBER
null
Revert temporary pin huggingface-hub < 0.23.0 introduced by - #6861 once the following issue is fixed and released: - huggingface/transformers#30618
{ "avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4", "events_url": "https://api.github.com/users/lhoestq/events{/privacy}", "followers_url": "https://api.github.com/users/lhoestq/followers", "following_url": "https://api.github.com/users/lhoestq/following{/other_user}", "gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lhoestq", "id": 42851186, "login": "lhoestq", "node_id": "MDQ6VXNlcjQyODUxMTg2", "organizations_url": "https://api.github.com/users/lhoestq/orgs", "received_events_url": "https://api.github.com/users/lhoestq/received_events", "repos_url": "https://api.github.com/users/lhoestq/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions", "type": "User", "url": "https://api.github.com/users/lhoestq", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6863/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6863/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6860
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6860/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6860/comments
https://api.github.com/repos/huggingface/datasets/issues/6860/events
https://github.com/huggingface/datasets/issues/6860
2,275,537,137
I_kwDODunzps6HofDx
6,860
CI fails after huggingface_hub-0.23.0 release: FutureWarning: "resume_download"
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "color": "d73a4a", "default": true, "description": "Something isn't working", "id": 1935892857, "name": "bug", "node_id": "MDU6TGFiZWwxOTM1ODkyODU3", "url": "https://api.github.com/repos/huggingface/datasets/labels/bug" } ]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[ "I think this needs to be fixed on transformers.\r\n\r\nCC: @Wauplin ", "See:\r\n- https://github.com/huggingface/transformers/issues/30618", "Opened https://github.com/huggingface/transformers/pull/30620" ]
1970-01-01T00:00:00.000001
1,714
1970-01-01T00:00:00.000001
MEMBER
null
CI fails after latest huggingface_hub-0.23.0 release: https://github.com/huggingface/huggingface_hub/releases/tag/v0.23.0 ``` FAILED tests/test_metric_common.py::LocalMetricTest::test_load_metric_bertscore - FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`. FAILED tests/test_metric_common.py::LocalMetricTest::test_load_metric_frugalscore - FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`. FAILED tests/test_metric_common.py::LocalMetricTest::test_load_metric_perplexity - FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`. FAILED tests/test_fingerprint.py::TokenizersHashTest::test_hash_tokenizer - FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`. FAILED tests/test_fingerprint.py::TokenizersHashTest::test_hash_tokenizer_with_cache - FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`. FAILED tests/test_arrow_dataset.py::MiscellaneousDatasetTest::test_set_format_encode - FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`. ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6860/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6860/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6858
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6858/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6858/comments
https://api.github.com/repos/huggingface/datasets/issues/6858/events
https://github.com/huggingface/datasets/issues/6858
2,274,917,185
I_kwDODunzps6HmHtB
6,858
Segmentation fault
{ "avatar_url": "https://avatars.githubusercontent.com/u/554155?v=4", "events_url": "https://api.github.com/users/scampion/events{/privacy}", "followers_url": "https://api.github.com/users/scampion/followers", "following_url": "https://api.github.com/users/scampion/following{/other_user}", "gists_url": "https://api.github.com/users/scampion/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/scampion", "id": 554155, "login": "scampion", "node_id": "MDQ6VXNlcjU1NDE1NQ==", "organizations_url": "https://api.github.com/users/scampion/orgs", "received_events_url": "https://api.github.com/users/scampion/received_events", "repos_url": "https://api.github.com/users/scampion/repos", "site_admin": false, "starred_url": "https://api.github.com/users/scampion/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/scampion/subscriptions", "type": "User", "url": "https://api.github.com/users/scampion", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "I downloaded the jsonl file and extract it manually. \r\nThe issue seems to be related to pyarrow.json \r\n\r\n\r\n\r\npython3 -q -X faulthandler -c \"from datasets import load_dataset; load_dataset('json', data_files='/Users/scampion/Downloads/1998-09.jsonl')\"\r\nGenerating train split: 0 examples [00:00, ? examples/s]Fatal Python error: Segmentation fault\r\n\r\nThread 0x00007000000c1000 (most recent call first):\r\n <no Python frame>\r\n\r\nThread 0x00007000024df000 (most recent call first):\r\n File \"/usr/local/Cellar/[email protected]/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py\", line 331 in wait\r\n File \"/usr/local/Cellar/[email protected]/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py\", line 629 in wait\r\n File \"/Users/scampion/src/test/venv_test/lib/python3.11/site-packages/tqdm/_monitor.py\", line 60 in run\r\n File \"/usr/local/Cellar/[email protected]/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py\", line 1045 in _bootstrap_inner\r\n File \"/usr/local/Cellar/[email protected]/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py\", line 1002 in _bootstrap\r\n\r\nThread 0x00007ff845c66640 (most recent call first):\r\n File \"/Users/scampion/src/test/venv_test/lib/python3.11/site-packages/datasets/packaged_modules/json/json.py\", line 122 in _generate_tables\r\n File \"/Users/scampion/src/test/venv_test/lib/python3.11/site-packages/datasets/builder.py\", line 1995 in _prepare_split_single\r\n File \"/Users/scampion/src/test/venv_test/lib/python3.11/site-packages/datasets/builder.py\", line 1882 in _prepare_split\r\n File \"/Users/scampion/src/test/venv_test/lib/python3.11/site-packages/datasets/builder.py\", line 1122 in _download_and_prepare\r\n File \"/Users/scampion/src/test/venv_test/lib/python3.11/site-packages/datasets/builder.py\", line 1027 in download_and_prepare\r\n File \"/Users/scampion/src/test/venv_test/lib/python3.11/site-packages/datasets/load.py\", line 2609 in load_dataset\r\n File \"<string>\", line 1 in <module>\r\n\r\nExtension modules: numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, pyarrow.lib, pyarrow._hdfsio, pandas._libs.tslibs.ccalendar, pandas._libs.tslibs.np_datetime, pandas._libs.tslibs.dtypes, pandas._libs.tslibs.base, pandas._libs.tslibs.nattype, pandas._libs.tslibs.timezones, pandas._libs.tslibs.fields, pandas._libs.tslibs.timedeltas, pandas._libs.tslibs.tzconversion, pandas._libs.tslibs.timestamps, pandas._libs.properties, pandas._libs.tslibs.offsets, pandas._libs.tslibs.strptime, pandas._libs.tslibs.parsing, pandas._libs.tslibs.conversion, pandas._libs.tslibs.period, pandas._libs.tslibs.vectorized, pandas._libs.ops_dispatch, pandas._libs.missing, pandas._libs.hashtable, pandas._libs.algos, pandas._libs.interval, pandas._libs.lib, pyarrow._compute, pandas._libs.ops, pandas._libs.hashing, pandas._libs.arrays, pandas._libs.tslib, pandas._libs.sparse, pandas._libs.internals, pandas._libs.indexing, pandas._libs.index, pandas._libs.writers, pandas._libs.join, pandas._libs.window.aggregations, pandas._libs.window.indexers, pandas._libs.reshape, pandas._libs.groupby, pandas._libs.json, pandas._libs.parsers, pandas._libs.testing, charset_normalizer.md, yaml._yaml, pyarrow._parquet, pyarrow._fs, pyarrow._hdfs, pyarrow._gcsfs, pyarrow._s3fs, multidict._multidict, yarl._quoting_c, aiohttp._helpers, aiohttp._http_writer, aiohttp._http_parser, aiohttp._websocket, frozenlist._frozenlist, xxhash._xxhash, pyarrow._json (total: 72)\r\n[1] 56678 segmentation fault python3 -q -X faulthandler -c\r\n/usr/local/Cellar/[email protected]/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown\r\n warnings.warn('resource_tracker: There appear to be %d '\r\n(venv_test)", "The error comes from data where one line contains \"null\"" ]
1970-01-01T00:00:00.000001
1,714
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug Using various version for datasets, I'm no more longer able to load that dataset without a segmentation fault. Several others files are also concerned. ### Steps to reproduce the bug # Create a new venv python3 -m venv venv_test source venv_test/bin/activate # Install the latest version pip install datasets # Load that dataset python3 -q -X faulthandler -c "from datasets import load_dataset; load_dataset('EuropeanParliament/Eurovoc', '1998-09')" ### Expected behavior Data must be loaded ### Environment info datasets==2.19.0 Python 3.11.7 Darwin 22.5.0 Darwin Kernel Version 22.5.0: Mon Apr 24 20:51:50 PDT 2023; root:xnu-8796.121.2~5/RELEASE_X86_64 x86_64
{ "avatar_url": "https://avatars.githubusercontent.com/u/554155?v=4", "events_url": "https://api.github.com/users/scampion/events{/privacy}", "followers_url": "https://api.github.com/users/scampion/followers", "following_url": "https://api.github.com/users/scampion/following{/other_user}", "gists_url": "https://api.github.com/users/scampion/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/scampion", "id": 554155, "login": "scampion", "node_id": "MDQ6VXNlcjU1NDE1NQ==", "organizations_url": "https://api.github.com/users/scampion/orgs", "received_events_url": "https://api.github.com/users/scampion/received_events", "repos_url": "https://api.github.com/users/scampion/repos", "site_admin": false, "starred_url": "https://api.github.com/users/scampion/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/scampion/subscriptions", "type": "User", "url": "https://api.github.com/users/scampion", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6858/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6858/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6856
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6856/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6856/comments
https://api.github.com/repos/huggingface/datasets/issues/6856/events
https://github.com/huggingface/datasets/issues/6856
2,274,828,933
I_kwDODunzps6HlyKF
6,856
CI fails on Windows for test_delete_from_hub and test_xgetsize_private due to new-line character
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "color": "d73a4a", "default": true, "description": "Something isn't working", "id": 1935892857, "name": "bug", "node_id": "MDU6TGFiZWwxOTM1ODkyODU3", "url": "https://api.github.com/repos/huggingface/datasets/labels/bug" } ]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[ "After investigation, I have found that when a local file is uploaded to the Hub, the new line character is no longer transformed to \"\\n\": on Windows machine now it is kept as \"\\r\\n\".\r\n\r\nAny idea why this changed?\r\nCC: @lhoestq " ]
1970-01-01T00:00:00.000001
1,714
1970-01-01T00:00:00.000001
MEMBER
null
CI fails on Windows for test_delete_from_hub after the merge of: - #6820 This is weird because the CI was green in the PR branch before merging to main. ``` FAILED tests/test_hub.py::test_delete_from_hub - AssertionError: assert [CommitOperat...\r\n---\r\n')] == [CommitOperat...in/*\n---\n')] At index 1 diff: CommitOperationAdd(path_in_repo='README.md', path_or_fileobj=b'---\r\nconfigs:\r\n- config_name: cats\r\n data_files:\r\n - split: train\r\n path: cats/train/*\r\n---\r\n') != CommitOperationAdd(path_in_repo='README.md', path_or_fileobj=b'---\nconfigs:\n- config_name: cats\n data_files:\n - split: train\n path: cats/train/*\n---\n') Full diff: [ CommitOperationDelete( path_in_repo='dogs/train/0000.csv', is_folder=False, ), CommitOperationAdd( path_in_repo='README.md', - path_or_fileobj=b'---\nconfigs:\n- config_name: cats\n data_files:\n ' ? -------- + path_or_fileobj=b'---\r\nconfigs:\r\n- config_name: cats\r\n data_f' ? ++ ++ ++ - b' - split: train\n path: cats/train/*\n---\n', ? ^^^^^^ - + b'iles:\r\n - split: train\r\n path: cats/train/*\r' ? ++++++++++ ++ ^ + b'\n---\r\n', ), ] ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6856/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6856/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6854
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6854/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6854/comments
https://api.github.com/repos/huggingface/datasets/issues/6854/events
https://github.com/huggingface/datasets/issues/6854
2,274,767,686
I_kwDODunzps6HljNG
6,854
Wrong example of usage when config name is missing for community script-datasets
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "color": "d73a4a", "default": true, "description": "Something isn't working", "id": 1935892857, "name": "bug", "node_id": "MDU6TGFiZWwxOTM1ODkyODU3", "url": "https://api.github.com/repos/huggingface/datasets/labels/bug" } ]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[]
1970-01-01T00:00:00.000001
1,714
1970-01-01T00:00:00.000001
MEMBER
null
As reported by @Wauplin, when loading a community dataset with script, there is a bug in the example of usage of the error message if the dataset has multiple configs (and no default config) and the user does not pass any config. For example: ```python >>> ds = load_dataset("google/fleurs") ValueError: Config name is missing. Please pick one among the available configs: ['af_za', 'am_et', 'ar_eg', 'as_in', 'ast_es', 'az_az', 'be_by', 'bg_bg', 'bn_in', 'bs_ba', 'ca_es', 'ceb_ph', 'ckb_iq', 'cmn_hans_cn', 'cs_cz', 'cy_gb', 'da_dk', 'de_de', 'el_gr', 'en_us', 'es_419', 'et_ee', 'fa_ir', 'ff_sn', 'fi_fi', 'fil_ph', 'fr_fr', 'ga_ie', 'gl_es', 'gu_in', 'ha_ng', 'he_il', 'hi_in', 'hr_hr', 'hu_hu', 'hy_am', 'id_id', 'ig_ng', 'is_is', 'it_it', 'ja_jp', 'jv_id', 'ka_ge', 'kam_ke', 'kea_cv', 'kk_kz', 'km_kh', 'kn_in', 'ko_kr', 'ky_kg', 'lb_lu', 'lg_ug', 'ln_cd', 'lo_la', 'lt_lt', 'luo_ke', 'lv_lv', 'mi_nz', 'mk_mk', 'ml_in', 'mn_mn', 'mr_in', 'ms_my', 'mt_mt', 'my_mm', 'nb_no', 'ne_np', 'nl_nl', 'nso_za', 'ny_mw', 'oc_fr', 'om_et', 'or_in', 'pa_in', 'pl_pl', 'ps_af', 'pt_br', 'ro_ro', 'ru_ru', 'sd_in', 'sk_sk', 'sl_si', 'sn_zw', 'so_so', 'sr_rs', 'sv_se', 'sw_ke', 'ta_in', 'te_in', 'tg_tj', 'th_th', 'tr_tr', 'uk_ua', 'umb_ao', 'ur_pk', 'uz_uz', 'vi_vn', 'wo_sn', 'xh_za', 'yo_ng', 'yue_hant_hk', 'zu_za', 'all'] Example of usage: `load_dataset('fleurs', 'af_za')` ``` Note the example of usage in the error message suggests loading "fleurs" instead of "google/fleurs".
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/huggingface/datasets/issues/6854/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6854/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6853
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6853/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6853/comments
https://api.github.com/repos/huggingface/datasets/issues/6853/events
https://github.com/huggingface/datasets/issues/6853
2,272,570,000
I_kwDODunzps6HdKqQ
6,853
Support soft links for load_datasets imagefolder
{ "avatar_url": "https://avatars.githubusercontent.com/u/10386511?v=4", "events_url": "https://api.github.com/users/billytcl/events{/privacy}", "followers_url": "https://api.github.com/users/billytcl/followers", "following_url": "https://api.github.com/users/billytcl/following{/other_user}", "gists_url": "https://api.github.com/users/billytcl/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/billytcl", "id": 10386511, "login": "billytcl", "node_id": "MDQ6VXNlcjEwMzg2NTEx", "organizations_url": "https://api.github.com/users/billytcl/orgs", "received_events_url": "https://api.github.com/users/billytcl/received_events", "repos_url": "https://api.github.com/users/billytcl/repos", "site_admin": false, "starred_url": "https://api.github.com/users/billytcl/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/billytcl/subscriptions", "type": "User", "url": "https://api.github.com/users/billytcl", "user_view_type": "public" }
[ { "color": "a2eeef", "default": true, "description": "New feature or request", "id": 1935892871, "name": "enhancement", "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement" } ]
open
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,714
null
NONE
null
### Feature request Load_dataset from a folder of images doesn't seem to support soft links. It would be nice if it did, especially during methods development where image folders are being curated. ### Motivation Images are coming from a complex variety of sources and we'd like to be able to soft link directly from the originating folders as opposed to copying. Having a copy of the file ensures that there may be issues with image versioning as well as having double the amount of required disk space. ### Your contribution N/A
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6853/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6853/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6852
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6852/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6852/comments
https://api.github.com/repos/huggingface/datasets/issues/6852/events
https://github.com/huggingface/datasets/issues/6852
2,272,465,011
I_kwDODunzps6HcxBz
6,852
Write token isn't working while pushing to datasets
{ "avatar_url": "https://avatars.githubusercontent.com/u/130903099?v=4", "events_url": "https://api.github.com/users/zaibutcooler/events{/privacy}", "followers_url": "https://api.github.com/users/zaibutcooler/followers", "following_url": "https://api.github.com/users/zaibutcooler/following{/other_user}", "gists_url": "https://api.github.com/users/zaibutcooler/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zaibutcooler", "id": 130903099, "login": "zaibutcooler", "node_id": "U_kgDOB81sOw", "organizations_url": "https://api.github.com/users/zaibutcooler/orgs", "received_events_url": "https://api.github.com/users/zaibutcooler/received_events", "repos_url": "https://api.github.com/users/zaibutcooler/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zaibutcooler/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zaibutcooler/subscriptions", "type": "User", "url": "https://api.github.com/users/zaibutcooler", "user_view_type": "public" }
[]
closed
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,714
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug <img width="1001" alt="Screenshot 2024-05-01 at 3 37 06 AM" src="https://github.com/huggingface/datasets/assets/130903099/00fcf12c-fcc1-4749-8592-d263d4efcbcc"> As you can see I logged in to my account and the write token is valid. But I can't upload on my main account and I am getting that error. It was okay on my test account at first try. (I refreshed the token, tried a new token but still doesn't work) ### Steps to reproduce the bug 1. I loaded a dataset. 2. I logged in using both cli and huggingface_hub 3. I pushed to my down dataset (It went well without any issues on my test account) ### Expected behavior It should have gone smoothly and this is not even my first time uploading to huggingface datasets ### Environment info colab, dataset (tried multiple versions)
{ "avatar_url": "https://avatars.githubusercontent.com/u/130903099?v=4", "events_url": "https://api.github.com/users/zaibutcooler/events{/privacy}", "followers_url": "https://api.github.com/users/zaibutcooler/followers", "following_url": "https://api.github.com/users/zaibutcooler/following{/other_user}", "gists_url": "https://api.github.com/users/zaibutcooler/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zaibutcooler", "id": 130903099, "login": "zaibutcooler", "node_id": "U_kgDOB81sOw", "organizations_url": "https://api.github.com/users/zaibutcooler/orgs", "received_events_url": "https://api.github.com/users/zaibutcooler/received_events", "repos_url": "https://api.github.com/users/zaibutcooler/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zaibutcooler/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zaibutcooler/subscriptions", "type": "User", "url": "https://api.github.com/users/zaibutcooler", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6852/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6852/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6851
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6851/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6851/comments
https://api.github.com/repos/huggingface/datasets/issues/6851/events
https://github.com/huggingface/datasets/issues/6851
2,270,965,503
I_kwDODunzps6HXC7_
6,851
load_dataset('emotion') UnicodeDecodeError
{ "avatar_url": "https://avatars.githubusercontent.com/u/32314558?v=4", "events_url": "https://api.github.com/users/L-Block-C/events{/privacy}", "followers_url": "https://api.github.com/users/L-Block-C/followers", "following_url": "https://api.github.com/users/L-Block-C/following{/other_user}", "gists_url": "https://api.github.com/users/L-Block-C/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/L-Block-C", "id": 32314558, "login": "L-Block-C", "node_id": "MDQ6VXNlcjMyMzE0NTU4", "organizations_url": "https://api.github.com/users/L-Block-C/orgs", "received_events_url": "https://api.github.com/users/L-Block-C/received_events", "repos_url": "https://api.github.com/users/L-Block-C/repos", "site_admin": false, "starred_url": "https://api.github.com/users/L-Block-C/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/L-Block-C/subscriptions", "type": "User", "url": "https://api.github.com/users/L-Block-C", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "I met the same problem, here is my code:\r\n```\r\nfrom datasets import load_dataset\r\n\r\nds_name = \"togethercomputer/RedPajama-Data-1T\"\r\nds = load_dataset(ds_name, download_mode=DownloadMode.FORCE_REDOWNLOAD)\r\n```\r\nAnd output error is:\r\n```\r\nTraceback (most recent call last):\r\n File \"/home/yatorho/doc/projs/TransformerEngine/local/download_redpajama.py\", line 10, in <module>\r\n ds = load_dataset(ds_name, download_mode=DownloadMode.FORCE_REDOWNLOAD)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/yatorho/anaconda3/envs/t24/lib/python3.12/site-packages/datasets/load.py\", line 2606, in load_dataset\r\n builder_instance = load_dataset_builder(\r\n ^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/yatorho/anaconda3/envs/t24/lib/python3.12/site-packages/datasets/load.py\", line 2277, in load_dataset_builder\r\n dataset_module = dataset_module_factory(\r\n ^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/yatorho/anaconda3/envs/t24/lib/python3.12/site-packages/datasets/load.py\", line 1923, in dataset_module_factory\r\n raise e1 from None\r\n File \"/home/yatorho/anaconda3/envs/t24/lib/python3.12/site-packages/datasets/load.py\", line 1875, in dataset_module_factory\r\n can_load_config_from_parquet_export = \"DEFAULT_CONFIG_NAME\" not in f.read()\r\n ^^^^^^^^\r\n File \"<frozen codecs>\", line 322, in decode\r\nUnicodeDecodeError: 'utf-8' codec can't decode byte 0xb5 in position 1: invalid start byte\r\n```\r\nMy `datasets` version is 2.21.0. Any help here would be appreciated!\r\n", "> I met the same problem, here is my code:\r\n> \r\n> ```\r\n> from datasets import load_dataset\r\n> \r\n> ds_name = \"togethercomputer/RedPajama-Data-1T\"\r\n> ds = load_dataset(ds_name, download_mode=DownloadMode.FORCE_REDOWNLOAD)\r\n> ```\r\n> \r\n> And output error is:\r\n> \r\n> ```\r\n> Traceback (most recent call last):\r\n> File \"/home/yatorho/doc/projs/TransformerEngine/local/download_redpajama.py\", line 10, in <module>\r\n> ds = load_dataset(ds_name, download_mode=DownloadMode.FORCE_REDOWNLOAD)\r\n> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n> File \"/home/yatorho/anaconda3/envs/t24/lib/python3.12/site-packages/datasets/load.py\", line 2606, in load_dataset\r\n> builder_instance = load_dataset_builder(\r\n> ^^^^^^^^^^^^^^^^^^^^^\r\n> File \"/home/yatorho/anaconda3/envs/t24/lib/python3.12/site-packages/datasets/load.py\", line 2277, in load_dataset_builder\r\n> dataset_module = dataset_module_factory(\r\n> ^^^^^^^^^^^^^^^^^^^^^^^\r\n> File \"/home/yatorho/anaconda3/envs/t24/lib/python3.12/site-packages/datasets/load.py\", line 1923, in dataset_module_factory\r\n> raise e1 from None\r\n> File \"/home/yatorho/anaconda3/envs/t24/lib/python3.12/site-packages/datasets/load.py\", line 1875, in dataset_module_factory\r\n> can_load_config_from_parquet_export = \"DEFAULT_CONFIG_NAME\" not in f.read()\r\n> ^^^^^^^^\r\n> File \"<frozen codecs>\", line 322, in decode\r\n> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb5 in position 1: invalid start byte\r\n> ```\r\n> \r\n> My `datasets` version is 2.21.0. Any help here would be appreciated!\r\n\r\nI passed encoding=\"utf-16\" to the `load_dataset` call and now it works for me.\r\n```\r\nds = load_dataset(ds_name, download_mode=DownloadMode.FORCE_REDOWNLOAD, encoding=\"utf-16\")\r\n```" ]
1970-01-01T00:00:00.000001
1,725
null
NONE
null
### Describe the bug **emotions = load_dataset('emotion')** _UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte_ ### Steps to reproduce the bug load_dataset('emotion') ### Expected behavior succese ### Environment info py3.10 transformers 4.41.0.dev0 datasets 2.19.0
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6851/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6851/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6850
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6850/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6850/comments
https://api.github.com/repos/huggingface/datasets/issues/6850/events
https://github.com/huggingface/datasets/issues/6850
2,269,500,624
I_kwDODunzps6HRdTQ
6,850
Problem loading voxpopuli dataset
{ "avatar_url": "https://avatars.githubusercontent.com/u/40496687?v=4", "events_url": "https://api.github.com/users/Namangarg110/events{/privacy}", "followers_url": "https://api.github.com/users/Namangarg110/followers", "following_url": "https://api.github.com/users/Namangarg110/following{/other_user}", "gists_url": "https://api.github.com/users/Namangarg110/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Namangarg110", "id": 40496687, "login": "Namangarg110", "node_id": "MDQ6VXNlcjQwNDk2Njg3", "organizations_url": "https://api.github.com/users/Namangarg110/orgs", "received_events_url": "https://api.github.com/users/Namangarg110/received_events", "repos_url": "https://api.github.com/users/Namangarg110/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Namangarg110/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Namangarg110/subscriptions", "type": "User", "url": "https://api.github.com/users/Namangarg110", "user_view_type": "public" }
[]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[ "Version 2.18 works without problem.", "@Namangarg110 @mohsen-goodarzi The bug appears because the number of urls is less than 16 and the algorithm is meant to work on the previously created mode for a single url as stated on line 314: https://github.com/huggingface/datasets/blob/1bf8a46cc7b096d5c547ea3794f6a4b6c31ea762/src/datasets/download/download_manager.py#L314\r\n\r\nIn addition, previously `map_nested` function was supported without batching and it is meant to be the default performance. \r\n\r\nOne of the shortest walk-arounds would be changing the part of the manager with the current setting:\r\n```\r\n if len(url_or_urls) >= 16:\r\n download_func = partial(self._download_batched, download_config=download_config)\r\n else:\r\n download_func = partial(self._download_single, download_config=download_config)\r\n\r\n start_time = datetime.now()\r\n with stack_multiprocessing_download_progress_bars():\r\n downloaded_path_or_paths = map_nested(\r\n download_func,\r\n url_or_urls,\r\n map_tuple=True,\r\n num_proc=download_config.num_proc,\r\n desc=\"Downloading data files\",\r\n batched=True if len(url_or_urls) >= 16 else False,\r\n batch_size=-1,\r\n )\r\n```\r\n\r\nI would suggest to consider other datasets for similar issues and make a pull-request. ", "Thanks for reporting @Namangarg110 and thanks for the investigation @MilanaShhanukova.\r\n\r\nApparently, there is an issue with the download functionality.\r\nI am proposing a fix." ]
1970-01-01T00:00:00.000001
1,714
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug ``` Exception has occurred: FileNotFoundError Couldn't find file at https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/{'en': 'data/en/asr_train.tsv'} ``` Error in logic for link url creation. The link should be https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/en/asr_train.tsv Basically there should be links directly under ```metadata["train"]```, not under ```metadata["train"][self.config.languages[0]]``` same for audio urls ### Steps to reproduce the bug ``` from datasets import load_dataset dataset = load_dataset("facebook/voxpopuli","en") ``` ### Expected behavior Dataset should be loaded successfully. ### Environment info - `datasets` version: 2.19.0 - Platform: Linux-5.15.0-1041-aws-x86_64-with-glibc2.31 - Python version: 3.10.13 - `huggingface_hub` version: 0.22.2 - PyArrow version: 16.0.0 - Pandas version: 2.2.0 - `fsspec` version: 2023.12.2
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 2, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 2, "url": "https://api.github.com/repos/huggingface/datasets/issues/6850/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6850/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6848
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6848/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6848/comments
https://api.github.com/repos/huggingface/datasets/issues/6848/events
https://github.com/huggingface/datasets/issues/6848
2,268,622,609
I_kwDODunzps6HOG8R
6,848
Cant Downlaod Common Voice 17.0 hy-AM
{ "avatar_url": "https://avatars.githubusercontent.com/u/31586104?v=4", "events_url": "https://api.github.com/users/mheryerznkanyan/events{/privacy}", "followers_url": "https://api.github.com/users/mheryerznkanyan/followers", "following_url": "https://api.github.com/users/mheryerznkanyan/following{/other_user}", "gists_url": "https://api.github.com/users/mheryerznkanyan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mheryerznkanyan", "id": 31586104, "login": "mheryerznkanyan", "node_id": "MDQ6VXNlcjMxNTg2MTA0", "organizations_url": "https://api.github.com/users/mheryerznkanyan/orgs", "received_events_url": "https://api.github.com/users/mheryerznkanyan/received_events", "repos_url": "https://api.github.com/users/mheryerznkanyan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mheryerznkanyan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mheryerznkanyan/subscriptions", "type": "User", "url": "https://api.github.com/users/mheryerznkanyan", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "Same issue here." ]
1970-01-01T00:00:00.000001
1,715
null
NONE
null
### Describe the bug I want to download Common Voice 17.0 hy-AM but it returns an error. ``` The version_base parameter is not specified. Please specify a compatability version level, or None. Will assume defaults for version 1.1 @hydra.main(config_name='hfds_config', config_path=None) /usr/local/lib/python3.10/dist-packages/hydra/_internal/hydra.py:119: UserWarning: Future Hydra versions will no longer change working directory at job runtime by default. See https://hydra.cc/docs/1.2/upgrades/1.1_to_1.2/changes_to_job_working_dir/ for more information. ret = run_job( /usr/local/lib/python3.10/dist-packages/datasets/load.py:1429: FutureWarning: The repository for mozilla-foundation/common_voice_17_0 contains custom code which must be executed to correctly load the dataset. You can inspect the repository content at https://hf.co/datasets/mozilla-foundation/common_voice_17_0 You can avoid this message in future by passing the argument `trust_remote_code=True`. Passing `trust_remote_code=True` will be mandatory to load this dataset from the next major release of `datasets`. warnings.warn( Reading metadata...: 6180it [00:00, 133224.37it/s]les/s] Generating train split: 0 examples [00:00, ? examples/s] HuggingFace datasets failed due to some reason (stack trace below). For certain datasets (eg: MCV), it may be necessary to login to the huggingface-cli (via `huggingface-cli login`). Once logged in, you need to set `use_auth_token=True` when calling this script. Traceback error for reference : Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1743, in _prepare_split_single example = self.info.features.encode_example(record) if self.info.features is not None else record File "/usr/local/lib/python3.10/dist-packages/datasets/features/features.py", line 1878, in encode_example return encode_nested_example(self, example) File "/usr/local/lib/python3.10/dist-packages/datasets/features/features.py", line 1243, in encode_nested_example { File "/usr/local/lib/python3.10/dist-packages/datasets/features/features.py", line 1243, in <dictcomp> { File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 326, in zip_dict yield key, tuple(d[key] for d in dicts) File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 326, in <genexpr> yield key, tuple(d[key] for d in dicts) KeyError: 'sentence_id' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/workspace/nemo/scripts/speech_recognition/convert_hf_dataset_to_nemo.py", line 358, in main dataset = load_dataset( File "/usr/local/lib/python3.10/dist-packages/datasets/load.py", line 2549, in load_dataset builder_instance.download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1005, in download_and_prepare self._download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1767, in _download_and_prepare super()._download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1100, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1605, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1762, in _prepare_split_single raise DatasetGenerationError("An error occurred while generating the dataset") from e datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset ``` ### Steps to reproduce the bug ``` from datasets import load_dataset cv_17 = load_dataset("mozilla-foundation/common_voice_17_0", "hy-AM") ``` ### Expected behavior It works fine with common_voice_16_1 ### Environment info - `datasets` version: 2.18.0 - Platform: Linux-5.15.0-1042-nvidia-x86_64-with-glibc2.35 - Python version: 3.11.6 - `huggingface_hub` version: 0.22.2 - PyArrow version: 15.0.2 - Pandas version: 2.2.2 - `fsspec` version: 2024.2.0
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6848/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6848/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6847
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6847/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6847/comments
https://api.github.com/repos/huggingface/datasets/issues/6847/events
https://github.com/huggingface/datasets/issues/6847
2,268,589,177
I_kwDODunzps6HN-x5
6,847
[Streaming] Only load requested splits without resolving files for the other splits
{ "avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4", "events_url": "https://api.github.com/users/lhoestq/events{/privacy}", "followers_url": "https://api.github.com/users/lhoestq/followers", "following_url": "https://api.github.com/users/lhoestq/following{/other_user}", "gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lhoestq", "id": 42851186, "login": "lhoestq", "node_id": "MDQ6VXNlcjQyODUxMTg2", "organizations_url": "https://api.github.com/users/lhoestq/orgs", "received_events_url": "https://api.github.com/users/lhoestq/received_events", "repos_url": "https://api.github.com/users/lhoestq/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions", "type": "User", "url": "https://api.github.com/users/lhoestq", "user_view_type": "public" }
[]
open
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4", "events_url": "https://api.github.com/users/lhoestq/events{/privacy}", "followers_url": "https://api.github.com/users/lhoestq/followers", "following_url": "https://api.github.com/users/lhoestq/following{/other_user}", "gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lhoestq", "id": 42851186, "login": "lhoestq", "node_id": "MDQ6VXNlcjQyODUxMTg2", "organizations_url": "https://api.github.com/users/lhoestq/orgs", "received_events_url": "https://api.github.com/users/lhoestq/received_events", "repos_url": "https://api.github.com/users/lhoestq/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions", "type": "User", "url": "https://api.github.com/users/lhoestq", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4", "events_url": "https://api.github.com/users/lhoestq/events{/privacy}", "followers_url": "https://api.github.com/users/lhoestq/followers", "following_url": "https://api.github.com/users/lhoestq/following{/other_user}", "gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lhoestq", "id": 42851186, "login": "lhoestq", "node_id": "MDQ6VXNlcjQyODUxMTg2", "organizations_url": "https://api.github.com/users/lhoestq/orgs", "received_events_url": "https://api.github.com/users/lhoestq/received_events", "repos_url": "https://api.github.com/users/lhoestq/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions", "type": "User", "url": "https://api.github.com/users/lhoestq", "user_view_type": "public" } ]
null
[ "This should help fixing this issue: https://github.com/huggingface/datasets/pull/6832", "I'm having a similar issue when using splices:\r\n<img width=\"947\" alt=\"image\" src=\"https://github.com/huggingface/datasets/assets/28941213/2153faac-e1fe-4b6d-a79b-30b2699407e8\">\r\n<img width=\"823\" alt=\"image\" src=\"https://github.com/huggingface/datasets/assets/28941213/80919eca-eb6c-407d-8070-52642fdcee54\">\r\n<img width=\"914\" alt=\"image\" src=\"https://github.com/huggingface/datasets/assets/28941213/5219c201-e22e-4536-acc3-a922677785ff\">\r\n\r\n\r\nIt seems to be downloading, loading, and generating splits using the entire dataset." ]
1970-01-01T00:00:00.000001
1,715
null
MEMBER
null
e.g. [thangvip](https://huggingface.co/thangvip)/[cosmopedia_vi_math](https://huggingface.co/datasets/thangvip/cosmopedia_vi_math) has 300 splits and it takes a very long time to load only one split. This is due to `load_dataset()` resolving the files of all the splits even if only one is needed. In `dataset-viewer` the splits are loaded in different jobs so it results in 300 jobs that resolve 300 splits -> 90k calls to `/paths-info`
null
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/huggingface/datasets/issues/6847/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6847/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6846
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6846/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6846/comments
https://api.github.com/repos/huggingface/datasets/issues/6846/events
https://github.com/huggingface/datasets/issues/6846
2,267,352,120
I_kwDODunzps6HJQw4
6,846
Unimaginable super slow iteration
{ "avatar_url": "https://avatars.githubusercontent.com/u/88258534?v=4", "events_url": "https://api.github.com/users/rangehow/events{/privacy}", "followers_url": "https://api.github.com/users/rangehow/followers", "following_url": "https://api.github.com/users/rangehow/following{/other_user}", "gists_url": "https://api.github.com/users/rangehow/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rangehow", "id": 88258534, "login": "rangehow", "node_id": "MDQ6VXNlcjg4MjU4NTM0", "organizations_url": "https://api.github.com/users/rangehow/orgs", "received_events_url": "https://api.github.com/users/rangehow/received_events", "repos_url": "https://api.github.com/users/rangehow/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rangehow/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rangehow/subscriptions", "type": "User", "url": "https://api.github.com/users/rangehow", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "In every iteration you load the full \"random_input\" column in memory, only then to access it's i-th element.\r\n\r\nYou can try using this instead\r\n\r\na,b=dataset[i]['random_input'],dataset[i]['random_output']" ]
1970-01-01T00:00:00.000001
1,714
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug Assuming there is a dataset with 52000 sentences, each with a length of 500, it takes 20 seconds to extract a sentence from the dataset……?Is there something wrong with my iteration? ### Steps to reproduce the bug ```python import datasets import time import random num_rows = 52000 num_cols = 500 random_input = [[random.randint(1, 100) for _ in range(num_cols)] for _ in range(num_rows)] random_output = [[random.randint(1, 100) for _ in range(num_cols)] for _ in range(num_rows)] s=time.time() d={'random_input':random_input,'random_output':random_output} dataset=datasets.Dataset.from_dict(d) print('from dict',time.time()-s) print(dataset) for i in range(len(dataset)): aa=time.time() a,b=dataset['random_input'][i],dataset['random_output'][i] print(time.time()-aa) ``` corresponding output ```bash from dict 9.215498685836792 Dataset({ features: ['random_input', 'random_output'], num_rows: 52000 }) 19.129778146743774 19.329464197158813 19.27668261528015 19.28557538986206 19.247620582580566 19.624247074127197 19.28673791885376 19.301053047180176 19.290496110916138 19.291821718215942 19.357765197753906 ``` ### Expected behavior Under normal circumstances, iteration should be very rapid as it does not involve the main tasks other than getting items ### Environment info - `datasets` version: 2.19.0 - Platform: Linux-3.10.0-1160.71.1.el7.x86_64-x86_64-with-glibc2.17 - Python version: 3.10.13 - `huggingface_hub` version: 0.21.4 - PyArrow version: 15.0.0 - Pandas version: 2.2.1 - `fsspec` version: 2024.2.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/88258534?v=4", "events_url": "https://api.github.com/users/rangehow/events{/privacy}", "followers_url": "https://api.github.com/users/rangehow/followers", "following_url": "https://api.github.com/users/rangehow/following{/other_user}", "gists_url": "https://api.github.com/users/rangehow/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rangehow", "id": 88258534, "login": "rangehow", "node_id": "MDQ6VXNlcjg4MjU4NTM0", "organizations_url": "https://api.github.com/users/rangehow/orgs", "received_events_url": "https://api.github.com/users/rangehow/received_events", "repos_url": "https://api.github.com/users/rangehow/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rangehow/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rangehow/subscriptions", "type": "User", "url": "https://api.github.com/users/rangehow", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6846/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6846/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6845
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6845/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6845/comments
https://api.github.com/repos/huggingface/datasets/issues/6845/events
https://github.com/huggingface/datasets/issues/6845
2,265,876,551
I_kwDODunzps6HDohH
6,845
load_dataset doesn't support list column
{ "avatar_url": "https://avatars.githubusercontent.com/u/16257131?v=4", "events_url": "https://api.github.com/users/arthasking123/events{/privacy}", "followers_url": "https://api.github.com/users/arthasking123/followers", "following_url": "https://api.github.com/users/arthasking123/following{/other_user}", "gists_url": "https://api.github.com/users/arthasking123/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/arthasking123", "id": 16257131, "login": "arthasking123", "node_id": "MDQ6VXNlcjE2MjU3MTMx", "organizations_url": "https://api.github.com/users/arthasking123/orgs", "received_events_url": "https://api.github.com/users/arthasking123/received_events", "repos_url": "https://api.github.com/users/arthasking123/repos", "site_admin": false, "starred_url": "https://api.github.com/users/arthasking123/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/arthasking123/subscriptions", "type": "User", "url": "https://api.github.com/users/arthasking123", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "I encountered this same issue when loading a customized dataset for ORPO training, in which there were three columns and two of them were lists. \r\nI debugged and found that it might be caused by the type-infer mechanism and because in some chunks one of the columns is always an empty list ([]), it was regarded as ```list<item: null>```, however in some other chunk it was ```list<item: string>```. This triggered a TypeError running the function ```table_cast()```.\r\n\r\nI temporarily fixed this by re-dumping the file into a regular JSON format instead of lines of JSON dict. I didn't dig deeper for the lack of knowledge and programming ability but I do hope some developer of this repo will find and fix it." ]
1970-01-01T00:00:00.000001
1,715
null
NONE
null
### Describe the bug dataset = load_dataset("Doraemon-AI/text-to-neo4j-cypher-chinese") got exception: Generating train split: 1834 examples [00:00, 5227.98 examples/s] Traceback (most recent call last): File "/usr/local/lib/python3.11/dist-packages/datasets/builder.py", line 2011, in _prepare_split_single writer.write_table(table) File "/usr/local/lib/python3.11/dist-packages/datasets/arrow_writer.py", line 585, in write_table pa_table = table_cast(pa_table, self._schema) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/datasets/table.py", line 2295, in table_cast return cast_table_to_schema(table, schema) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/datasets/table.py", line 2254, in cast_table_to_schema arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/datasets/table.py", line 2254, in <listcomp> arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/datasets/table.py", line 1802, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/datasets/table.py", line 1802, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/datasets/table.py", line 2018, in cast_array_to_feature casted_array_values = _c(array.values, feature[0]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/datasets/table.py", line 1804, in wrapper return func(array, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/datasets/table.py", line 2115, in cast_array_to_feature raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") TypeError: Couldn't cast array of type struct<m.name: string, x.name: string, p.name: string, n.name: string, h.name: string, name: string, c: int64, collect(r.name): list<item: string>, q.name: string, rel.name: string, count(p): int64, 1: int64, p.location: string, max(n.name): null, mn.name: string, p.time: int64, min(q.name): string> to {'q.name': Value(dtype='string', id=None), 'mn.name': Value(dtype='string', id=None), 'x.name': Value(dtype='string', id=None), 'p.name': Value(dtype='string', id=None), 'n.name': Value(dtype='string', id=None), 'name': Value(dtype='string', id=None), 'm.name': Value(dtype='string', id=None), 'h.name': Value(dtype='string', id=None), 'count(p)': Value(dtype='int64', id=None), 'rel.name': Value(dtype='string', id=None), 'c': Value(dtype='int64', id=None), 'collect(r.name)': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), '1': Value(dtype='int64', id=None), 'p.location': Value(dtype='string', id=None), 'substring(h.name,0,5)': Value(dtype='string', id=None), 'p.time': Value(dtype='int64', id=None)} The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/ubuntu/llm/train-2.py", line 150, in <module> dataset = load_dataset("Doraemon-AI/text-to-neo4j-cypher-chinese") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/datasets/load.py", line 2609, in load_dataset builder_instance.download_and_prepare( File "/usr/local/lib/python3.11/dist-packages/datasets/builder.py", line 1027, in download_and_prepare self._download_and_prepare( File "/usr/local/lib/python3.11/dist-packages/datasets/builder.py", line 1122, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/usr/local/lib/python3.11/dist-packages/datasets/builder.py", line 1882, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/usr/local/lib/python3.11/dist-packages/datasets/builder.py", line 2038, in _prepare_split_single raise DatasetGenerationError("An error occurred while generating the dataset") from e datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset ### Steps to reproduce the bug dataset = load_dataset("Doraemon-AI/text-to-neo4j-cypher-chinese") ### Expected behavior no exception ### Environment info python 3.11 datasets 2.19.0
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6845/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6845/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6843
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6843/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6843/comments
https://api.github.com/repos/huggingface/datasets/issues/6843/events
https://github.com/huggingface/datasets/issues/6843
2,265,432,897
I_kwDODunzps6HB8NB
6,843
IterableDataset raises exception instead of retrying
{ "avatar_url": "https://avatars.githubusercontent.com/u/145220868?v=4", "events_url": "https://api.github.com/users/bauwenst/events{/privacy}", "followers_url": "https://api.github.com/users/bauwenst/followers", "following_url": "https://api.github.com/users/bauwenst/following{/other_user}", "gists_url": "https://api.github.com/users/bauwenst/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bauwenst", "id": 145220868, "login": "bauwenst", "node_id": "U_kgDOCKflBA", "organizations_url": "https://api.github.com/users/bauwenst/orgs", "received_events_url": "https://api.github.com/users/bauwenst/received_events", "repos_url": "https://api.github.com/users/bauwenst/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bauwenst/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bauwenst/subscriptions", "type": "User", "url": "https://api.github.com/users/bauwenst", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "Thanks for reporting! I've opened a PR with a fix.", "Thanks, @mariosasko! Related question (although I guess this is a feature request): could we have some kind of exponential back-off for these retries? Here's my reasoning:\r\n- If a one-time accidental error happens, you should retry immediately and will succeed immediately.\r\n- If the Hub has a small outage on the order of minutes, you don't want to retry on the order of hours. \r\n- If the Hub has a prologned outage of several hours, we don't want to keep retrying on the order of minutes.\r\n\r\nThere actually already exists an implementation for (clipped) exponential backoff in the HuggingFace suite ([here](https://github.com/huggingface/huggingface_hub/blob/61b156a4f2e5fe1a492ed8712b26803e2122bde0/src/huggingface_hub/utils/_http.py#L306)), but I don't think it is used here.\r\n\r\nThe requirements are basically that you have an initial minimum waiting time and a maximum waiting time, and with each retry, the waiting time is doubled. We don't want to overload your servers with needless retries, especially when they're down :sweat_smile:", "Oh, I've just remembered that we added retries to the `HfFileSystem` in `huggingface_hub` 0.21.0 (see [this](https://github.com/huggingface/huggingface_hub/blob/61b156a4f2e5fe1a492ed8712b26803e2122bde0/src/huggingface_hub/hf_file_system.py#L703)), so I'll close the linked PR as we don't want to retry the retries :).\r\n\r\nI agree with the exponential backoff suggestion, so I'll open another PR.", "@mariosasko The call you linked indeed points to the implementation I linked in my previous comment, yes, but it has no configurability. Arguably, you want to have this hidden backoff under the hood that catches small network disturbances on the time scale of seconds -- perhaps even with hardcoded limits as is the case currently -- but you also still want to have a separate backoff on top of that with the configurability as suggested by @lhoestq in [the comment I linked](https://github.com/huggingface/datasets/issues/6172#issuecomment-1794876229).\r\n\r\nMy particular use-case is that I'm streaming a dataset while training on a university cluster with a very long scheduling queue. This means that when the backoff runs out of retries (which happens in under 30 seconds with the call you linked), I lose my spot on the cluster and have to queue for a whole day or more. Ideally, I should be able to specify that I want to retry for 2 to 3 hours but with more and more time between requests, so that I can smooth over hours-long outages without a setback of days.", "I also have my runs crash a surprising amount due to the dataloader crashing because of the hub, some way to address this would be nice.", "@mariosasko The implementation for retries is still broken and there is still no exponential back-off.\r\n\r\nHuggingFace has a two-tiered back-off:\r\n- `huggingface_hub.utils` provides the low-level `http_backoff` function which is used for all HTTP requests. It retries first with 1 second delay, then 2, then 4, then 8, then 8, and then it crashes. This is not even half a minute of exponential backoff in total.\r\n- `datasets.utils.file_utils` provides a function `_add_retries_to_file_obj_read_method` that monkey-patches the `read` method of an `HfFileSystemFile` to have constant-time backoff on certain exceptions. The amount of retries and seconds between retries is customisable as explained by @lhoestq [here](https://github.com/huggingface/datasets/issues/6172#issuecomment-1794876229). The implementation looks like this:\r\n\r\nhttps://github.com/huggingface/datasets/blob/65f6eb54aa0e8bb44cea35deea28e0e8fecc25b9/src/datasets/utils/file_utils.py#L822-L841\r\n\r\nThis **still does not catch the correct exceptions** and hence no backoff happens **at all** which means that as soon as the hub is out for more than half a minute, processes will already start failing. Here is a stack trace of an uncaught exception:\r\n\r\n```\r\n File \"/miniconda3/envs/draft/lib/python3.11/site-packages/datasets/iterable_dataset.py\", line 268, in __iter__\r\n for key, pa_table in self.generate_tables_fn(**gen_kwags):\r\n File \"/miniconda3/envs/draft/lib/python3.11/site-packages/datasets/packaged_modules/json/json.py\", line 123, in _generate_tables\r\n batch = f.read(self.config.chunksize)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/miniconda3/envs/draft/lib/python3.11/site-packages/datasets/utils/file_utils.py\", line 830, in read_with_retries\r\n out = read(*args, **kwargs)\r\n ^^^^^^^^^^^^^^^^^^^^^\r\n File \"/miniconda3/envs/draft/lib/python3.11/site-packages/huggingface_hub/hf_file_system.py\", line 757, in read\r\n return super().read(length)\r\n ^^^^^^^^^^^^^^^^^^^^\r\n File \"/miniconda3/envs/draft/lib/python3.11/site-packages/fsspec/spec.py\", line 1856, in read\r\n out = self.cache._fetch(self.loc, self.loc + length)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/miniconda3/envs/draft/lib/python3.11/site-packages/fsspec/caching.py\", line 189, in _fetch\r\n self.cache = self.fetcher(start, end) # new block replaces old\r\n ^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/miniconda3/envs/draft/lib/python3.11/site-packages/huggingface_hub/hf_file_system.py\", line 713, in _fetch_range\r\n r = http_backoff(\r\n ^^^^^^^^^^^^^\r\n File \"/miniconda3/envs/draft/lib/python3.11/site-packages/huggingface_hub/utils/_http.py\", line 326, in http_backoff\r\n raise err\r\n File \"/miniconda3/envs/draft/lib/python3.11/site-packages/huggingface_hub/utils/_http.py\", line 307, in http_backoff\r\n response = session.request(method=method, url=url, **kwargs)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/miniconda3/envs/draft/lib/python3.11/site-packages/requests/sessions.py\", line 589, in request\r\n resp = self.send(prep, **send_kwargs)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/miniconda3/envs/draft/lib/python3.11/site-packages/requests/sessions.py\", line 703, in send\r\n r = adapter.send(request, **kwargs)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/miniconda3/envs/draft/lib/python3.11/site-packages/huggingface_hub/utils/_http.py\", line 93, in send\r\n return super().send(request, *args, **kwargs)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/miniconda3/envs/draft/lib/python3.11/site-packages/requests/adapters.py\", line 713, in send\r\n raise ReadTimeout(e, request=request)\r\nrequests.exceptions.ReadTimeout: (ReadTimeoutError(\"HTTPSConnectionPool(host='huggingface.co', port=443): Read timed out. (read timeout=10)\"), '(Request ID: 3d145d98-e4fa-442f-bead-6be060e60d59)')\r\n```\r\n**requests.exceptions.ReadTimeout** is not caught and hence the code fails after **0 retries**.", "I merged a fix for this, thanks for reporting ! It will now retry on any `requests` Timeout error, including ReadTimeoutError: https://github.com/huggingface/datasets/pull/7256" ]
1970-01-01T00:00:00.000001
1,730
null
NONE
null
### Describe the bug In light of the recent server outages, I decided to look into whether I could somehow wrap my IterableDataset streams to retry rather than error out immediately. To my surprise, `datasets` [already supports retries](https://github.com/huggingface/datasets/issues/6172#issuecomment-1794876229). Since a commit by @lhoestq [last week](https://github.com/huggingface/datasets/commit/a188022dc43a76a119d90c03832d51d6e4a94d91), that code lives here: https://github.com/huggingface/datasets/blob/fe2bea6a4b09b180bd23b88fe96dfd1a11191a4f/src/datasets/utils/file_utils.py#L1097C1-L1111C19 If GitHub code snippets still aren't working, here's a copy: ```python def read_with_retries(*args, **kwargs): disconnect_err = None for retry in range(1, max_retries + 1): try: out = read(*args, **kwargs) break except (ClientError, TimeoutError) as err: disconnect_err = err logger.warning( f"Got disconnected from remote data host. Retrying in {config.STREAMING_READ_RETRY_INTERVAL}sec [{retry}/{max_retries}]" ) time.sleep(config.STREAMING_READ_RETRY_INTERVAL) else: raise ConnectionError("Server Disconnected") from disconnect_err return out ``` With the latest outage, the end of my stack trace looked like this: ``` ... File "/miniconda3/envs/draft/lib/python3.11/site-packages/datasets/download/streaming_download_manager.py", line 342, in read_with_retries out = read(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/miniconda3/envs/draft/lib/python3.11/gzip.py", line 301, in read return self._buffer.read(size) ^^^^^^^^^^^^^^^^^^^^^^^ File "/miniconda3/envs/draft/lib/python3.11/_compression.py", line 68, in readinto data = self.read(len(byte_view)) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/miniconda3/envs/draft/lib/python3.11/gzip.py", line 505, in read buf = self._fp.read(io.DEFAULT_BUFFER_SIZE) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/miniconda3/envs/draft/lib/python3.11/gzip.py", line 88, in read return self.file.read(size) ^^^^^^^^^^^^^^^^^^^^ File "/miniconda3/envs/draft/lib/python3.11/site-packages/fsspec/spec.py", line 1856, in read out = self.cache._fetch(self.loc, self.loc + length) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/miniconda3/envs/draft/lib/python3.11/site-packages/fsspec/caching.py", line 189, in _fetch self.cache = self.fetcher(start, end) # new block replaces old ^^^^^^^^^^^^^^^^^^^^^^^^ File "/miniconda3/envs/draft/lib/python3.11/site-packages/huggingface_hub/hf_file_system.py", line 626, in _fetch_range hf_raise_for_status(r) File "/miniconda3/envs/draft/lib/python3.11/site-packages/huggingface_hub/utils/_errors.py", line 333, in hf_raise_for_status raise HfHubHTTPError(str(e), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: 504 Server Error: Gateway Time-out for url: https://huggingface.co/datasets/allenai/c4/resolve/1588ec454efa1a09f29cd18ddd04fe05fc8653a2/en/c4-train.00346-of-01024.json.gz ``` Indeed, the code for retries only catches `ClientError`s and `TimeoutError`s, and all other exceptions, *including HuggingFace's own custom HTTP error class*, **are not caught. Nothing is retried,** and instead the exception is propagated upwards immediately. ### Steps to reproduce the bug Not sure how you reproduce this. Maybe unplug your Ethernet cable while streaming a dataset; the issue is pretty clear from the stack trace. ### Expected behavior All HTTP errors while iterating a streamable dataset should cause retries. ### Environment info Output from `datasets-cli env`: - `datasets` version: 2.18.0 - Platform: Linux-4.18.0-513.24.1.el8_9.x86_64-x86_64-with-glibc2.28 - Python version: 3.11.7 - `huggingface_hub` version: 0.20.3 - PyArrow version: 15.0.0 - Pandas version: 2.2.0 - `fsspec` version: 2023.10.0
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6843/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6843/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6842
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6842/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6842/comments
https://api.github.com/repos/huggingface/datasets/issues/6842/events
https://github.com/huggingface/datasets/issues/6842
2,264,692,159
I_kwDODunzps6G_HW_
6,842
Datasets with files with colon : in filenames cannot be used on Windows
{ "avatar_url": "https://avatars.githubusercontent.com/u/1038927?v=4", "events_url": "https://api.github.com/users/jacobjennings/events{/privacy}", "followers_url": "https://api.github.com/users/jacobjennings/followers", "following_url": "https://api.github.com/users/jacobjennings/following{/other_user}", "gists_url": "https://api.github.com/users/jacobjennings/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jacobjennings", "id": 1038927, "login": "jacobjennings", "node_id": "MDQ6VXNlcjEwMzg5Mjc=", "organizations_url": "https://api.github.com/users/jacobjennings/orgs", "received_events_url": "https://api.github.com/users/jacobjennings/received_events", "repos_url": "https://api.github.com/users/jacobjennings/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jacobjennings/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jacobjennings/subscriptions", "type": "User", "url": "https://api.github.com/users/jacobjennings", "user_view_type": "public" }
[]
open
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,714
null
NONE
null
### Describe the bug Datasets (such as https://huggingface.co/datasets/MLCommons/peoples_speech) cannot be used on Windows due to the fact that windows does not allow colons ":" in filenames. These should be converted into alternative strings. ### Steps to reproduce the bug 1. Attempt to run load_dataset on MLCommons/peoples_speech ### Expected behavior Does not crash during extraction ### Environment info Windows 11, NTFS filesystem, Python 3.12
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6842/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6842/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6841
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6841/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6841/comments
https://api.github.com/repos/huggingface/datasets/issues/6841/events
https://github.com/huggingface/datasets/issues/6841
2,264,687,683
I_kwDODunzps6G_GRD
6,841
Unable to load wiki_auto_asset_turk from GEM
{ "avatar_url": "https://avatars.githubusercontent.com/u/23074600?v=4", "events_url": "https://api.github.com/users/abhinavsethy/events{/privacy}", "followers_url": "https://api.github.com/users/abhinavsethy/followers", "following_url": "https://api.github.com/users/abhinavsethy/following{/other_user}", "gists_url": "https://api.github.com/users/abhinavsethy/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/abhinavsethy", "id": 23074600, "login": "abhinavsethy", "node_id": "MDQ6VXNlcjIzMDc0NjAw", "organizations_url": "https://api.github.com/users/abhinavsethy/orgs", "received_events_url": "https://api.github.com/users/abhinavsethy/received_events", "repos_url": "https://api.github.com/users/abhinavsethy/repos", "site_admin": false, "starred_url": "https://api.github.com/users/abhinavsethy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/abhinavsethy/subscriptions", "type": "User", "url": "https://api.github.com/users/abhinavsethy", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "Hi! I've opened a [PR](https://huggingface.co/datasets/GEM/wiki_auto_asset_turk/discussions/5) with a fix. While waiting for it to be merged, you can load the dataset from the PR branch with `datasets.load_dataset(\"GEM/wiki_auto_asset_turk\", revision=\"refs/pr/5\")`", "Thanks Mario. Still getting the same issue though with the suggested fix\r\n\r\n#cat gem_sari.py\r\nimport datasets\r\nprint (datasets.__version__)\r\ndataset =datasets.load_dataset(\"GEM/wiki_auto_asset_turk\", revision=\"refs/pr/5\")\r\n\r\nEnd up with \r\n File \"/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/datasets/load.py\", line 2582, in load_dataset\r\n builder_instance.download_and_prepare(\r\n File \"/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/datasets/builder.py\", line 1005, in download_and_prepare\r\n self._download_and_prepare(\r\n File \"/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/datasets/builder.py\", line 1767, in _download_and_prepare\r\n super()._download_and_prepare(\r\n File \"/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/datasets/builder.py\", line 1100, in _download_and_prepare\r\n self._prepare_split(split_generator, **prepare_split_kwargs)\r\n File \"/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/datasets/builder.py\", line 1565, in _prepare_split\r\n split_info = self.info.splits[split_generator.name]\r\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/datasets/splits.py\", line 532, in __getitem__\r\n instructions = make_file_instructions(\r\n ^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/datasets/arrow_reader.py\", line 121, in make_file_instructions\r\n info.name: filenames_for_dataset_split(\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/datasets/naming.py\", line 72, in filenames_for_dataset_split\r\n prefix = os.path.join(path, prefix)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"<frozen posixpath>\", line 76, in join\r\nTypeError: expected str, bytes or os.PathLike object, not NoneType", "Hmm, that's weird. Maybe try deleting the cache with `!rm -rf ~/.cache/huggingface/datasets` and then re-download.", "Tried that a couple of time. It does download the data fresh but end up with same error. Is there a way to see if its using the right version ?", "You can check the version with `python -c \"import datasets; print(datasets.__version__)\"`", "the datasets version is 2.18. \r\n\r\nI wanted to see if the command datasets.load_dataset(\"GEM/wiki_auto_asset_turk\", revision=\"refs/pr/5\") is using the right revision (refs/pr/5). \r\n\r\n\r\n\r\n\r\n\r\n ", "Still have this problem", "The issue is fixed once the fixing PR has been merged and the dataset has been converted to Parquet.\r\n\r\nIf the problem persists on your side, you should update your `datasets` library:\r\n```shell\r\npip install -U datasets\r\n```\r\nAnd if you have already the latest version of `datasets`, then you need to delete the old version of this dataset in your cache:\r\n```shell\r\nrm -fr ~/.cache/huggingface/datasets/GEM___wiki_auto_asset_turk\r\nrm -fr ~/.cache/huggingface/modules/datasets_modules/datasets/GEM--wiki_auto_asset_turk\r\n```" ]
1970-01-01T00:00:00.000001
1,716
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug I am unable to load the wiki_auto_asset_turk dataset. I get a fatal error while trying to access wiki_auto_asset_turk and load it with datasets.load_dataset. The error (TypeError: expected str, bytes or os.PathLike object, not NoneType) is from filenames_for_dataset_split in a os.path.join call >>import datasets >>print (datasets.__version__) >>dataset = datasets.load_dataset("GEM/wiki_auto_asset_turk") System output: Generating train split: 100%|█| 483801/483801 [00:03<00:00, 127164.26 examples/s Generating validation split: 100%|█| 20000/20000 [00:00<00:00, 116052.94 example Generating test_asset split: 100%|██| 359/359 [00:00<00:00, 76155.93 examples/s] Generating test_turk split: 100%|███| 359/359 [00:00<00:00, 87691.76 examples/s] Traceback (most recent call last): File "/Users/abhinav.sethy/Code/openai_evals/evals/evals/grammarly_tasks/gem_sari.py", line 3, in <module> dataset = datasets.load_dataset("GEM/wiki_auto_asset_turk") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/datasets/load.py", line 2582, in load_dataset builder_instance.download_and_prepare( File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/datasets/builder.py", line 1005, in download_and_prepare self._download_and_prepare( File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/datasets/builder.py", line 1767, in _download_and_prepare super()._download_and_prepare( File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/datasets/builder.py", line 1100, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/datasets/builder.py", line 1565, in _prepare_split split_info = self.info.splits[split_generator.name] ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/datasets/splits.py", line 532, in __getitem__ instructions = make_file_instructions( ^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/datasets/arrow_reader.py", line 121, in make_file_instructions info.name: filenames_for_dataset_split( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/datasets/naming.py", line 72, in filenames_for_dataset_split prefix = os.path.join(path, prefix) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen posixpath>", line 76, in join TypeError: expected str, bytes or os.PathLike object, not NoneType ### Steps to reproduce the bug import datasets print (datasets.__version__) dataset = datasets.load_dataset("GEM/wiki_auto_asset_turk") ### Expected behavior Should be able to load the dataset without any issues ### Environment info datasets version 2.18.0 (was able to reproduce bug with older versions 2.16 and 2.14 also) Python 3.12.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4", "events_url": "https://api.github.com/users/mariosasko/events{/privacy}", "followers_url": "https://api.github.com/users/mariosasko/followers", "following_url": "https://api.github.com/users/mariosasko/following{/other_user}", "gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mariosasko", "id": 47462742, "login": "mariosasko", "node_id": "MDQ6VXNlcjQ3NDYyNzQy", "organizations_url": "https://api.github.com/users/mariosasko/orgs", "received_events_url": "https://api.github.com/users/mariosasko/received_events", "repos_url": "https://api.github.com/users/mariosasko/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions", "type": "User", "url": "https://api.github.com/users/mariosasko", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6841/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6841/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6840
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6840/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6840/comments
https://api.github.com/repos/huggingface/datasets/issues/6840/events
https://github.com/huggingface/datasets/issues/6840
2,264,604,766
I_kwDODunzps6G-yBe
6,840
Delete uploaded files from the UI
{ "avatar_url": "https://avatars.githubusercontent.com/u/62512681?v=4", "events_url": "https://api.github.com/users/saicharan2804/events{/privacy}", "followers_url": "https://api.github.com/users/saicharan2804/followers", "following_url": "https://api.github.com/users/saicharan2804/following{/other_user}", "gists_url": "https://api.github.com/users/saicharan2804/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/saicharan2804", "id": 62512681, "login": "saicharan2804", "node_id": "MDQ6VXNlcjYyNTEyNjgx", "organizations_url": "https://api.github.com/users/saicharan2804/orgs", "received_events_url": "https://api.github.com/users/saicharan2804/received_events", "repos_url": "https://api.github.com/users/saicharan2804/repos", "site_admin": false, "starred_url": "https://api.github.com/users/saicharan2804/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/saicharan2804/subscriptions", "type": "User", "url": "https://api.github.com/users/saicharan2804", "user_view_type": "public" }
[ { "color": "a2eeef", "default": true, "description": "New feature or request", "id": 1935892871, "name": "enhancement", "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement" } ]
open
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,714
null
NONE
null
### Feature request Once a file is uploaded and the commit is made, I am unable to delete individual files without completely deleting the whole dataset via the website UI. ### Motivation Would be a useful addition ### Your contribution Would love to help out with some guidance
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6840/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6840/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6838
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6838/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6838/comments
https://api.github.com/repos/huggingface/datasets/issues/6838/events
https://github.com/huggingface/datasets/issues/6838
2,263,674,843
I_kwDODunzps6G7O_b
6,838
Remove token arg from CLI examples
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[]
1970-01-01T00:00:00.000001
1,714
1970-01-01T00:00:00.000001
MEMBER
null
As suggested by @Wauplin, see: https://github.com/huggingface/datasets/pull/6831#discussion_r1579492603 > I would not advertise the --token arg in the example as this shouldn't be the recommended way (best to login with env variable or huggingface-cli login)
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/huggingface/datasets/issues/6838/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6838/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6837
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6837/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6837/comments
https://api.github.com/repos/huggingface/datasets/issues/6837/events
https://github.com/huggingface/datasets/issues/6837
2,263,273,983
I_kwDODunzps6G5tH_
6,837
Cannot use cached dataset without Internet connection (or when servers are down)
{ "avatar_url": "https://avatars.githubusercontent.com/u/112088378?v=4", "events_url": "https://api.github.com/users/DionisMuzenitov/events{/privacy}", "followers_url": "https://api.github.com/users/DionisMuzenitov/followers", "following_url": "https://api.github.com/users/DionisMuzenitov/following{/other_user}", "gists_url": "https://api.github.com/users/DionisMuzenitov/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/DionisMuzenitov", "id": 112088378, "login": "DionisMuzenitov", "node_id": "U_kgDOBq5VOg", "organizations_url": "https://api.github.com/users/DionisMuzenitov/orgs", "received_events_url": "https://api.github.com/users/DionisMuzenitov/received_events", "repos_url": "https://api.github.com/users/DionisMuzenitov/repos", "site_admin": false, "starred_url": "https://api.github.com/users/DionisMuzenitov/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DionisMuzenitov/subscriptions", "type": "User", "url": "https://api.github.com/users/DionisMuzenitov", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "There are 2 workarounds, tho:\r\n1. Download datasets from web and just load them locally\r\n2. Use metadata directly (temporal solution, since metadata can change)\r\n```\r\nimport datasets\r\nfrom datasets.data_files import DataFilesDict, DataFilesList\r\n\r\ndata_files_list = DataFilesList(\r\n [\r\n \"hf://datasets/allenai/c4@1588ec454efa1a09f29cd18ddd04fe05fc8653a2/en/c4-train.00000-of-01024.json.gz\"\r\n ],\r\n [(\"allenai/c4\", \"1588ec454efa1a09f29cd18ddd04fe05fc8653a2\")],\r\n)\r\ndata_files = DataFilesDict({\"train\": data_files_list})\r\nc4_dataset = datasets.load_dataset(\r\n path=\"allenai/c4\",\r\n data_files=data_files,\r\n split=\"train\",\r\n cache_dir=\"/datesets/cache\",\r\n download_mode=\"reuse_cache_if_exists\",\r\n token=False,\r\n)\r\n```\r\nSecond solution also shows where to find the bug. I suggest that the hashing functions should always use only original parameter `data_files`, and not the one they get after connecting to the server and creating `DataFilesDict`", "Hi! You need to set the `HF_DATASETS_OFFLINE` env variable to `1` to load cached datasets offline, as explained in the docs [here](https://huggingface.co/docs/datasets/v2.19.0/en/loading#offline).", "Just tested. It doesn't work, because of the exact problem I described above: hash of dataset config is different.\r\nThe only error difference is the reason why it cannot connect to HuggingFace (now it's 'offline mode is enabled')\r\n![image](https://github.com/huggingface/datasets/assets/112088378/1a7e1720-d711-46e3-9c90-53d52c441e68)\r\n", "Met a pretty similar issue here, as I manually load the dataset into ~/.cache and try to let `load_dataset` detect it automatically, but it will always try reach hub even I set `HF_DATASETS_OFFLINE` to 1. Have you solved it? ", "same here!" ]
1970-01-01T00:00:00.000001
1,729
null
NONE
null
### Describe the bug I want to be able to use cached dataset from HuggingFace even when I have no Internet connection (or when HuggingFace servers are down, or my company has network issues). The problem why I can't use it: `data_files` argument from `datasets.load_dataset()` function get it updates from the server before calculating hash for caching. As a result, when I run the same code with and without Internet I get different dataset configuration directory name. ### Steps to reproduce the bug ``` import datasets c4_dataset = datasets.load_dataset( path="allenai/c4", data_files={"train": "en/c4-train.00000-of-01024.json.gz"}, split="train", cache_dir="/datesets/cache", download_mode="reuse_cache_if_exists", token=False, ) ``` 1. Run this code with the Internet. 2. Run the same code without the Internet. ### Expected behavior When running without the Internet connection, the loader should be able to get dataset from cache ### Environment info - `datasets` version: 2.19.0 - Platform: Windows-10-10.0.19044-SP0 - Python version: 3.10.13 - `huggingface_hub` version: 0.22.2 - PyArrow version: 16.0.0 - Pandas version: 1.5.3 - `fsspec` version: 2023.12.2
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6837/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6837/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6836
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6836/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6836/comments
https://api.github.com/repos/huggingface/datasets/issues/6836/events
https://github.com/huggingface/datasets/issues/6836
2,262,249,919
I_kwDODunzps6G1zG_
6,836
ExpectedMoreSplits error on load_dataset when upgrading to 2.19.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/24319399?v=4", "events_url": "https://api.github.com/users/ebsmothers/events{/privacy}", "followers_url": "https://api.github.com/users/ebsmothers/followers", "following_url": "https://api.github.com/users/ebsmothers/following{/other_user}", "gists_url": "https://api.github.com/users/ebsmothers/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ebsmothers", "id": 24319399, "login": "ebsmothers", "node_id": "MDQ6VXNlcjI0MzE5Mzk5", "organizations_url": "https://api.github.com/users/ebsmothers/orgs", "received_events_url": "https://api.github.com/users/ebsmothers/received_events", "repos_url": "https://api.github.com/users/ebsmothers/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ebsmothers/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ebsmothers/subscriptions", "type": "User", "url": "https://api.github.com/users/ebsmothers", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "Get same error on same datasets too.", "+1", "same error" ]
1970-01-01T00:00:00.000001
1,715
null
NONE
null
### Describe the bug Hi there, thanks for the great library! We have been using it a lot in torchtune and it's been a huge help for us. Regarding the bug: the same call to `load_dataset` errors with `ExpectedMoreSplits` in 2.19.0 after working fine in 2.18.0. Full details given in the repro below. ### Steps to reproduce the bug On 2.18.0, things work fine: ``` # First clear the locally cached dataset rm -r ~/.cache/huggingface/datasets/lvwerra___stack-exchange-paired pip install "datasets==2.18.0" python3 >>> from datasets import load_dataset >>> dataset = load_dataset('lvwerra/stack-exchange-paired', split='train', data_dir='data/rl') ``` On 2.19.0, they do not: ``` # First clear the locally cached dataset rm -r ~/.cache/huggingface/datasets/lvwerra___stack-exchange-paired pip install "datasets==2.19.0" python3 >>> from datasets import load_dataset >>> dataset = load_dataset('lvwerra/stack-exchange-paired', split='train', data_dir='data/rl') ``` The stack trace I see from the 2.19.0 version of load_dataset can be seen [here](https://gist.github.com/ebsmothers/f9b1f1949bee7030a8d7bb8a491550d2). (Maybe unsurprising but) notably if I do not delete the cache first I am able to load the dataset successfully. So based on this I suspect the cause is somewhere in the download logic. ### Expected behavior Download the dataset successfully :) ### Environment info - `datasets` version: 2.19.0 - Platform: Linux-5.12.0-0_fbk16_zion_7661_geb00762ce6d2-x86_64-with-glibc2.34 - Python version: 3.11.9 - `huggingface_hub` version: 0.22.2 - PyArrow version: 16.0.0 - Pandas version: 2.2.2 - `fsspec` version: 2024.3.1
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6836/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6836/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6834
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6834/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6834/comments
https://api.github.com/repos/huggingface/datasets/issues/6834/events
https://github.com/huggingface/datasets/issues/6834
2,261,078,104
I_kwDODunzps6GxVBY
6,834
largelisttype not supported (.from_polars())
{ "avatar_url": "https://avatars.githubusercontent.com/u/37351874?v=4", "events_url": "https://api.github.com/users/Modexus/events{/privacy}", "followers_url": "https://api.github.com/users/Modexus/followers", "following_url": "https://api.github.com/users/Modexus/following{/other_user}", "gists_url": "https://api.github.com/users/Modexus/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Modexus", "id": 37351874, "login": "Modexus", "node_id": "MDQ6VXNlcjM3MzUxODc0", "organizations_url": "https://api.github.com/users/Modexus/orgs", "received_events_url": "https://api.github.com/users/Modexus/received_events", "repos_url": "https://api.github.com/users/Modexus/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Modexus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Modexus/subscriptions", "type": "User", "url": "https://api.github.com/users/Modexus", "user_view_type": "public" }
[]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[]
1970-01-01T00:00:00.000001
1,723
1970-01-01T00:00:00.000001
CONTRIBUTOR
null
### Describe the bug The following code fails because LargeListType is not supported. This is especially a problem for .from_polars since polars uses LargeListType. ### Steps to reproduce the bug ```python import datasets import polars as pl df = pl.DataFrame({"list": [[]]}) datasets.Dataset.from_polars(df) ``` ### Expected behavior Convert LargeListType to list. ### Environment info - `datasets` version: 2.19.1.dev0 - Platform: Linux-6.8.7-200.fc39.x86_64-x86_64-with-glibc2.38 - Python version: 3.12.2 - `huggingface_hub` version: 0.22.2 - PyArrow version: 16.0.0 - Pandas version: 2.1.4 - `fsspec` version: 2024.3.1
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6834/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6834/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6833
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6833/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6833/comments
https://api.github.com/repos/huggingface/datasets/issues/6833/events
https://github.com/huggingface/datasets/issues/6833
2,259,731,274
I_kwDODunzps6GsMNK
6,833
Super slow iteration with trivial custom transform
{ "avatar_url": "https://avatars.githubusercontent.com/u/2780075?v=4", "events_url": "https://api.github.com/users/xslittlegrass/events{/privacy}", "followers_url": "https://api.github.com/users/xslittlegrass/followers", "following_url": "https://api.github.com/users/xslittlegrass/following{/other_user}", "gists_url": "https://api.github.com/users/xslittlegrass/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/xslittlegrass", "id": 2780075, "login": "xslittlegrass", "node_id": "MDQ6VXNlcjI3ODAwNzU=", "organizations_url": "https://api.github.com/users/xslittlegrass/orgs", "received_events_url": "https://api.github.com/users/xslittlegrass/received_events", "repos_url": "https://api.github.com/users/xslittlegrass/repos", "site_admin": false, "starred_url": "https://api.github.com/users/xslittlegrass/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/xslittlegrass/subscriptions", "type": "User", "url": "https://api.github.com/users/xslittlegrass", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "Similar issue in text process \r\n\r\n```python\r\n\r\ntokenizer=AutoTokenizer.from_pretrained(model_dir[args.model])\r\ntrain_dataset=datasets.load_from_disk(dataset_dir[args.dataset],keep_in_memory=True)['train']\r\ntrain_dataset=train_dataset.map(partial(dname2func[args.dataset],tokenizer=tokenizer),batched=True,num_proc =50,remove_columns=train_dataset.features.keys(),desc='tokenize',keep_in_memory=True)\r\n\r\n```\r\nAfter this train_dataset will be like\r\n```python\r\nDataset({\r\n features: ['input_ids', 'labels'],\r\n num_rows: 51760\r\n})\r\n```\r\nIn which input_ids and labels are both List[int]\r\nHowever, per iter on dataset cost 7.412479639053345s ……?\r\n```python\r\nfor j in tqdm(range(len(train_dataset)),desc='first stage'):\r\n input_id,label=train_dataset['input_ids'][j],train_dataset['labels'][j]\r\n\r\n``` ", "The transform currently replaces the numpy formatting.\r\n\r\nSo you're back to copying data to long python lists which is super slow.\r\n\r\nIt would be cool for the transform to not remove the formatting in this case, but this requires a few changes in the lib", "This also (somewhat surprisingly) affects iterable datasets, making map very challenging to use for data with large arrays, unless there is some workaround?", "For iterable datasets you should be able to do this without slow downs\r\n```python\r\nds = ds.with_format(\"arrow\").map(...)\r\n```\r\n\r\nI haven't tried with \"numpy\" though, maybe there is a step that does Arrow -> List -> NumPy instead of Arrow -> NumPy directly. If it's the case it would be cool to avoid that", "Thanks! this works for me\r\n\r\nHowever, it raises an error if batched=False and map batch_size isn't explicitly set to 1 due to map's default batch_size affecting the batch size of the RebatchedArrowExamplesIterable - is this a bug?", "Thanks for the fix @alex-hh !", "opened a new issue for the numpy slowdown #7206 " ]
1970-01-01T00:00:00.000001
1,728
null
NONE
null
### Describe the bug Dataset is 10X slower when applying trivial transforms: ``` import time import numpy as np from datasets import Dataset, Features, Array2D a = np.zeros((800, 800)) a = np.stack([a] * 1000) features = Features({"a": Array2D(shape=(800, 800), dtype="uint8")}) ds1 = Dataset.from_dict({"a": a}, features=features).with_format('numpy') def transform(batch): return batch ds2 = ds1.with_transform(transform) %time sum(1 for _ in ds1) %time sum(1 for _ in ds2) ``` ``` CPU times: user 472 ms, sys: 319 ms, total: 791 ms Wall time: 794 ms CPU times: user 9.32 s, sys: 443 ms, total: 9.76 s Wall time: 9.78 s ``` In my real code I'm using set_transform to apply some post-processing on-the-fly for the 2d array, but it significantly slows down the dataset even if the transform itself is trivial. Related issue: https://github.com/huggingface/datasets/issues/5841 ### Steps to reproduce the bug Use code in the description to reproduce. ### Expected behavior Trivial custom transform in the example should not slowdown the dataset iteration. ### Environment info - `datasets` version: 2.18.0 - Platform: Linux-5.15.0-79-generic-x86_64-with-glibc2.35 - Python version: 3.11.4 - `huggingface_hub` version: 0.20.2 - PyArrow version: 15.0.0 - Pandas version: 1.5.3 - `fsspec` version: 2023.12.2
null
{ "+1": 3, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 3, "url": "https://api.github.com/repos/huggingface/datasets/issues/6833/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6833/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6830
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6830/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6830/comments
https://api.github.com/repos/huggingface/datasets/issues/6830/events
https://github.com/huggingface/datasets/issues/6830
2,258,433,178
I_kwDODunzps6GnPSa
6,830
Add a doc page for the convert_to_parquet CLI
{ "avatar_url": "https://avatars.githubusercontent.com/u/1676121?v=4", "events_url": "https://api.github.com/users/severo/events{/privacy}", "followers_url": "https://api.github.com/users/severo/followers", "following_url": "https://api.github.com/users/severo/following{/other_user}", "gists_url": "https://api.github.com/users/severo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/severo", "id": 1676121, "login": "severo", "node_id": "MDQ6VXNlcjE2NzYxMjE=", "organizations_url": "https://api.github.com/users/severo/orgs", "received_events_url": "https://api.github.com/users/severo/received_events", "repos_url": "https://api.github.com/users/severo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/severo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/severo/subscriptions", "type": "User", "url": "https://api.github.com/users/severo", "user_view_type": "public" }
[ { "color": "0075ca", "default": true, "description": "Improvements or additions to documentation", "id": 1935892861, "name": "documentation", "node_id": "MDU6TGFiZWwxOTM1ODkyODYx", "url": "https://api.github.com/repos/huggingface/datasets/labels/documentation" } ]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[]
1970-01-01T00:00:00.000001
1,714
1970-01-01T00:00:00.000001
COLLABORATOR
null
Follow-up to https://github.com/huggingface/datasets/pull/6795. Useful for https://github.com/huggingface/dataset-viewer/issues/2742. cc @albertvillanova
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 1, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/huggingface/datasets/issues/6830/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6830/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6829
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6829/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6829/comments
https://api.github.com/repos/huggingface/datasets/issues/6829/events
https://github.com/huggingface/datasets/issues/6829
2,258,424,577
I_kwDODunzps6GnNMB
6,829
Load and save from/to disk no longer accept pathlib.Path
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "color": "d73a4a", "default": true, "description": "Something isn't working", "id": 1935892857, "name": "bug", "node_id": "MDU6TGFiZWwxOTM1ODkyODU3", "url": "https://api.github.com/repos/huggingface/datasets/labels/bug" } ]
open
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,713
null
MEMBER
null
Reported by @vttrifonov at https://github.com/huggingface/datasets/pull/6704#issuecomment-2071168296: > This change is breaking in > https://github.com/huggingface/datasets/blob/f96e74d5c633cd5435dd526adb4a74631eb05c43/src/datasets/arrow_dataset.py#L1515 > when the input is `pathlib.Path`. The issue is that `url_to_fs` expects a `str` and cannot deal with `Path`. `get_fs_token_paths` converts to `str` so it is not a problem This change was introduced in: - #6704
null
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/huggingface/datasets/issues/6829/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6829/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6827
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6827/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6827/comments
https://api.github.com/repos/huggingface/datasets/issues/6827/events
https://github.com/huggingface/datasets/issues/6827
2,254,011,833
I_kwDODunzps6GWX25
6,827
Loading a remote dataset fails in the last release (v2.19.0)
{ "avatar_url": "https://avatars.githubusercontent.com/u/35369637?v=4", "events_url": "https://api.github.com/users/zrthxn/events{/privacy}", "followers_url": "https://api.github.com/users/zrthxn/followers", "following_url": "https://api.github.com/users/zrthxn/following{/other_user}", "gists_url": "https://api.github.com/users/zrthxn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zrthxn", "id": 35369637, "login": "zrthxn", "node_id": "MDQ6VXNlcjM1MzY5NjM3", "organizations_url": "https://api.github.com/users/zrthxn/orgs", "received_events_url": "https://api.github.com/users/zrthxn/received_events", "repos_url": "https://api.github.com/users/zrthxn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zrthxn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zrthxn/subscriptions", "type": "User", "url": "https://api.github.com/users/zrthxn", "user_view_type": "public" }
[]
open
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,713
null
NONE
null
While loading a dataset with multiple splits I get an error saying `Couldn't find file at <URL>` I am loading the dataset like so, nothing out of the ordinary. This dataset needs a token to access it. ``` token="hf_myhftoken-sdhbdsjgkhbd" load_dataset("speechcolab/gigaspeech", "test", cache_dir=f"gigaspeech/test", token=token) ``` I get the following error ![Screenshot 2024-04-19 at 11 03 07 PM](https://github.com/huggingface/datasets/assets/35369637/8dce757f-08ff-45dd-85b5-890fced7c5bc) Now you can see that the URL that it is trying to reach has the JSON object of the dataset split appended to the base URL. I think this may be due to a newly introduced issue. I did not have this issue with the previous version of the datasets. Everything was fine for me yesterday and after the release 12 hours ago, this seems to have broken. Also, the dataset in question runs custom code and I checked and there have been no commits to the dataset on Huggingface in 6 months. ### Steps to reproduce the bug Since this happened with one particular dataset for me, I am listing steps to use that dataset. 1. Open https://huggingface.co/datasets/speechcolab/gigaspeech and fill the form to get access. 2. Create a token on your huggingface account with read access. 3. Run the following line, substituing `<your_token_here>` with your token. ``` load_dataset("speechcolab/gigaspeech", "test", cache_dir=f"gigaspeech/test", token="<your_token_here>") ``` ### Expected behavior Be able to load the dataset in question. ### Environment info datasets == 2.19.0 python == 3.10 kernel == Linux 6.1.58+
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6827/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6827/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6824
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6824/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6824/comments
https://api.github.com/repos/huggingface/datasets/issues/6824/events
https://github.com/huggingface/datasets/issues/6824
2,251,076,197
I_kwDODunzps6GLLJl
6,824
Winogrande does not seem to be compatible with datasets version of 1.18.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/7878204?v=4", "events_url": "https://api.github.com/users/spliew/events{/privacy}", "followers_url": "https://api.github.com/users/spliew/followers", "following_url": "https://api.github.com/users/spliew/following{/other_user}", "gists_url": "https://api.github.com/users/spliew/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/spliew", "id": 7878204, "login": "spliew", "node_id": "MDQ6VXNlcjc4NzgyMDQ=", "organizations_url": "https://api.github.com/users/spliew/orgs", "received_events_url": "https://api.github.com/users/spliew/received_events", "repos_url": "https://api.github.com/users/spliew/repos", "site_admin": false, "starred_url": "https://api.github.com/users/spliew/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/spliew/subscriptions", "type": "User", "url": "https://api.github.com/users/spliew", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "Hi ! Do you mean 2.18 ? Can you try to update `fsspec` and `huggingface_hub` ?\r\n\r\n```\r\npip install -U fsspec huggingface_hub\r\n```", "Yes I meant 2.18, and it works after updating `fsspec` and `huggingface_hub`. Thanks!" ]
1970-01-01T00:00:00.000001
1,713
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug I get the following error when simply running `load_dataset('winogrande','winogrande_xl')`. I do not have such an issue in the 1.17.0 version. ```Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.10/dist-packages/datasets/load.py", line 2556, in load_dataset builder_instance = load_dataset_builder( File "/usr/local/lib/python3.10/dist-packages/datasets/load.py", line 2265, in load_dataset_builder builder_instance: DatasetBuilder = builder_cls( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 371, in __init__ self.config, self.config_id = self._create_builder_config( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 620, in _create_builder_config builder_config._resolve_data_files( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 211, in _resolve_data_files self.data_files = self.data_files.resolve(base_path, download_config) File "/usr/local/lib/python3.10/dist-packages/datasets/data_files.py", line 799, in resolve out[key] = data_files_patterns_list.resolve(base_path, download_config) File "/usr/local/lib/python3.10/dist-packages/datasets/data_files.py", line 752, in resolve resolve_pattern( File "/usr/local/lib/python3.10/dist-packages/datasets/data_files.py", line 393, in resolve_pattern raise FileNotFoundError(error_msg) FileNotFoundError: Unable to find 'hf://datasets/winogrande@ebf71e3c7b5880d019ecf6099c0b09311b1084f5/winogrande_xl/train/0000.parquet' with any supported extension ['.csv', '.tsv', '.json', '.jsonl', '.parquet', '.geoparquet', '.gpq', '.arrow', '.txt', '.tar', '.blp', '.bmp', '.dib', '.bufr', '.cur', '.pcx', '.dcx', '.dds', '.ps', '.eps', '.fit', '.fits', '.fli', '.flc', '.ftc', '.ftu', '.gbr', '.gif', '.grib', '.h5', '.hdf', '.png', '.apng', '.jp2', '.j2k', '.jpc', '.jpf', '.jpx', '.j2c', '.icns', '.ico', '.im', '.iim', '.tif', '.tiff', '.jfif', '.jpe', '.jpg', '.jpeg', '.mpg', '.mpeg', '.msp', '.pcd', '.pxr', '.pbm', '.pgm', '.ppm', '.pnm', '.psd', '.bw', '.rgb', '.rgba', '.sgi', '.ras', '.tga', '.icb', '.vda', '.vst', '.webp', '.wmf', '.emf', '.xbm', '.xpm', '.BLP', '.BMP', '.DIB', '.BUFR', '.CUR', '.PCX', '.DCX', '.DDS', '.PS', '.EPS', '.FIT', '.FITS', '.FLI', '.FLC', '.FTC', '.FTU', '.GBR', '.GIF', '.GRIB', '.H5', '.HDF', '.PNG', '.APNG', '.JP2', '.J2K', '.JPC', '.JPF', '.JPX', '.J2C', '.ICNS', '.ICO', '.IM', '.IIM', '.TIF', '.TIFF', '.JFIF', '.JPE', '.JPG', '.JPEG', '.MPG', '.MPEG', '.MSP', '.PCD', '.PXR', '.PBM', '.PGM', '.PPM', '.PNM', '.PSD', '.BW', '.RGB', '.RGBA', '.SGI', '.RAS', '.TGA', '.ICB', '.VDA', '.VST', '.WEBP', '.WMF', '.EMF', '.XBM', '.XPM', '.aiff', '.au', '.avr', '.caf', '.flac', '.htk', '.svx', '.mat4', '.mat5', '.mpc2k', '.ogg', '.paf', '.pvf', '.raw', '.rf64', '.sd2', '.sds', '.ircam', '.voc', '.w64', '.wav', '.nist', '.wavex', '.wve', '.xi', '.mp3', '.opus', '.AIFF', '.AU', '.AVR', '.CAF', '.FLAC', '.HTK', '.SVX', '.MAT4', '.MAT5', '.MPC2K', '.OGG', '.PAF', '.PVF', '.RAW', '.RF64', '.SD2', '.SDS', '.IRCAM', '.VOC', '.W64', '.WAV', '.NIST', '.WAVEX', '.WVE', '.XI', '.MP3', '.OPUS', '.zip']``` ### Steps to reproduce the bug from datasets import load_dataset datasets = load_dataset('winogrande','winogrande_xl') ### Expected behavior ```Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.06M/2.06M [00:00<00:00, 5.16MB/s] Downloading data: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 118k/118k [00:00<00:00, 360kB/s] Downloading data: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 85.9k/85.9k [00:00<00:00, 242kB/s] Generating train split: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████| 40398/40398 [00:00<00:00, 845491.12 examples/s] Generating test split: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 1767/1767 [00:00<00:00, 362501.11 examples/s] Generating validation split: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████| 1267/1267 [00:00<00:00, 318768.11 examples/s]``` ### Environment info datasets version: 1.18.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/7878204?v=4", "events_url": "https://api.github.com/users/spliew/events{/privacy}", "followers_url": "https://api.github.com/users/spliew/followers", "following_url": "https://api.github.com/users/spliew/following{/other_user}", "gists_url": "https://api.github.com/users/spliew/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/spliew", "id": 7878204, "login": "spliew", "node_id": "MDQ6VXNlcjc4NzgyMDQ=", "organizations_url": "https://api.github.com/users/spliew/orgs", "received_events_url": "https://api.github.com/users/spliew/received_events", "repos_url": "https://api.github.com/users/spliew/repos", "site_admin": false, "starred_url": "https://api.github.com/users/spliew/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/spliew/subscriptions", "type": "User", "url": "https://api.github.com/users/spliew", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6824/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6824/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6823
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6823/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6823/comments
https://api.github.com/repos/huggingface/datasets/issues/6823/events
https://github.com/huggingface/datasets/issues/6823
2,250,775,569
I_kwDODunzps6GKBwR
6,823
Loading problems of Datasets with a single shard
{ "avatar_url": "https://avatars.githubusercontent.com/u/60151338?v=4", "events_url": "https://api.github.com/users/andjoer/events{/privacy}", "followers_url": "https://api.github.com/users/andjoer/followers", "following_url": "https://api.github.com/users/andjoer/following{/other_user}", "gists_url": "https://api.github.com/users/andjoer/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/andjoer", "id": 60151338, "login": "andjoer", "node_id": "MDQ6VXNlcjYwMTUxMzM4", "organizations_url": "https://api.github.com/users/andjoer/orgs", "received_events_url": "https://api.github.com/users/andjoer/received_events", "repos_url": "https://api.github.com/users/andjoer/repos", "site_admin": false, "starred_url": "https://api.github.com/users/andjoer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/andjoer/subscriptions", "type": "User", "url": "https://api.github.com/users/andjoer", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "Has there been a PR to resolve this already?", "The problem rises from using a wrong api.\r\nWhen loading a save_to_disk dataset, **load_from_disk** (instead of load_dataset) is what should be used.\r\n\r\n```python\r\nfrom datasets import load_from_disk\r\n\r\ndst.save_to_disk(\"cache\")\r\ndst = load_from_disk(\"cache\")\r\n```" ]
1970-01-01T00:00:00.000001
1,732
null
NONE
null
### Describe the bug When saving a dataset on disk and it has a single shard it is not loaded as when it is saved in multiple shards. I installed the latest version of datasets via pip. ### Steps to reproduce the bug The code below reproduces the behavior. All works well when the range of the loop is 10000 but it fails when it is 1000. ``` from PIL import Image import numpy as np from datasets import Dataset, DatasetDict, load_dataset def load_image(): # Generate random noise image noise = np.random.randint(0, 256, (256, 256, 3), dtype=np.uint8) return Image.fromarray(noise) def create_dataset(): input_images = [] output_images = [] text_prompts = [] for _ in range(10000): # this is the problematic parameter input_images.append(load_image()) output_images.append(load_image()) text_prompts.append('test prompt') data = {'input_image': input_images, 'output_image': output_images, 'text_prompt': text_prompts} dataset = Dataset.from_dict(data) return DatasetDict({'train': dataset}) dataset = create_dataset() print('dataset before saving') print(dataset) print(dataset['train'].column_names) dataset.save_to_disk('test_ds') print('dataset after loading') dataset_loaded = load_dataset('test_ds') print(dataset_loaded) print(dataset_loaded['train'].column_names) ``` The output for 1000 iterations is: ``` dataset before saving DatasetDict({ train: Dataset({ features: ['input_image', 'output_image', 'text_prompt'], num_rows: 1000 }) }) ['input_image', 'output_image', 'text_prompt'] Saving the dataset (1/1 shards): 100%|█| 1000/1000 [00:00<00:00, 5156.00 example dataset after loading Generating train split: 1 examples [00:00, 230.52 examples/s] DatasetDict({ train: Dataset({ features: ['_data_files', '_fingerprint', '_format_columns', '_format_kwargs', '_format_type', '_output_all_columns', '_split'], num_rows: 1 }) }) ['_data_files', '_fingerprint', '_format_columns', '_format_kwargs', '_format_type', '_output_all_columns', '_split'] ``` For 10000 iteration (8 shards) it is correct: ``` dataset before saving DatasetDict({ train: Dataset({ features: ['input_image', 'output_image', 'text_prompt'], num_rows: 10000 }) }) ['input_image', 'output_image', 'text_prompt'] Saving the dataset (8/8 shards): 100%|█| 10000/10000 [00:01<00:00, 6237.68 examp dataset after loading Generating train split: 10000 examples [00:00, 10773.16 examples/s] DatasetDict({ train: Dataset({ features: ['input_image', 'output_image', 'text_prompt'], num_rows: 10000 }) }) ['input_image', 'output_image', 'text_prompt'] ``` ### Expected behavior The procedure should work for a dataset with one shrad the same as for one with multiple shards ### Environment info - `datasets` version: 2.18.0 - Platform: macOS-14.1-arm64-arm-64bit - Python version: 3.11.8 - `huggingface_hub` version: 0.22.2 - PyArrow version: 15.0.2 - Pandas version: 2.2.2 - `fsspec` version: 2024.2.0 Edit: I looked in the source code of load.py in datasets. I should have used "load_from_disk" and it indeed works that way. But ideally load_dataset would have raisen an error the same way as if I call a path: ``` if Path(path, config.DATASET_STATE_JSON_FILENAME).exists(): raise ValueError( "You are trying to load a dataset that was saved using `save_to_disk`. " "Please use `load_from_disk` instead." ) ``` nevertheless I find it interesting that it works just well and without a warning if there are multiple shards.
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6823/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6823/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6819
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6819/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6819/comments
https://api.github.com/repos/huggingface/datasets/issues/6819/events
https://github.com/huggingface/datasets/issues/6819
2,248,043,797
I_kwDODunzps6F_m0V
6,819
Give more details in `DataFilesNotFoundError` when getting the config names
{ "avatar_url": "https://avatars.githubusercontent.com/u/1676121?v=4", "events_url": "https://api.github.com/users/severo/events{/privacy}", "followers_url": "https://api.github.com/users/severo/followers", "following_url": "https://api.github.com/users/severo/following{/other_user}", "gists_url": "https://api.github.com/users/severo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/severo", "id": 1676121, "login": "severo", "node_id": "MDQ6VXNlcjE2NzYxMjE=", "organizations_url": "https://api.github.com/users/severo/orgs", "received_events_url": "https://api.github.com/users/severo/received_events", "repos_url": "https://api.github.com/users/severo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/severo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/severo/subscriptions", "type": "User", "url": "https://api.github.com/users/severo", "user_view_type": "public" }
[ { "color": "a2eeef", "default": true, "description": "New feature or request", "id": 1935892871, "name": "enhancement", "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement" } ]
open
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,713
null
COLLABORATOR
null
### Feature request After https://huggingface.co/datasets/cis-lmu/Glot500/commit/39060e01272ff228cc0ce1d31ae53789cacae8c3, the dataset viewer gives the following error: ``` { "error": "Cannot get the config names for the dataset.", "cause_exception": "DataFilesNotFoundError", "cause_message": "No (supported) data files found in cis-lmu/Glot500", "cause_traceback": [ "Traceback (most recent call last):\n", " File \"/src/services/worker/src/worker/job_runners/dataset/config_names.py\", line 73, in compute_config_names_response\n config_names = get_dataset_config_names(\n", " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py\", line 347, in get_dataset_config_names\n dataset_module = dataset_module_factory(\n", " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py\", line 1873, in dataset_module_factory\n raise e1 from None\n", " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py\", line 1854, in dataset_module_factory\n return HubDatasetModuleFactoryWithoutScript(\n", " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py\", line 1245, in get_module\n module_name, default_builder_kwargs = infer_module_for_data_files(\n", " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py\", line 595, in infer_module_for_data_files\n raise DataFilesNotFoundError(\"No (supported) data files found\" + (f\" in {path}\" if path else \"\"))\n", "datasets.exceptions.DataFilesNotFoundError: No (supported) data files found in cis-lmu/Glot500\n" ] } ``` because the deleted files were still listed in the README, see https://huggingface.co/datasets/cis-lmu/Glot500/discussions/4 Ideally, the error message would include the name of the first configuration with missing files, to help the user understand how to fix it. Here, it would tell that configuration `aze_Ethi` has no supported data files, instead of telling that the `cis-lmu/Glot500` *dataset* has no supported data files (which is not true). ### Motivation Giving more detail in the error would help the Datasets Hub users to debug why the dataset viewer does not work. ### Your contribution Not sure how to best fix this, as there are a lot of loops on the dataset configs in the traceback methods. "maybe" it would be easier to handle if the code was completely isolating each config.
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6819/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6819/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6814
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6814/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6814/comments
https://api.github.com/repos/huggingface/datasets/issues/6814/events
https://github.com/huggingface/datasets/issues/6814
2,245,857,902
I_kwDODunzps6F3RJu
6,814
`map` with `num_proc` > 1 leads to OOM
{ "avatar_url": "https://avatars.githubusercontent.com/u/19718818?v=4", "events_url": "https://api.github.com/users/bhavitvyamalik/events{/privacy}", "followers_url": "https://api.github.com/users/bhavitvyamalik/followers", "following_url": "https://api.github.com/users/bhavitvyamalik/following{/other_user}", "gists_url": "https://api.github.com/users/bhavitvyamalik/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bhavitvyamalik", "id": 19718818, "login": "bhavitvyamalik", "node_id": "MDQ6VXNlcjE5NzE4ODE4", "organizations_url": "https://api.github.com/users/bhavitvyamalik/orgs", "received_events_url": "https://api.github.com/users/bhavitvyamalik/received_events", "repos_url": "https://api.github.com/users/bhavitvyamalik/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bhavitvyamalik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bhavitvyamalik/subscriptions", "type": "User", "url": "https://api.github.com/users/bhavitvyamalik", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "Hi ! You can try to reduce `writer_batch_size`. It corresponds to the number of samples that stay in RAM before being flushed to disk" ]
1970-01-01T00:00:00.000001
1,713
null
CONTRIBUTOR
null
### Describe the bug When running `map` on parquet dataset loaded from local machine, the RAM usage increases linearly eventually leading to OOM. I was wondering if I should I save the `cache_file` after every n steps in order to prevent this? ### Steps to reproduce the bug ``` ds = load_dataset("parquet", data_files=dataset_path, split="train") ds = ds.shard(num_shards=4, index=0) ds = ds.cast_column("audio", datasets.features.Audio(sampling_rate=16_000)) ds = ds.map(prepare_dataset, num_proc=32, writer_batch_size=1000, keep_in_memory=False, desc="preprocess dataset") ``` ``` def prepare_dataset(batch): # load audio sample = batch["audio"] inputs = feature_extractor(sample["array"], sampling_rate=16000) batch["input_values"] = inputs.input_values[0] batch["input_length"] = len(sample["array"].squeeze()) return batch ``` ### Expected behavior It shouldn't run into OOM problem. ### Environment info - `datasets` version: 2.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.17 - Python version: 3.8.19 - `huggingface_hub` version: 0.22.2 - PyArrow version: 15.0.2 - Pandas version: 2.0.3 - `fsspec` version: 2024.2.0
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6814/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6814/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6810
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6810/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6810/comments
https://api.github.com/repos/huggingface/datasets/issues/6810/events
https://github.com/huggingface/datasets/issues/6810
2,242,968,745
I_kwDODunzps6FsPyp
6,810
Allow deleting a subset/config from a no-script dataset
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "color": "a2eeef", "default": true, "description": "New feature or request", "id": 1935892871, "name": "enhancement", "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement" } ]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[ "Probably best to implement this as a CLI command?", "Thanks for your comment, @mariosasko. Or maybe both (in Python and as CLI command)? The Python command would be just the reverse of `push_to_hub`...\r\n\r\nI am working on a draft implementation, so we can discuss about the API and UX." ]
1970-01-01T00:00:00.000001
1,714
1970-01-01T00:00:00.000001
MEMBER
null
As proposed by @BramVanroy, it would be neat to have this functionality through the API.
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6810/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6810/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6808
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6808/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6808/comments
https://api.github.com/repos/huggingface/datasets/issues/6808/events
https://github.com/huggingface/datasets/issues/6808
2,242,843,611
I_kwDODunzps6FrxPb
6,808
Make convert_to_parquet CLI command create script branch
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "color": "a2eeef", "default": true, "description": "New feature or request", "id": 1935892871, "name": "enhancement", "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement" } ]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[]
1970-01-01T00:00:00.000001
1,713
1970-01-01T00:00:00.000001
MEMBER
null
As proposed by @severo, maybe we should add this functionality as well to the CLI command to convert a script-dataset to Parquet. See: https://github.com/huggingface/datasets/pull/6795#discussion_r1562819168 > When providing support, we sometimes suggest that users store their script in a script branch. What do you think of this alternative to deleting the files?
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6808/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6808/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6805
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6805/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6805/comments
https://api.github.com/repos/huggingface/datasets/issues/6805/events
https://github.com/huggingface/datasets/issues/6805
2,239,034,951
I_kwDODunzps6FdPZH
6,805
Batched mapping of existing string column casts boolean to string
{ "avatar_url": "https://avatars.githubusercontent.com/u/46891489?v=4", "events_url": "https://api.github.com/users/starmpcc/events{/privacy}", "followers_url": "https://api.github.com/users/starmpcc/followers", "following_url": "https://api.github.com/users/starmpcc/following{/other_user}", "gists_url": "https://api.github.com/users/starmpcc/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/starmpcc", "id": 46891489, "login": "starmpcc", "node_id": "MDQ6VXNlcjQ2ODkxNDg5", "organizations_url": "https://api.github.com/users/starmpcc/orgs", "received_events_url": "https://api.github.com/users/starmpcc/received_events", "repos_url": "https://api.github.com/users/starmpcc/repos", "site_admin": false, "starred_url": "https://api.github.com/users/starmpcc/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/starmpcc/subscriptions", "type": "User", "url": "https://api.github.com/users/starmpcc", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "This seems to be hardcoded behavior in table.py `array_cast`.\r\n```python\r\nif (\r\n not allow_number_to_str\r\n and pa.types.is_string(pa_type)\r\n and (pa.types.is_floating(array.type) or pa.types.is_integer(array.type))\r\n ):\r\n raise TypeError(\r\n f\"Couldn't cast array of type {array.type} to {pa_type} since allow_number_to_str is set to {allow_number_to_str}\"\r\n )\r\n if pa.types.is_null(pa_type) and not pa.types.is_null(array.type):\r\n raise TypeError(f\"Couldn't cast array of type {array.type} to {pa_type}\")\r\n return array.cast(pa_type)\r\n```\r\nwhere floats and integers are not cast to string but booleans are.\r\nMaybe this should be extended to booleans?", "Thanks for reporting! @Modexus Do you want to open a PR with the suggested fix?", "I'll gladly create a PR but not sure what the behavior should be.\r\n\r\nShould a value returned from map be cast to the current feature?\r\nAt the moment this seems very inconsistent since `datetime `is also cast (this would only fix `boolean`) but nested structures are not.\r\n\r\n```python\r\ndset = Dataset.from_dict({\"a\": [\"Hello world!\"]})\r\ndset = dset.map(lambda x: {\"a\": date(2021, 1, 1)})\r\n# dset[0][\"a\"] == '2021-01-01'\r\n```\r\n```python\r\ndset = Dataset.from_dict({\"a\": [\"Hello world!\"]})\r\ndset = dset.map(lambda x: {\"a\": [True]})\r\n# dset[0][\"a\"] == [True]\r\n```\r\n\r\nIs there are reason to cast the value if the user doesn't specify it explicitly?\r\nSeems tricky that some things are cast and some are not.", "Indeed, it also makes sense to raise a `TypeError` for temporal and decimal types.\r\n\r\n> Is there are reason to cast the value if the user doesn't specify it explicitly?\r\n\r\nThis is how PyArrow's built-in `cast` behaves - it allows casting from primitive types to strings. Hence, we need `allow_number_to_str` to disallow such casts (e.g., in the [scenario](https://github.com/huggingface/datasets/blob/a3bc89d8bfd47c2a175c3ce16d92b7307cdeafd6/src/datasets/arrow_writer.py#L208) when we are \"trying a type\" to preserve the original type if there is a column in the output dataset with the same name as in the input one).\r\n\r\nPS: In the PR, we can introduce `allow_numeric_to_str` (for floats, integers, decimals, booleans) and `allow_temporal_to_str` (for dates, timestamps, ...) and deprecate `allow_number_to_str` to make it clear what each parameter does.", "Would just `allow_primitive_to_str` work?\r\nThis should include all `numeric`, `boolean `and `temporal`formats.\r\n\r\nNote that at least in the [ C++ implementation](https://arrow.apache.org/docs/cpp/api/utilities.html#_CPPv410is_numericRK8DataType) `numeric `seems to exclude `boolean`.\r\n[](https://arrow.apache.org/docs/cpp/api/utilities.html#_CPPv410is_numericRK8DataType)", "Indeed, `allow_primitive_to_str` sounds better.\r\n\r\nPS: PyArrow's `pa.types.is_primitive` returns `False` for decimal types, but I think is okay for us to treat decimals as primitive types (or we can have `allow_decimal_to_str` to be fully consistent with PyArrow)", "Fixed by:\r\n- #6811" ]
1970-01-01T00:00:00.000001
1,720
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug Let the dataset contain a column named 'a', which is of the string type. If 'a' is converted to a boolean using batched mapping, the mapper automatically casts the boolean to a string (e.g., True -> 'true'). It only happens when the original column and the mapped column name are identical. Thank you! ### Steps to reproduce the bug ```python from datasets import Dataset dset = Dataset.from_dict({'a': ['11', '22']}) dset = dset.map(lambda x: {'a': [True for _ in x['a']]}, batched=True) print(dset['a']) ``` ``` > ['true', 'true'] ``` ### Expected behavior [True, True] ### Environment info - `datasets` version: 2.18.0 - Platform: Linux-5.4.0-148-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - `huggingface_hub` version: 0.21.4 - PyArrow version: 15.0.2 - Pandas version: 2.2.1 - `fsspec` version: 2023.12.2
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6805/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6805/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6801
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6801/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6801/comments
https://api.github.com/repos/huggingface/datasets/issues/6801/events
https://github.com/huggingface/datasets/issues/6801
2,236,911,556
I_kwDODunzps6FVI_E
6,801
got fileNotFound
{ "avatar_url": "https://avatars.githubusercontent.com/u/93729155?v=4", "events_url": "https://api.github.com/users/laoniandisko/events{/privacy}", "followers_url": "https://api.github.com/users/laoniandisko/followers", "following_url": "https://api.github.com/users/laoniandisko/following{/other_user}", "gists_url": "https://api.github.com/users/laoniandisko/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/laoniandisko", "id": 93729155, "login": "laoniandisko", "node_id": "U_kgDOBZYxgw", "organizations_url": "https://api.github.com/users/laoniandisko/orgs", "received_events_url": "https://api.github.com/users/laoniandisko/received_events", "repos_url": "https://api.github.com/users/laoniandisko/repos", "site_admin": false, "starred_url": "https://api.github.com/users/laoniandisko/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/laoniandisko/subscriptions", "type": "User", "url": "https://api.github.com/users/laoniandisko", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "Hi! I'll open a PR on the Hub to fix this, but please use the Hub's [Community tab](https://huggingface.co/datasets/nyanko7/danbooru2023/discussions) to report such issues in the future.", "I've opened a [PR](https://huggingface.co/datasets/nyanko7/danbooru2023/discussions/8) in the repo, so let's continue the discussion there" ]
1970-01-01T00:00:00.000001
1,712
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug When I use load_dataset to load the nyanko7/danbooru2023 data set, the cache is read in the form of a symlink. There may be a problem with the arrow_dataset initialization process and I get FileNotFoundError: [Errno 2] No such file or directory: '2945000.jpg' ### Steps to reproduce the bug #code show as below from datasets import load_dataset data = load_dataset("nyanko7/danbooru2023",cache_dir=<symlink>) data["train"][0] ### Expected behavior I should get this result: {'image': <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=365x256 at 0x7FB730CB4070>, 'label': 0} ### Environment info datasets==2.12.0 python==3.10.14
{ "avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4", "events_url": "https://api.github.com/users/mariosasko/events{/privacy}", "followers_url": "https://api.github.com/users/mariosasko/followers", "following_url": "https://api.github.com/users/mariosasko/following{/other_user}", "gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mariosasko", "id": 47462742, "login": "mariosasko", "node_id": "MDQ6VXNlcjQ3NDYyNzQy", "organizations_url": "https://api.github.com/users/mariosasko/orgs", "received_events_url": "https://api.github.com/users/mariosasko/received_events", "repos_url": "https://api.github.com/users/mariosasko/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions", "type": "User", "url": "https://api.github.com/users/mariosasko", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6801/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6801/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6800
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6800/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6800/comments
https://api.github.com/repos/huggingface/datasets/issues/6800/events
https://github.com/huggingface/datasets/issues/6800
2,236,431,288
I_kwDODunzps6FTTu4
6,800
High overhead when loading lots of subsets from the same dataset
{ "avatar_url": "https://avatars.githubusercontent.com/u/53355258?v=4", "events_url": "https://api.github.com/users/loicmagne/events{/privacy}", "followers_url": "https://api.github.com/users/loicmagne/followers", "following_url": "https://api.github.com/users/loicmagne/following{/other_user}", "gists_url": "https://api.github.com/users/loicmagne/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/loicmagne", "id": 53355258, "login": "loicmagne", "node_id": "MDQ6VXNlcjUzMzU1MjU4", "organizations_url": "https://api.github.com/users/loicmagne/orgs", "received_events_url": "https://api.github.com/users/loicmagne/received_events", "repos_url": "https://api.github.com/users/loicmagne/repos", "site_admin": false, "starred_url": "https://api.github.com/users/loicmagne/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/loicmagne/subscriptions", "type": "User", "url": "https://api.github.com/users/loicmagne", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "Hi !\r\n\r\nIt's possible to multiple files at once:\r\n\r\n```python\r\ndata_files = \"data/*.jsonl\"\r\n# Or pass a list of files\r\nlangs = ['ka-ml', 'br-sr', 'ka-pt', 'id-ko', ..., 'fi-ze_zh', 'he-kk', 'ka-tr']\r\ndata_files = [f\"data/{lang}.jsonl\" for lang in langs]\r\nds = load_dataset(\"loicmagne/open-subtitles-250-bitext-mining\", data_files=data_files, split=\"train\")\r\n```\r\n\r\nAlso maybe you can add a subset called \"all\" for people that want to load all the data without having to list all the languages ?\r\n\r\n```yaml\r\n - config_name: all\r\n data_files: data/*.jsonl\r\n```\r\n", "Thanks for your reply, it is indeed much faster, however the result is a dataset where all the subsets are \"merged\" together, the language pair is lost:\r\n```\r\nDatasetDict({\r\n train: Dataset({\r\n features: ['sentence1', 'sentence2'],\r\n num_rows: 247809\r\n })\r\n})\r\n```\r\nI guess I could add a 'lang' feature for each row in the dataset, is there a better way to do it ?", "Hi @lhoestq over at https://github.com/embeddings-benchmark/mteb/issues/530 we have started examining these issues and would love to make a PR for datasets if we believe there is a way to improve the speed. As I assume you have a better overview than me @lhoestq, would you be interested in a PR, and might you have an idea about where we would start working on it?\r\n\r\nWe see a speed comparison of \r\n1. 15 minutes (for ~20% of the languages) when loaded using a for loop\r\n2. 17 minutes using the your suggestion\r\n3. ~30 seconds when using @loicmagne \"merged\" method.\r\n\r\nWorth mentioning is that solution 2 looses the language information.", "Can you retry using `datasets` 2.19 ? We improved a lot the speed of downloading datasets with tons of small files.\r\n\r\n```\r\npip install -U datasets\r\n```\r\n\r\nNow this takes 17sec on my side instead of the 17min minutes @loicmagne mentioned :)\r\n\r\n```python\r\n>>> %time ds = load_dataset(\"loicmagne/open-subtitles-250-bitext-mining\", data_files=\"data/*.jsonl\")\r\nDownloading readme: 100%|█████████████████████████████████| 13.7k/13.7k [00:00<00:00, 5.47MB/s]\r\nResolving data files: 100%|█████████████████████████████████| 250/250 [00:00<00:00, 612.51it/s]\r\nDownloading data: 100%|██████████████████████████████████| 250/250 [00:12<00:00, 19.68files/s]\r\nGenerating train split: 247809 examples [00:00, 1057071.08 examples/s]\r\nCPU times: user 4.95 s, sys: 3.1 s, total: 8.05 s\r\nWall time: 17.4 s\r\n```", "> Can you retry using `datasets` 2.19 ? We improved a lot the speed of downloading datasets with tons of small files.\r\n> \r\n> ```\r\n> pip install -U datasets\r\n> ```\r\n> \r\n> Now this takes 17sec on my side instead of the 17min minutes @loicmagne mentioned :)\r\n> \r\n> ```python\r\n> >>> %time ds = load_dataset(\"loicmagne/open-subtitles-250-bitext-mining\", data_files=\"data/*.jsonl\")\r\n> Downloading readme: 100%|█████████████████████████████████| 13.7k/13.7k [00:00<00:00, 5.47MB/s]\r\n> Resolving data files: 100%|█████████████████████████████████| 250/250 [00:00<00:00, 612.51it/s]\r\n> Downloading data: 100%|██████████████████████████████████| 250/250 [00:12<00:00, 19.68files/s]\r\n> Generating train split: 247809 examples [00:00, 1057071.08 examples/s]\r\n> CPU times: user 4.95 s, sys: 3.1 s, total: 8.05 s\r\n> Wall time: 17.4 s\r\n> ```\r\n\r\nI was actually just noticing that, I bumped from 2.18 to 2.19 and got a massive speedup, amazing!\r\n\r\nAbout the fact that subset names are lost when loading all files at once, currently my solution is to add a 'lang' feature to each rows, convert to polars and use:\r\n\r\n```python\r\nds_split = ds.to_polars().group_by('lang')\r\n```\r\n\r\nIt's fast so I think it's an acceptable solution, but is there a better way to do it ?", "It's the fastest way I think :)\r\n\r\nAlternatively you can download the dataset repository locally using [huggingface_hub](https://huggingface.co/docs/huggingface_hub/guides/download) (either via CLI or in python) and load the subsets one by one locally using a for loop as you were doing before (just pass the directory path to load_dataset instead of the dataset_id). " ]
1970-01-01T00:00:00.000001
1,713
null
NONE
null
### Describe the bug I have a multilingual dataset that contains a lot of subsets. Each subset corresponds to a pair of languages, you can see here an example with 250 subsets: [https://hf.co/datasets/loicmagne/open-subtitles-250-bitext-mining](). As part of the MTEB benchmark, we may need to load all the subsets of the dataset. The dataset is relatively small and contains only ~45MB of data, but when I try to load every subset, it takes 15 minutes from the HF hub and 13 minutes from the cache This issue https://github.com/huggingface/datasets/issues/5499 also referenced this overhead, but I'm wondering if there is anything I can do to speedup loading different subsets of the same dataset, both when loading from disk and from the HF hub? Currently each subset is stored in a jsonl file ### Steps to reproduce the bug ``` from datasets import load_dataset for subset in ['ka-ml', 'br-sr', 'bg-br', 'kk-lv', 'br-sk', 'br-fi', 'eu-ze_zh', 'kk-nl', 'kk-vi', 'ja-kk', 'br-sv', 'kk-zh_cn', 'kk-ms', 'br-et', 'br-hu', 'eo-kk', 'br-tr', 'ko-tl', 'te-zh_tw', 'br-hr', 'br-nl', 'ka-si', 'br-cs', 'br-is', 'br-ro', 'br-de', 'et-kk', 'fr-hy', 'br-no', 'is-ko', 'br-da', 'br-en', 'eo-lt', 'is-ze_zh', 'eu-ko', 'br-it', 'br-id', 'eu-zh_cn', 'is-ja', 'br-sl', 'br-gl', 'br-pt_br', 'br-es', 'br-pt', 'is-th', 'fa-is', 'br-ca', 'eu-ka', 'is-zh_cn', 'eu-ur', 'id-kk', 'br-sq', 'eu-ja', 'uk-ur', 'is-zh_tw', 'ka-ko', 'eu-zh_tw', 'eu-th', 'eu-is', 'is-tl', 'br-eo', 'eo-ze_zh', 'eu-te', 'ar-kk', 'eo-lv', 'ko-ze_zh', 'ml-ze_zh', 'is-lt', 'br-fr', 'ko-te', 'kk-sl', 'eu-fa', 'eo-ko', 'ka-ze_en', 'eo-eu', 'ta-zh_tw', 'eu-lv', 'ko-lv', 'lt-tl', 'eu-si', 'hy-ru', 'ar-is', 'eu-lt', 'eu-tl', 'eu-uk', 'ka-ze_zh', 'si-ze_zh', 'el-is', 'bn-is', 'ko-ze_en', 'eo-si', 'cs-kk', 'is-uk', 'eu-ze_en', 'ta-ze_zh', 'is-pl', 'is-mk', 'eu-ta', 'ko-lt', 'is-lv', 'fa-ko', 'bn-ko', 'hi-is', 'bn-ze_zh', 'bn-eu', 'bn-ja', 'is-ml', 'eu-ru', 'ko-ta', 'is-vi', 'ja-tl', 'eu-mk', 'eu-he', 'ka-zh_tw', 'ka-zh_cn', 'si-tl', 'is-kk', 'eu-fi', 'fi-ko', 'is-ur', 'ka-th', 'ko-ur', 'eo-ja', 'he-is', 'is-tr', 'ka-ur', 'et-ko', 'eu-vi', 'is-sk', 'gl-is', 'fr-is', 'is-sq', 'hu-is', 'fr-kk', 'eu-sq', 'is-ru', 'ja-ka', 'fi-tl', 'ka-lv', 'fi-is', 'is-si', 'ar-ko', 'ko-sl', 'ar-eu', 'ko-si', 'bg-is', 'eu-hu', 'ko-sv', 'bn-hu', 'kk-ro', 'eu-hi', 'ka-ms', 'ko-th', 'ko-sr', 'ko-mk', 'fi-kk', 'ka-vi', 'eu-ml', 'ko-ml', 'de-ko', 'fa-ze_zh', 'eu-sk', 'is-sl', 'et-is', 'eo-is', 'is-sr', 'is-ze_en', 'kk-pt_br', 'hr-hy', 'kk-pl', 'ja-ta', 'is-ms', 'hi-ze_en', 'is-ro', 'ko-zh_cn', 'el-eu', 'ka-pl', 'ka-sq', 'eu-sl', 'fa-ka', 'ko-no', 'si-ze_en', 'ko-uk', 'ja-ze_zh', 'hu-ko', 'kk-no', 'eu-pl', 'is-pt_br', 'bn-lv', 'tl-zh_cn', 'is-nl', 'he-ko', 'ko-sq', 'ta-th', 'lt-ta', 'da-ko', 'ca-is', 'is-ta', 'bn-fi', 'ja-ml', 'lv-si', 'eu-sv', 'ja-te', 'bn-ur', 'bn-ca', 'bs-ko', 'bs-is', 'eu-sr', 'ko-vi', 'ko-zh_tw', 'et-tl', 'kk-tr', 'eo-vi', 'is-it', 'ja-ko', 'eo-et', 'id-is', 'bn-et', 'bs-eu', 'bn-lt', 'tl-uk', 'bn-zh_tw', 'da-eu', 'el-ko', 'no-tl', 'ko-sk', 'is-pt', 'hu-kk', 'si-zh_tw', 'si-te', 'ka-ru', 'lt-ml', 'af-ja', 'bg-eu', 'eo-th', 'cs-is', 'pl-ze_zh', 'el-kk', 'kk-sv', 'ka-nl', 'ko-pl', 'bg-ko', 'ka-pt_br', 'et-eu', 'tl-zh_tw', 'ka-pt', 'id-ko', 'fi-ze_zh', 'he-kk', 'ka-tr']: load_dataset('loicmagne/open-subtitles-250-bitext-mining', subset) ``` ### Expected behavior Faster loading? ### Environment info Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.18.0 - Platform: Linux-6.5.0-27-generic-x86_64-with-glibc2.35 - Python version: 3.10.12 - `huggingface_hub` version: 0.22.2 - PyArrow version: 15.0.2 - Pandas version: 2.2.2 - `fsspec` version: 2023.5.0
null
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/huggingface/datasets/issues/6800/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6800/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6798
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6798/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6798/comments
https://api.github.com/repos/huggingface/datasets/issues/6798/events
https://github.com/huggingface/datasets/issues/6798
2,235,768,891
I_kwDODunzps6FQyA7
6,798
`DatasetBuilder._split_generators` incomplete type annotation
{ "avatar_url": "https://avatars.githubusercontent.com/u/33965649?v=4", "events_url": "https://api.github.com/users/JonasLoos/events{/privacy}", "followers_url": "https://api.github.com/users/JonasLoos/followers", "following_url": "https://api.github.com/users/JonasLoos/following{/other_user}", "gists_url": "https://api.github.com/users/JonasLoos/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/JonasLoos", "id": 33965649, "login": "JonasLoos", "node_id": "MDQ6VXNlcjMzOTY1NjQ5", "organizations_url": "https://api.github.com/users/JonasLoos/orgs", "received_events_url": "https://api.github.com/users/JonasLoos/received_events", "repos_url": "https://api.github.com/users/JonasLoos/repos", "site_admin": false, "starred_url": "https://api.github.com/users/JonasLoos/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/JonasLoos/subscriptions", "type": "User", "url": "https://api.github.com/users/JonasLoos", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "Good catch! Feel free to open a PR with the suggested fix :).", "There is also the [`MockDownloadManager`](https://github.com/JonasLoos/datasets/blob/main/src/datasets/download/mock_download_manager.py#L33), which seems like it might get passed here too. However, to me, it doesn't really seem relevant to the users of the datasets library, so I would just ignore it. What do you think, @mariosasko?", "The API (`dummy_data` CLI command ) that uses the `MockDownloadManager` has been deprecated, so ignoring it sounds good!" ]
1970-01-01T00:00:00.000001
1,712
1970-01-01T00:00:00.000001
CONTRIBUTOR
null
### Describe the bug The [`DatasetBuilder._split_generators`](https://github.com/huggingface/datasets/blob/0f27d7b77c73412cfc50b24354bfd7a3e838202f/src/datasets/builder.py#L1449) function has currently the following signature: ```python class DatasetBuilder: def _split_generators(self, dl_manager: DownloadManager): ... ``` However, the `dl_manager` argument can also be of type [`StreamingDownloadManager`](https://github.com/huggingface/datasets/blob/0f27d7b77c73412cfc50b24354bfd7a3e838202f/src/datasets/download/streaming_download_manager.py#L962), which has different functionality. For example, the `download` function doesn't download, but rather just returns the given url(s). I suggest changing the function signature to: ```python class DatasetBuilder: def _split_generators(self, dl_manager: Union[DownloadManager, StreamingDownloadManager]): ... ``` and also adjust the docstring accordingly. I would like to create a Pull Request to fix this, and have the following questions: * Are there also other options than `DownloadManager`, and `StreamingDownloadManager`? * Should this also be changed in other functions? ### Steps to reproduce the bug Minimal example to print the different class names: ```python import tempfile from datasets import load_dataset example = b''' from datasets import GeneratorBasedBuilder, DatasetInfo, Features, Value, SplitGenerator class Test(GeneratorBasedBuilder): def _info(self): return DatasetInfo(features=Features({"x": Value("int64")})) def _split_generators(self, dl_manager): print(type(dl_manager)) return [SplitGenerator('test')] def _generate_examples(self): yield 0, {'x': 42} ''' with tempfile.NamedTemporaryFile(suffix='.py') as f: f.write(example) f.flush() load_dataset(f.name, streaming=False) load_dataset(f.name, streaming=True) ``` ### Expected behavior complete type annotations ### Environment info /
{ "avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4", "events_url": "https://api.github.com/users/mariosasko/events{/privacy}", "followers_url": "https://api.github.com/users/mariosasko/followers", "following_url": "https://api.github.com/users/mariosasko/following{/other_user}", "gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mariosasko", "id": 47462742, "login": "mariosasko", "node_id": "MDQ6VXNlcjQ3NDYyNzQy", "organizations_url": "https://api.github.com/users/mariosasko/orgs", "received_events_url": "https://api.github.com/users/mariosasko/received_events", "repos_url": "https://api.github.com/users/mariosasko/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions", "type": "User", "url": "https://api.github.com/users/mariosasko", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6798/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6798/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6796
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6796/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6796/comments
https://api.github.com/repos/huggingface/datasets/issues/6796/events
https://github.com/huggingface/datasets/issues/6796
2,234,887,618
I_kwDODunzps6FNa3C
6,796
CI is broken due to hf-internal-testing/dataset_with_script
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "color": "d73a4a", "default": true, "description": "Something isn't working", "id": 1935892857, "name": "bug", "node_id": "MDU6TGFiZWwxOTM1ODkyODU3", "url": "https://api.github.com/repos/huggingface/datasets/labels/bug" } ]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" } ]
null
[ "Finally:\r\n- the initial issue seems it was temporary\r\n- there is a different issue now: https://github.com/huggingface/datasets/actions/runs/8627153993/job/23646584590?pr=6797\r\n```\r\nFAILED tests/test_load.py::ModuleFactoryTest::test_HubDatasetModuleFactoryWithParquetExport - datasets.utils._dataset_viewer.DatasetViewerError: No exported Parquet files available.\r\nFAILED tests/test_load.py::ModuleFactoryTest::test_HubDatasetModuleFactoryWithParquetExport_errors_on_wrong_sha - datasets.utils._dataset_viewer.DatasetViewerError: No exported Parquet files available.\r\nFAILED tests/test_load.py::test_load_dataset_builder_for_community_dataset_with_script - AssertionError: assert 'dataset_with_script' == 'parquet'\r\n \r\n - parquet\r\n + dataset_with_script\r\n```\r\n\r\nMaybe related to `hf-internal-testing/dataset_with_script` dataset: https://huggingface.co/datasets/hf-internal-testing/dataset_with_script", "This URL: https://datasets-server.huggingface.co/parquet?dataset=hf-internal-testing/dataset_with_script\r\nraises:\r\n> {\"error\":\"The dataset viewer doesn't support this dataset because it runs arbitrary python code. Please open a discussion in the discussion tab if you think this is an error and tag @lhoestq and @severo.\"}\r\n\r\nWas there a recent change on the Hub enforcing this behavior?", "OK, I just saw this PR:\r\n- https://github.com/huggingface/dataset-viewer/pull/2689\r\n\r\nOnce merged and deployed, it should fix the issue.", "Once the script-dataset has been allowed in the dataset-viewer, we should fix our test to make the CI pass.\r\n\r\nI am addressing this." ]
1970-01-01T00:00:00.000001
1,712
1970-01-01T00:00:00.000001
MEMBER
null
CI is broken for test_load_dataset_distributed_with_script. See: https://github.com/huggingface/datasets/actions/runs/8614926216/job/23609378127 ``` FAILED tests/test_load.py::test_load_dataset_distributed_with_script[None] - assert False + where False = all(<generator object test_load_dataset_distributed_with_script.<locals>.<genexpr> at 0x7f0c741de3b0>) FAILED tests/test_load.py::test_load_dataset_distributed_with_script[force_redownload] - assert False + where False = all(<generator object test_load_dataset_distributed_with_script.<locals>.<genexpr> at 0x7f0be45f6ea0>) ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6796/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6796/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6793
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6793/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6793/comments
https://api.github.com/repos/huggingface/datasets/issues/6793/events
https://github.com/huggingface/datasets/issues/6793
2,231,400,200
I_kwDODunzps6FAHcI
6,793
Loading just one particular split is not possible for imagenet-1k
{ "avatar_url": "https://avatars.githubusercontent.com/u/165930106?v=4", "events_url": "https://api.github.com/users/PaulPSta/events{/privacy}", "followers_url": "https://api.github.com/users/PaulPSta/followers", "following_url": "https://api.github.com/users/PaulPSta/following{/other_user}", "gists_url": "https://api.github.com/users/PaulPSta/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/PaulPSta", "id": 165930106, "login": "PaulPSta", "node_id": "U_kgDOCePkeg", "organizations_url": "https://api.github.com/users/PaulPSta/orgs", "received_events_url": "https://api.github.com/users/PaulPSta/received_events", "repos_url": "https://api.github.com/users/PaulPSta/repos", "site_admin": false, "starred_url": "https://api.github.com/users/PaulPSta/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/PaulPSta/subscriptions", "type": "User", "url": "https://api.github.com/users/PaulPSta", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "+1" ]
1970-01-01T00:00:00.000001
1,726
null
NONE
null
### Describe the bug I'd expect the following code to download just the validation split but instead I get all data on my disk (train, test and validation splits) ` from datasets import load_dataset dataset = load_dataset("imagenet-1k", split="validation", trust_remote_code=True) ` Is it expected to work like that? ### Steps to reproduce the bug 1. Install the required libraries (python, datasets, huggingface_hub) 2. Login using huggingface cli 2. Run the code in the description ### Expected behavior Just a single (validation) split should be downloaded. ### Environment info python: 3.12.2 datasets: 2.18.0 huggingface_hub: 0.22.2
null
{ "+1": 3, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 3, "url": "https://api.github.com/repos/huggingface/datasets/issues/6793/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6793/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6791
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6791/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6791/comments
https://api.github.com/repos/huggingface/datasets/issues/6791/events
https://github.com/huggingface/datasets/issues/6791
2,230,102,332
I_kwDODunzps6E7Kk8
6,791
`add_faiss_index` raises ValueError: not enough values to unpack (expected 2, got 1)
{ "avatar_url": "https://avatars.githubusercontent.com/u/40491005?v=4", "events_url": "https://api.github.com/users/NeuralFlux/events{/privacy}", "followers_url": "https://api.github.com/users/NeuralFlux/followers", "following_url": "https://api.github.com/users/NeuralFlux/following{/other_user}", "gists_url": "https://api.github.com/users/NeuralFlux/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/NeuralFlux", "id": 40491005, "login": "NeuralFlux", "node_id": "MDQ6VXNlcjQwNDkxMDA1", "organizations_url": "https://api.github.com/users/NeuralFlux/orgs", "received_events_url": "https://api.github.com/users/NeuralFlux/received_events", "repos_url": "https://api.github.com/users/NeuralFlux/repos", "site_admin": false, "starred_url": "https://api.github.com/users/NeuralFlux/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/NeuralFlux/subscriptions", "type": "User", "url": "https://api.github.com/users/NeuralFlux", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "I realized I was passing a string column to this instead of float. Is it possible to add a warning or error to prevent users from falsely believing there's a bug?", "Hello!\r\n\r\nI agree that we could add some safeguards around the type of `ds[column]`. At least for FAISS, we need the column to be made of embeddings as FAISS doesn't perform the embeddings itself.\r\n\r\nI can propose a PR sometime this week.", "@Dref360 thanks for the initiative!" ]
1970-01-01T00:00:00.000001
1,712
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug Calling `add_faiss_index` on a `Dataset` with a column argument raises a ValueError. The following is the trace ```python 214 def replacement_add(self, x): 215 """Adds vectors to the index. 216 The index must be trained before vectors can be added to it. 217 The vectors are implicitly numbered in sequence. When `n` vectors are (...) 224 `dtype` must be float32. 225 """ --> 227 n, d = x.shape 228 assert d == self.d 229 x = np.ascontiguousarray(x, dtype='float32') ValueError: not enough values to unpack (expected 2, got 1) ``` ### Steps to reproduce the bug 1. Load any dataset like `ds = datasets.load_dataset("wikimedia/wikipedia", "20231101.en")["train"]` 2. Add an FAISS index on any column `ds.add_faiss_index('title')` ### Expected behavior The index should be created ### Environment info - `datasets` version: 2.18.0 - Platform: Linux-6.5.0-26-generic-x86_64-with-glibc2.35 - Python version: 3.9.19 - `huggingface_hub` version: 0.22.2 - PyArrow version: 15.0.2 - Pandas version: 2.2.1 - `fsspec` version: 2024.2.0 - `faiss-cpu` version: 1.8.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4", "events_url": "https://api.github.com/users/mariosasko/events{/privacy}", "followers_url": "https://api.github.com/users/mariosasko/followers", "following_url": "https://api.github.com/users/mariosasko/following{/other_user}", "gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mariosasko", "id": 47462742, "login": "mariosasko", "node_id": "MDQ6VXNlcjQ3NDYyNzQy", "organizations_url": "https://api.github.com/users/mariosasko/orgs", "received_events_url": "https://api.github.com/users/mariosasko/received_events", "repos_url": "https://api.github.com/users/mariosasko/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions", "type": "User", "url": "https://api.github.com/users/mariosasko", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6791/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6791/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6790
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6790/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6790/comments
https://api.github.com/repos/huggingface/datasets/issues/6790/events
https://github.com/huggingface/datasets/issues/6790
2,229,915,236
I_kwDODunzps6E6c5k
6,790
PyArrow 'Memory mapping file failed: Cannot allocate memory' bug
{ "avatar_url": "https://avatars.githubusercontent.com/u/25725697?v=4", "events_url": "https://api.github.com/users/lasuomela/events{/privacy}", "followers_url": "https://api.github.com/users/lasuomela/followers", "following_url": "https://api.github.com/users/lasuomela/following{/other_user}", "gists_url": "https://api.github.com/users/lasuomela/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lasuomela", "id": 25725697, "login": "lasuomela", "node_id": "MDQ6VXNlcjI1NzI1Njk3", "organizations_url": "https://api.github.com/users/lasuomela/orgs", "received_events_url": "https://api.github.com/users/lasuomela/received_events", "repos_url": "https://api.github.com/users/lasuomela/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lasuomela/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lasuomela/subscriptions", "type": "User", "url": "https://api.github.com/users/lasuomela", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "Thanks for a very clean explanation. This happened to me too, and I don't have sudo access to update the value. I wonder if there might be another workaround.", "One option is to just have more data in each file - /proc/sys/vm/max_map_count limits the maximum number of concurrently open files, but I don't know if the size of a single file is restricted in any way. E.g. 5000 files with 1GB each is 5TB of data. https://huggingface.co/docs/datasets/v2.18.0/en/package_reference/main_classes#datasets.concatenate_datasets can come in handy." ]
1970-01-01T00:00:00.000001
1,725
null
NONE
null
### Describe the bug Hello, I've been struggling with a problem using Huggingface datasets caused by PyArrow memory allocation. I finally managed to solve it, and thought to document it since similar issues have been raised here before (https://github.com/huggingface/datasets/issues/5710, https://github.com/huggingface/datasets/issues/6176). In my case, I was trying to load ~70k dataset files from disk using `datasets.load_from_disk(data_path)` (meaning 70k repeated calls to load_from_disk). This triggered an (uninformative) exception around 64k loaded files: ``` File "pyarrow/io.pxi", line 1053, in pyarrow.lib.memory_map File "pyarrow/io.pxi", line 1000, in pyarrow.lib.MemoryMappedFile._open File "pyarrow/error.pxi", line 154, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status OSError: Memory mapping file failed: Cannot allocate memory ``` Despite system RAM usage being very low. After a lot of digging around, I discovered that my Ubuntu machine had a limit on the maximum number of memory mapped files in `/proc/sys/vm/max_map_count` set to 65530, which was causing my data loader to crash. Increasing the limit in the file (`echo <new_mmap_size> | sudo tee /proc/sys/vm/max_map_count`) made the issue go away. While this isn't a bug as such in either Datasets or PyArrow, this behavior can be very confusing to users. Maybe this should be mentioned in documentation? I suspect the other issues raised here about memory mapping OOM errors could actually be consequence of system configuration. Br, Lauri ### Steps to reproduce the bug ``` import numpy as np import pyarrow as pa import tqdm # Write some data to disk arr = pa.array(np.arange(100)) schema = pa.schema([ pa.field('nums', arr.type) ]) with pa.OSFile('arraydata.arrow', 'wb') as sink: with pa.ipc.new_file(sink, schema=schema) as writer: batch = pa.record_batch([arr], schema=schema) writer.write(batch) # Number of times to open the memory map nums = 70000 # Read the data back arrays = [pa.memory_map('arraydata.arrow', 'r') for _ in tqdm.tqdm(range(nums))] ``` ### Expected behavior No errors. ### Environment info datasets: 2.18.0 pyarrow: 15.0.0
null
{ "+1": 2, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 2, "url": "https://api.github.com/repos/huggingface/datasets/issues/6790/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6790/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6789
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6789/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6789/comments
https://api.github.com/repos/huggingface/datasets/issues/6789/events
https://github.com/huggingface/datasets/issues/6789
2,229,527,001
I_kwDODunzps6E4-HZ
6,789
Issue with map
{ "avatar_url": "https://avatars.githubusercontent.com/u/102672238?v=4", "events_url": "https://api.github.com/users/Nsohko/events{/privacy}", "followers_url": "https://api.github.com/users/Nsohko/followers", "following_url": "https://api.github.com/users/Nsohko/following{/other_user}", "gists_url": "https://api.github.com/users/Nsohko/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Nsohko", "id": 102672238, "login": "Nsohko", "node_id": "U_kgDOBh6nbg", "organizations_url": "https://api.github.com/users/Nsohko/orgs", "received_events_url": "https://api.github.com/users/Nsohko/received_events", "repos_url": "https://api.github.com/users/Nsohko/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Nsohko/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Nsohko/subscriptions", "type": "User", "url": "https://api.github.com/users/Nsohko", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "Default `writer_batch_size `is set to 1000 (see [map](https://huggingface.co/docs/datasets/v2.16.1/en/package_reference/main_classes#datasets.Dataset.map)).\r\nThe \"tmp1335llua\" is probably the temp file it creates while writing to disk.\r\nMaybe try lowering the `writer_batch_size`.\r\n\r\nFor multi-processing you should probably pass the `processor `as an argument (with e.g. partial) to the function or create it inside so that the sub-processes have access to it and maybe add `if __name__ == \"__main__\"` (not sure that's necessary?).\r\n", "Hi @Modexus,\r\n\r\nThank you very much for the help! Yep after playing around with map, I managed to get the parallel processing to work by implementing it like you suggested.\r\n\r\nRegarding the temp files, it seems like the temp files just keep growing in size as the map continues. Eventually, once map finishes, the temp files are deleted, but they are instead saved as cache .arrow files. These cache files are absolutely gigantic (~ 30-50x the size of the initial dataset!).\r\n\r\nAfter playing around with the `prepare_dataset()` function above, it seems this issue is caused by the following line in the function, where the log-Mel spectrogram of the audio is calculated:\r\n\r\n`# compute log-Mel input features from input audio array\r\n batch[\"input_features\"] = processor.feature_extractor(audio[\"array\"], \r\n sampling_rate=audio[\"sampling_rate\"]).input_features[0]\r\n`\r\n\r\nWhen I remove this line, the final cache files are approximately the same size as the initial dataset.\r\n\r\nCan I check whether this is expected behavior with the whisper feature extractor? I cant imagine the spectrograms are that large!\r\n\r\nThank you so much for the help!", "I'm having a similar issue with the spectrographs taking up an incredibly large amount of space. (i.e. 100GB for 3GB of audio). Is this really normal behavior?", "Upon taking a look at the hex contents of the mapped dataset files I found that the overwhelming majority of the data contained within them was duplicated junk similar to this. I'm not very familiar with the inner workings of AI but I have to assume this is an inefficient way of storing data at best and a bug at worst.\r\n![image](https://github.com/huggingface/datasets/assets/157770431/70bcbf59-d9ac-4fbf-9b8c-c9e3acc1b539)\r\n", "Same problem, dataset.map takes long time to process 12GB raw audio data and create 200GB cache file. Is there any method can run process(map) during train, instead current run \r\nonce and save cache file ? ", "Same issue here. Just trying to normalise image data for a 300MB dataset, ends up with an 11GB cache. The initial .map() call takes 80s over the 15000 images, but then simply iterating over the dataset takes almost 2 minutes. It should be doing no processing here! Something seems wrong.\r\nkeep_in_memory=True also offers no speedup.\r\nEDIT: Running the normalisation with set_transform (i.e. on the fly) iterates through the dataset in 18s. With no normalisation it takes around 14s. No reason for .map() to take 5 mins!", "@eufrizz How you handle this using set_transform?\r\nI have a really big dataset of size 1.2TB and i am going to use it for fine-tunning whisper model. if i use map for dataset_preparing function it will take over 20 days!!!", "> @eufrizz How you handle this using set_transform?\n> I have a really big dataset of size 1.2TB and i am going to use it for fine-tunning whisper model. if i use map for dataset_preparing function it will take over 20 days!!!\n\nJust give the preprocessing function you were using for map to set_transform. Just look at the set_transform documentation. If you're going to do lots of epochs you might be better off just saving the preprocessed data into a new dataset. " ]
1970-01-01T00:00:00.000001
1,721
null
NONE
null
### Describe the bug Map has been taking extremely long to preprocess my data. It seems to process 1000 examples (which it does really fast in about 10 seconds), then it hangs for a good 1-2 minutes, before it moves on to the next batch of 1000 examples. It also keeps eating up my hard drive space for some reason by creating a file named tmp1335llua that is over 300GB. Trying to set num_proc to be >1 also gives me the following error: NameError: name 'processor' is not defined Please advise on how I could optimise this? ### Steps to reproduce the bug In general, I have been using map as per normal. Here is a snippet of my code: ```` ########################### DATASET LOADING AND PREP ######################### def load_custom_dataset(split): ds = [] if split == 'train': for dset in args.train_datasets: ds.append(load_from_disk(dset)) if split == 'test': for dset in args.test_datasets: ds.append(load_from_disk(dset)) ds_to_return = concatenate_datasets(ds) ds_to_return = ds_to_return.shuffle(seed=22) return ds_to_return def prepare_dataset(batch): # load and (possibly) resample audio data to 16kHz audio = batch["audio"] # compute log-Mel input features from input audio array batch["input_features"] = processor.feature_extractor(audio["array"], sampling_rate=audio["sampling_rate"]).input_features[0] # compute input length of audio sample in seconds batch["input_length"] = len(audio["array"]) / audio["sampling_rate"] # optional pre-processing steps transcription = batch["sentence"] if do_lower_case: transcription = transcription.lower() if do_remove_punctuation: transcription = normalizer(transcription).strip() # encode target text to label ids batch["labels"] = processor.tokenizer(transcription).input_ids return batch print('DATASET PREPARATION IN PROGRESS...') # case 3: combine_and_shuffle is true, only train provided # load train datasets train_set = load_custom_dataset('train') # split dataset raw_dataset = DatasetDict() raw_dataset = train_set.train_test_split(test_size = args.test_size, shuffle=True, seed=42) raw_dataset = raw_dataset.cast_column("audio", Audio(sampling_rate=args.sampling_rate)) print("Before Map:") print(raw_dataset) raw_dataset = raw_dataset.map(prepare_dataset, num_proc=1) print("After Map:") print(raw_dataset) ```` ### Expected behavior Based on the speed at which map is processing examples, I would expect a 5-6 hours completion for all mapping However, because it hangs every 1000 examples, I instead roughly estimate it would take about 40 hours! Moreover, i cant even finish the map because it keeps exponentially eating up my hard drive space ### Environment info - `datasets` version: 2.18.0 - Platform: Windows-10-10.0.22631-SP0 - Python version: 3.10.14 - `huggingface_hub` version: 0.22.2 - PyArrow version: 15.0.2 - Pandas version: 2.2.1 - `fsspec` version: 2024.2.0
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6789/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6789/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6788
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6788/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6788/comments
https://api.github.com/repos/huggingface/datasets/issues/6788/events
https://github.com/huggingface/datasets/issues/6788
2,229,207,521
I_kwDODunzps6E3wHh
6,788
A Question About the Map Function
{ "avatar_url": "https://avatars.githubusercontent.com/u/87431052?v=4", "events_url": "https://api.github.com/users/Klein-Lan/events{/privacy}", "followers_url": "https://api.github.com/users/Klein-Lan/followers", "following_url": "https://api.github.com/users/Klein-Lan/following{/other_user}", "gists_url": "https://api.github.com/users/Klein-Lan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Klein-Lan", "id": 87431052, "login": "Klein-Lan", "node_id": "MDQ6VXNlcjg3NDMxMDUy", "organizations_url": "https://api.github.com/users/Klein-Lan/orgs", "received_events_url": "https://api.github.com/users/Klein-Lan/received_events", "repos_url": "https://api.github.com/users/Klein-Lan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Klein-Lan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Klein-Lan/subscriptions", "type": "User", "url": "https://api.github.com/users/Klein-Lan", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "All data is saved in the arrow format on disk.\r\nIf you return a tensor it gets converted to arrow before saving to disk when using map.\r\n\r\nTo get a tensor when you access data elements you can use `dataset.set_format(\"pt\")`.\r\nNote that this just changes how the data is loaded, not how it is stored.", "> All data is saved in the arrow format on disk. If you return a tensor it gets converted to arrow before saving to disk when using map.\r\n> \r\n> To get a tensor when you access data elements you can use `dataset.set_format(\"pt\")`. Note that this just changes how the data is loaded, not how it is stored.\r\n\r\nThank you very much for your explanation, I understand what you mean now. So you're saying that when streaming=True, there's no need to convert it to the arrow format and save it to disk. But if we directly load all formats and then convert them into the arrow format after passing through the map function, it will convert torch.Tensor into a List. I see." ]
1970-01-01T00:00:00.000001
1,712
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug Hello, I have a question regarding the map function in the Hugging Face datasets. The situation is as follows: when I load a jsonl file using load_dataset(..., streaming=False), and then utilize the map function to process it, I specify that the returned example should be of type Torch.tensor. However, I noticed that after applying the map function, the datatype automatically changes to List, which leads to errors in my program. I attempted to use load_dataset(..., streaming=True), and this issue no longer occurs. I'm not entirely clear on why this happens. Could you please provide some insights into this? ### Steps to reproduce the bug 1.dataset = load_dataset(xxx, streaming = False) 2. dataset.map(function), function will return torch.Tensor. 3. you will find the format of data in dataset is List. ### Expected behavior I expected to receieve the format of data is torch.Tensor. ### Environment info 2.18.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/87431052?v=4", "events_url": "https://api.github.com/users/Klein-Lan/events{/privacy}", "followers_url": "https://api.github.com/users/Klein-Lan/followers", "following_url": "https://api.github.com/users/Klein-Lan/following{/other_user}", "gists_url": "https://api.github.com/users/Klein-Lan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Klein-Lan", "id": 87431052, "login": "Klein-Lan", "node_id": "MDQ6VXNlcjg3NDMxMDUy", "organizations_url": "https://api.github.com/users/Klein-Lan/orgs", "received_events_url": "https://api.github.com/users/Klein-Lan/received_events", "repos_url": "https://api.github.com/users/Klein-Lan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Klein-Lan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Klein-Lan/subscriptions", "type": "User", "url": "https://api.github.com/users/Klein-Lan", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6788/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6788/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6787
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6787/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6787/comments
https://api.github.com/repos/huggingface/datasets/issues/6787/events
https://github.com/huggingface/datasets/issues/6787
2,229,103,264
I_kwDODunzps6E3Wqg
6,787
TimeoutError in map
{ "avatar_url": "https://avatars.githubusercontent.com/u/48146603?v=4", "events_url": "https://api.github.com/users/Jiaxin-Wen/events{/privacy}", "followers_url": "https://api.github.com/users/Jiaxin-Wen/followers", "following_url": "https://api.github.com/users/Jiaxin-Wen/following{/other_user}", "gists_url": "https://api.github.com/users/Jiaxin-Wen/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Jiaxin-Wen", "id": 48146603, "login": "Jiaxin-Wen", "node_id": "MDQ6VXNlcjQ4MTQ2NjAz", "organizations_url": "https://api.github.com/users/Jiaxin-Wen/orgs", "received_events_url": "https://api.github.com/users/Jiaxin-Wen/received_events", "repos_url": "https://api.github.com/users/Jiaxin-Wen/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Jiaxin-Wen/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Jiaxin-Wen/subscriptions", "type": "User", "url": "https://api.github.com/users/Jiaxin-Wen", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "From my current understanding, this timeout is only used when we need to get the results.\r\n\r\nOne of:\r\n1. All tasks are done\r\n2. One worker died\r\n\r\nYour function should work fine and it's definitely a bug if it doesn't.", "When one of the `map`'s worker processes crashes, the linked code re-raises an error from the crash and returns it to the caller.\r\n\r\nIf your question is how to limit the time of long-running tasks/worker processes, such functionality doesn't exist in `datasets` (yet), which means you need to implement it yourself.\r\n\r\nE.g., you can implement it using the built-in `signal` module like this:\r\n```python\r\nimport time\r\nimport signal\r\nfrom contextlib import contextmanager\r\n\r\nfrom datasets import Dataset\r\n\r\n\r\n@contextmanager\r\ndef max_exec_time(t):\r\n def raise_timeout_handler(signum, frame):\r\n raise TimeoutError\r\n \r\n orig_handler = signal.getsignal(signal.SIGALRM)\r\n signal.signal(signal.SIGALRM, raise_timeout_handler)\r\n try:\r\n signal.alarm(t)\r\n yield\r\n finally:\r\n signal.alarm(0)\r\n signal.signal(signal.SIGALRM, orig_handler)\r\n\r\n\r\ndef worker(example, rank):\r\n try:\r\n with max_exec_time(20): # 20 sec execution limit\r\n if rank % 2 == 0:\r\n time.sleep(50) # simulate a long-running task\r\n example[\"a\"] = 100\r\n except TimeoutError:\r\n example[\"a\"] = None # Or return empty batches here in the \"batched\" mode\r\n return example\r\n\r\ndata = Dataset.from_list([{\"a\": 1}, {\"a\": 2}])\r\ndata = data.map(worker, num_proc=2, with_rank=True)\r\nprint(data[0])\r\n```", "> From my current understanding, this timeout is only used when we need to get the results.\r\n> \r\n> One of:\r\n> \r\n> 1. All tasks are done\r\n> 2. One worker died\r\n> \r\n> Your function should work fine and it's definitely a bug if it doesn't.\r\n\r\nthanks for responding! can you reproduce the stuck with the above example code?", "> When one of the `map`'s worker processes crashes, the linked code re-raises an error from the crash and returns it to the caller.\r\n> \r\n> If your question is how to limit the time of long-running tasks/worker processes, such functionality doesn't exist in `datasets` (yet), which means you need to implement it yourself.\r\n> \r\n> E.g., you can implement it using the built-in `signal` module like this:\r\n> \r\n> ```python\r\n> import time\r\n> import signal\r\n> from contextlib import contextmanager\r\n> \r\n> from datasets import Dataset\r\n> \r\n> \r\n> @contextmanager\r\n> def max_exec_time(t):\r\n> def raise_timeout_handler(signum, frame):\r\n> raise TimeoutError\r\n> \r\n> orig_handler = signal.getsignal(signal.SIGALRM)\r\n> signal.signal(signal.SIGALRM, raise_timeout_handler)\r\n> try:\r\n> signal.alarm(t)\r\n> yield\r\n> finally:\r\n> signal.alarm(0)\r\n> signal.signal(signal.SIGALRM, orig_handler)\r\n> \r\n> \r\n> def worker(example, rank):\r\n> try:\r\n> with max_exec_time(20): # 20 sec execution limit\r\n> if rank % 2 == 0:\r\n> time.sleep(50) # simulate a long-running task\r\n> example[\"a\"] = 100\r\n> except TimeoutError:\r\n> example[\"a\"] = None # Or return empty batches here in the \"batched\" mode\r\n> return example\r\n> \r\n> data = Dataset.from_list([{\"a\": 1}, {\"a\": 2}])\r\n> data = data.map(worker, num_proc=2, with_rank=True)\r\n> print(data[0])\r\n> ```\r\n\r\nthanks for responding! However, I don't think we should use `signal` in the context of multiprocessing since sometimes it will crash one process and raise the following error\r\nhttps://github.com/huggingface/datasets/blob/c3ddb1ef00334a6f973679a51e783905fbc9ef0b/src/datasets/utils/py_utils.py#L664", "> thanks for responding! However, I don't think we should use signal in the context of multiprocessing since sometimes it will crash one process and raise the following error\r\n\r\nThe above code has `try/except` to catch the error from the handler. Or do you get an error other than `TimeoutError`?", "> > thanks for responding! However, I don't think we should use signal in the context of multiprocessing since sometimes it will crash one process and raise the following error\r\n> \r\n> The above code has `try/except` to catch the error from the handler. Or do you get an error other than `TimeoutError`?\r\n\r\nyup, it will raise the RuntimeError: https://github.com/huggingface/datasets/blob/c3ddb1ef00334a6f973679a51e783905fbc9ef0b/src/datasets/utils/py_utils.py#L667C19-L670C22\r\n\r\n```\r\n raise RuntimeError(\r\n \"One of the subprocesses has abruptly died during map operation.\"\r\n \"To debug the error, disable multiprocessing.\"\r\n )\r\n```", "What @mariosasko proposed it's very useful for debugging. Thank you!" ]
1970-01-01T00:00:00.000001
1,723
null
CONTRIBUTOR
null
### Describe the bug ```python from datasets import Dataset def worker(example): while True: continue example['a'] = 100 return example data = Dataset.from_list([{"a": 1}, {"a": 2}]) data = data.map(worker) print(data[0]) ``` I'm implementing a worker function whose runtime will depend on specific examples (e.g., while most examples take 0.01s in worker, several examples may take 50s). Therefore, I would like to know how the current implementation will handle those subprocesses that require a long (e.g., >= 5min) or even infinite time. I notice that the current implementation set a timeout of 0.05 second https://github.com/huggingface/datasets/blob/c3ddb1ef00334a6f973679a51e783905fbc9ef0b/src/datasets/utils/py_utils.py#L674 However, this example code still gets stuck. ### Steps to reproduce the bug run the example above ### Expected behavior I want to set a default worker to handle these timeout cases, instead of getting stuck ### Environment info main branch version
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6787/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6787/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6783
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6783/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6783/comments
https://api.github.com/repos/huggingface/datasets/issues/6783/events
https://github.com/huggingface/datasets/issues/6783
2,228,179,466
I_kwDODunzps6Ez1IK
6,783
AttributeError: module 'numpy' has no attribute 'object'. in Kaggle Notebook
{ "avatar_url": "https://avatars.githubusercontent.com/u/26062262?v=4", "events_url": "https://api.github.com/users/petrov826/events{/privacy}", "followers_url": "https://api.github.com/users/petrov826/followers", "following_url": "https://api.github.com/users/petrov826/following{/other_user}", "gists_url": "https://api.github.com/users/petrov826/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/petrov826", "id": 26062262, "login": "petrov826", "node_id": "MDQ6VXNlcjI2MDYyMjYy", "organizations_url": "https://api.github.com/users/petrov826/orgs", "received_events_url": "https://api.github.com/users/petrov826/received_events", "repos_url": "https://api.github.com/users/petrov826/repos", "site_admin": false, "starred_url": "https://api.github.com/users/petrov826/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/petrov826/subscriptions", "type": "User", "url": "https://api.github.com/users/petrov826", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "Hi! You can fix this by updating the `datasets` package with `pip install -U datasets` and restarting the notebook.\r\n", "Kaggle removed the problematic `datasets==2.1.0` pin last week, so I'm closing this issue (now it pre-installs the latest version)." ]
1970-01-01T00:00:00.000001
1,712
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug # problem I can't resample audio dataset in Kaggle Notebook. It looks like some code in `datasets` library use aliases that were deprecated in NumPy 1.20. ## code for resampling ``` from datasets import load_dataset, Audio from transformers import AutoFeatureExtractor from transformers import AutoModelForAudioClassification, TrainingArguments, Trainer minds = load_dataset("PolyAI/minds14", name="en-US", split="train") feature_extractor = AutoFeatureExtractor.from_pretrained("facebook/wav2vec2-base") def preprocess_function(examples): audio_arrays = [x["array"] for x in examples["audio"]] inputs = feature_extractor( audio_arrays, sampling_rate=feature_extractor.sampling_rate, max_length=16000, truncation=True ) return inputs dataset = dataset.map(preprocess_function, remove_columns="audio", batched=True, batch_size=100) ``` ## the error I got <details> <summary>Click to expand</summary> ``` --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[20], line 1 ----> 1 dataset = dataset.map(preprocess_function, remove_columns="audio", batched=True, batch_size=100) 2 dataset File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:1955, in Dataset.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1952 disable_tqdm = not logging.is_progress_bar_enabled() 1954 if num_proc is None or num_proc == 1: -> 1955 return self._map_single( 1956 function=function, 1957 with_indices=with_indices, 1958 with_rank=with_rank, 1959 input_columns=input_columns, 1960 batched=batched, 1961 batch_size=batch_size, 1962 drop_last_batch=drop_last_batch, 1963 remove_columns=remove_columns, 1964 keep_in_memory=keep_in_memory, 1965 load_from_cache_file=load_from_cache_file, 1966 cache_file_name=cache_file_name, 1967 writer_batch_size=writer_batch_size, 1968 features=features, 1969 disable_nullable=disable_nullable, 1970 fn_kwargs=fn_kwargs, 1971 new_fingerprint=new_fingerprint, 1972 disable_tqdm=disable_tqdm, 1973 desc=desc, 1974 ) 1975 else: 1977 def format_cache_file_name(cache_file_name, rank): File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:520, in transmit_tasks.<locals>.wrapper(*args, **kwargs) 518 self: "Dataset" = kwargs.pop("self") 519 # apply actual function --> 520 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 521 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 522 for dataset in datasets: 523 # Remove task templates if a column mapping of the template is no longer valid File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:487, in transmit_format.<locals>.wrapper(*args, **kwargs) 480 self_format = { 481 "type": self._format_type, 482 "format_kwargs": self._format_kwargs, 483 "columns": self._format_columns, 484 "output_all_columns": self._output_all_columns, 485 } 486 # apply actual function --> 487 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 488 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 489 # re-apply format to the output File /opt/conda/lib/python3.10/site-packages/datasets/fingerprint.py:458, in fingerprint_transform.<locals>._fingerprint.<locals>.wrapper(*args, **kwargs) 452 kwargs[fingerprint_name] = update_fingerprint( 453 self._fingerprint, transform, kwargs_for_fingerprint 454 ) 456 # Call actual function --> 458 out = func(self, *args, **kwargs) 460 # Update fingerprint of in-place transforms + update in-place history of transforms 462 if inplace: # update after calling func so that the fingerprint doesn't change if the function fails File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:2356, in Dataset._map_single(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, disable_tqdm, desc, cache_only) 2354 writer.write_table(batch) 2355 else: -> 2356 writer.write_batch(batch) 2357 if update_data and writer is not None: 2358 writer.finalize() # close_stream=bool(buf_writer is None)) # We only close if we are writing in a file File /opt/conda/lib/python3.10/site-packages/datasets/arrow_writer.py:507, in ArrowWriter.write_batch(self, batch_examples, writer_batch_size) 505 col_try_type = try_features[col] if try_features is not None and col in try_features else None 506 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 507 arrays.append(pa.array(typed_sequence)) 508 inferred_features[col] = typed_sequence.get_inferred_type() 509 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema File /opt/conda/lib/python3.10/site-packages/pyarrow/array.pxi:236, in pyarrow.lib.array() File /opt/conda/lib/python3.10/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol() File /opt/conda/lib/python3.10/site-packages/datasets/arrow_writer.py:184, in TypedSequence.__arrow_array__(self, type) 182 out = numpy_to_pyarrow_listarray(data) 183 elif isinstance(data, list) and data and isinstance(first_non_null_value(data)[1], np.ndarray): --> 184 out = list_of_np_array_to_pyarrow_listarray(data) 185 else: 186 trying_cast_to_python_objects = True File /opt/conda/lib/python3.10/site-packages/datasets/features/features.py:1174, in list_of_np_array_to_pyarrow_listarray(l_arr, type) 1172 """Build a PyArrow ListArray from a possibly nested list of NumPy arrays""" 1173 if len(l_arr) > 0: -> 1174 return list_of_pa_arrays_to_pyarrow_listarray( 1175 [numpy_to_pyarrow_listarray(arr, type=type) if arr is not None else None for arr in l_arr] 1176 ) 1177 else: 1178 return pa.array([], type=type) File /opt/conda/lib/python3.10/site-packages/datasets/features/features.py:1163, in list_of_pa_arrays_to_pyarrow_listarray(l_arr) 1160 null_indices = [i for i, arr in enumerate(l_arr) if arr is None] 1161 l_arr = [arr for arr in l_arr if arr is not None] 1162 offsets = np.cumsum( -> 1163 [0] + [len(arr) for arr in l_arr], dtype=np.object 1164 ) # convert to dtype object to allow None insertion 1165 offsets = np.insert(offsets, null_indices, None) 1166 offsets = pa.array(offsets, type=pa.int32()) File /opt/conda/lib/python3.10/site-packages/numpy/__init__.py:324, in __getattr__(attr) 319 warnings.warn( 320 f"In the future `np.{attr}` will be defined as the " 321 "corresponding NumPy scalar.", FutureWarning, stacklevel=2) 323 if attr in __former_attrs__: --> 324 raise AttributeError(__former_attrs__[attr]) 326 if attr == 'testing': 327 import numpy.testing as testing AttributeError: module 'numpy' has no attribute 'object'. `np.object` was a deprecated alias for the builtin `object`. To avoid this error in existing code, use `object` by itself. Doing this will not modify any behavior and is safe. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations ``` </details> ### Steps to reproduce the bug Run above code in Kaggle Notebook. ### Expected behavior I can resample audio data without fail. ### Environment info - `datasets` version: 2.1.0 - Platform: Linux-5.15.133+-x86_64-with-glibc2.31 - Python version: 3.10.13 - PyArrow version: 11.0.0 - Pandas version: 2.2.1
{ "avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4", "events_url": "https://api.github.com/users/mariosasko/events{/privacy}", "followers_url": "https://api.github.com/users/mariosasko/followers", "following_url": "https://api.github.com/users/mariosasko/following{/other_user}", "gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mariosasko", "id": 47462742, "login": "mariosasko", "node_id": "MDQ6VXNlcjQ3NDYyNzQy", "organizations_url": "https://api.github.com/users/mariosasko/orgs", "received_events_url": "https://api.github.com/users/mariosasko/received_events", "repos_url": "https://api.github.com/users/mariosasko/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions", "type": "User", "url": "https://api.github.com/users/mariosasko", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6783/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6783/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6782
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6782/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6782/comments
https://api.github.com/repos/huggingface/datasets/issues/6782/events
https://github.com/huggingface/datasets/issues/6782
2,228,081,955
I_kwDODunzps6EzdUj
6,782
Image cast_storage very slow for arrays (e.g. numpy, tensors)
{ "avatar_url": "https://avatars.githubusercontent.com/u/37351874?v=4", "events_url": "https://api.github.com/users/Modexus/events{/privacy}", "followers_url": "https://api.github.com/users/Modexus/followers", "following_url": "https://api.github.com/users/Modexus/following{/other_user}", "gists_url": "https://api.github.com/users/Modexus/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Modexus", "id": 37351874, "login": "Modexus", "node_id": "MDQ6VXNlcjM3MzUxODc0", "organizations_url": "https://api.github.com/users/Modexus/orgs", "received_events_url": "https://api.github.com/users/Modexus/received_events", "repos_url": "https://api.github.com/users/Modexus/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Modexus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Modexus/subscriptions", "type": "User", "url": "https://api.github.com/users/Modexus", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "This may be a solution that only changes `cast_storage` of `Image`.\r\nHowever, I'm not totally sure that the assumptions hold that are made about the `ListArray`.\r\n\r\n```python\r\nelif pa.types.is_list(storage.type):\r\n from .features import Array3DExtensionType\r\n\r\n def get_shapes(arr):\r\n shape = ()\r\n while isinstance(arr, pa.ListArray):\r\n len_curr = len(arr)\r\n arr = arr.flatten()\r\n len_new = len(arr)\r\n shape = shape + (len_new // len_curr,)\r\n return shape\r\n\r\n def get_dtypes(arr):\r\n dtype = storage.type\r\n while hasattr(dtype, \"value_type\"):\r\n dtype = dtype.value_type\r\n return dtype\r\n\r\n arrays = []\r\n for i, is_null in enumerate(storage.is_null()):\r\n if not is_null.as_py():\r\n storage_part = storage.take([i])\r\n shape = get_shapes(storage_part)\r\n dtype = get_dtypes(storage_part)\r\n\r\n extension_type = Array3DExtensionType(shape=shape, dtype=str(dtype))\r\n array = pa.ExtensionArray.from_storage(extension_type, storage_part)\r\n arrays.append(array.to_numpy().squeeze(0))\r\n else:\r\n arrays.append(None)\r\n\r\n bytes_array = pa.array(\r\n [encode_np_array(arr)[\"bytes\"] if arr is not None else None for arr in arrays],\r\n type=pa.binary(),\r\n )\r\n path_array = pa.array([None] * len(storage), type=pa.string())\r\n storage = pa.StructArray.from_arrays(\r\n [bytes_array, path_array], [\"bytes\", \"path\"], mask=bytes_array.is_null()\r\n )\r\n```\r\n(Edited): to handle nulls\r\n\r\nNotably this doesn't change anything about the passing through of data or other things, just in the `Image` class.\r\nSeems quite fast:\r\n```bash\r\nFri Apr 5 17:55:51 2024 restats\r\n\r\n 63818 function calls (61995 primitive calls) in 0.812 seconds\r\n\r\n Ordered by: cumulative time\r\n List reduced from 1051 to 20 due to restriction <20>\r\n\r\n ncalls tottime percall cumtime percall filename:lineno(function)\r\n 47/1 0.000 0.000 0.810 0.810 {built-in method builtins.exec}\r\n 2/1 0.000 0.000 0.810 0.810 <string>:1(<module>)\r\n 2/1 0.000 0.000 0.809 0.809 arrow_dataset.py:594(wrapper)\r\n 2/1 0.000 0.000 0.809 0.809 arrow_dataset.py:551(wrapper)\r\n 2/1 0.000 0.000 0.809 0.809 arrow_dataset.py:2916(map)\r\n 3 0.000 0.000 0.807 0.269 arrow_dataset.py:3277(_map_single)\r\n 1 0.000 0.000 0.760 0.760 arrow_writer.py:589(finalize)\r\n 1 0.000 0.000 0.760 0.760 arrow_writer.py:423(write_examples_on_file)\r\n 1 0.000 0.000 0.759 0.759 arrow_writer.py:527(write_batch)\r\n 1 0.001 0.001 0.754 0.754 arrow_writer.py:161(__arrow_array__)\r\n 2/1 0.000 0.000 0.719 0.719 table.py:1800(wrapper)\r\n 1 0.000 0.000 0.719 0.719 table.py:1950(cast_array_to_feature)\r\n 1 0.006 0.006 0.718 0.718 image.py:209(cast_storage)\r\n 1 0.000 0.000 0.451 0.451 image.py:361(encode_np_array)\r\n 1 0.000 0.000 0.444 0.444 image.py:343(image_to_bytes)\r\n 1 0.000 0.000 0.413 0.413 Image.py:2376(save)\r\n 1 0.000 0.000 0.413 0.413 PngImagePlugin.py:1233(_save)\r\n 1 0.000 0.000 0.413 0.413 ImageFile.py:517(_save)\r\n 1 0.000 0.000 0.413 0.413 ImageFile.py:545(_encode_tile)\r\n 397 0.409 0.001 0.409 0.001 {method 'encode' of 'ImagingEncoder' objects}\r\n```", "Also encounter this problem. Has been strugging with it for a long time...", "This actually applies to all arrays (numpy or tensors like in torch), not only from external files.\r\n```python\r\nimport numpy as np\r\nimport datasets\r\n\r\nds = datasets.Dataset.from_dict(\r\n {\"image\": [np.random.randint(0, 255, (2048, 2048, 3), dtype=np.uint8)]},\r\n features=datasets.Features({\"image\": datasets.Image(decode=True)}),\r\n)\r\nds.set_format(\"numpy\")\r\n\r\nds = ds.map(load_from_cache_file=False)\r\n```" ]
1970-01-01T00:00:00.000001
1,712
null
CONTRIBUTOR
null
Update: see comments below ### Describe the bug Operations that save an image from a path are very slow. I believe the reason for this is that the image data (`numpy`) is converted into `pyarrow` format but then back to python using `.pylist()` before being converted to a numpy array again. `pylist` is already slow but used on a multi-dimensional numpy array such as an image it takes a very long time. From the trace below we can see that `__arrow_array__` takes a long time. It is currently also called in `get_inferred_type`, this should be removable #6781 but doesn't change the underyling issue. The conversion to `pyarrow` and back also leads to the `numpy` array having type `int64` which causes a warning message because the image type excepts `uint8`. However, originally the `numpy` image array was in `uint8`. ### Steps to reproduce the bug ```python from PIL import Image import numpy as np import datasets import cProfile image = Image.fromarray(np.random.randint(0, 255, (2048, 2048, 3), dtype=np.uint8)) image.save("test_image.jpg") ds = datasets.Dataset.from_dict( {"image": ["test_image.jpg"]}, features=datasets.Features({"image": datasets.Image(decode=True)}), ) # load as numpy array, e.g. for further processing with map # same result as map returning numpy arrays ds.set_format("numpy") cProfile.run("ds.map(writer_batch_size=1, load_from_cache_file=False)", "restats") ``` ```bash Fri Apr 5 14:56:17 2024 restats 66817 function calls (64992 primitive calls) in 33.382 seconds Ordered by: cumulative time List reduced from 1073 to 20 due to restriction <20> ncalls tottime percall cumtime percall filename:lineno(function) 46/1 0.000 0.000 33.382 33.382 {built-in method builtins.exec} 1 0.000 0.000 33.382 33.382 <string>:1(<module>) 1 0.000 0.000 33.382 33.382 arrow_dataset.py:594(wrapper) 1 0.000 0.000 33.382 33.382 arrow_dataset.py:551(wrapper) 1 0.000 0.000 33.379 33.379 arrow_dataset.py:2916(map) 4 0.000 0.000 33.327 8.332 arrow_dataset.py:3277(_map_single) 1 0.000 0.000 33.311 33.311 arrow_writer.py:465(write) 2 0.000 0.000 33.311 16.656 arrow_writer.py:423(write_examples_on_file) 1 0.000 0.000 33.311 33.311 arrow_writer.py:527(write_batch) 2 14.484 7.242 33.260 16.630 arrow_writer.py:161(__arrow_array__) 1 0.001 0.001 16.438 16.438 arrow_writer.py:121(get_inferred_type) 1 0.000 0.000 14.398 14.398 threading.py:637(wait) 1 0.000 0.000 14.398 14.398 threading.py:323(wait) 8 14.398 1.800 14.398 1.800 {method 'acquire' of '_thread.lock' objects} 4/2 0.000 0.000 4.337 2.169 table.py:1800(wrapper) 2 0.000 0.000 4.337 2.169 table.py:1950(cast_array_to_feature) 2 0.475 0.238 4.337 2.169 image.py:209(cast_storage) 9 2.583 0.287 2.583 0.287 {built-in method numpy.array} 2 0.000 0.000 1.284 0.642 image.py:319(encode_np_array) 2 0.000 0.000 1.246 0.623 image.py:301(image_to_bytes) ``` ### Expected behavior The `numpy` image data should be passed through as it will be directly consumed by `pillow` to convert it to bytes. As an example one can replace `list_of_np_array_to_pyarrow_listarray(data)` in `__arrow_array__` with just `out = data` as a test. We have to change `cast_storage` of the `Image` feature so it handles the passed through data (& if to handle type before) ```python bytes_array = pa.array( [encode_np_array(arr)["bytes"] if arr is not None else None for arr in storage], type=pa.binary(), ) ``` Leading to the following: ```bash Fri Apr 5 15:44:27 2024 restats 66419 function calls (64595 primitive calls) in 0.937 seconds Ordered by: cumulative time List reduced from 1023 to 20 due to restriction <20> ncalls tottime percall cumtime percall filename:lineno(function) 47/1 0.000 0.000 0.935 0.935 {built-in method builtins.exec} 2/1 0.000 0.000 0.935 0.935 <string>:1(<module>) 2/1 0.000 0.000 0.934 0.934 arrow_dataset.py:594(wrapper) 2/1 0.000 0.000 0.934 0.934 arrow_dataset.py:551(wrapper) 2/1 0.000 0.000 0.934 0.934 arrow_dataset.py:2916(map) 4 0.000 0.000 0.933 0.233 arrow_dataset.py:3277(_map_single) 1 0.000 0.000 0.883 0.883 arrow_writer.py:466(write) 2 0.000 0.000 0.883 0.441 arrow_writer.py:424(write_examples_on_file) 1 0.000 0.000 0.882 0.882 arrow_writer.py:528(write_batch) 2 0.000 0.000 0.877 0.439 arrow_writer.py:161(__arrow_array__) 4/2 0.000 0.000 0.877 0.439 table.py:1800(wrapper) 2 0.000 0.000 0.877 0.439 table.py:1950(cast_array_to_feature) 2 0.009 0.005 0.877 0.439 image.py:209(cast_storage) 2 0.000 0.000 0.868 0.434 image.py:335(encode_np_array) 2 0.000 0.000 0.856 0.428 image.py:317(image_to_bytes) 2 0.000 0.000 0.822 0.411 Image.py:2376(save) 2 0.000 0.000 0.822 0.411 PngImagePlugin.py:1233(_save) 2 0.000 0.000 0.822 0.411 ImageFile.py:517(_save) 2 0.000 0.000 0.821 0.411 ImageFile.py:545(_encode_tile) 589 0.803 0.001 0.803 0.001 {method 'encode' of 'ImagingEncoder' objects} ``` This is of course only a test as it passes through all `numpy` arrays irrespective of if they should be an image. Also I guess `cast_storage` is meant for casting `pyarrow` storage exclusively. Converting to `pyarrow` array seems like a good solution as it also handles `pytorch` tensors etc., maybe there is a more efficient way to create a PIL image from a `pyarrow` array? Not sure how this should be handled but I would be happy to help if there is a good solution. ### Environment info - `datasets` version: 2.18.1.dev0 - Platform: Linux-6.7.11-200.fc39.x86_64-x86_64-with-glibc2.38 - Python version: 3.12.2 - `huggingface_hub` version: 0.22.2 - PyArrow version: 15.0.2 - Pandas version: 2.2.1 - `fsspec` version: 2024.3.1
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6782/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6782/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6778
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6778/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6778/comments
https://api.github.com/repos/huggingface/datasets/issues/6778/events
https://github.com/huggingface/datasets/issues/6778
2,226,040,636
I_kwDODunzps6Erq88
6,778
Dataset.to_csv() missing commas in columns with lists
{ "avatar_url": "https://avatars.githubusercontent.com/u/100041276?v=4", "events_url": "https://api.github.com/users/mpickard-dataprof/events{/privacy}", "followers_url": "https://api.github.com/users/mpickard-dataprof/followers", "following_url": "https://api.github.com/users/mpickard-dataprof/following{/other_user}", "gists_url": "https://api.github.com/users/mpickard-dataprof/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mpickard-dataprof", "id": 100041276, "login": "mpickard-dataprof", "node_id": "U_kgDOBfaCPA", "organizations_url": "https://api.github.com/users/mpickard-dataprof/orgs", "received_events_url": "https://api.github.com/users/mpickard-dataprof/received_events", "repos_url": "https://api.github.com/users/mpickard-dataprof/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mpickard-dataprof/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mpickard-dataprof/subscriptions", "type": "User", "url": "https://api.github.com/users/mpickard-dataprof", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "Hello!\r\n\r\nThis is due to how pandas write numpy arrays to csv. [Source](https://stackoverflow.com/questions/54753179/to-csv-saves-np-array-as-string-instead-of-as-a-list)\r\nTo fix this, you can convert them to list yourselves.\r\n\r\n```python\r\ndf = ds.to_pandas()\r\ndf['int'] = df['int'].apply(lambda arr: list(arr))\r\ndf.to_csv(index=False, '../output/temp.csv')\r\n```\r\n\r\nI think it would be good if `datasets` would do the conversion itself, but it's a breaking change and I would wait for the greenlight from someone from HF." ]
1970-01-01T00:00:00.000001
1,712
null
NONE
null
### Describe the bug The `to_csv()` method does not output commas in lists. So when the Dataset is loaded back in the data structure of the column with a list is not correct. Here's an example: Obviously, it's not as trivial as inserting commas in the list, since its a comma-separated file. But hopefully there's a way to export the list in a way that it'll be imported by `load_dataset()` correctly. ### Steps to reproduce the bug Here's some code to reproduce the bug: ```python from datasets import Dataset ds = Dataset.from_dict( { "pokemon": ["bulbasaur", "squirtle"], "type": ["grass", "water"] } ) def ascii_to_hex(text): return [ord(c) for c in text] ds = ds.map(lambda x: {"int": ascii_to_hex(x['pokemon'])}) ds.to_csv('../output/temp.csv') ``` temp.csv then contains: ``` ### Expected behavior ACTUAL OUTPUT: ``` pokemon,type,int bulbasaur,grass,[ 98 117 108 98 97 115 97 117 114] squirtle,water,[115 113 117 105 114 116 108 101] ``` EXPECTED OUTPUT: ``` pokemon,type,int bulbasaur,grass,[98, 117, 108, 98, 97, 115, 97, 117, 114] squirtle,water,[115, 113, 117, 105, 114, 116, 108, 101] ``` or probably something more like this since it's a CSV file: ``` pokemon,type,int bulbasaur,grass,"[98, 117, 108, 98, 97, 115, 97, 117, 114]" squirtle,water,"[115, 113, 117, 105, 114, 116, 108, 101]" ``` ### Environment info ### Package Version Name: datasets Version: 2.16.1 ### Python version: 3.10.12 ### OS Info PRETTY_NAME="Ubuntu 22.04.4 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.4 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian ... UBUNTU_CODENAME=jammy
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6778/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6778/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6777
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6777/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6777/comments
https://api.github.com/repos/huggingface/datasets/issues/6777/events
https://github.com/huggingface/datasets/issues/6777
2,224,611,247
I_kwDODunzps6EmN-v
6,777
.Jsonl metadata not detected
{ "avatar_url": "https://avatars.githubusercontent.com/u/81643693?v=4", "events_url": "https://api.github.com/users/nighting0le01/events{/privacy}", "followers_url": "https://api.github.com/users/nighting0le01/followers", "following_url": "https://api.github.com/users/nighting0le01/following{/other_user}", "gists_url": "https://api.github.com/users/nighting0le01/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nighting0le01", "id": 81643693, "login": "nighting0le01", "node_id": "MDQ6VXNlcjgxNjQzNjkz", "organizations_url": "https://api.github.com/users/nighting0le01/orgs", "received_events_url": "https://api.github.com/users/nighting0le01/received_events", "repos_url": "https://api.github.com/users/nighting0le01/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nighting0le01/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nighting0le01/subscriptions", "type": "User", "url": "https://api.github.com/users/nighting0le01", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "Hi! `metadata.jsonl` (or `metadata.csv`) is the only allowed name for the `imagefolder`'s metadata files.", "@mariosasko hey i tried with metadata.jsonl also and it still doesn't get the right columns", "@mariosasko it says metadata.csv not found\r\n<img width=\"1150\" alt=\"image\" src=\"https://github.com/huggingface/datasets/assets/81643693/3754980c-6185-4413-88fa-b499bcdd4195\">\r\n\r\ndataset = load_dataset('/dataset',metadata.csv) \r\n\r\n| workspace\r\n|| source code\r\n| dataset\r\n| |-- images\r\n| |-- metadata.csv\r\n| |-- metadata.jsonl\r\n| |-- padded_images\r\n\r\nExample of metadata.jsonl file\r\n{\"caption\": \"a drawing depicts a full shot of a black t-shirt with a triangular pattern on the front there is a white label on the left side of the triangle\", \"image\": \"images/212734.png\", \"gaussian_padded_image\": \"padded_images/p_212734.png\"}\r\n{\"caption\": \"an eye-level full shot of a large elephant and a baby elephant standing in a watering hole on the left side is a small elephant with its head turned to the right of dry land, trees, and bushes\", \"image\": \"images/212735.png\", \"gaussian_padded_image\": \"padded_images/p_212735.png\"}\r\n", "Loading more than one image per row with `imagefolder` is not supported currently. You can subscribe to https://github.com/huggingface/datasets/issues/5760 to see when it will be.\r\n\r\nInstead, you can load the dataset with `Dataset.from_generator`:\r\n```python\r\nimport json\r\nfrom datasets import Dataset, Value, Image, Features\r\n\r\ndef gen():\r\n with open(\"./dataset/metadata.jsonl\") as f:\r\n for line in f:\r\n line = json.loads(line)\r\n yield {\"caption\": line[\"caption\"], \"image\": os.path.join(\"./dataset\", line[\"image\"], \"gaussian_padded_image\": os.path.join(\"./dataset\", line[\"gaussian_padded_image\"]))}\r\n\r\nfeatures = Features({\"caption\": Value(\"string\"), \"image\": Image(), \"gaussian_padded_image\": Image()})\r\ndataset = Dataset.from_generator(gen, features=features)\r\n```\r\n(E.g., if you want to share this dataset on the Hub, you can call `dataset.push_to_hub(...)` afterward)", "hi Thanks for sharing this, Actually I was trying with a webdataset format of the data as well and it did'nt work. Could you share how i can create Dataset object from webdataset format of this data?" ]
1970-01-01T00:00:00.000001
1,712
null
NONE
null
### Describe the bug Hi I have the following directory structure: |--dataset | |-- images | |-- metadata1000.csv | |-- metadata1000.jsonl | |-- padded_images Example of metadata1000.jsonl file {"caption": "a drawing depicts a full shot of a black t-shirt with a triangular pattern on the front there is a white label on the left side of the triangle", "image": "images/212734.png", "gaussian_padded_image": "padded_images/p_212734.png"} {"caption": "an eye-level full shot of a large elephant and a baby elephant standing in a watering hole on the left side is a small elephant with its head turned to the right of dry land, trees, and bushes", "image": "images/212735.png", "gaussian_padded_image": "padded_images/p_212735.png"} . . . I'm trying to use dataset = load_dataset("imagefolder", data_dir='/dataset/', split='train') to load the the dataset, however it is not able to load according to the fields in the metadata1000.jsonl . please assist to load the data properly also getting ``` File "/workspace/train_trans_vae.py", line 1089, in <module> print(get_metadata_patterns('/dataset/')) File "/opt/conda/lib/python3.10/site-packages/datasets/data_files.py", line 499, in get_metadata_patterns raise FileNotFoundError(f"The directory at {base_path} doesn't contain any metadata file") from None FileNotFoundError: The directory at /dataset/ doesn't contain any metadata file ``` when trying ``` from datasets.data_files import get_metadata_patterns print(get_metadata_patterns('/dataset/')) ``` ### Steps to reproduce the bug dataset Version: 2.18.0 make a similar jsonl and similar directory format ### Expected behavior creates a dataset object with the column names, caption,image,gaussian_padded_image ### Environment info dataset Version: 2.18.0
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6777/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6777/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6775
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6775/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6775/comments
https://api.github.com/repos/huggingface/datasets/issues/6775/events
https://github.com/huggingface/datasets/issues/6775
2,223,457,792
I_kwDODunzps6Eh0YA
6,775
IndexError: Invalid key: 0 is out of bounds for size 0
{ "avatar_url": "https://avatars.githubusercontent.com/u/38481564?v=4", "events_url": "https://api.github.com/users/kk2491/events{/privacy}", "followers_url": "https://api.github.com/users/kk2491/followers", "following_url": "https://api.github.com/users/kk2491/following{/other_user}", "gists_url": "https://api.github.com/users/kk2491/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kk2491", "id": 38481564, "login": "kk2491", "node_id": "MDQ6VXNlcjM4NDgxNTY0", "organizations_url": "https://api.github.com/users/kk2491/orgs", "received_events_url": "https://api.github.com/users/kk2491/received_events", "repos_url": "https://api.github.com/users/kk2491/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kk2491/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kk2491/subscriptions", "type": "User", "url": "https://api.github.com/users/kk2491", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "Same problem.", "Hi! You should be able to fix this by passing `remove_unused_columns=False` to the `transformers` `TrainingArguments` as explained in https://github.com/huggingface/peft/issues/1299.\r\n\r\n(I'm not familiar with Vertex AI, but I'd assume `remove_unused_columns` can be passed as a flag to the docker container) ", "I had the same problem, but I spent a whole day trying different combination with my own dataset with the example data set and found the reason: the example data is multi-turn conversation between human and assistant, so # Humman or # Assistant appear at least twice. If your own custom data only has single turn conversation, it might end up with the same error. What you can do is repeat your single turn conversation twice in your training data (keep the key 'text' the same) and maybe it works. I guess the reason is the specific way processing the data requires and counts multi-turn only (single turn will be discarded so it ends up with no training data), but since I am using Google Vertex AI, I don't have direct access to the underlying code so that was just my guess. ", "> Hi! You should be able to fix this by passing `remove_unused_columns=False` to the `transformers` `TrainingArguments` as explained in [huggingface/peft#1299](https://github.com/huggingface/peft/issues/1299).\r\n> \r\n> (I'm not familiar with Vertex AI, but I'd assume `remove_unused_columns` can be passed as a flag to the docker container)\r\n\r\n@mariosasko Thanks for the response and suggestion. \r\nWhen I set `remove_unused_columns` as `False` , I end up getting different error (will post the error soon). \r\nEither the Vertex-AI does not support `remove_unused_columns` or my dataset is completely wrong. \r\n\r\nThank you, \r\nKK", "> I had the same problem, but I spent a whole day trying different combination with my own dataset with the example data set and found the reason: the example data is multi-turn conversation between human and assistant, so # Humman or # Assistant appear at least twice. If your own custom data only has single turn conversation, it might end up with the same error. What you can do is repeat your single turn conversation twice in your training data (keep the key 'text' the same) and maybe it works. I guess the reason is the specific way processing the data requires and counts multi-turn only (single turn will be discarded so it ends up with no training data), but since I am using Google Vertex AI, I don't have direct access to the underlying code so that was just my guess.\r\n\r\n@cyberyu Thanks for your suggestions. \r\nI have tried the approach you suggested, copied the same conversation in each jsonl element so every jsonl item has 2 `HUMAN` and `ASSISTANT`. \r\nHowever in my case, the issue persists. I am gonna give few more tries, and post the results here. \r\nYou can find my dataset [here](https://huggingface.co/datasets/kk2491/test/tree/main) \r\n\r\nThank you, \r\nKK ", "> > I had the same problem, but I spent a whole day trying different combination with my own dataset with the example data set and found the reason: the example data is multi-turn conversation between human and assistant, so # Humman or # Assistant appear at least twice. If your own custom data only has single turn conversation, it might end up with the same error. What you can do is repeat your single turn conversation twice in your training data (keep the key 'text' the same) and maybe it works. I guess the reason is the specific way processing the data requires and counts multi-turn only (single turn will be discarded so it ends up with no training data), but since I am using Google Vertex AI, I don't have direct access to the underlying code so that was just my guess.\r\n> \r\n> @cyberyu Thanks for your suggestions. I have tried the approach you suggested, copied the same conversation in each jsonl element so every jsonl item has 2 `HUMAN` and `ASSISTANT`. However in my case, the issue persists. I am gonna give few more tries, and post the results here. You can find my dataset [here](https://huggingface.co/datasets/kk2491/test/tree/main)\r\n> \r\n> Thank you, KK\r\n\r\nI think another reason is your training sample length is too short. I saw a relevant report (https://discuss.huggingface.co/t/indexerror-invalid-key-16-is-out-of-bounds-for-size-0/14298/16) stating that the processing code might have a bug discarding sequence length short than max_seq_length, which is 512. Not sure the Vertex AI backend code has fixed that bug or not. So I tried to add some garbage content in your data, and extended the length longer than 512 for a single turn, and repeated twice. You can copy the following line as 5 repeated lines as your training data jsonl file of five samples (no eval or test needed, for speed up, set evaluation step to 5 and training step to 10,), and it will pass.\r\n\r\n{\"text\":\"### Human: You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You will handle customers queries and provide effective help message. Please provide response to 'Can Interplai software optimize routes for minimizing package handling and transfer times in distribution centers'? ### Assistant: Yes, Interplai software can optimize routes for distribution centers by streamlining package handling processes, minimizing transfer times between loading docks and storage areas, and optimizing warehouse layouts for efficient order fulfillment. ### Human: You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You are a helpful AI Assistant familiar with customer service. You will handle customers queries and provide effective help message. Please provide response to 'Can Interplai software optimize routes for minimizing package handling and transfer times in distribution centers'? ### Assistant: Yes, Interplai software can optimize routes for distribution centers by streamlining package handling processes, minimizing transfer times between loading docks and storage areas, and optimizing warehouse layouts for efficient order fulfillment.\"}\r\n", "@cyberyu **Thank you so much, You saved my day (+ so many days)**. \r\nI tried the example you provided above, and the training is successfully completed in Vertex-AI (through GUI). \r\nI never thought there would be constraints on the length of the samples and also on the number of turns. \r\nI will update my complete dataset and see update here once the training is completed. \r\n\r\nThank you, \r\nKK " ]
1970-01-01T00:00:00.000001
1,712
null
NONE
null
### Describe the bug I am trying to fine-tune llama2-7b model in GCP. The notebook I am using for this can be found [here](https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/community/model_garden/model_garden_pytorch_llama2_peft_finetuning.ipynb). When I use the dataset given in the example, the training gets successfully completed (example dataset can be found [here](https://huggingface.co/datasets/timdettmers/openassistant-guanaco)). However when I use my own dataset which is in the same format as the example dataset, I get the below error (my dataset can be found [here](https://huggingface.co/datasets/kk2491/finetune_dataset_002)). ![image](https://github.com/huggingface/datasets/assets/38481564/47fa2de3-95e0-478b-a35f-58cbaf90427a) I see the files are being read correctly from the logs: ![image](https://github.com/huggingface/datasets/assets/38481564/b0b6316c-2cc7-476c-9674-ca2222c8f4e3) ### Steps to reproduce the bug 1. Clone the [vertex-ai-samples](https://github.com/GoogleCloudPlatform/vertex-ai-samples) repository. 2. Run the [llama2-7b peft fine-tuning](https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/community/model_garden/model_garden_pytorch_llama2_peft_finetuning.ipynb). 3. Change the dataset `kk2491/finetune_dataset_002` ### Expected behavior The training should complete successfully, and model gets deployed to an endpoint. ### Environment info Python version : Python 3.10.12 Dataset : https://huggingface.co/datasets/kk2491/finetune_dataset_002
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6775/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6775/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6774
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6774/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6774/comments
https://api.github.com/repos/huggingface/datasets/issues/6774/events
https://github.com/huggingface/datasets/issues/6774
2,222,164,316
I_kwDODunzps6Ec4lc
6,774
Generating split is very slow when Image format is PNG
{ "avatar_url": "https://avatars.githubusercontent.com/u/22740819?v=4", "events_url": "https://api.github.com/users/Tramac/events{/privacy}", "followers_url": "https://api.github.com/users/Tramac/followers", "following_url": "https://api.github.com/users/Tramac/following{/other_user}", "gists_url": "https://api.github.com/users/Tramac/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Tramac", "id": 22740819, "login": "Tramac", "node_id": "MDQ6VXNlcjIyNzQwODE5", "organizations_url": "https://api.github.com/users/Tramac/orgs", "received_events_url": "https://api.github.com/users/Tramac/received_events", "repos_url": "https://api.github.com/users/Tramac/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Tramac/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Tramac/subscriptions", "type": "User", "url": "https://api.github.com/users/Tramac", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "I think this is due to the speed of reading a `png` image using pillow compared to a `jpg` image.\r\nNotably the same is true with `tiff`, it is even faster than `jpg` in my case." ]
1970-01-01T00:00:00.000001
1,712
null
NONE
null
### Describe the bug When I create a dataset, it gets stuck while generating cached data. The image format is PNG, and it will not get stuck when the image format is jpeg. ![image](https://github.com/huggingface/datasets/assets/22740819/3b888fd8-e6d6-488f-b828-95a8f206a152) After debugging, I know that it is because of the `pa.array` operation in [arrow_writer](https://github.com/huggingface/datasets/blob/2.13.0/src/datasets/arrow_writer.py#L553), but i don't why. ### Steps to reproduce the bug ``` from datasets import Dataset def generator(lines): for line in lines: img = Image.open(open(line["url"], "rb")) # print(img.format) # "PNG" yield { "image": img, } lines = open(dataset_path, "r") dataset = Dataset.from_generator( generator, gen_kwargs={"lines": lines} ) ``` ### Expected behavior Generating split done. ### Environment info datasets 2.13.0
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6774/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6774/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6773
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6773/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6773/comments
https://api.github.com/repos/huggingface/datasets/issues/6773/events
https://github.com/huggingface/datasets/issues/6773
2,221,049,121
I_kwDODunzps6EYoUh
6,773
Dataset on Hub re-downloads every time?
{ "avatar_url": "https://avatars.githubusercontent.com/u/9099139?v=4", "events_url": "https://api.github.com/users/manestay/events{/privacy}", "followers_url": "https://api.github.com/users/manestay/followers", "following_url": "https://api.github.com/users/manestay/following{/other_user}", "gists_url": "https://api.github.com/users/manestay/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/manestay", "id": 9099139, "login": "manestay", "node_id": "MDQ6VXNlcjkwOTkxMzk=", "organizations_url": "https://api.github.com/users/manestay/orgs", "received_events_url": "https://api.github.com/users/manestay/received_events", "repos_url": "https://api.github.com/users/manestay/repos", "site_admin": false, "starred_url": "https://api.github.com/users/manestay/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/manestay/subscriptions", "type": "User", "url": "https://api.github.com/users/manestay", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "The caching works as expected when I try to reproduce this locally or on Colab...", "hi @mariosasko , Thank you for checking. I also tried running this again just now, and it seems like the `load_dataset()` caches properly (though I'll double check later).\r\n\r\nI think the issue might be in the caching of the function output for `territories.map(lambda row: {'Claimants': row['Claimants'].split(';')})`. My current run re-ran this, even though I have run this many times before, and as demonstrated by loading from cache, the loaded dataset is the same.\r\n\r\nI wonder if the issue stems from using CSV output. Do you recommend changing to Parquet, and if so, is there an easy way to take the already uploaded data on the Hub and reformat?", "This issue seems similar to https://github.com/huggingface/datasets/issues/6184 (`dill` serializes objects defined outside the `__main__` module by reference). You should be able to work around this limitation by defining the lambdas outside of `load_borderlines_hf` (as module variables) and then setting their `__module__` attribute's value to `None` to force serializing them by value, e.g., like this: \r\n```python\r\nsplit_Claimants_row = lambda row: {'Claimants': row['Claimants'].split(';')}\r\nsplit_Claimants_row.__module__ = None\r\n```", "Thank you, I'll give this a try. Your fix makes sense to me, so this issue can be closed for now.\r\n\r\nUnrelated comment -- for \"Downloads last month\" on the hub page, I'm assuming for this project that each downloaded CSV is 1 download? The dataset consists of 51 CSVs, so I'm trying to see why it's incrementing so quickly (1125 2 days ago, 1246 right now).", "This doc explains how we count \"Downloads last month\": https://huggingface.co/docs/hub/datasets-download-stats" ]
1970-01-01T00:00:00.000001
1,712
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug Hi, I have a dataset on the hub [here](https://huggingface.co/datasets/manestay/borderlines). It has 1k+ downloads, which I sure is mostly just me and my colleagues working with it. It should have far fewer, since I'm using the same machine with a properly set up HF_HOME variable. However, whenever I run the below function `load_borderlines_hf`, it downloads the entire dataset from the hub and then does the other logic: https://github.com/manestay/borderlines/blob/4e161f444661e2ebfe643f3fe149d9258d63a57d/run_gpt/lib.py#L80 Let me know what I'm doing wrong here, or if it's a bug with the `datasets` library itself. On the hub I have my data stored in CSVs, but several columns are lists, so that's why I have the code to map splitting on `;`. I looked into dataset loading scripts, but it seemed difficult to set up. I have verified that other `datasets` and `models` on my system are using the cache properly (e.g. I have a 13B parameter model and large datasets, but those are cached and don't redownload). __EDIT: __ as pointed out in the discussion below, it may be the `map()` calls that aren't being cached properly. Supposing the `load_dataset()` retrieve from the cache, then it should be the case that the `map()` calls also retrieve from the cached output. But the `map()` commands re-execute sometimes. ### Steps to reproduce the bug 1. Copy and paste the function from [here](https://github.com/manestay/borderlines/blob/4e161f444661e2ebfe643f3fe149d9258d63a57d/run_gpt/lib.py#L80) (lines 80-100) 2. Run it in Python `load_borderlines_hf(None)` 3. It completes successfully, downloading from HF hub, then doing the mapping logic etc. 4. If you run it again after some time, it will re-download, ignoring the cache ### Expected behavior Re-running the code, which calls `datasets.load_dataset('manestay/borderlines', 'territories')`, should use the cached version ### Environment info - `datasets` version: 2.16.1 - Platform: Linux-5.14.21-150500.55.7-default-x86_64-with-glibc2.31 - Python version: 3.10.13 - `huggingface_hub` version: 0.20.3 - PyArrow version: 15.0.0 - Pandas version: 1.5.3 - `fsspec` version: 2023.10.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/9099139?v=4", "events_url": "https://api.github.com/users/manestay/events{/privacy}", "followers_url": "https://api.github.com/users/manestay/followers", "following_url": "https://api.github.com/users/manestay/following{/other_user}", "gists_url": "https://api.github.com/users/manestay/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/manestay", "id": 9099139, "login": "manestay", "node_id": "MDQ6VXNlcjkwOTkxMzk=", "organizations_url": "https://api.github.com/users/manestay/orgs", "received_events_url": "https://api.github.com/users/manestay/received_events", "repos_url": "https://api.github.com/users/manestay/repos", "site_admin": false, "starred_url": "https://api.github.com/users/manestay/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/manestay/subscriptions", "type": "User", "url": "https://api.github.com/users/manestay", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6773/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6773/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6771
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6771/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6771/comments
https://api.github.com/repos/huggingface/datasets/issues/6771/events
https://github.com/huggingface/datasets/issues/6771
2,220,131,457
I_kwDODunzps6EVISB
6,771
Datasets FileNotFoundError when trying to generate examples.
{ "avatar_url": "https://avatars.githubusercontent.com/u/26197115?v=4", "events_url": "https://api.github.com/users/RitchieP/events{/privacy}", "followers_url": "https://api.github.com/users/RitchieP/followers", "following_url": "https://api.github.com/users/RitchieP/following{/other_user}", "gists_url": "https://api.github.com/users/RitchieP/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/RitchieP", "id": 26197115, "login": "RitchieP", "node_id": "MDQ6VXNlcjI2MTk3MTE1", "organizations_url": "https://api.github.com/users/RitchieP/orgs", "received_events_url": "https://api.github.com/users/RitchieP/received_events", "repos_url": "https://api.github.com/users/RitchieP/repos", "site_admin": false, "starred_url": "https://api.github.com/users/RitchieP/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/RitchieP/subscriptions", "type": "User", "url": "https://api.github.com/users/RitchieP", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "Hi! I've opened a PR in the repo to fix this issue: https://huggingface.co/datasets/RitchieP/VerbaLex_voice/discussions/6", "@mariosasko Thanks for the PR and help! Guess I could close the issue for now. Appreciate the help!" ]
1970-01-01T00:00:00.000001
1,712
1970-01-01T00:00:00.000001
NONE
null
### Discussed in https://github.com/huggingface/datasets/discussions/6768 <div type='discussions-op-text'> <sup>Originally posted by **RitchieP** April 1, 2024</sup> Currently, I have a dataset hosted on Huggingface with a custom script [here](https://huggingface.co/datasets/RitchieP/VerbaLex_voice). I'm loading my dataset as below. ```py from datasets import load_dataset, IterableDatasetDict dataset = IterableDatasetDict() dataset["train"] = load_dataset("RitchieP/VerbaLex_voice", "ar", split="train", use_auth_token=True, streaming=True) dataset["test"] = load_dataset("RitchieP/VerbaLex_voice", "ar", split="test", use_auth_token=True, streaming=True) ``` And when I try to see the data I have loaded with ```py list(dataset["train"].take(1)) ``` And it gives me this stack trace ``` --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) Cell In[2], line 1 ----> 1 list(dataset["train"].take(1)) File /opt/conda/lib/python3.10/site-packages/datasets/iterable_dataset.py:1388, in IterableDataset.__iter__(self) 1385 yield formatter.format_row(pa_table) 1386 return -> 1388 for key, example in ex_iterable: 1389 if self.features: 1390 # `IterableDataset` automatically fills missing columns with None. 1391 # This is done with `_apply_feature_types_on_example`. 1392 example = _apply_feature_types_on_example( 1393 example, self.features, token_per_repo_id=self._token_per_repo_id 1394 ) File /opt/conda/lib/python3.10/site-packages/datasets/iterable_dataset.py:1044, in TakeExamplesIterable.__iter__(self) 1043 def __iter__(self): -> 1044 yield from islice(self.ex_iterable, self.n) File /opt/conda/lib/python3.10/site-packages/datasets/iterable_dataset.py:234, in ExamplesIterable.__iter__(self) 233 def __iter__(self): --> 234 yield from self.generate_examples_fn(**self.kwargs) File ~/.cache/huggingface/modules/datasets_modules/datasets/RitchieP--VerbaLex_voice/9465eaee58383cf9d7c3e14111d7abaea56398185a641b646897d6df4e4732f7/VerbaLex_voice.py:127, in VerbaLexVoiceDataset._generate_examples(self, local_extracted_archive_paths, archives, meta_path) 125 for i, audio_archive in enumerate(archives): 126 print(audio_archive) --> 127 for path, file in audio_archive: 128 _, filename = os.path.split(path) 129 if filename in metadata: File /opt/conda/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py:869, in _IterableFromGenerator.__iter__(self) 868 def __iter__(self): --> 869 yield from self.generator(*self.args, **self.kwargs) File /opt/conda/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py:919, in ArchiveIterable._iter_from_urlpath(cls, urlpath, download_config) 915 @classmethod 916 def _iter_from_urlpath( 917 cls, urlpath: str, download_config: Optional[DownloadConfig] = None 918 ) -> Generator[Tuple, None, None]: --> 919 compression = _get_extraction_protocol(urlpath, download_config=download_config) 920 # Set block_size=0 to get faster streaming 921 # (e.g. for hf:// and https:// it uses streaming Requests file-like instances) 922 with xopen(urlpath, "rb", download_config=download_config, block_size=0) as f: File /opt/conda/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py:400, in _get_extraction_protocol(urlpath, download_config) 398 urlpath, storage_options = _prepare_path_and_storage_options(urlpath, download_config=download_config) 399 try: --> 400 with fsspec.open(urlpath, **(storage_options or {})) as f: 401 return _get_extraction_protocol_with_magic_number(f) 402 except FileNotFoundError: File /opt/conda/lib/python3.10/site-packages/fsspec/core.py:100, in OpenFile.__enter__(self) 97 def __enter__(self): 98 mode = self.mode.replace("t", "").replace("b", "") + "b" --> 100 f = self.fs.open(self.path, mode=mode) 102 self.fobjects = [f] 104 if self.compression is not None: File /opt/conda/lib/python3.10/site-packages/fsspec/spec.py:1307, in AbstractFileSystem.open(self, path, mode, block_size, cache_options, compression, **kwargs) 1305 else: 1306 ac = kwargs.pop("autocommit", not self._intrans) -> 1307 f = self._open( 1308 path, 1309 mode=mode, 1310 block_size=block_size, 1311 autocommit=ac, 1312 cache_options=cache_options, 1313 **kwargs, 1314 ) 1315 if compression is not None: 1316 from fsspec.compression import compr File /opt/conda/lib/python3.10/site-packages/fsspec/implementations/local.py:180, in LocalFileSystem._open(self, path, mode, block_size, **kwargs) 178 if self.auto_mkdir and "w" in mode: 179 self.makedirs(self._parent(path), exist_ok=True) --> 180 return LocalFileOpener(path, mode, fs=self, **kwargs) File /opt/conda/lib/python3.10/site-packages/fsspec/implementations/local.py:302, in LocalFileOpener.__init__(self, path, mode, autocommit, fs, compression, **kwargs) 300 self.compression = get_compression(path, compression) 301 self.blocksize = io.DEFAULT_BUFFER_SIZE --> 302 self._open() File /opt/conda/lib/python3.10/site-packages/fsspec/implementations/local.py:307, in LocalFileOpener._open(self) 305 if self.f is None or self.f.closed: 306 if self.autocommit or "w" not in self.mode: --> 307 self.f = open(self.path, mode=self.mode) 308 if self.compression: 309 compress = compr[self.compression] FileNotFoundError: [Errno 2] No such file or directory: '/kaggle/working/h' ``` After looking into the stack trace, and referring to the source codes, it looks like its trying to access a directory in the notebook's environment and I don't understand why. Not sure if its a bug in Datasets library, so I'm opening a discussions first. Feel free to ask for more information if needed. Appreciate any help in advance!</div> Hi, referring to the discussion title above, after further digging, I think it's an issue within the datasets library. But not quite sure where it is. If you require any more info or actions from me, please let me know. Appreciate any help in advance!
{ "avatar_url": "https://avatars.githubusercontent.com/u/26197115?v=4", "events_url": "https://api.github.com/users/RitchieP/events{/privacy}", "followers_url": "https://api.github.com/users/RitchieP/followers", "following_url": "https://api.github.com/users/RitchieP/following{/other_user}", "gists_url": "https://api.github.com/users/RitchieP/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/RitchieP", "id": 26197115, "login": "RitchieP", "node_id": "MDQ6VXNlcjI2MTk3MTE1", "organizations_url": "https://api.github.com/users/RitchieP/orgs", "received_events_url": "https://api.github.com/users/RitchieP/received_events", "repos_url": "https://api.github.com/users/RitchieP/repos", "site_admin": false, "starred_url": "https://api.github.com/users/RitchieP/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/RitchieP/subscriptions", "type": "User", "url": "https://api.github.com/users/RitchieP", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6771/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6771/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6770
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6770/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6770/comments
https://api.github.com/repos/huggingface/datasets/issues/6770/events
https://github.com/huggingface/datasets/issues/6770
2,218,991,883
I_kwDODunzps6EQyEL
6,770
[Bug Report] `datasets==2.18.0` is not compatible with `fsspec==2023.12.2`
{ "avatar_url": "https://avatars.githubusercontent.com/u/19348888?v=4", "events_url": "https://api.github.com/users/fshp971/events{/privacy}", "followers_url": "https://api.github.com/users/fshp971/followers", "following_url": "https://api.github.com/users/fshp971/following{/other_user}", "gists_url": "https://api.github.com/users/fshp971/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/fshp971", "id": 19348888, "login": "fshp971", "node_id": "MDQ6VXNlcjE5MzQ4ODg4", "organizations_url": "https://api.github.com/users/fshp971/orgs", "received_events_url": "https://api.github.com/users/fshp971/received_events", "repos_url": "https://api.github.com/users/fshp971/repos", "site_admin": false, "starred_url": "https://api.github.com/users/fshp971/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/fshp971/subscriptions", "type": "User", "url": "https://api.github.com/users/fshp971", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "You should be able to fix this by updating `huggingface_hub` with `pip install -U huggingface_hub`. We use this package under the hood to resolve the Hub's files." ]
1970-01-01T00:00:00.000001
1,712
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug `Datasets==2.18.0` is not compatible with `fsspec==2023.12.2`. I have to downgrade fsspec to `fsspec==2023.10.0` to make `Datasets==2.18.0` work properly. ### Steps to reproduce the bug To reproduce the bug: 1. Make sure that `Datasets==2.18.0` and `fsspec==2023.12.2`. 2. Run the following code: ``` from datasets import load_dataset dataset = load_dataset("trec") ``` 3. Then one will get the following error message: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/conda/lib/python3.10/site-packages/datasets/load.py", line 2556, in load_dataset builder_instance = load_dataset_builder( File "/opt/conda/lib/python3.10/site-packages/datasets/load.py", line 2265, in load_dataset_builder builder_instance: DatasetBuilder = builder_cls( File "/opt/conda/lib/python3.10/site-packages/datasets/builder.py", line 371, in __init__ self.config, self.config_id = self._create_builder_config( File "/opt/conda/lib/python3.10/site-packages/datasets/builder.py", line 620, in _create_builder_config builder_config._resolve_data_files( File "/opt/conda/lib/python3.10/site-packages/datasets/builder.py", line 211, in _resolve_data_files self.data_files = self.data_files.resolve(base_path, download_config) File "/opt/conda/lib/python3.10/site-packages/datasets/data_files.py", line 799, in resolve out[key] = data_files_patterns_list.resolve(base_path, download_config) File "/opt/conda/lib/python3.10/site-packages/datasets/data_files.py", line 752, in resolve resolve_pattern( File "/opt/conda/lib/python3.10/site-packages/datasets/data_files.py", line 393, in resolve_pattern raise FileNotFoundError(error_msg) FileNotFoundError: Unable to find 'hf://datasets/trec@65752bf53af25bc935a0dce92fb5b6c930728450/default/train/0000.parquet' with any supported extension ['.csv', '.tsv', '.json', '.jsonl', '.parquet', '.geoparquet', '.gpq', '.arrow', '.txt', '.tar', '.blp', '.bmp', '.dib', '.bufr', '.cur', '.pcx', '.dcx', '.dds', '.ps', '.eps', '.fit', '.fits', '.fli', '.flc', '.ftc', '.ftu', '.gbr', '.gif', '.grib', '.h5', '.hdf', '.png', '.apng', '.jp2', '.j2k', '.jpc', '.jpf', '.jpx', '.j2c', '.icns', '.ico', '.im', '.iim', '.tif', '.tiff', '.jfif', '.jpe', '.jpg', '.jpeg', '.mpg', '.mpeg', '.msp', '.pcd', '.pxr', '.pbm', '.pgm', '.ppm', '.pnm', '.psd', '.bw', '.rgb', '.rgba', '.sgi', '.ras', '.tga', '.icb', '.vda', '.vst', '.webp', '.wmf', '.emf', '.xbm', '.xpm', '.BLP', '.BMP', '.DIB', '.BUFR', '.CUR', '.PCX', '.DCX', '.DDS', '.PS', '.EPS', '.FIT', '.FITS', '.FLI', '.FLC', '.FTC', '.FTU', '.GBR', '.GIF', '.GRIB', '.H5', '.HDF', '.PNG', '.APNG', '.JP2', '.J2K', '.JPC', '.JPF', '.JPX', '.J2C', '.ICNS', '.ICO', '.IM', '.IIM', '.TIF', '.TIFF', '.JFIF', '.JPE', '.JPG', '.JPEG', '.MPG', '.MPEG', '.MSP', '.PCD', '.PXR', '.PBM', '.PGM', '.PPM', '.PNM', '.PSD', '.BW', '.RGB', '.RGBA', '.SGI', '.RAS', '.TGA', '.ICB', '.VDA', '.VST', '.WEBP', '.WMF', '.EMF', '.XBM', '.XPM', '.aiff', '.au', '.avr', '.caf', '.flac', '.htk', '.svx', '.mat4', '.mat5', '.mpc2k', '.ogg', '.paf', '.pvf', '.raw', '.rf64', '.sd2', '.sds', '.ircam', '.voc', '.w64', '.wav', '.nist', '.wavex', '.wve', '.xi', '.mp3', '.opus', '.AIFF', '.AU', '.AVR', '.CAF', '.FLAC', '.HTK', '.SVX', '.MAT4', '.MAT5', '.MPC2K', '.OGG', '.PAF', '.PVF', '.RAW', '.RF64', '.SD2', '.SDS', '.IRCAM', '.VOC', '.W64', '.WAV', '.NIST', '.WAVEX', '.WVE', '.XI', '.MP3', '.OPUS', '.zip'] ``` 4. Similar issue also found for the following code: ``` dataset = load_dataset("sst", "default") ``` ### Expected behavior If the dataset is loaded correctly, one will have: ``` >>> print(dataset) DatasetDict({ train: Dataset({ features: ['text', 'coarse_label', 'fine_label'], num_rows: 5452 }) test: Dataset({ features: ['text', 'coarse_label', 'fine_label'], num_rows: 500 }) }) >>> ``` ### Environment info - `datasets` version: 2.18.0 - Platform: Linux-6.2.0-35-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - `huggingface_hub` version: 0.20.3 - PyArrow version: 15.0.1 - Pandas version: 2.2.1 - `fsspec` version: 2023.12.2
{ "avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4", "events_url": "https://api.github.com/users/mariosasko/events{/privacy}", "followers_url": "https://api.github.com/users/mariosasko/followers", "following_url": "https://api.github.com/users/mariosasko/following{/other_user}", "gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mariosasko", "id": 47462742, "login": "mariosasko", "node_id": "MDQ6VXNlcjQ3NDYyNzQy", "organizations_url": "https://api.github.com/users/mariosasko/orgs", "received_events_url": "https://api.github.com/users/mariosasko/received_events", "repos_url": "https://api.github.com/users/mariosasko/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions", "type": "User", "url": "https://api.github.com/users/mariosasko", "user_view_type": "public" }
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/huggingface/datasets/issues/6770/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6770/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6769
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6769/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6769/comments
https://api.github.com/repos/huggingface/datasets/issues/6769/events
https://github.com/huggingface/datasets/issues/6769
2,218,242,015
I_kwDODunzps6EN6_f
6,769
(Willing to PR) Datasets with custom python objects
{ "avatar_url": "https://avatars.githubusercontent.com/u/5236035?v=4", "events_url": "https://api.github.com/users/fzyzcjy/events{/privacy}", "followers_url": "https://api.github.com/users/fzyzcjy/followers", "following_url": "https://api.github.com/users/fzyzcjy/following{/other_user}", "gists_url": "https://api.github.com/users/fzyzcjy/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/fzyzcjy", "id": 5236035, "login": "fzyzcjy", "node_id": "MDQ6VXNlcjUyMzYwMzU=", "organizations_url": "https://api.github.com/users/fzyzcjy/orgs", "received_events_url": "https://api.github.com/users/fzyzcjy/received_events", "repos_url": "https://api.github.com/users/fzyzcjy/repos", "site_admin": false, "starred_url": "https://api.github.com/users/fzyzcjy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/fzyzcjy/subscriptions", "type": "User", "url": "https://api.github.com/users/fzyzcjy", "user_view_type": "public" }
[ { "color": "a2eeef", "default": true, "description": "New feature or request", "id": 1935892871, "name": "enhancement", "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement" } ]
open
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,711
null
CONTRIBUTOR
null
### Feature request Hi thanks for the library! I would like to have a huggingface Dataset, and one of its column is custom (non-serializable) Python objects. For example, a minimal code: ``` class MyClass: pass dataset = datasets.Dataset.from_list([ dict(a=MyClass(), b='hello'), ]) ``` It gives error: ``` ArrowInvalid: Could not convert <__main__.MyClass object at 0x7a852830d050> with type MyClass: did not recognize Python value type when inferring an Arrow data type ``` I guess it is because Dataset forces to convert everything into arrow format. However, is there any ways to make the scenario work? Thanks! ### Motivation (see above) ### Your contribution Yes, I am happy to PR! Cross-posted: https://discuss.huggingface.co/t/datasets-with-custom-python-objects/79050?u=fzyzcjy EDIT: possibly related https://github.com/huggingface/datasets/issues/5766
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 1, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/huggingface/datasets/issues/6769/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6769/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6765
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6765/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6765/comments
https://api.github.com/repos/huggingface/datasets/issues/6765/events
https://github.com/huggingface/datasets/issues/6765
2,215,933,515
I_kwDODunzps6EFHZL
6,765
Compatibility issue between s3fs, fsspec, and datasets
{ "avatar_url": "https://avatars.githubusercontent.com/u/33383515?v=4", "events_url": "https://api.github.com/users/njbrake/events{/privacy}", "followers_url": "https://api.github.com/users/njbrake/followers", "following_url": "https://api.github.com/users/njbrake/following{/other_user}", "gists_url": "https://api.github.com/users/njbrake/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/njbrake", "id": 33383515, "login": "njbrake", "node_id": "MDQ6VXNlcjMzMzgzNTE1", "organizations_url": "https://api.github.com/users/njbrake/orgs", "received_events_url": "https://api.github.com/users/njbrake/received_events", "repos_url": "https://api.github.com/users/njbrake/repos", "site_admin": false, "starred_url": "https://api.github.com/users/njbrake/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/njbrake/subscriptions", "type": "User", "url": "https://api.github.com/users/njbrake", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "Hi! Instead of running `pip install` separately for each package, you should pass all the packages to a single `pip install` call (in this case, `pip install datasets s3fs`) to let `pip` properly resolve their versions.", "> Hi! Instead of running `pip install` separately for each package, you should pass all the packages to a single `pip install` call (in this case, `pip install datasets s3fs`) to let `pip` properly resolve their versions.\r\n\r\nThanks so much! My inexperience with pip is showing 😆 🙈 ", "> Hi! Instead of running `pip install` separately for each package, you should pass all the packages to a single `pip install` call (in this case, `pip install datasets s3fs`) to let `pip` properly resolve their versions.\r\n\r\nyou are awesome bro", "Hey, the suggestion by @mariosasko unfortunately only address this issue via pip. The original message was about poetry and I am still facing a dependency conflict with that.\r\n\r\nThe following command complains first about `fsspec` (`... no versions of fsspec match ...`) and then I get an error.\r\n\r\nCommand:\r\n`poetry add datasets s3fs` \r\n\r\nError: \r\n` ... your project ... depends on both datasets (^3.1.0) and s3fs (^2024.10.0), version solving failed`\r\n\r\nInstalling first `s3fs` and then the rest of the huggingface libraries, like `datasets`, also did not help." ]
1970-01-01T00:00:00.000001
1,731
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug Here is the full error stack when installing: ``` ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. datasets 2.18.0 requires fsspec[http]<=2024.2.0,>=2023.1.0, but you have fsspec 2024.3.1 which is incompatible. Successfully installed aiobotocore-2.12.1 aioitertools-0.11.0 botocore-1.34.51 fsspec-2024.3.1 jmespath-1.0.1 s3fs-2024.3.1 urllib3-2.0.7 wrapt-1.16.0 ``` When I install with pip, pip allows this error to exist while still installing s3fs, but this error breaks poetry, since poetry will refuse to install s3fs because of the dependency conflict. Maybe I'm missing something so maybe it's not a bug but some mistake on my end? Any input would be helpful. Thanks! ### Steps to reproduce the bug 1. conda create -n tmp python=3.10 -y 2. conda activate tmp 3. pip install datasets 4. pip install s3fs ### Expected behavior I would expect there to be no error. ### Environment info MacOS (ARM), Python3.10, conda 23.11.0.
{ "avatar_url": "https://avatars.githubusercontent.com/u/33383515?v=4", "events_url": "https://api.github.com/users/njbrake/events{/privacy}", "followers_url": "https://api.github.com/users/njbrake/followers", "following_url": "https://api.github.com/users/njbrake/following{/other_user}", "gists_url": "https://api.github.com/users/njbrake/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/njbrake", "id": 33383515, "login": "njbrake", "node_id": "MDQ6VXNlcjMzMzgzNTE1", "organizations_url": "https://api.github.com/users/njbrake/orgs", "received_events_url": "https://api.github.com/users/njbrake/received_events", "repos_url": "https://api.github.com/users/njbrake/repos", "site_admin": false, "starred_url": "https://api.github.com/users/njbrake/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/njbrake/subscriptions", "type": "User", "url": "https://api.github.com/users/njbrake", "user_view_type": "public" }
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/huggingface/datasets/issues/6765/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6765/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6764
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6764/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6764/comments
https://api.github.com/repos/huggingface/datasets/issues/6764/events
https://github.com/huggingface/datasets/issues/6764
2,215,767,119
I_kwDODunzps6EEexP
6,764
load_dataset can't work with symbolic links
{ "avatar_url": "https://avatars.githubusercontent.com/u/13640533?v=4", "events_url": "https://api.github.com/users/VladimirVincan/events{/privacy}", "followers_url": "https://api.github.com/users/VladimirVincan/followers", "following_url": "https://api.github.com/users/VladimirVincan/following{/other_user}", "gists_url": "https://api.github.com/users/VladimirVincan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/VladimirVincan", "id": 13640533, "login": "VladimirVincan", "node_id": "MDQ6VXNlcjEzNjQwNTMz", "organizations_url": "https://api.github.com/users/VladimirVincan/orgs", "received_events_url": "https://api.github.com/users/VladimirVincan/received_events", "repos_url": "https://api.github.com/users/VladimirVincan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/VladimirVincan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/VladimirVincan/subscriptions", "type": "User", "url": "https://api.github.com/users/VladimirVincan", "user_view_type": "public" }
[ { "color": "a2eeef", "default": true, "description": "New feature or request", "id": 1935892871, "name": "enhancement", "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement" } ]
open
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,711
null
NONE
null
### Feature request Enable the `load_dataset` function to load local datasets with symbolic links. E.g, this dataset can be loaded: ├── example_dataset/ │ ├── data/ │ │ ├── train/ │ │ │ ├── file0 │ │ │ ├── file1 │ │ ├── dev/ │ │ │ ├── file2 │ │ │ ├── file3 │ ├── metadata.csv while this dataset can't: ├── example_dataset_symlink/ │ ├── data/ │ │ ├── train/ │ │ │ ├── sym0 -> file0 │ │ │ ├── sym1 -> file1 │ │ ├── dev/ │ │ │ ├── sym2 -> file2 │ │ │ ├── sym3 -> file3 │ ├── metadata.csv I have created an example dataset in order to reproduce the problem: 1. Unzip `example_dataset.zip`. 2. Run `no_symlink.sh`. Training should start without issues. 3. Run `symlink.sh`. You will see that all four examples will be in train split, instead of having two examples in train and two examples in dev. The script won't load the correct audio files. [example_dataset.zip](https://github.com/huggingface/datasets/files/14807053/example_dataset.zip) ### Motivation I have a very large dataset locally. Instead of initiating training on the entire dataset, I need to start training on smaller subsets of the data. Due to the purpose of the experiments I am running, I will need to create many smaller datasets with overlapping data. Instead of copying the all the files for each subset, I would prefer copying symbolic links of the data. This way, the memory usage would not significantly increase beyond the initial dataset size. Advantages of this approach: - It would leave a smaller memory footprint on the hard drive - Creating smaller datasets would be much faster ### Your contribution I would gladly contribute, if this is something useful to the community. It seems like a simple change of code, something like `file_path = os.path.realpath(file_path)` should be added before loading the files. If anyone has insights on how to incorporate this functionality, I would greatly appreciate your knowledge and input.
null
{ "+1": 5, "-1": 0, "confused": 0, "eyes": 3, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 8, "url": "https://api.github.com/repos/huggingface/datasets/issues/6764/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6764/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6760
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6760/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6760/comments
https://api.github.com/repos/huggingface/datasets/issues/6760/events
https://github.com/huggingface/datasets/issues/6760
2,212,288,122
I_kwDODunzps6D3NZ6
6,760
Load codeparrot/apps raising UnicodeDecodeError in datasets-2.18.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/17897916?v=4", "events_url": "https://api.github.com/users/yucc-leon/events{/privacy}", "followers_url": "https://api.github.com/users/yucc-leon/followers", "following_url": "https://api.github.com/users/yucc-leon/following{/other_user}", "gists_url": "https://api.github.com/users/yucc-leon/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yucc-leon", "id": 17897916, "login": "yucc-leon", "node_id": "MDQ6VXNlcjE3ODk3OTE2", "organizations_url": "https://api.github.com/users/yucc-leon/orgs", "received_events_url": "https://api.github.com/users/yucc-leon/received_events", "repos_url": "https://api.github.com/users/yucc-leon/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yucc-leon/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yucc-leon/subscriptions", "type": "User", "url": "https://api.github.com/users/yucc-leon", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "The same error with mteb datasets.", "Unfortunately, I'm unable to reproduce this error locally or on Colab.", "Here is the requirements.txt from a clean virtual environment (managed by conda) where I only install `datasets` by \r\n`pip install datasets`. \r\nThe pip list:\r\n```\r\naiohttp==3.9.3\r\naiosignal==1.3.1\r\nattrs==23.2.0\r\ncertifi==2024.2.2\r\ncharset-normalizer==3.3.2\r\ndatasets==2.18.0\r\ndill==0.3.8\r\nfilelock==3.13.3\r\nfrozenlist==1.4.1\r\nfsspec==2024.2.0\r\nhuggingface-hub==0.22.2\r\nidna==3.6\r\nmultidict==6.0.5\r\nmultiprocess==0.70.16\r\nnumpy==1.26.4\r\npackaging==24.0\r\npandas==2.2.1\r\npyarrow==15.0.2\r\npyarrow-hotfix==0.6\r\npython-dateutil==2.9.0.post0\r\npytz==2024.1\r\nPyYAML==6.0.1\r\nrequests==2.31.0\r\nsix==1.16.0\r\ntqdm==4.66.2\r\ntyping_extensions==4.11.0\r\ntzdata==2024.1\r\nurllib3==2.2.1\r\nxxhash==3.4.1\r\nyarl==1.9.4\r\n```\r\nAnd the error can be reproduced.\r\n\r\nDowngrading to datasets==2.14.6 changes some packages' versions:\r\n\r\n```\r\nSuccessfully installed datasets-2.14.6 dill-0.3.7 fsspec-2023.10.0 multiprocess-0.70.15\r\n```\r\nand the dataset can be downloaded and loaded. \r\n\r\nThen I upgrade the version to 2.18.0 again; now the dataset can be loaded with such a line:\r\n```Using the latest cached version of the module from /home/xxx/.cache/huggingface/modules/datasets_modules/datasets/codeparrot--apps/04ac807715d07d6e5cc580f59cdc8213cd7dc4529d0bb819cca72c9f8e8c1aa5 (last modified on Sun Apr 7 09:06:43 2024) since it couldn't be found locally at codeparrot/apps, or remotely on the Hugging Face Hub. ```\r\n\r\nSo the latest version works wrong when requesting the dataset info. \r\n\r\n**But if you cannot reproduce this, I may ignore some detailed information: I use `HF_ENDPOINT=https://hf-mirror.com` for some reason (if not use this I cannot connect to huggingface resources) and the error occurs when requesting the dataset's info card.** \r\nMaybe the error is caused by this environment variable.\r\nI'll open an issue in the author's repo now.", "> Here is the requirements.txt from a clean virtual environment (managed by conda) where I only install `datasets` by `pip install datasets`. The pip list:\r\n> \r\n> ```\r\n> aiohttp==3.9.3\r\n> aiosignal==1.3.1\r\n> attrs==23.2.0\r\n> certifi==2024.2.2\r\n> charset-normalizer==3.3.2\r\n> datasets==2.18.0\r\n> dill==0.3.8\r\n> filelock==3.13.3\r\n> frozenlist==1.4.1\r\n> fsspec==2024.2.0\r\n> huggingface-hub==0.22.2\r\n> idna==3.6\r\n> multidict==6.0.5\r\n> multiprocess==0.70.16\r\n> numpy==1.26.4\r\n> packaging==24.0\r\n> pandas==2.2.1\r\n> pyarrow==15.0.2\r\n> pyarrow-hotfix==0.6\r\n> python-dateutil==2.9.0.post0\r\n> pytz==2024.1\r\n> PyYAML==6.0.1\r\n> requests==2.31.0\r\n> six==1.16.0\r\n> tqdm==4.66.2\r\n> typing_extensions==4.11.0\r\n> tzdata==2024.1\r\n> urllib3==2.2.1\r\n> xxhash==3.4.1\r\n> yarl==1.9.4\r\n> ```\r\n> \r\n> And the error can be reproduced.\r\n> \r\n> Downgrading to datasets==2.14.6 changes some packages' versions:\r\n> \r\n> ```\r\n> Successfully installed datasets-2.14.6 dill-0.3.7 fsspec-2023.10.0 multiprocess-0.70.15\r\n> ```\r\n> \r\n> and the dataset can be downloaded and loaded.\r\n> \r\n> Then I upgrade the version to 2.18.0 again; now the dataset can be loaded with such a line: `Using the latest cached version of the module from /home/xxx/.cache/huggingface/modules/datasets_modules/datasets/codeparrot--apps/04ac807715d07d6e5cc580f59cdc8213cd7dc4529d0bb819cca72c9f8e8c1aa5 (last modified on Sun Apr 7 09:06:43 2024) since it couldn't be found locally at codeparrot/apps, or remotely on the Hugging Face Hub. `\r\n> \r\n> So the latest version works wrong when requesting the dataset info.\r\n> \r\n> **But if you cannot reproduce this, I may ignore some detailed information: I use `HF_ENDPOINT=https://hf-mirror.com` for some reason (if not use this I cannot connect to huggingface resources) and the error occurs when requesting the dataset's info card.** Maybe the error is caused by this environment variable. I'll open an issue in the author's repo now.\r\n\r\nThis is useful and my same error is settled!!!" ]
1970-01-01T00:00:00.000001
1,718
null
NONE
null
### Describe the bug This happens with datasets-2.18.0; I downgraded the version to 2.14.6 fixing this temporarily. ``` Traceback (most recent call last): File "/home/xxx/miniconda3/envs/py310/lib/python3.10/site-packages/datasets/load.py", line 2556, in load_dataset builder_instance = load_dataset_builder( File "/home/xxx/miniconda3/envs/py310/lib/python3.10/site-packages/datasets/load.py", line 2228, in load_dataset_builder dataset_module = dataset_module_factory( File "/home/xxx/miniconda3/envs/py310/lib/python3.10/site-packages/datasets/load.py", line 1879, in dataset_module_factory raise e1 from None File "/home/xxx/miniconda3/envs/py310/lib/python3.10/site-packages/datasets/load.py", line 1831, in dataset_module_factory can_load_config_from_parquet_export = "DEFAULT_CONFIG_NAME" not in f.read() File "/home/xxx/miniconda3/envs/py310/lib/python3.10/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte ``` ### Steps to reproduce the bug 1. Using Python3.10/3.11 2. Install datasets-2.18.0 3. test with ``` from datasets import load_dataset dataset = load_dataset("codeparrot/apps") ``` ### Expected behavior Normally it should manage to download and load the dataset without such error. ### Environment info Ubuntu, Python3.10/3.11
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6760/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6760/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6759
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6759/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6759/comments
https://api.github.com/repos/huggingface/datasets/issues/6759/events
https://github.com/huggingface/datasets/issues/6759
2,208,892,891
I_kwDODunzps6DqQfb
6,759
Persistent multi-process Pool
{ "avatar_url": "https://avatars.githubusercontent.com/u/4337024?v=4", "events_url": "https://api.github.com/users/fostiropoulos/events{/privacy}", "followers_url": "https://api.github.com/users/fostiropoulos/followers", "following_url": "https://api.github.com/users/fostiropoulos/following{/other_user}", "gists_url": "https://api.github.com/users/fostiropoulos/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/fostiropoulos", "id": 4337024, "login": "fostiropoulos", "node_id": "MDQ6VXNlcjQzMzcwMjQ=", "organizations_url": "https://api.github.com/users/fostiropoulos/orgs", "received_events_url": "https://api.github.com/users/fostiropoulos/received_events", "repos_url": "https://api.github.com/users/fostiropoulos/repos", "site_admin": false, "starred_url": "https://api.github.com/users/fostiropoulos/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/fostiropoulos/subscriptions", "type": "User", "url": "https://api.github.com/users/fostiropoulos", "user_view_type": "public" }
[ { "color": "a2eeef", "default": true, "description": "New feature or request", "id": 1935892871, "name": "enhancement", "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement" } ]
open
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,711
null
NONE
null
### Feature request Running .map and filter functions with `num_procs` consecutively instantiates several multiprocessing pools iteratively. As instantiating a Pool is very resource intensive it can be a bottleneck to performing iteratively filtering. My ideas: 1. There should be an option to declare `persistent_workers` similar to pytorch DataLoader. Downside would be that would be complex to determine the correct resource allocation and deallocation of the pool. i.e. the dataset can outlive the utility of the pool. 2. Provide a pool as an argument. Downside would be the expertise required by the user. Upside, is that there is better resource management. ### Motivation Is really slow to iteratively perform map and filter operations on a dataset. ### Your contribution If approved I could integrate it. I would need to know what method would be most suitable to implement from the two options above.
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6759/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6759/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6758
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6758/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6758/comments
https://api.github.com/repos/huggingface/datasets/issues/6758/events
https://github.com/huggingface/datasets/issues/6758
2,208,494,302
I_kwDODunzps6DovLe
6,758
Passing `sample_by` to `load_dataset` when loading text data does not work
{ "avatar_url": "https://avatars.githubusercontent.com/u/823693?v=4", "events_url": "https://api.github.com/users/ntoxeg/events{/privacy}", "followers_url": "https://api.github.com/users/ntoxeg/followers", "following_url": "https://api.github.com/users/ntoxeg/following{/other_user}", "gists_url": "https://api.github.com/users/ntoxeg/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ntoxeg", "id": 823693, "login": "ntoxeg", "node_id": "MDQ6VXNlcjgyMzY5Mw==", "organizations_url": "https://api.github.com/users/ntoxeg/orgs", "received_events_url": "https://api.github.com/users/ntoxeg/received_events", "repos_url": "https://api.github.com/users/ntoxeg/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ntoxeg/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ntoxeg/subscriptions", "type": "User", "url": "https://api.github.com/users/ntoxeg", "user_view_type": "public" }
[]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4", "events_url": "https://api.github.com/users/lhoestq/events{/privacy}", "followers_url": "https://api.github.com/users/lhoestq/followers", "following_url": "https://api.github.com/users/lhoestq/following{/other_user}", "gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lhoestq", "id": 42851186, "login": "lhoestq", "node_id": "MDQ6VXNlcjQyODUxMTg2", "organizations_url": "https://api.github.com/users/lhoestq/orgs", "received_events_url": "https://api.github.com/users/lhoestq/received_events", "repos_url": "https://api.github.com/users/lhoestq/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions", "type": "User", "url": "https://api.github.com/users/lhoestq", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4", "events_url": "https://api.github.com/users/lhoestq/events{/privacy}", "followers_url": "https://api.github.com/users/lhoestq/followers", "following_url": "https://api.github.com/users/lhoestq/following{/other_user}", "gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lhoestq", "id": 42851186, "login": "lhoestq", "node_id": "MDQ6VXNlcjQyODUxMTg2", "organizations_url": "https://api.github.com/users/lhoestq/orgs", "received_events_url": "https://api.github.com/users/lhoestq/received_events", "repos_url": "https://api.github.com/users/lhoestq/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions", "type": "User", "url": "https://api.github.com/users/lhoestq", "user_view_type": "public" } ]
null
[ "Thanks for reporting! We are working on a fix." ]
1970-01-01T00:00:00.000001
1,712
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug I have a dataset that consists of a bunch of text files, each representing an example. There is an undocumented `sample_by` argument for the `TextConfig` class that is used by `Text` to decide whether to split files into lines, paragraphs or take them whole. Passing `sample_by=“document”` to `load_dataset` results in files getting split into lines regardless. I have edited `src/datasets/packaged_modules/text/text.py` for myself to switch the default and it works fine. As a side note, the `if-else` for `sample_by` will silently load an empty dataset if someone makes a typo in the argument, which is not ideal. ### Steps to reproduce the bug 1. Prepare data as a bunch of files in a directory. 2. Load that data via `load_dataset(“text”, data_files=<data_dir>/<files_glob>, …, sample_by=“document”)`. 3. Inspect the resultant dataset — every item should have the form of `{“text”: <a line from a file>}`. ### Expected behavior `load_dataset(“text”, data_files=<data_dir>/<files_glob>, …, sample_by=“document”)` should result in a dataset with items of the form `{“text”: <one document>}`. ### Environment info - `datasets` version: 2.18.0 - Platform: Linux-5.15.0-1046-nvidia-x86_64-with-glibc2.35 - Python version: 3.11.8 - `huggingface_hub` version: 0.21.4 - PyArrow version: 15.0.2 - Pandas version: 2.2.1 - `fsspec` version: 2024.2.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4", "events_url": "https://api.github.com/users/lhoestq/events{/privacy}", "followers_url": "https://api.github.com/users/lhoestq/followers", "following_url": "https://api.github.com/users/lhoestq/following{/other_user}", "gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lhoestq", "id": 42851186, "login": "lhoestq", "node_id": "MDQ6VXNlcjQyODUxMTg2", "organizations_url": "https://api.github.com/users/lhoestq/orgs", "received_events_url": "https://api.github.com/users/lhoestq/received_events", "repos_url": "https://api.github.com/users/lhoestq/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions", "type": "User", "url": "https://api.github.com/users/lhoestq", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6758/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6758/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6756
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6756/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6756/comments
https://api.github.com/repos/huggingface/datasets/issues/6756/events
https://github.com/huggingface/datasets/issues/6756
2,205,557,725
I_kwDODunzps6DdiPd
6,756
Support SQLite files?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1676121?v=4", "events_url": "https://api.github.com/users/severo/events{/privacy}", "followers_url": "https://api.github.com/users/severo/followers", "following_url": "https://api.github.com/users/severo/following{/other_user}", "gists_url": "https://api.github.com/users/severo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/severo", "id": 1676121, "login": "severo", "node_id": "MDQ6VXNlcjE2NzYxMjE=", "organizations_url": "https://api.github.com/users/severo/orgs", "received_events_url": "https://api.github.com/users/severo/received_events", "repos_url": "https://api.github.com/users/severo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/severo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/severo/subscriptions", "type": "User", "url": "https://api.github.com/users/severo", "user_view_type": "public" }
[ { "color": "a2eeef", "default": true, "description": "New feature or request", "id": 1935892871, "name": "enhancement", "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement" } ]
closed
false
null
[]
null
[ "You can use `Dataset.from_sql(path_to_sql_file)` already. Though we haven't added the Sql dataset builder to the `_PACKAGED_DATASETS_MODULES` list or in `_EXTENSION_TO_MODULE` to map `.sqlite` to the Sql dataset builder\r\n\r\nThis would allow to load a dataset repository with a `.sqlite` file using `load_dataset` and enable the Dataset Viewer", "Considering `Dataset.from_sql`'s (extremely) low usage, I don't think many users are interested in using this format for their datasets. Also, SQLite files are hard/impossible to stream efficiently and require custom logic to define splits/subsets, so IMO we shouldn't encourage people to use SQLite on the Hub.\r\n\r\n@severo Do you have some real-world examples of datasets published in this format?", "No. Indeed, it seems better to explicitly not support sqlite" ]
1970-01-01T00:00:00.000001
1,711
1970-01-01T00:00:00.000001
COLLABORATOR
null
### Feature request Support loading a dataset from a SQLite file https://huggingface.co/datasets/severo/test_iris_sqlite/tree/main ### Motivation SQLite is a popular file format. ### Your contribution See discussion on slack: https://huggingface.slack.com/archives/C04L6P8KNQ5/p1702481859117909 (internal) In particular: a SQLite file can contain multiple tables, which might be matched to multiple configs. Maybe the detail of splits and configs should be defined in the README YAML, or use the same format as for ZIP files: `Iris.sqlite::Iris`. See dataset here: https://huggingface.co/datasets/severo/test_iris_sqlite Note: should we also support DuckDB files?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1676121?v=4", "events_url": "https://api.github.com/users/severo/events{/privacy}", "followers_url": "https://api.github.com/users/severo/followers", "following_url": "https://api.github.com/users/severo/following{/other_user}", "gists_url": "https://api.github.com/users/severo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/severo", "id": 1676121, "login": "severo", "node_id": "MDQ6VXNlcjE2NzYxMjE=", "organizations_url": "https://api.github.com/users/severo/orgs", "received_events_url": "https://api.github.com/users/severo/received_events", "repos_url": "https://api.github.com/users/severo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/severo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/severo/subscriptions", "type": "User", "url": "https://api.github.com/users/severo", "user_view_type": "public" }
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/huggingface/datasets/issues/6756/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6756/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6755
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6755/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6755/comments
https://api.github.com/repos/huggingface/datasets/issues/6755/events
https://github.com/huggingface/datasets/issues/6755
2,204,573,289
I_kwDODunzps6DZx5p
6,755
Small typo on the documentation
{ "avatar_url": "https://avatars.githubusercontent.com/u/4337024?v=4", "events_url": "https://api.github.com/users/fostiropoulos/events{/privacy}", "followers_url": "https://api.github.com/users/fostiropoulos/followers", "following_url": "https://api.github.com/users/fostiropoulos/following{/other_user}", "gists_url": "https://api.github.com/users/fostiropoulos/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/fostiropoulos", "id": 4337024, "login": "fostiropoulos", "node_id": "MDQ6VXNlcjQzMzcwMjQ=", "organizations_url": "https://api.github.com/users/fostiropoulos/orgs", "received_events_url": "https://api.github.com/users/fostiropoulos/received_events", "repos_url": "https://api.github.com/users/fostiropoulos/repos", "site_admin": false, "starred_url": "https://api.github.com/users/fostiropoulos/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/fostiropoulos/subscriptions", "type": "User", "url": "https://api.github.com/users/fostiropoulos", "user_view_type": "public" }
[ { "color": "7057ff", "default": true, "description": "Good for newcomers", "id": 1935892877, "name": "good first issue", "node_id": "MDU6TGFiZWwxOTM1ODkyODc3", "url": "https://api.github.com/repos/huggingface/datasets/labels/good%20first%20issue" } ]
closed
false
{ "avatar_url": "https://avatars.githubusercontent.com/u/63234112?v=4", "events_url": "https://api.github.com/users/JINO-ROHIT/events{/privacy}", "followers_url": "https://api.github.com/users/JINO-ROHIT/followers", "following_url": "https://api.github.com/users/JINO-ROHIT/following{/other_user}", "gists_url": "https://api.github.com/users/JINO-ROHIT/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/JINO-ROHIT", "id": 63234112, "login": "JINO-ROHIT", "node_id": "MDQ6VXNlcjYzMjM0MTEy", "organizations_url": "https://api.github.com/users/JINO-ROHIT/orgs", "received_events_url": "https://api.github.com/users/JINO-ROHIT/received_events", "repos_url": "https://api.github.com/users/JINO-ROHIT/repos", "site_admin": false, "starred_url": "https://api.github.com/users/JINO-ROHIT/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/JINO-ROHIT/subscriptions", "type": "User", "url": "https://api.github.com/users/JINO-ROHIT", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/63234112?v=4", "events_url": "https://api.github.com/users/JINO-ROHIT/events{/privacy}", "followers_url": "https://api.github.com/users/JINO-ROHIT/followers", "following_url": "https://api.github.com/users/JINO-ROHIT/following{/other_user}", "gists_url": "https://api.github.com/users/JINO-ROHIT/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/JINO-ROHIT", "id": 63234112, "login": "JINO-ROHIT", "node_id": "MDQ6VXNlcjYzMjM0MTEy", "organizations_url": "https://api.github.com/users/JINO-ROHIT/orgs", "received_events_url": "https://api.github.com/users/JINO-ROHIT/received_events", "repos_url": "https://api.github.com/users/JINO-ROHIT/repos", "site_admin": false, "starred_url": "https://api.github.com/users/JINO-ROHIT/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/JINO-ROHIT/subscriptions", "type": "User", "url": "https://api.github.com/users/JINO-ROHIT", "user_view_type": "public" } ]
null
[ "Thanks for reporting @fostiropoulos! I've edited your comment to fix the link to the problematic line.\r\n", "@mariosasko can i take this up?", "#self-assign" ]
1970-01-01T00:00:00.000001
1,712
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug There is a small typo on https://github.com/huggingface/datasets/blob/d5468836fe94e8be1ae093397dd43d4a2503b926/src/datasets/dataset_dict.py#L938 It should be `caching is enabled`. ### Steps to reproduce the bug Please visit https://github.com/huggingface/datasets/blob/d5468836fe94e8be1ae093397dd43d4a2503b926/src/datasets/dataset_dict.py#L938 ### Expected behavior `caching is enabled` ### Environment info - `datasets` version: 2.17.1 - Platform: Linux-5.15.0-101-generic-x86_64-with-glibc2.35 - Python version: 3.11.7 - `huggingface_hub` version: 0.20.3 - PyArrow version: 15.0.0 - Pandas version: 2.2.1 - `fsspec` version: 2023.10.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4", "events_url": "https://api.github.com/users/mariosasko/events{/privacy}", "followers_url": "https://api.github.com/users/mariosasko/followers", "following_url": "https://api.github.com/users/mariosasko/following{/other_user}", "gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mariosasko", "id": 47462742, "login": "mariosasko", "node_id": "MDQ6VXNlcjQ3NDYyNzQy", "organizations_url": "https://api.github.com/users/mariosasko/orgs", "received_events_url": "https://api.github.com/users/mariosasko/received_events", "repos_url": "https://api.github.com/users/mariosasko/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions", "type": "User", "url": "https://api.github.com/users/mariosasko", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6755/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6755/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6753
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6753/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6753/comments
https://api.github.com/repos/huggingface/datasets/issues/6753/events
https://github.com/huggingface/datasets/issues/6753
2,204,155,091
I_kwDODunzps6DYLzT
6,753
Type error when importing datasets on Kaggle
{ "avatar_url": "https://avatars.githubusercontent.com/u/18300717?v=4", "events_url": "https://api.github.com/users/jtv199/events{/privacy}", "followers_url": "https://api.github.com/users/jtv199/followers", "following_url": "https://api.github.com/users/jtv199/following{/other_user}", "gists_url": "https://api.github.com/users/jtv199/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jtv199", "id": 18300717, "login": "jtv199", "node_id": "MDQ6VXNlcjE4MzAwNzE3", "organizations_url": "https://api.github.com/users/jtv199/orgs", "received_events_url": "https://api.github.com/users/jtv199/received_events", "repos_url": "https://api.github.com/users/jtv199/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jtv199/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jtv199/subscriptions", "type": "User", "url": "https://api.github.com/users/jtv199", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "I have the same problem \r\nIt seems that it only appears when you are using GPU \r\nIt seems to work fine with the 2.17 version though", "Same here.", "> I have the same problem\r\n> It seems that it only appears when you are using GPU\r\n> It seems to work fine with the 2.17 version though\r\n\r\nI downgraded from 2.18 to 2.17, and it works with CPU/GPU .. except now pyarrow complains\r\n\r\n```\r\n...\r\nFile /opt/conda/lib/python3.10/site-packages/pyarrow/array.pxi:830, in pyarrow.lib._PandasConvertible.to_pandas()\r\n\r\nFile /opt/conda/lib/python3.10/site-packages/pyarrow/table.pxi:3989, in pyarrow.lib.Table._to_pandas()\r\n\r\nImportError: cannot import name table_to_blockmanager\r\n```\r\n\r\nsee also https://www.kaggle.com/competitions/pii-detection-removal-from-educational-data/discussion/487474#2722594", "Solved for me by downgrading `!pip install -U datasets==2.16.0` Works with gpu aswell", "I think you should remain open this issue. It works at the previous version but not the latter versions. It is possible as a bug that the maintainer could take note for.", "> Solved for me by downgrading `!pip install -U datasets==2.16.0` Works with gpu as well\r\n\r\nVerified it's working w/ GPU if I make these 3 updates.\r\n\r\n```\r\ndatasets==2.16.0\r\nfsspec==2023.10.0\r\ngcsfs==2023.10.0\r\n```\r\n\r\nbut the issue shouldn't be closed, this is just a workaround until they get the issue with 2.18.0 resolved.\r\n\r\nSee also: https://www.kaggle.com/competitions/pii-detection-removal-from-educational-data/discussion/487474", "> > Solved for me by downgrading `!pip install -U datasets==2.16.0` Works with gpu as well\r\n> \r\n> Verified it's working w/ GPU if I make these 3 updates.\r\n> \r\n> ```\r\n> datasets==2.16.0\r\n> fsspec==2023.10.0\r\n> gcsfs==2023.10.0\r\n> ```\r\n> \r\n> but the issue shouldn't be closed, this is just a workaround until they get the issue with 2.18.0 resolved.\r\n> \r\n> See also: https://www.kaggle.com/competitions/pii-detection-removal-from-educational-data/discussion/487474\r\n\r\nThis also works for me, thanks", "I am seeing similar error but with pandas while using kaggle kernel. \r\n`---> 38 PANDAS_VERSION = version.parse(importlib.metadata.version(\"pandas\"))\r\nTypeError: expected string or bytes-like object\r\n\r\n`" ]
1970-01-01T00:00:00.000001
1,727
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug When trying to run ``` import datasets print(datasets.__version__) ``` It generates the following error ``` TypeError: expected string or bytes-like object ``` It looks like It cannot find the valid versions of `fsspec` though fsspec version is fine when I checked Via command ``` import fsspec print(fsspec.__version__) ​ # output: 2024.3.1 ``` Detailed crash report ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[1], line 1 ----> 1 import datasets 2 print(datasets.__version__) File /opt/conda/lib/python3.10/site-packages/datasets/__init__.py:18 1 # ruff: noqa 2 # Copyright 2020 The HuggingFace Datasets Authors and the TensorFlow Datasets Authors. 3 # (...) 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 16 __version__ = "2.18.0" ---> 18 from .arrow_dataset import Dataset 19 from .arrow_reader import ReadInstruction 20 from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:66 63 from multiprocess import Pool 64 from tqdm.contrib.concurrent import thread_map ---> 66 from . import config 67 from .arrow_reader import ArrowReader 68 from .arrow_writer import ArrowWriter, OptimizedTypedSequence File /opt/conda/lib/python3.10/site-packages/datasets/config.py:41 39 # Imports 40 DILL_VERSION = version.parse(importlib.metadata.version("dill")) ---> 41 FSSPEC_VERSION = version.parse(importlib.metadata.version("fsspec")) 42 PANDAS_VERSION = version.parse(importlib.metadata.version("pandas")) 43 PYARROW_VERSION = version.parse(importlib.metadata.version("pyarrow")) File /opt/conda/lib/python3.10/site-packages/packaging/version.py:49, in parse(version) 43 """ 44 Parse the given version string and return either a :class:`Version` object 45 or a :class:`LegacyVersion` object depending on if the given version is 46 a valid PEP 440 version or a legacy version. 47 """ 48 try: ---> 49 return Version(version) 50 except InvalidVersion: 51 return LegacyVersion(version) File /opt/conda/lib/python3.10/site-packages/packaging/version.py:264, in Version.__init__(self, version) 261 def __init__(self, version: str) -> None: 262 263 # Validate the version and parse it into pieces --> 264 match = self._regex.search(version) 265 if not match: 266 raise InvalidVersion(f"Invalid version: '{version}'") TypeError: expected string or bytes-like object ``` ### Steps to reproduce the bug 1. run `!pip install -U datasets` on kaggle 2. check datasets is installed via ``` import datasets print(datasets.__version__) ``` ### Expected behavior Expected to print datasets version, like `2.18.0` ### Environment info Running on Kaggle, latest enviornment , here is the notebook https://www.kaggle.com/code/jtv199/mistrial-7b-part2
{ "avatar_url": "https://avatars.githubusercontent.com/u/18300717?v=4", "events_url": "https://api.github.com/users/jtv199/events{/privacy}", "followers_url": "https://api.github.com/users/jtv199/followers", "following_url": "https://api.github.com/users/jtv199/following{/other_user}", "gists_url": "https://api.github.com/users/jtv199/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jtv199", "id": 18300717, "login": "jtv199", "node_id": "MDQ6VXNlcjE4MzAwNzE3", "organizations_url": "https://api.github.com/users/jtv199/orgs", "received_events_url": "https://api.github.com/users/jtv199/received_events", "repos_url": "https://api.github.com/users/jtv199/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jtv199/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jtv199/subscriptions", "type": "User", "url": "https://api.github.com/users/jtv199", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6753/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6753/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6752
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6752/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6752/comments
https://api.github.com/repos/huggingface/datasets/issues/6752/events
https://github.com/huggingface/datasets/issues/6752
2,204,043,839
I_kwDODunzps6DXwo_
6,752
Precision being changed from float16 to float32 unexpectedly
{ "avatar_url": "https://avatars.githubusercontent.com/u/21228908?v=4", "events_url": "https://api.github.com/users/gcervantes8/events{/privacy}", "followers_url": "https://api.github.com/users/gcervantes8/followers", "following_url": "https://api.github.com/users/gcervantes8/following{/other_user}", "gists_url": "https://api.github.com/users/gcervantes8/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gcervantes8", "id": 21228908, "login": "gcervantes8", "node_id": "MDQ6VXNlcjIxMjI4OTA4", "organizations_url": "https://api.github.com/users/gcervantes8/orgs", "received_events_url": "https://api.github.com/users/gcervantes8/received_events", "repos_url": "https://api.github.com/users/gcervantes8/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gcervantes8/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gcervantes8/subscriptions", "type": "User", "url": "https://api.github.com/users/gcervantes8", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "This is because of the formatter (`torch` in this case).\r\nIt defaults to `float32`.\r\n\r\nYou can load it in `float16` using `dataset.set_format(\"torch\", dtype=torch.float16)`." ]
1970-01-01T00:00:00.000001
1,712
null
NONE
null
### Describe the bug I'm loading a HuggingFace Dataset for images. I'm running a preprocessing (map operation) step that runs a few operations, one of them being conversion to float16. The Dataset features also say that the 'img' is of type float16. Whenever I take an image from that HuggingFace Dataset instance, the type turns out to be float32. ### Steps to reproduce the bug ```python import torchvision.transforms.v2 as transforms from datasets import load_dataset dataset = load_dataset('cifar10', split='test') dataset = dataset.with_format("torch") data_transform = transforms.Compose([transforms.Resize((32, 32)), transforms.ToDtype(torch.float16, scale=True), transforms.Normalize([0.5, 0.5, 0.5], [0.5, 0.5, 0.5]), ]) def _preprocess(examples): # Permutes from (BS x H x W x C) to (BS x C x H x W) images = torch.permute(examples['img'], (0, 3, 2, 1)) examples['img'] = data_transform(images) return examples dataset = dataset.map(_preprocess, batched=True, batch_size=8) ``` Now at this point the dataset.features are showing float16 which is great because that's what I want. ```python print(data_loader.features['img']) Sequence(feature=Sequence(feature=Sequence(feature=Value(dtype='float16', id=None), length=-1, id=None), length=-1, id=None), length=-1, id=None) ``` But when I try to sample an image from this dataloader; I'm getting a float32 image, when I'm expecting float16: ```python print(next(iter(data_loader))['img'].dtype) torch.float32 ``` ### Expected behavior I'm expecting the images loaded after the transformation to stay in float16. ### Environment info - `datasets` version: 2.18.0 - Platform: Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.31 - Python version: 3.10.9 - `huggingface_hub` version: 0.21.4 - PyArrow version: 14.0.2 - Pandas version: 2.0.3 - `fsspec` version: 2023.10.0
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6752/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6752/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6750
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6750/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6750/comments
https://api.github.com/repos/huggingface/datasets/issues/6750/events
https://github.com/huggingface/datasets/issues/6750
2,203,590,658
I_kwDODunzps6DWCAC
6,750
`load_dataset` requires a network connection for local download?
{ "avatar_url": "https://avatars.githubusercontent.com/u/6306695?v=4", "events_url": "https://api.github.com/users/MiroFurtado/events{/privacy}", "followers_url": "https://api.github.com/users/MiroFurtado/followers", "following_url": "https://api.github.com/users/MiroFurtado/following{/other_user}", "gists_url": "https://api.github.com/users/MiroFurtado/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/MiroFurtado", "id": 6306695, "login": "MiroFurtado", "node_id": "MDQ6VXNlcjYzMDY2OTU=", "organizations_url": "https://api.github.com/users/MiroFurtado/orgs", "received_events_url": "https://api.github.com/users/MiroFurtado/received_events", "repos_url": "https://api.github.com/users/MiroFurtado/repos", "site_admin": false, "starred_url": "https://api.github.com/users/MiroFurtado/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MiroFurtado/subscriptions", "type": "User", "url": "https://api.github.com/users/MiroFurtado", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "Are you using `HF_DATASETS_OFFLINE=1` ?", "> Are you using `HF_DATASETS_OFFLINE=1` ?\r\n\r\nThis doesn't work for me. `datasets=2.18.0`\r\n\r\n`test.py`:\r\n```\r\nimport datasets\r\n\r\ndatasets.utils.logging.set_verbosity_info()\r\n\r\nds = datasets.load_dataset('C-MTEB/AFQMC', revision='b44c3b011063adb25877c13823db83bb193913c4')\r\n\r\nprint(ds)\r\n```\r\n\r\nrun `python test.py`\r\n```\r\nGenerating dataset afqmc (/home/data/.cache/huggingface/datasets/C-MTEB___afqmc/default/0.0.0/b44c3b011063adb25877c13823db83bb193913c4)\r\nDownloading and preparing dataset afqmc/default to /home/data/.cache/huggingface/datasets/C-MTEB___afqmc/default/0.0.0/b44c3b011063adb25877c13823db83bb193913c4...\r\nDataset not on Hf google storage. Downloading and preparing it from source\r\nhf://datasets/C-MTEB/AFQMC@b44c3b011063adb25877c13823db83bb193913c4/data/validation-00000-of-00001-b8fc393b5ddedac7.parquet not found in cache or force_download set to True, downloading to /home/data/.cache/huggingface/datasets/downloads/78949f93104662359f4f3d5a2f7ec1ae37af5a5af44420a51212ea08c0be966b.incomplete\r\nDownloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 240k/240k [00:01<00:00, 178kB/s]\r\nstoring hf://datasets/C-MTEB/AFQMC@b44c3b011063adb25877c13823db83bb193913c4/data/validation-00000-of-00001-b8fc393b5ddedac7.parquet in cache at /home/data/.cache/huggingface/datasets/downloads/78949f93104662359f4f3d5a2f7ec1ae37af5a5af44420a51212ea08c0be966b\r\ncreating metadata file for /home/data/.cache/huggingface/datasets/downloads/78949f93104662359f4f3d5a2f7ec1ae37af5a5af44420a51212ea08c0be966b\r\nDownloading took 0.0 min\r\nChecksum Computation took 0.0 min\r\nGenerating test split\r\nGenerating test split: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3861/3861 [00:00<00:00, 3972.00 examples/s]\r\nGenerating train split\r\nGenerating train split: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 34334/34334 [00:00<00:00, 34355.50 examples/s]\r\nGenerating validation split\r\nGenerating validation split: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4316/4316 [00:00<00:00, 4477.00 examples/s]\r\nAll the splits matched successfully.\r\nDataset afqmc downloaded and prepared to /home/data/.cache/huggingface/datasets/C-MTEB___afqmc/default/0.0.0/b44c3b011063adb25877c13823db83bb193913c4. Subsequent calls will reuse this data.\r\nDatasetDict({\r\n test: Dataset({\r\n features: ['sentence1', 'sentence2', 'score', 'idx'],\r\n num_rows: 3861\r\n })\r\n train: Dataset({\r\n features: ['sentence1', 'sentence2', 'score', 'idx'],\r\n num_rows: 34334\r\n })\r\n validation: Dataset({\r\n features: ['sentence1', 'sentence2', 'score', 'idx'],\r\n num_rows: 4316\r\n })\r\n})\r\n```\r\n\r\nThen run `HF_DATASETS_OFFLINE=1 python test.py`\r\n```\r\nTraceback (most recent call last):\r\n File \"test.py\", line 9, in <module>\r\n ds = datasets.load_dataset('C-MTEB/AFQMC', revision='b44c3b011063adb25877c13823db83bb193913c4')\r\n File \"/dev/shm/tmp_env/lib/python3.10/site-packages/datasets/load.py\", line 2556, in load_dataset\r\n builder_instance = load_dataset_builder(\r\n File \"/dev/shm/tmp_env/lib/python3.10/site-packages/datasets/load.py\", line 2228, in load_dataset_builder\r\n dataset_module = dataset_module_factory(\r\n File \"/dev/shm/tmp_env/lib/python3.10/site-packages/datasets/load.py\", line 1871, in dataset_module_factory\r\n raise ConnectionError(f\"Couldn't reach the Hugging Face Hub for dataset '{path}': {e1}\") from None\r\nConnectionError: Couldn't reach the Hugging Face Hub for dataset 'C-MTEB/AFQMC': Offline mode is enabled.\r\n```\r\n\r\n", "I was having similar inexplicable issues.\r\n\r\nDoing this I *think* helped, but, `datasets` still *clearly* does not want to respect the cache:\r\n\r\n```python\r\npip install --upgrade datasets # now it is 2.18.0\r\nHF_DATASETS_OFFLINE=\"1\" python blah.py\r\n```\r\n\r\nOr similarly, I must spacify that env var to resuse the cache, IE, no arg to `load_dataset` helps it reuse the cache:\r\n\r\n```python\r\n\r\nimport os\r\nos.environ[\"HF_DATASETS_OFFLINE\"] = \"1\"\r\n\r\nimport logging\r\nlogging.basicConfig(level=logging.DEBUG)\r\n\r\nimport datasets\r\n# >>> datasets.__version__\r\n# '2.18.0'\r\n\r\ndatasets.utils.logging.set_verbosity_info()\r\ndata = datasets.load_dataset(\"c-s-ale/dolly-15k-instruction-alpaca-format\")\r\n```" ]
1970-01-01T00:00:00.000001
1,713
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug Hi all - I see that in the past a network dependency has been mistakenly introduced into `load_dataset` even for local loads. Is it possible this has happened again? ### Steps to reproduce the bug ``` >>> import datasets >>> datasets.load_dataset("hh-rlhf") Repo card metadata block was not found. Setting CardData to empty. *hangs bc i'm firewalled* ```` stack trace from ctrl-c: ``` ^CTraceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/jobuser/.local/lib/python3.10/site-packages/datasets/load.py", line 2582, in load_dataset builder_instance.download_and_prepare( output_path = get_from_cache( [0/122] File "/home/jobuser/.local/lib/python3.10/site-packages/datasets/utils/file_utils.py", line 532, in get_from_cache response = http_head( File "/home/jobuser/.local/lib/python3.10/site-packages/datasets/utils/file_utils.py", line 419, in http_head response = _request_with_retry( File "/home/jobuser/.local/lib/python3.10/site-packages/datasets/utils/file_utils.py", line 304, in _request_with_retry response = requests.request(method=method.upper(), url=url, timeout=timeout, **params) File "/home/jobuser/build/lipy-flytekit-image/environments/satellites/python/lib/python3.10/site-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, **kwargs) File "/home/jobuser/build/lipy-flytekit-image/environments/satellites/python/lib/python3.10/site-packages/requests/sessions.py", line 587, in request resp = self.send(prep, **send_kwargs) File "/home/jobuser/build/lipy-flytekit-image/environments/satellites/python/lib/python3.10/site-packages/requests/sessions.py", line 701, in send r = adapter.send(request, **kwargs) File "/home/jobuser/build/lipy-flytekit-image/environments/satellites/python/lib/python3.10/site-packages/requests/adapters.py", line 487, in send resp = conn.urlopen( File "/home/jobuser/build/lipy-flytekit-image/environments/satellites/python/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "/home/jobuser/build/lipy-flytekit-image/environments/satellites/python/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request self._validate_conn(conn) File "/home/jobuser/build/lipy-flytekit-image/environments/satellites/python/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn conn.connect() File "/home/jobuser/build/lipy-flytekit-image/environments/satellites/python/lib/python3.10/site-packages/urllib3/connection.py", line 363, in connect self.sock = conn = self._new_conn() File "/home/jobuser/build/lipy-flytekit-image/environments/satellites/python/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( File "/home/jobuser/build/lipy-flytekit-image/environments/satellites/python/lib/python3.10/site-packages/urllib3/util/connection.py", line 85, in create_connection sock.connect(sa) KeyboardInterrupt ``` ### Expected behavior loads the dataset ### Environment info ``` > pip show datasets Name: datasets Version: 2.18.0 ``` Python 3.10.2
{ "avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4", "events_url": "https://api.github.com/users/lhoestq/events{/privacy}", "followers_url": "https://api.github.com/users/lhoestq/followers", "following_url": "https://api.github.com/users/lhoestq/following{/other_user}", "gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lhoestq", "id": 42851186, "login": "lhoestq", "node_id": "MDQ6VXNlcjQyODUxMTg2", "organizations_url": "https://api.github.com/users/lhoestq/orgs", "received_events_url": "https://api.github.com/users/lhoestq/received_events", "repos_url": "https://api.github.com/users/lhoestq/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions", "type": "User", "url": "https://api.github.com/users/lhoestq", "user_view_type": "public" }
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/huggingface/datasets/issues/6750/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6750/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6748
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6748/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6748/comments
https://api.github.com/repos/huggingface/datasets/issues/6748/events
https://github.com/huggingface/datasets/issues/6748
2,201,517,348
I_kwDODunzps6DOH0k
6,748
Strange slicing behavior
{ "avatar_url": "https://avatars.githubusercontent.com/u/20135317?v=4", "events_url": "https://api.github.com/users/Luciennnnnnn/events{/privacy}", "followers_url": "https://api.github.com/users/Luciennnnnnn/followers", "following_url": "https://api.github.com/users/Luciennnnnnn/following{/other_user}", "gists_url": "https://api.github.com/users/Luciennnnnnn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Luciennnnnnn", "id": 20135317, "login": "Luciennnnnnn", "node_id": "MDQ6VXNlcjIwMTM1MzE3", "organizations_url": "https://api.github.com/users/Luciennnnnnn/orgs", "received_events_url": "https://api.github.com/users/Luciennnnnnn/received_events", "repos_url": "https://api.github.com/users/Luciennnnnnn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Luciennnnnnn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Luciennnnnnn/subscriptions", "type": "User", "url": "https://api.github.com/users/Luciennnnnnn", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "As explained in the [docs](https://huggingface.co/docs/datasets/v2.18.0/en/access#slicing), slicing a `Dataset` returns a dictionary that maps its column names to their values. So, `len(dataset[:300])=2` is expected, assuming your dataset has 2 columns (the returned dict has 2 keys, but each value in the dict has 300 items).\r\n` " ]
1970-01-01T00:00:00.000001
1,711
null
NONE
null
### Describe the bug I have loaded a dataset, and then slice first 300 samples using `:` ops, however, the resulting dataset is not expected, as the output below: ```bash len(dataset)=1050324 len(dataset[:300])=2 len(dataset[0:300])=2 len(dataset.select(range(300)))=300 ``` ### Steps to reproduce the bug load a dataset then: ```bash dataset = load_from_disk(args.train_data_dir) print(f"{len(dataset)=}", flush=True) print(f"{len(dataset[:300])=}", flush=True) print(f"{len(dataset[0:300])=}", flush=True) print(f"{len(dataset.select(range(300)))=}", flush=True) ``` ### Expected behavior ```bash len(dataset)=1050324 len(dataset[:300])=300 len(dataset[0:300])=300 len(dataset.select(range(300)))=300 ``` ### Environment info - `datasets` version: 2.16.1 - Platform: Linux-5.15.0-60-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - `huggingface_hub` version: 0.20.2 - PyArrow version: 10.0.1 - Pandas version: 1.5.3 - `fsspec` version: 2023.10.0
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6748/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6748/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6746
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6746/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6746/comments
https://api.github.com/repos/huggingface/datasets/issues/6746/events
https://github.com/huggingface/datasets/issues/6746
2,198,993,949
I_kwDODunzps6DEfwd
6,746
ExpectedMoreSplits error when loading C4 dataset
{ "avatar_url": "https://avatars.githubusercontent.com/u/65165345?v=4", "events_url": "https://api.github.com/users/billwang485/events{/privacy}", "followers_url": "https://api.github.com/users/billwang485/followers", "following_url": "https://api.github.com/users/billwang485/following{/other_user}", "gists_url": "https://api.github.com/users/billwang485/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/billwang485", "id": 65165345, "login": "billwang485", "node_id": "MDQ6VXNlcjY1MTY1MzQ1", "organizations_url": "https://api.github.com/users/billwang485/orgs", "received_events_url": "https://api.github.com/users/billwang485/received_events", "repos_url": "https://api.github.com/users/billwang485/repos", "site_admin": false, "starred_url": "https://api.github.com/users/billwang485/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/billwang485/subscriptions", "type": "User", "url": "https://api.github.com/users/billwang485", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "Hi ! We updated the `allenai/c4` repository to allow people to specify which language to load easily (the the [c4 dataset page](https://huggingface.co/datasets/allenai/c4))\r\n\r\nTo fix this issue **you can update** `datasets` and remove the mention of the legacy configuration name \"allenai--c4\":\r\n\r\n```python\r\ntraindata = load_dataset('allenai/c4', data_files={'train': 'en/c4-train.00000-of-01024.json.gz'}, split='train')\r\nvaldata = load_dataset('allenai/c4', data_files={'validation': 'en/c4-validation.00000-of-00008.json.gz'}, split='validation')\r\n```", "Did you solve this problem?I have the same bug.It is no use to delete \"allenai--c4\".", "Did you solve it? I met this problem too.", "But after I romove allenai--c4,it still fails", "For me it works this way. I'm using datasets version 2.17.0", "First, pip install --upgrade datasets.\r\nSecond, Update the following two lines of code in data.py (in lib)\r\ntraindata = load_dataset('allenai/c4', data_files={'train': 'en/c4-train.00000-of-01024.json.gz'}, split='train')\r\nvaldata = load_dataset('allenai/c4', data_files={'validation': 'en/c4-validation.00000-of-00008.json.gz'}, split='validation')", "The error is in the Wanda repository: https://github.com/locuslab/wanda\r\n- https://github.com/locuslab/wanda/issues/57\r\n\r\nConcretely, in these code lines:\r\nhttps://github.com/locuslab/wanda/blob/8e8fc87b4a2f9955baa7e76e64d5fce7fa8724a6/lib/data.py#L43-L44\r\n\r\nPlease report there and/or make the fix in their code.", "> traindata = load_dataset('allenai/c4', data_files={'train': 'en/c4-train.00000-of-01024.json.gz'}, split='train')\r\n> valdata = load_dataset('allenai/c4', data_files={'validation': 'en/c4-validation.00000-of-00008.json.gz'}, split='validation')\r\n\r\nSolved for me ! Thanks!" ]
1970-01-01T00:00:00.000001
1,726
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug I encounter bug when running the example command line ```python python main.py \ --model decapoda-research/llama-7b-hf \ --prune_method wanda \ --sparsity_ratio 0.5 \ --sparsity_type unstructured \ --save out/llama_7b/unstructured/wanda/ ``` The bug occurred at these lines of code (when loading c4 dataset) ```python traindata = load_dataset('allenai/c4', 'allenai--c4', data_files={'train': 'en/c4-train.00000-of-01024.json.gz'}, split='train') valdata = load_dataset('allenai/c4', 'allenai--c4', data_files={'validation': 'en/c4-validation.00000-of-00008.json.gz'}, split='validation') ``` The error message states: ``` raise ExpectedMoreSplits(str(set(expected_splits) - set(recorded_splits))) datasets.utils.info_utils.ExpectedMoreSplits: {'validation'} ``` ### Steps to reproduce the bug 1. I encounter bug when running the example command line ### Expected behavior The error message states: ``` raise ExpectedMoreSplits(str(set(expected_splits) - set(recorded_splits))) datasets.utils.info_utils.ExpectedMoreSplits: {'validation'} ``` ### Environment info I'm using cuda 12.4, so I use ```pip install pytorch``` instead of conda provided in install.md Also, I've tried another environment using the same commands in install.md, but the same bug occured
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6746/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6746/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6745
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6745/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6745/comments
https://api.github.com/repos/huggingface/datasets/issues/6745/events
https://github.com/huggingface/datasets/issues/6745
2,198,541,732
I_kwDODunzps6DCxWk
6,745
Scraping the whole of github including private repos is bad; kindly stop
{ "avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4", "events_url": "https://api.github.com/users/ghost/events{/privacy}", "followers_url": "https://api.github.com/users/ghost/followers", "following_url": "https://api.github.com/users/ghost/following{/other_user}", "gists_url": "https://api.github.com/users/ghost/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ghost", "id": 10137, "login": "ghost", "node_id": "MDQ6VXNlcjEwMTM3", "organizations_url": "https://api.github.com/users/ghost/orgs", "received_events_url": "https://api.github.com/users/ghost/received_events", "repos_url": "https://api.github.com/users/ghost/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ghost/subscriptions", "type": "User", "url": "https://api.github.com/users/ghost", "user_view_type": "public" }
[ { "color": "a2eeef", "default": true, "description": "New feature or request", "id": 1935892871, "name": "enhancement", "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement" } ]
closed
false
null
[]
null
[ "It's not twitter here" ]
1970-01-01T00:00:00.000001
1,711
1970-01-01T00:00:00.000001
NONE
null
### Feature request https://github.com/bigcode-project/opt-out-v2 - opt out is not consent. kindly quit this ridiculous nonsense. ### Motivation [EDITED: insults not tolerated] ### Your contribution [EDITED: insults not tolerated]
{ "avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4", "events_url": "https://api.github.com/users/lhoestq/events{/privacy}", "followers_url": "https://api.github.com/users/lhoestq/followers", "following_url": "https://api.github.com/users/lhoestq/following{/other_user}", "gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lhoestq", "id": 42851186, "login": "lhoestq", "node_id": "MDQ6VXNlcjQyODUxMTg2", "organizations_url": "https://api.github.com/users/lhoestq/orgs", "received_events_url": "https://api.github.com/users/lhoestq/received_events", "repos_url": "https://api.github.com/users/lhoestq/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions", "type": "User", "url": "https://api.github.com/users/lhoestq", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6745/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6745/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6744
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6744/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6744/comments
https://api.github.com/repos/huggingface/datasets/issues/6744/events
https://github.com/huggingface/datasets/issues/6744
2,197,910,168
I_kwDODunzps6DAXKY
6,744
Option to disable file locking
{ "avatar_url": "https://avatars.githubusercontent.com/u/35767167?v=4", "events_url": "https://api.github.com/users/VRehnberg/events{/privacy}", "followers_url": "https://api.github.com/users/VRehnberg/followers", "following_url": "https://api.github.com/users/VRehnberg/following{/other_user}", "gists_url": "https://api.github.com/users/VRehnberg/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/VRehnberg", "id": 35767167, "login": "VRehnberg", "node_id": "MDQ6VXNlcjM1NzY3MTY3", "organizations_url": "https://api.github.com/users/VRehnberg/orgs", "received_events_url": "https://api.github.com/users/VRehnberg/received_events", "repos_url": "https://api.github.com/users/VRehnberg/repos", "site_admin": false, "starred_url": "https://api.github.com/users/VRehnberg/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/VRehnberg/subscriptions", "type": "User", "url": "https://api.github.com/users/VRehnberg", "user_view_type": "public" }
[ { "color": "a2eeef", "default": true, "description": "New feature or request", "id": 1935892871, "name": "enhancement", "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement" } ]
open
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,710
null
NONE
null
### Feature request Commands such as `load_dataset` creates file locks with `filelock.FileLock`. It would be good if there was a way to disable this. ### Motivation File locking doesn't work on all file-systems (in my case NFS mounted Weka). If the `cache_dir` only had small files then it would be possible to point to local disk and the problem would be solved. However, as cache_dir is both where the small info files are written and the processed datasets are put this isn't a feasible solution. Considering https://github.com/huggingface/datasets/issues/6395 I still do think this is something that belongs in HuggingFace. The possibility to control packages separately is valuable. It might be that a user has their dataset on a file-system that doesn't support file-locking while they are using file locking on local disk to control some other type of access. ### Your contribution My suggested solution: ``` diff --git a/src/datasets/utils/_filelock.py b/src/datasets/utils/_filelock.py index 19620e6e..58f41a02 100644 --- a/src/datasets/utils/_filelock.py +++ b/src/datasets/utils/_filelock.py @@ -18,11 +18,15 @@ import os from filelock import FileLock as FileLock_ -from filelock import UnixFileLock +from filelock import SoftFileLock, UnixFileLock from filelock import __version__ as _filelock_version from packaging import version +if os.getenv('HF_USE_SOFTFILELOCK', 'false').lower() in ('true', '1'): + FileLock_ = SoftFileLock + + class FileLock(FileLock_): """ A `filelock.FileLock` initializer that handles long paths. ```
null
{ "+1": 2, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 2, "url": "https://api.github.com/repos/huggingface/datasets/issues/6744/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6744/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6740
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6740/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6740/comments
https://api.github.com/repos/huggingface/datasets/issues/6740/events
https://github.com/huggingface/datasets/issues/6740
2,193,172,074
I_kwDODunzps6CuSZq
6,740
Support for loading geotiff files as a part of the ImageFolder
{ "avatar_url": "https://avatars.githubusercontent.com/u/31362090?v=4", "events_url": "https://api.github.com/users/sunny1401/events{/privacy}", "followers_url": "https://api.github.com/users/sunny1401/followers", "following_url": "https://api.github.com/users/sunny1401/following{/other_user}", "gists_url": "https://api.github.com/users/sunny1401/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sunny1401", "id": 31362090, "login": "sunny1401", "node_id": "MDQ6VXNlcjMxMzYyMDkw", "organizations_url": "https://api.github.com/users/sunny1401/orgs", "received_events_url": "https://api.github.com/users/sunny1401/received_events", "repos_url": "https://api.github.com/users/sunny1401/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sunny1401/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sunny1401/subscriptions", "type": "User", "url": "https://api.github.com/users/sunny1401", "user_view_type": "public" }
[ { "color": "a2eeef", "default": true, "description": "New feature or request", "id": 1935892871, "name": "enhancement", "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement" } ]
closed
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,711
1970-01-01T00:00:00.000001
NONE
null
### Feature request Request for adding rasterio support to load geotiff as a part of ImageFolder, instead of using PIL ### Motivation As of now, there are many datasets in HuggingFace Hub which are predominantly focussed towards RemoteSensing or are from RemoteSensing. The current ImageFolder (if I have understood correctly) uses PIL. This is not really optimized because mostly these datasets have images with many channels and additional metadata. Using PIL makes one loose it unless we provide a custom script. Hence, maybe an API could be added to have this in common? ### Your contribution If the issue is accepted - i can contribute the code, because I would like to have it automated and generalised.
{ "avatar_url": "https://avatars.githubusercontent.com/u/31362090?v=4", "events_url": "https://api.github.com/users/sunny1401/events{/privacy}", "followers_url": "https://api.github.com/users/sunny1401/followers", "following_url": "https://api.github.com/users/sunny1401/following{/other_user}", "gists_url": "https://api.github.com/users/sunny1401/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sunny1401", "id": 31362090, "login": "sunny1401", "node_id": "MDQ6VXNlcjMxMzYyMDkw", "organizations_url": "https://api.github.com/users/sunny1401/orgs", "received_events_url": "https://api.github.com/users/sunny1401/received_events", "repos_url": "https://api.github.com/users/sunny1401/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sunny1401/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sunny1401/subscriptions", "type": "User", "url": "https://api.github.com/users/sunny1401", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6740/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6740/timeline
null
not_planned
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6738
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6738/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6738/comments
https://api.github.com/repos/huggingface/datasets/issues/6738/events
https://github.com/huggingface/datasets/issues/6738
2,192,386,536
I_kwDODunzps6CrSno
6,738
Dict feature is non-nullable while nested dict feature is
{ "avatar_url": "https://avatars.githubusercontent.com/u/16348744?v=4", "events_url": "https://api.github.com/users/polinaeterna/events{/privacy}", "followers_url": "https://api.github.com/users/polinaeterna/followers", "following_url": "https://api.github.com/users/polinaeterna/following{/other_user}", "gists_url": "https://api.github.com/users/polinaeterna/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/polinaeterna", "id": 16348744, "login": "polinaeterna", "node_id": "MDQ6VXNlcjE2MzQ4NzQ0", "organizations_url": "https://api.github.com/users/polinaeterna/orgs", "received_events_url": "https://api.github.com/users/polinaeterna/received_events", "repos_url": "https://api.github.com/users/polinaeterna/repos", "site_admin": false, "starred_url": "https://api.github.com/users/polinaeterna/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/polinaeterna/subscriptions", "type": "User", "url": "https://api.github.com/users/polinaeterna", "user_view_type": "public" }
[ { "color": "d73a4a", "default": true, "description": "Something isn't working", "id": 1935892857, "name": "bug", "node_id": "MDU6TGFiZWwxOTM1ODkyODU3", "url": "https://api.github.com/repos/huggingface/datasets/labels/bug" } ]
closed
false
null
[]
null
[ "It looks like a bug, by default every feature should be nullable.", "I've linked a PR with a fix :)", "@mariosasko awesome thank you!" ]
1970-01-01T00:00:00.000001
1,710
1970-01-01T00:00:00.000001
CONTRIBUTOR
null
When i try to create a `Dataset` object with None values inside a dict column, like this: ```python from datasets import Dataset, Features, Value Dataset.from_dict( { "dict": [{"a": 0, "b": 0}, None], }, features=Features( {"dict": {"a": Value("int16"), "b": Value("int16")}} ) ) ``` i get `ValueError: Got None but expected a dictionary instead`. At the same time, having None in _nested_ dict feature works, for example, this doesn't throw any errors: ```python from datasets import Dataset, Features, Value, Sequence dataset = Dataset.from_dict( { "list_dict": [[{"a": 0, "b": 0}], None], "sequence_dict": [[{"a": 0, "b": 0}], None], }, features=Features({ "list_dict": [{"a": Value("int16"), "b": Value("int16")}], "sequence_dict": Sequence({"a": Value("int16"), "b": Value("int16")}), }) ) ``` Other types of features also seem to be nullable (but I haven't checked all of them). Version of `datasets` is the latest atm (2.18.0) Is this an expected behavior or a bug?
{ "avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4", "events_url": "https://api.github.com/users/mariosasko/events{/privacy}", "followers_url": "https://api.github.com/users/mariosasko/followers", "following_url": "https://api.github.com/users/mariosasko/following{/other_user}", "gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mariosasko", "id": 47462742, "login": "mariosasko", "node_id": "MDQ6VXNlcjQ3NDYyNzQy", "organizations_url": "https://api.github.com/users/mariosasko/orgs", "received_events_url": "https://api.github.com/users/mariosasko/received_events", "repos_url": "https://api.github.com/users/mariosasko/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions", "type": "User", "url": "https://api.github.com/users/mariosasko", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6738/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6738/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6737
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6737/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6737/comments
https://api.github.com/repos/huggingface/datasets/issues/6737/events
https://github.com/huggingface/datasets/issues/6737
2,190,198,425
I_kwDODunzps6Ci8aZ
6,737
Invalid pattern: '**' can only be an entire path component
{ "avatar_url": "https://avatars.githubusercontent.com/u/28976175?v=4", "events_url": "https://api.github.com/users/JPonsa/events{/privacy}", "followers_url": "https://api.github.com/users/JPonsa/followers", "following_url": "https://api.github.com/users/JPonsa/following{/other_user}", "gists_url": "https://api.github.com/users/JPonsa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/JPonsa", "id": 28976175, "login": "JPonsa", "node_id": "MDQ6VXNlcjI4OTc2MTc1", "organizations_url": "https://api.github.com/users/JPonsa/orgs", "received_events_url": "https://api.github.com/users/JPonsa/received_events", "repos_url": "https://api.github.com/users/JPonsa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/JPonsa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/JPonsa/subscriptions", "type": "User", "url": "https://api.github.com/users/JPonsa", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "I couldn't reproduce the issue on my side on MacOS, I guess the issue comes from the recent `fsspec` on Windows.\r\n\r\nCan you try downgrading to `fsspec==2023.9.2` for now ? It would also be great to investigate this and see if we need a fix in `datasets` or `fsspec`", "I had the same issue! \r\nDowngrading to fsspec from 2023.10.0 to 2023.9.2 solved it for me.\r\n\r\n(env: python 3.11.7, datasets version: 2.15.0, Windows 10 22H2, Build 19045.4170)\r\n\r\nThanks a lot!", "Ubuntu 20.04 had the same issue\r\npython 3.9 \r\n\r\nFile \"/home/delight-gpu/Workspace2/azuryl/FLAP/main.py\", line 112, in <module>\r\n main()\r\n File \"/home/delight-gpu/Workspace2/azuryl/FLAP/main.py\", line 85, in main\r\n prune_flap(args, model, tokenizer, device)\r\n File \"/home/delight-gpu/Workspace2/azuryl/FLAP/lib/prune.py\", line 294, in prune_flap\r\n dataloader, _ = get_loaders(\"wikitext2\", nsamples=args.nsamples,seed=args.seed,seqlen=model.seqlen,tokenizer=tokenizer)\r\n File \"/home/delight-gpu/Workspace2/azuryl/FLAP/lib/data.py\", line 159, in get_loaders\r\n return get_wikitext2(nsamples, seed, seqlen, tokenizer)\r\n File \"/home/delight-gpu/Workspace2/azuryl/FLAP/lib/data.py\", line 79, in get_wikitext2\r\n traindata = load_dataset('wikitext', 'wikitext-2-raw-v1', split='train')\r\n File \"/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/datasets/load.py\", line 1767, in load_dataset\r\n builder_instance = load_dataset_builder(\r\n File \"/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/datasets/load.py\", line 1498, in load_dataset_builder\r\n dataset_module = dataset_module_factory(\r\n File \"/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/datasets/load.py\", line 1215, in dataset_module_factory\r\n raise e1 from None\r\n File \"/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/datasets/load.py\", line 1192, in dataset_module_factory\r\n return HubDatasetModuleFactoryWithoutScript(\r\n File \"/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/datasets/load.py\", line 765, in get_module\r\n else get_data_patterns_in_dataset_repository(hfh_dataset_info, self.data_dir)\r\n File \"/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/datasets/data_files.py\", line 675, in get_data_patterns_in_dataset_repository\r\n return _get_data_files_patterns(resolver)\r\n File \"/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/datasets/data_files.py\", line 236, in _get_data_files_patterns\r\n data_files = pattern_resolver(pattern)\r\n File \"/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/datasets/data_files.py\", line 486, in _resolve_single_pattern_in_dataset_repository\r\n glob_iter = [PurePath(filepath) for filepath in fs.glob(PurePath(pattern).as_posix()) if fs.isfile(filepath)]\r\n File \"/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/fsspec/spec.py\", line 606, in glob\r\n pattern = glob_translate(path + (\"/\" if ends_with_sep else \"\"))\r\n File \"/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/fsspec/utils.py\", line 734, in glob_translate\r\n raise ValueError(\r\nValueError: Invalid pattern: '**' can only be an entire path component", "on ubuntu you just need to have the latest `datasets` and `fsspec`\r\n\r\n```\r\npip install -U datasets fsspec\r\n```", "The issue was caused by an incompatibility between the versions of `datasets`, `huggingface-hub` and `fsspec`.\r\n\r\nThe issue was fixed in:\r\n- huggingface-hub-0.21.2: https://github.com/huggingface/huggingface_hub/pull/2056\r\n- and datasets-2.18.0: https://github.com/huggingface/datasets/pull/6687\r\n - datasets-2.19.1 fixed the minimum requirement huggingface-hub >= 0.21.2: https://github.com/huggingface/datasets/pull/6713", "@albertvillanova, thank you for this solution. I encountered the same issue and had to use:\r\n```\r\nconda install -c conda-forge huggingface_hub=0.21.2 datasets=2.19.1\r\n```\r\n\r\nCheers", "Cheers!" ]
1970-01-01T00:00:00.000001
1,721
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug ValueError: Invalid pattern: '**' can only be an entire path component when loading any dataset ### Steps to reproduce the bug import datasets ds = datasets.load_dataset("TokenBender/code_instructions_122k_alpaca_style") ### Expected behavior loading the dataset successfully ### Environment info - `datasets` version: 2.18.0 - Platform: Windows-10-10.0.22631-SP0 - Python version: 3.11.7 - `huggingface_hub` version: 0.20.3 - PyArrow version: 15.0.0 - Pandas version: 2.2.1 - `fsspec` version: 2023.12.2
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 7, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 7, "url": "https://api.github.com/repos/huggingface/datasets/issues/6737/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6737/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6736
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6736/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6736/comments
https://api.github.com/repos/huggingface/datasets/issues/6736/events
https://github.com/huggingface/datasets/issues/6736
2,190,181,422
I_kwDODunzps6Ci4Qu
6,736
Mosaic Streaming (MDS) Support
{ "avatar_url": "https://avatars.githubusercontent.com/u/2498509?v=4", "events_url": "https://api.github.com/users/siddk/events{/privacy}", "followers_url": "https://api.github.com/users/siddk/followers", "following_url": "https://api.github.com/users/siddk/following{/other_user}", "gists_url": "https://api.github.com/users/siddk/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/siddk", "id": 2498509, "login": "siddk", "node_id": "MDQ6VXNlcjI0OTg1MDk=", "organizations_url": "https://api.github.com/users/siddk/orgs", "received_events_url": "https://api.github.com/users/siddk/received_events", "repos_url": "https://api.github.com/users/siddk/repos", "site_admin": false, "starred_url": "https://api.github.com/users/siddk/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/siddk/subscriptions", "type": "User", "url": "https://api.github.com/users/siddk", "user_view_type": "public" }
[ { "color": "a2eeef", "default": true, "description": "New feature or request", "id": 1935892871, "name": "enhancement", "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement" } ]
open
false
null
[]
null
[ "Hi ! that would be great :) Though note that `datasets` doesn't implement format-specific resuming when streaming, so in general I think it's better if users can use the mosaic-streaming library to read their MDS datasets. I wonder if they support `hf://` paths though...\r\n\r\nAnyway for those interested, the code for WebDataset is a single file here: https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/webdataset/webdataset.py.\r\n\r\nIt implements `_split_generators` that downloads files and returns the lists of splits (train/validation/test) and `_split_generators` to generate examples (dicts) from the downloaded files. Streaming is automatically supported by making download steps lazy and by extending `open()` to work with remote URLs." ]
1970-01-01T00:00:00.000001
1,710
null
NONE
null
### Feature request I'm a huge fan of the current HF Datasets `webdataset` integration (especially the built-in streaming support). However, I'd love to upload some robotics and multimodal datasets I've processed for use with [Mosaic Streaming](https://docs.mosaicml.com/projects/streaming/en/stable/), specifically their [MDS Format](https://docs.mosaicml.com/projects/streaming/en/stable/fundamentals/dataset_format.html#mds). Because the shard files have similar semantics to WebDataset, I'm hoping that adding such support won't be too much trouble? ### Motivation One of the downsides with WebDataset is a lack of out-of-the-box determinism (especially for large-scale training and reproducibility), easy job resumption, and the ability to quickly debug / visualize individual examples. Mosaic Streaming provides a [great interface for this out of the box](https://docs.mosaicml.com/projects/streaming/en/stable/#key-features), so I'd love to see it supported in HF Datasets. ### Your contribution Happy to help test things / provide example data. Can potentially submit a PR if maintainers could point me to the necessary WebDataset logic / steps for adding a new streaming format!
null
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/huggingface/datasets/issues/6736/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6736/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6734
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6734/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6734/comments
https://api.github.com/repos/huggingface/datasets/issues/6734/events
https://github.com/huggingface/datasets/issues/6734
2,187,646,694
I_kwDODunzps6CZNbm
6,734
Tokenization slows towards end of dataset
{ "avatar_url": "https://avatars.githubusercontent.com/u/98723285?v=4", "events_url": "https://api.github.com/users/ethansmith2000/events{/privacy}", "followers_url": "https://api.github.com/users/ethansmith2000/followers", "following_url": "https://api.github.com/users/ethansmith2000/following{/other_user}", "gists_url": "https://api.github.com/users/ethansmith2000/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ethansmith2000", "id": 98723285, "login": "ethansmith2000", "node_id": "U_kgDOBeJl1Q", "organizations_url": "https://api.github.com/users/ethansmith2000/orgs", "received_events_url": "https://api.github.com/users/ethansmith2000/received_events", "repos_url": "https://api.github.com/users/ethansmith2000/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ethansmith2000/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ethansmith2000/subscriptions", "type": "User", "url": "https://api.github.com/users/ethansmith2000", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "Hi ! First note that if the dataset is not heterogeneous / shuffled, there might be places in the data with shorter texts that are faster to tokenize.\r\n\r\nMoreover, the way `num_proc` works is by slicing the dataset and passing each slice to a process to run the `map()` function. So at the very end of `map()`, some processes might have finished transforming their slice of data while others are still running, causing the throughput to become lower.", "I did see some comments about how num_proc=None could help and outputting numpy arrays can also help in the docs, but this seems quite odd now dropping down to 1it/s\r\n\r\n```bash\r\nRunning tokenizer on dataset (num_proc=48): 99%|█████████▉| 46048888/46390354 [12:33:30<4:20:32, 21.84 examples/s]\r\nRunning tokenizer on dataset (num_proc=48): 99%|█████████▉| 46049888/46390354 [12:36:11<8:37:59, 10.95 examples/s]\r\nRunning tokenizer on dataset (num_proc=48): 99%|█████████▉| 46050888/46390354 [12:46:35<24:56:56, 3.78 examples/s]\r\nRunning tokenizer on dataset (num_proc=48): 99%|█████████▉| 46051888/46390354 [12:56:43<35:08:10, 2.68 examples/s]\r\nRunning tokenizer on dataset (num_proc=48): 99%|█████████▉| 46052888/46390354 [13:06:58<42:05:41, 2.23 examples/s]\r\nRunning tokenizer on dataset (num_proc=48): 99%|█████████▉| 46053888/46390354 [13:16:01<44:40:18, 2.09 examples/s]\r\nRunning tokenizer on dataset (num_proc=48): 99%|█████████▉| 46054888/46390354 [13:25:11<46:35:28, 2.00 examples/s]\r\nRunning tokenizer on dataset (num_proc=48): 99%|█████████▉| 46055888/46390354 [13:34:23<47:55:34, 1.94 examples/s]\r\n```\r\n\r\n", "@ethansmith2000 Hi, did you solve this problem? I'm strugging with the same problem now." ]
1970-01-01T00:00:00.000001
1,712
null
NONE
null
### Describe the bug Mapped tokenization slows down substantially towards end of dataset. train set started off very slow, caught up to 20k then tapered off til the end. what's particularly strange is that the tokenization crashed a few times before due to errors with invalid tokens somewhere or corrupted downloads, and the speed ups/downs consistently happened the same times ```bash Running tokenizer on dataset (num_proc=48): 0%| | 847000/881416735 [12:18<252:45:45, 967.72 examples/s] Running tokenizer on dataset (num_proc=48): 0%| | 848000/881416735 [12:19<224:16:10, 1090.66 examples/s] Running tokenizer on dataset (num_proc=48): 10%|▉ | 84964000/881416735 [3:48:00<11:21:34, 19476.01 examples/s] Running tokenizer on dataset (num_proc=48): 10%|▉ | 84967000/881416735 [3:48:00<12:04:01, 18333.79 examples/s] Running tokenizer on dataset (num_proc=48): 61%|██████ | 538631977/881416735 [13:46:40<27:50:04, 3420.84 examples/s] Running tokenizer on dataset (num_proc=48): 61%|██████ | 538632977/881416735 [13:46:40<23:48:20, 3999.77 examples/s] Running tokenizer on dataset (num_proc=48): 100%|█████████▉| 881365886/881416735 [38:30:19<04:34, 185.10 examples/s] Running tokenizer on dataset (num_proc=48): 100%|█████████▉| 881366886/881416735 [38:30:25<04:36, 180.57 examples/s] ``` and validation set as well ```bash Running tokenizer on dataset (num_proc=48): 90%|████████▉ | 41544000/46390354 [28:44<02:37, 30798.76 examples/s] Running tokenizer on dataset (num_proc=48): 90%|████████▉ | 41550000/46390354 [28:44<02:08, 37698.08 examples/s] Running tokenizer on dataset (num_proc=48): 96%|█████████▋| 44747422/46390354 [2:15:48<12:22:44, 36.87 examples/s] Running tokenizer on dataset (num_proc=48): 96%|█████████▋| 44747422/46390354 [2:16:00<12:22:44, 36.87 examples/s] ``` ### Steps to reproduce the bug using the following kwargs ```python with accelerator.main_process_first(): lm_datasets = tokenized_datasets.map( group_texts, batched=True, num_proc=48 load_from_cache_file=True, desc=f"Grouping texts in chunks of {block_size}", ) ``` running through slurm script ```bash #SBATCH --partition=gpu-nvidia-a100 #SBATCH --nodes=1 #SBATCH --ntasks=1 #SBATCH --gpus-per-task=8 #SBATCH --cpus-per-task=96 ``` using this dataset https://huggingface.co/datasets/togethercomputer/RedPajama-Data-1T ### Expected behavior Constant speed throughout ### Environment info - `datasets` version: 2.15.0 - Platform: Linux-5.15.0-1049-aws-x86_64-with-glibc2.10 - Python version: 3.8.18 - `huggingface_hub` version: 0.19.4 - PyArrow version: 14.0.1 - Pandas version: 2.0.3 - `fsspec` version: 2023.10.0
null
{ "+1": 2, "-1": 0, "confused": 0, "eyes": 1, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 3, "url": "https://api.github.com/repos/huggingface/datasets/issues/6734/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6734/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6733
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6733/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6733/comments
https://api.github.com/repos/huggingface/datasets/issues/6733/events
https://github.com/huggingface/datasets/issues/6733
2,186,811,724
I_kwDODunzps6CWBlM
6,733
EmptyDatasetError when loading dataset downloaded with HuggingFace cli
{ "avatar_url": "https://avatars.githubusercontent.com/u/77196999?v=4", "events_url": "https://api.github.com/users/StwayneXG/events{/privacy}", "followers_url": "https://api.github.com/users/StwayneXG/followers", "following_url": "https://api.github.com/users/StwayneXG/following{/other_user}", "gists_url": "https://api.github.com/users/StwayneXG/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/StwayneXG", "id": 77196999, "login": "StwayneXG", "node_id": "MDQ6VXNlcjc3MTk2OTk5", "organizations_url": "https://api.github.com/users/StwayneXG/orgs", "received_events_url": "https://api.github.com/users/StwayneXG/received_events", "repos_url": "https://api.github.com/users/StwayneXG/repos", "site_admin": false, "starred_url": "https://api.github.com/users/StwayneXG/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/StwayneXG/subscriptions", "type": "User", "url": "https://api.github.com/users/StwayneXG", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "Hi! `datasets` is not compatible with `huggingface_hub`'s cache structure, hence the error.\r\n\r\nYou can track https://github.com/huggingface/datasets/issues/5080 to get notified when this is implemented." ]
1970-01-01T00:00:00.000001
1,710
null
NONE
null
### Describe the bug I am using a cluster that does not have access to the internet when given a job. I tried downloading the dataset using the huggingface-cli command and then loading it with load_dataset but I get an error: ```raise EmptyDatasetError(f"The directory at {base_path} doesn't contain any data files") from None``` The dataset I'm using is "lmsys/chatbot_arena_conversations". The folder structure is - README.md - data - train-00000-of-00001-cced8514c7ed782a.parquet ### Steps to reproduce the bug 1. Download dataset using HuggingFace CLI: ```huggingface-cli download lmsys/chatbot_arena_conversations --local-dir ./lmsys/chatbot_arena_conversations``` 2. In Python ``` from datasets import load_dataset load_dataset("lmsys/chatbot_arena_conversations") ``` ### Expected behavior Should return a Dataset Dict in the form of ``` DatasetDict({ train: Dataset({ features: [...], num_rows: 33,000 }) }) ``` ### Environment info Python 3.11.5 Datasets 2.18.0 Transformers 4.38.2 Pytorch 2.2.0 Pyarrow 15.0.1 Rocky Linux release 8.9 (Green Obsidian)
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6733/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6733/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6731
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6731/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6731/comments
https://api.github.com/repos/huggingface/datasets/issues/6731/events
https://github.com/huggingface/datasets/issues/6731
2,182,844,673
I_kwDODunzps6CG5EB
6,731
Unexpected behavior when using load_dataset with streaming=True in a for loop
{ "avatar_url": "https://avatars.githubusercontent.com/u/42908296?v=4", "events_url": "https://api.github.com/users/uApiv/events{/privacy}", "followers_url": "https://api.github.com/users/uApiv/followers", "following_url": "https://api.github.com/users/uApiv/following{/other_user}", "gists_url": "https://api.github.com/users/uApiv/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/uApiv", "id": 42908296, "login": "uApiv", "node_id": "MDQ6VXNlcjQyOTA4Mjk2", "organizations_url": "https://api.github.com/users/uApiv/orgs", "received_events_url": "https://api.github.com/users/uApiv/received_events", "repos_url": "https://api.github.com/users/uApiv/repos", "site_admin": false, "starred_url": "https://api.github.com/users/uApiv/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/uApiv/subscriptions", "type": "User", "url": "https://api.github.com/users/uApiv", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "This is normal behavior in python when using `lambda`: the `i` defined in your `lambda` refers to the global variable `i` in your loop, and `i` equals to `1` when you run your `for e in res[0]` line.\r\n\r\nYou should pass `fn_kwargs` that will be passed to your `lambda` instead of using the global variable:\r\n\r\n```python\r\nfrom datasets import load_dataset\r\n\r\nres=[]\r\nfor i in [0,1]:\r\n di = load_dataset(\r\n \"json\", \r\n data_files='path_to.json', \r\n split='train',\r\n streaming=True, \r\n ).map(lambda x, source: {\"source\": source}, fn_kwargs={\"source\": i})\r\n\r\n res.append(di)\r\n\r\nfor e in res[0]:\r\n print(e)\r\n```\r\n\r\nThis doesn't happen in non-streaming since in that case `map` is executed while the variable `i` has the right value. In streaming mode, `map` is executed on-the-fly when you iterate on the dataset.", "Thank you very much for your answer. I think this issue can be closed now." ]
1970-01-01T00:00:00.000001
1,713
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug ### My Code ``` from datasets import load_dataset res=[] for i in [0,1]: di=load_dataset( "json", data_files='path_to.json', split='train', streaming=True, ).map(lambda x: {"source": i}) res.append(di) for e in res[0]: print(e) ``` ### Unexpected Behavior Data in `res[0]` has `source=1`. However the expected value is 0. ### FYI I further switch `streaming` to `False`. And the output value is as expected (0). So there may exist bugs in setting `streaming=True` in a for loop. ### Environment Python 3.8.0 datasets==2.18.0 transformers==4.28.1 ### Steps to reproduce the bug 1. Create a Json file with any content. 2. Run the provided code. 3. Switch `streaming` to `False` and run again to see the expected behavior. ### Expected behavior The expected behavior is the data are mapped with its corresponding value in the for loop. ### Environment info Python 3.8.0 datasets==2.18.0 transformers==4.28.1 Ubuntu 20.04
{ "avatar_url": "https://avatars.githubusercontent.com/u/42908296?v=4", "events_url": "https://api.github.com/users/uApiv/events{/privacy}", "followers_url": "https://api.github.com/users/uApiv/followers", "following_url": "https://api.github.com/users/uApiv/following{/other_user}", "gists_url": "https://api.github.com/users/uApiv/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/uApiv", "id": 42908296, "login": "uApiv", "node_id": "MDQ6VXNlcjQyOTA4Mjk2", "organizations_url": "https://api.github.com/users/uApiv/orgs", "received_events_url": "https://api.github.com/users/uApiv/received_events", "repos_url": "https://api.github.com/users/uApiv/repos", "site_admin": false, "starred_url": "https://api.github.com/users/uApiv/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/uApiv/subscriptions", "type": "User", "url": "https://api.github.com/users/uApiv", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6731/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6731/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6729
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6729/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6729/comments
https://api.github.com/repos/huggingface/datasets/issues/6729/events
https://github.com/huggingface/datasets/issues/6729
2,180,237,159
I_kwDODunzps6B88dn
6,729
Support zipfiles that span multiple disks?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1676121?v=4", "events_url": "https://api.github.com/users/severo/events{/privacy}", "followers_url": "https://api.github.com/users/severo/followers", "following_url": "https://api.github.com/users/severo/following{/other_user}", "gists_url": "https://api.github.com/users/severo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/severo", "id": 1676121, "login": "severo", "node_id": "MDQ6VXNlcjE2NzYxMjE=", "organizations_url": "https://api.github.com/users/severo/orgs", "received_events_url": "https://api.github.com/users/severo/received_events", "repos_url": "https://api.github.com/users/severo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/severo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/severo/subscriptions", "type": "User", "url": "https://api.github.com/users/severo", "user_view_type": "public" }
[ { "color": "a2eeef", "default": true, "description": "New feature or request", "id": 1935892871, "name": "enhancement", "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement" }, { "color": "d876e3", "default": true, "description": "Further information is requested", "id": 1935892912, "name": "question", "node_id": "MDU6TGFiZWwxOTM1ODkyOTEy", "url": "https://api.github.com/repos/huggingface/datasets/labels/question" } ]
closed
false
null
[]
null
[ "@severo were you able to solve it?", "No. cc @albertvillanova @lhoestq @polinaeterna for an evaluation of what it would take to support this feature.", "The underlying issue issue is that the dataset repository has used split ZIP archive files: https://huggingface.co/datasets/PhilEO-community/PhilEO-downstream/tree/main/data\r\n```\r\ndownstream_dataset_patches_npzip.z01\r\ndownstream_dataset_patches_npzip.z02\r\n...\r\ndownstream_dataset_patches_npzip.zip\r\n```\r\nand these are not supported by the Python standard library package `zipfile`.", "It's a pretty bad way to share a dataset since one needs to download the full dataset to use it.\r\n\r\nWe likely won't support this format.", "I agree it is a format we maybe should not support: streaming is not possible.", "I opened a PR in the reported repo to disable the viewer: https://huggingface.co/datasets/PhilEO-community/PhilEO-downstream/discussions/1" ]
1970-01-01T00:00:00.000001
1,719
1970-01-01T00:00:00.000001
COLLABORATOR
null
See https://huggingface.co/datasets/PhilEO-community/PhilEO-downstream The dataset viewer gives the following error: ``` Error code: ConfigNamesError Exception: BadZipFile Message: zipfiles that span multiple disks are not supported Traceback: Traceback (most recent call last): File "/src/services/worker/src/worker/job_runners/dataset/config_names.py", line 67, in compute_config_names_response get_dataset_config_names( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 347, in get_dataset_config_names dataset_module = dataset_module_factory( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1871, in dataset_module_factory raise e1 from None File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1846, in dataset_module_factory return HubDatasetModuleFactoryWithoutScript( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1240, in get_module module_name, default_builder_kwargs = infer_module_for_data_files( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 584, in infer_module_for_data_files split_modules = { File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 585, in <dictcomp> split: infer_module_for_data_files_list(data_files_list, download_config=download_config) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 526, in infer_module_for_data_files_list return infer_module_for_data_files_list_in_archives(data_files_list, download_config=download_config) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 554, in infer_module_for_data_files_list_in_archives for f in xglob(extracted, recursive=True, download_config=download_config)[ File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 576, in xglob fs, *_ = fsspec.get_fs_token_paths(urlpath, storage_options=storage_options) File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/core.py", line 622, in get_fs_token_paths fs = filesystem(protocol, **inkwargs) File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/registry.py", line 290, in filesystem return cls(**storage_options) File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/spec.py", line 79, in __call__ obj = super().__call__(*args, **kwargs) File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/implementations/zip.py", line 57, in __init__ self.zip = zipfile.ZipFile( File "/usr/local/lib/python3.9/zipfile.py", line 1266, in __init__ self._RealGetContents() File "/usr/local/lib/python3.9/zipfile.py", line 1329, in _RealGetContents endrec = _EndRecData(fp) File "/usr/local/lib/python3.9/zipfile.py", line 286, in _EndRecData return _EndRecData64(fpin, -sizeEndCentDir, endrec) File "/usr/local/lib/python3.9/zipfile.py", line 232, in _EndRecData64 raise BadZipFile("zipfiles that span multiple disks are not supported") zipfile.BadZipFile: zipfiles that span multiple disks are not supported ``` The files (https://huggingface.co/datasets/PhilEO-community/PhilEO-downstream/tree/main/data) are: <img width="629" alt="Capture d’écran 2024-03-11 à 22 07 30" src="https://github.com/huggingface/datasets/assets/1676121/0bb15a51-d54f-4d73-8572-e427ea644b36">
{ "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/albertvillanova", "id": 8515462, "login": "albertvillanova", "node_id": "MDQ6VXNlcjg1MTU0NjI=", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "repos_url": "https://api.github.com/users/albertvillanova/repos", "site_admin": false, "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "type": "User", "url": "https://api.github.com/users/albertvillanova", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6729/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6729/timeline
null
not_planned
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6728
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6728/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6728/comments
https://api.github.com/repos/huggingface/datasets/issues/6728/events
https://github.com/huggingface/datasets/issues/6728
2,178,607,012
I_kwDODunzps6B2uek
6,728
Issue Downloading Certain Datasets After Setting Custom `HF_ENDPOINT`
{ "avatar_url": "https://avatars.githubusercontent.com/u/10057041?v=4", "events_url": "https://api.github.com/users/padeoe/events{/privacy}", "followers_url": "https://api.github.com/users/padeoe/followers", "following_url": "https://api.github.com/users/padeoe/following{/other_user}", "gists_url": "https://api.github.com/users/padeoe/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/padeoe", "id": 10057041, "login": "padeoe", "node_id": "MDQ6VXNlcjEwMDU3MDQx", "organizations_url": "https://api.github.com/users/padeoe/orgs", "received_events_url": "https://api.github.com/users/padeoe/received_events", "repos_url": "https://api.github.com/users/padeoe/repos", "site_admin": false, "starred_url": "https://api.github.com/users/padeoe/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/padeoe/subscriptions", "type": "User", "url": "https://api.github.com/users/padeoe", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "Through debugging, I found a potential solution is to modify the code in the error handling module of `huggingface_hub`: https://github.com/huggingface/huggingface_hub/commit/56d6c798c44e83d2a3167e74c022737d8fcbe822 ", "@Wauplin ", "Thanks for investigating and reporting the bug @padeoe! I've opened a PR in `huggingface_hub` with your suggested fix! :) https://github.com/huggingface/huggingface_hub/pull/2119" ]
1970-01-01T00:00:00.000001
1,710
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug This bug is triggered under the following conditions: - datasets repo ids without organization names trigger errors, such as `bookcorpus`, `gsm8k`, `wikipedia`, rather than in the form of `A/B`. - If `HF_ENDPOINT` is set and the hostname is not in the form of `(hub-ci.)?huggingface.co`. - This issue occurs with `datasets>2.15.0` or `huggingface-hub>0.19.4`. For example, using the latest versions: `datasets==2.18.0` and `huggingface-hub==0.21.4`, ### Steps to reproduce the bug the issue can be reproduced with the following code: 1. install specific datasets and huggingface_hub. ```bash pip install datasets==2.18.0 pip install huggingface_hub==0.21.4 ``` 2. execute python code. ```Python import os os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com' from datasets import load_dataset bookcorpus = load_dataset('bookcorpus', split='train') ``` console output: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/padeoe/.local/lib/python3.10/site-packages/datasets/load.py", line 2556, in load_dataset builder_instance = load_dataset_builder( File "/home/padeoe/.local/lib/python3.10/site-packages/datasets/load.py", line 2228, in load_dataset_builder dataset_module = dataset_module_factory( File "/home/padeoe/.local/lib/python3.10/site-packages/datasets/load.py", line 1879, in dataset_module_factory raise e1 from None File "/home/padeoe/.local/lib/python3.10/site-packages/datasets/load.py", line 1830, in dataset_module_factory with fs.open(f"datasets/{path}/{filename}", "r", encoding="utf-8") as f: File "/home/padeoe/.local/lib/python3.10/site-packages/fsspec/spec.py", line 1295, in open self.open( File "/home/padeoe/.local/lib/python3.10/site-packages/fsspec/spec.py", line 1307, in open f = self._open( File "/home/padeoe/.local/lib/python3.10/site-packages/huggingface_hub/hf_file_system.py", line 228, in _open return HfFileSystemFile(self, path, mode=mode, revision=revision, block_size=block_size, **kwargs) File "/home/padeoe/.local/lib/python3.10/site-packages/huggingface_hub/hf_file_system.py", line 615, in __init__ self.resolved_path = fs.resolve_path(path, revision=revision) File "/home/padeoe/.local/lib/python3.10/site-packages/huggingface_hub/hf_file_system.py", line 180, in resolve_path repo_and_revision_exist, err = self._repo_and_revision_exist(repo_type, repo_id, revision) File "/home/padeoe/.local/lib/python3.10/site-packages/huggingface_hub/hf_file_system.py", line 117, in _repo_and_revision_exist self._api.repo_info(repo_id, revision=revision, repo_type=repo_type) File "/home/padeoe/.local/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/home/padeoe/.local/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 2413, in repo_info return method( File "/home/padeoe/.local/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/home/padeoe/.local/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 2286, in dataset_info hf_raise_for_status(r) File "/home/padeoe/.local/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 362, in hf_raise_for_status raise HfHubHTTPError(str(e), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: 401 Client Error: Unauthorized for url: https://hf-mirror.com/api/datasets/bookcorpus/bookcorpus.py (Request ID: Root=1-65ee8659-5ab10eec5960c63e71f2bb58;b00bdbea-fd6e-4a74-8fe0-bc4682ae090e) ``` ### Expected behavior The dataset was downloaded correctly without any errors. ### Environment info datasets==2.18.0 huggingface-hub==0.21.4
{ "avatar_url": "https://avatars.githubusercontent.com/u/11801849?v=4", "events_url": "https://api.github.com/users/Wauplin/events{/privacy}", "followers_url": "https://api.github.com/users/Wauplin/followers", "following_url": "https://api.github.com/users/Wauplin/following{/other_user}", "gists_url": "https://api.github.com/users/Wauplin/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Wauplin", "id": 11801849, "login": "Wauplin", "node_id": "MDQ6VXNlcjExODAxODQ5", "organizations_url": "https://api.github.com/users/Wauplin/orgs", "received_events_url": "https://api.github.com/users/Wauplin/received_events", "repos_url": "https://api.github.com/users/Wauplin/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Wauplin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Wauplin/subscriptions", "type": "User", "url": "https://api.github.com/users/Wauplin", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6728/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6728/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6726
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6726/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6726/comments
https://api.github.com/repos/huggingface/datasets/issues/6726/events
https://github.com/huggingface/datasets/issues/6726
2,177,097,232
I_kwDODunzps6Bw94Q
6,726
Profiling for HF Filesystem shows there are easy performance gains to be made
{ "avatar_url": "https://avatars.githubusercontent.com/u/159512661?v=4", "events_url": "https://api.github.com/users/awgr/events{/privacy}", "followers_url": "https://api.github.com/users/awgr/followers", "following_url": "https://api.github.com/users/awgr/following{/other_user}", "gists_url": "https://api.github.com/users/awgr/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/awgr", "id": 159512661, "login": "awgr", "node_id": "U_kgDOCYH4VQ", "organizations_url": "https://api.github.com/users/awgr/orgs", "received_events_url": "https://api.github.com/users/awgr/received_events", "repos_url": "https://api.github.com/users/awgr/repos", "site_admin": false, "starred_url": "https://api.github.com/users/awgr/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/awgr/subscriptions", "type": "User", "url": "https://api.github.com/users/awgr", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "FWIW I debugged this while waiting for it to go", "Oh I forgot to mention you can also cache resolve_pattern, and that seemed to also substantially improves things, if you want to load a dataset twice for whatever reason." ]
1970-01-01T00:00:00.000001
1,709
null
NONE
null
### Describe the bug # Let's make it faster First, an evidence... ![image](https://github.com/huggingface/datasets/assets/159512661/a703a82c-43a0-426c-9d99-24c563d70965) Figure 1: CProfile for loading 3 files from cerebras/SlimPajama-627B train split, and 3 files from test split using streaming=True. X axis is 1106 seconds long. See? It's pretty slow. What is resolve pattern doing? ``` resolve_pattern called with **/train/** and hf://datasets/cerebras/SlimPajama-627B@2d0accdd58c5d5511943ca1f5ff0e3eb5e293543 resolve_pattern took 20.815081119537354 seconds ``` Makes sense. How to improve it? ## Bigger project, biggest payoff Databricks (and consequently, spark) store a compressed manifest file of the files contained in the remote filesystem. Then, you download one tiny file, decompress it, and all the operations are local instead of this shenanigans. It seems pretty straightforward to make dataset uploads compute a manifest and upload it alongside their data. This would make resolution time so fast that nobody would ever think about it again. It also means you either need to have the uploader compute it _every time_, or have a hook that computes it. ## Smaller project, immediate payoff: Be diligent in avoiding deepcopy Revise the _ls_tree method to avoid deepcopy: ``` def _ls_tree( self, path: str, recursive: bool = False, refresh: bool = False, revision: Optional[str] = None, expand_info: bool = True, ): ..... omitted ..... for path_info in tree: if isinstance(path_info, RepoFile): cache_path_info = { "name": root_path + "/" + path_info.path, "size": path_info.size, "type": "file", "blob_id": path_info.blob_id, "lfs": path_info.lfs, "last_commit": path_info.last_commit, "security": path_info.security, } else: cache_path_info = { "name": root_path + "/" + path_info.path, "size": 0, "type": "directory", "tree_id": path_info.tree_id, "last_commit": path_info.last_commit, } parent_path = self._parent(cache_path_info["name"]) self.dircache.setdefault(parent_path, []).append(cache_path_info) out.append(cache_path_info) return copy.deepcopy(out) # copy to not let users modify the dircache ``` Observe this deepcopy at the end. It is making a copy of a very simple data structure. We do not need to copy. We can simply generate the data structure twice instead. It will be much faster. ``` def _ls_tree( self, path: str, recursive: bool = False, refresh: bool = False, revision: Optional[str] = None, expand_info: bool = True, ): ..... omitted ..... def make_cache_path_info(path_info): if isinstance(path_info, RepoFile): return { "name": root_path + "/" + path_info.path, "size": path_info.size, "type": "file", "blob_id": path_info.blob_id, "lfs": path_info.lfs, "last_commit": path_info.last_commit, "security": path_info.security, } else: return { "name": root_path + "/" + path_info.path, "size": 0, "type": "directory", "tree_id": path_info.tree_id, "last_commit": path_info.last_commit, } for path_info in tree: cache_path_info = make_cache_path_info(path_info) out_cache_path_info = make_cache_path_info(path_info) # copy to not let users modify the dircache parent_path = self._parent(cache_path_info["name"]) self.dircache.setdefault(parent_path, []).append(cache_path_info) out.append(out_cache_path_info) return out ``` Note there is no longer a deepcopy in this method. We have replaced it with generating the output twice. This is substantially faster. For me, the entire resolution went from 1100s to 360s. ## Medium project, medium payoff After the above change, we have this profile: ![image](https://github.com/huggingface/datasets/assets/159512661/db7b83da-2dfc-4c2e-abab-0ede9477876c) Figure 2: x-axis is 355 seconds. Note that globbing and _ls_tree deep copy is gone. No surprise there. It's much faster now, but we still spend ~187seconds in get_fs_token_paths. Well get_fs_token_paths is part of fsspec. We don't need to fix that because we can trust their developers to write high performance code. Probably the caller has misconfigured something. Let's take a look at the storage_options being provided to the filesystem that is constructed during this call. Ah yes, streaming_download_manager::_prepare_single_hop_path_and_storage_options. We know streaming download manager is not compatible with async right now, but we really need this specific part of the code to be async. We're spending so much time checking isDir on the remote filesystem, it's a huge waste. We can make the call easily 20-30x faster by using async, removing this performance bottleneck almost entirely (and reducing the total time of this part of the code to <30s. There is no reason to block async isDir calls for streaming. I'm not going to mess w/ this one myself; I didn't write the streaming impl, and I don't know how it works, but I know the isDir check can be async. ### Steps to reproduce the bug ``` with cProfile.Profile() as pr: pr.enable() # Begin Data if not os.path.exists(data_cache_dir): os.makedirs(data_cache_dir, exist_ok=True) training_dataset = load_dataset(training_dataset_name, split=training_split, cache_dir=data_cache_dir, streaming=True).take(training_slice) eval_dataset = load_dataset(eval_dataset_name, split=eval_split, cache_dir=data_cache_dir, streaming=True).take(eval_slice) # End Data pr.disable() pr.create_stats() if not os.path.exists(profiling_path): os.makedirs(profiling_path, exist_ok=True) pr.dump_stats(os.path.join(profiling_path, "cprofile.prof")) ``` run this code for "cerebras/SlimPajama-627B" and whatever other params ### Expected behavior Something better. ### Environment info - `datasets` version: 2.18.0 - Platform: Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 - Python version: 3.10.13 - `huggingface_hub` version: 0.21.3 - PyArrow version: 15.0.0 - Pandas version: 2.2.1 - `fsspec` version: 2024.2.0
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 1, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/huggingface/datasets/issues/6726/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6726/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6725
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6725/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6725/comments
https://api.github.com/repos/huggingface/datasets/issues/6725/events
https://github.com/huggingface/datasets/issues/6725
2,175,527,530
I_kwDODunzps6Bq-pq
6,725
Request for a comparison of huggingface datasets compared with other data format especially webdataset
{ "avatar_url": "https://avatars.githubusercontent.com/u/20135317?v=4", "events_url": "https://api.github.com/users/Luciennnnnnn/events{/privacy}", "followers_url": "https://api.github.com/users/Luciennnnnnn/followers", "following_url": "https://api.github.com/users/Luciennnnnnn/following{/other_user}", "gists_url": "https://api.github.com/users/Luciennnnnnn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Luciennnnnnn", "id": 20135317, "login": "Luciennnnnnn", "node_id": "MDQ6VXNlcjIwMTM1MzE3", "organizations_url": "https://api.github.com/users/Luciennnnnnn/orgs", "received_events_url": "https://api.github.com/users/Luciennnnnnn/received_events", "repos_url": "https://api.github.com/users/Luciennnnnnn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Luciennnnnnn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Luciennnnnnn/subscriptions", "type": "User", "url": "https://api.github.com/users/Luciennnnnnn", "user_view_type": "public" }
[ { "color": "a2eeef", "default": true, "description": "New feature or request", "id": 1935892871, "name": "enhancement", "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement" } ]
open
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,709
null
NONE
null
### Feature request Request for a comparison of huggingface datasets compared with other data format especially webdataset ### Motivation I see huggingface datasets uses Apache Arrow as its backend, it seems to be great, but I'm curious about how it is good compared with other dataset format, like webdataset, what's the pros/cons of them. ### Your contribution More information
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6725/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6725/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6724
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6724/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6724/comments
https://api.github.com/repos/huggingface/datasets/issues/6724/events
https://github.com/huggingface/datasets/issues/6724
2,174,398,227
I_kwDODunzps6Bmq8T
6,724
Dataset with loading script does not work in renamed repos
{ "avatar_url": "https://avatars.githubusercontent.com/u/2779410?v=4", "events_url": "https://api.github.com/users/BramVanroy/events{/privacy}", "followers_url": "https://api.github.com/users/BramVanroy/followers", "following_url": "https://api.github.com/users/BramVanroy/following{/other_user}", "gists_url": "https://api.github.com/users/BramVanroy/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/BramVanroy", "id": 2779410, "login": "BramVanroy", "node_id": "MDQ6VXNlcjI3Nzk0MTA=", "organizations_url": "https://api.github.com/users/BramVanroy/orgs", "received_events_url": "https://api.github.com/users/BramVanroy/received_events", "repos_url": "https://api.github.com/users/BramVanroy/repos", "site_admin": false, "starred_url": "https://api.github.com/users/BramVanroy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/BramVanroy/subscriptions", "type": "User", "url": "https://api.github.com/users/BramVanroy", "user_view_type": "public" }
[]
open
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,709
null
CONTRIBUTOR
null
### Describe the bug My data repository was first called `BramVanroy/hplt-mono-v1-2` but I then renamed to use underscores instead of dashes. However, it seems that `datasets` retrieves the old repo name when it checks whether the repo contains data loading scripts in this line. https://github.com/huggingface/datasets/blob/6fb6c834f008996c994b0a86c3808d0a33d44525/src/datasets/load.py#L1845 When I print `filename` it returns `hplt-mono-v1-2.py` but the files in the repo are of course `['.gitattributes', 'README.md', 'hplt_mono_v1_2.py']`. So the `filename` is the original reponame instead of the renamed one. I am not sure if this is a caching issue or not or how I can resolve it. ### Steps to reproduce the bug ``` from datasets import load_dataset ds = load_dataset( "BramVanroy/hplt-mono-v1-2", "ky", trust_remote_code=True ) ``` ### Expected behavior That the most recent repo name is used when `filename` is generated. ### Environment info - `datasets` version: 2.16.1 - Platform: Linux-5.14.0-284.25.1.el9_2.x86_64-x86_64-with-glibc2.34 - Python version: 3.10.13 - `huggingface_hub` version: 0.20.2 - PyArrow version: 14.0.1 - Pandas version: 2.1.3 - `fsspec` version: 2023.10.0
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6724/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6724/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6721
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6721/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6721/comments
https://api.github.com/repos/huggingface/datasets/issues/6721/events
https://github.com/huggingface/datasets/issues/6721
2,173,931,714
I_kwDODunzps6Bk5DC
6,721
Hi,do you know how to load the dataset from local file now?
{ "avatar_url": "https://avatars.githubusercontent.com/u/50232044?v=4", "events_url": "https://api.github.com/users/Gera001/events{/privacy}", "followers_url": "https://api.github.com/users/Gera001/followers", "following_url": "https://api.github.com/users/Gera001/following{/other_user}", "gists_url": "https://api.github.com/users/Gera001/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Gera001", "id": 50232044, "login": "Gera001", "node_id": "MDQ6VXNlcjUwMjMyMDQ0", "organizations_url": "https://api.github.com/users/Gera001/orgs", "received_events_url": "https://api.github.com/users/Gera001/received_events", "repos_url": "https://api.github.com/users/Gera001/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Gera001/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Gera001/subscriptions", "type": "User", "url": "https://api.github.com/users/Gera001", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "\r\n@Gera001\r\n# Loading Dataset from Local Files Using 🤗Hugging Face.\r\n\r\nTo load a dataset from local files using the Hugging Face datasets library, you can use the `load_dataset` function.\r\n\r\n```\r\nfrom datasets import load_dataset\r\ndataset = load_dataset('csv', data_files={'train': 'path/to/train.csv',\r\n 'test': 'path/to/test.csv'})\r\n```\r\n\r\nReference to [HF Datasets docs for loading from local](https://huggingface.co/docs/datasets/en/loading#csv). \r\n\r\n@albertvillanova\r\nthis issue can be closed here.", "like this: from datasets import load_from_disk\r\ndataset = load_from_disk(data_path)\r\n", "@ge00009 \r\n> like this: from datasets import load_from_disk dataset = load_from_disk(data_path)\r\n\r\nLoads a dataset that was previously saved using `save_to_disk()`.\r\n\r\nReference link:\r\nhttps://huggingface.co/docs/datasets/en/package_reference/loading_methods#datasets.load_from_disk.example" ]
1970-01-01T00:00:00.000001
1,711
null
NONE
null
Hi, if I want to load the dataset from local file, then how to specify the configuration name? _Originally posted by @WHU-gentle in https://github.com/huggingface/datasets/issues/2976#issuecomment-1333455222_
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6721/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6721/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6720
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6720/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6720/comments
https://api.github.com/repos/huggingface/datasets/issues/6720/events
https://github.com/huggingface/datasets/issues/6720
2,173,603,459
I_kwDODunzps6Bjo6D
6,720
TypeError: 'str' object is not callable
{ "avatar_url": "https://avatars.githubusercontent.com/u/2779410?v=4", "events_url": "https://api.github.com/users/BramVanroy/events{/privacy}", "followers_url": "https://api.github.com/users/BramVanroy/followers", "following_url": "https://api.github.com/users/BramVanroy/following{/other_user}", "gists_url": "https://api.github.com/users/BramVanroy/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/BramVanroy", "id": 2779410, "login": "BramVanroy", "node_id": "MDQ6VXNlcjI3Nzk0MTA=", "organizations_url": "https://api.github.com/users/BramVanroy/orgs", "received_events_url": "https://api.github.com/users/BramVanroy/received_events", "repos_url": "https://api.github.com/users/BramVanroy/repos", "site_admin": false, "starred_url": "https://api.github.com/users/BramVanroy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/BramVanroy/subscriptions", "type": "User", "url": "https://api.github.com/users/BramVanroy", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "Hi ! I opened a PR to fix an issue in the Features defined in your code\r\n\r\nBasically changing\r\n```python\r\nSequence(\"float32\")\r\n```\r\n\r\nto\r\n```python\r\nSequence(Value(\"float32\"))\r\n```\r\n\r\n\r\nhttps://huggingface.co/datasets/BramVanroy/hplt_mono_v1_2/discussions/1", "D'oh! Was wondering why the `str() is not callable` was in there. Glad the error is my end though, and not related to zstandard (which I had not used in the past).\r\n\r\nThanks a lot!" ]
1970-01-01T00:00:00.000001
1,709
1970-01-01T00:00:00.000001
CONTRIBUTOR
null
### Describe the bug I am trying to get the HPLT datasets on the hub. Downloading/re-uploading would be too time- and resource consuming so I wrote [a dataset loader script](https://huggingface.co/datasets/BramVanroy/hplt_mono_v1_2/blob/main/hplt_mono_v1_2.py). I think I am very close but for some reason I always get the error below. It happens during the clean-up phase where the directory cannot be removed because it is not empty. My only guess would be that this may have to do with zstandard ``` Traceback (most recent call last): File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/builder.py", line 1744, in _prepare_split_single writer.write(example, key) File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 492, in write self.write_examples_on_file() File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 434, in write_examples_on_file if self.schema File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 409, in schema else (pa.schema(self._features.type) if self._features is not None else None) File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/features/features.py", line 1643, in type return get_nested_type(self) File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/features/features.py", line 1209, in get_nested_type {key: get_nested_type(schema[key]) for key in schema} File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/features/features.py", line 1209, in <dictcomp> {key: get_nested_type(schema[key]) for key in schema} File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/features/features.py", line 1221, in get_nested_type value_type = get_nested_type(schema.feature) File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/features/features.py", line 1228, in get_nested_type return schema() TypeError: 'str' object is not callable During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/builder.py", line 1753, in _prepare_split_single num_examples, num_bytes = writer.finalize() File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 588, in finalize self.write_examples_on_file() File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 434, in write_examples_on_file if self.schema File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 409, in schema else (pa.schema(self._features.type) if self._features is not None else None) File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/features/features.py", line 1643, in type return get_nested_type(self) File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/features/features.py", line 1209, in get_nested_type {key: get_nested_type(schema[key]) for key in schema} File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/features/features.py", line 1209, in <dictcomp> {key: get_nested_type(schema[key]) for key in schema} File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/features/features.py", line 1221, in get_nested_type value_type = get_nested_type(schema.feature) File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/features/features.py", line 1228, in get_nested_type return schema() TypeError: 'str' object is not callable The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/builder.py", line 959, in incomplete_dir yield tmp_dir File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/builder.py", line 1005, in download_and_prepare self._download_and_prepare( File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/builder.py", line 1767, in _download_and_prepare super()._download_and_prepare( File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/builder.py", line 1100, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/builder.py", line 1605, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/builder.py", line 1762, in _prepare_split_single raise DatasetGenerationError("An error occurred while generating the dataset") from e datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pricie/vanroy/.config/JetBrains/PyCharm2023.3/scratches/scratch_5.py", line 4, in <module> ds = load_dataset( File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/load.py", line 2549, in load_dataset builder_instance.download_and_prepare( File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/builder.py", line 985, in download_and_prepare with incomplete_dir(self._output_dir) as tmp_output_dir: File "/home/pricie/vanroy/.pyenv/versions/3.10.13/lib/python3.10/contextlib.py", line 153, in __exit__ self.gen.throw(typ, value, traceback) File "/home/local/vanroy/dutch-instruction-datasets/.venv/lib/python3.10/site-packages/datasets/builder.py", line 966, in incomplete_dir shutil.rmtree(tmp_dir) File "/home/pricie/vanroy/.pyenv/versions/3.10.13/lib/python3.10/shutil.py", line 731, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home/pricie/vanroy/.pyenv/versions/3.10.13/lib/python3.10/shutil.py", line 729, in rmtree os.rmdir(path) OSError: [Errno 39] Directory not empty: '/home/pricie/vanroy/.cache/huggingface/datasets/BramVanroy___hplt_mono_v1_2/ky/1.2.0/7ab138629fe7e9e29fe93ce63d809d5ef9d963273b829f61ab538e012dc9cc47.incomplete' ``` Interestingly, though, this directory _does_ appear to be empty: ```shell > cd /home/pricie/vanroy/.cache/huggingface/datasets/BramVanroy___hplt_mono_v1_2/ky/1.2.0/7ab138629fe7e9e29fe93ce63d809d5ef9d963273b829f61ab538e012dc9cc47.incomplete > ls -lah total 0 drwxr-xr-x. 1 vanroy vanroy 0 Mar 7 12:01 . drwxr-xr-x. 1 vanroy vanroy 304 Mar 7 11:52 .. > cd .. > ls 7ab138629fe7e9e29fe93ce63d809d5ef9d963273b829f61ab538e012dc9cc47_builder.lock 7ab138629fe7e9e29fe93ce63d809d5ef9d963273b829f61ab538e012dc9cc47.incomplete ``` ### Steps to reproduce the bug ```python from datasets import load_dataset ds = load_dataset( "BramVanroy/hplt_mono_v1_2", "ky", trust_remote_code=True ) ``` ### Expected behavior No error. ### Environment info - `datasets` version: 2.16.1 - Platform: Linux-5.14.0-284.25.1.el9_2.x86_64-x86_64-with-glibc2.34 - Python version: 3.10.13 - `huggingface_hub` version: 0.20.2 - PyArrow version: 14.0.1 - Pandas version: 2.1.3 - `fsspec` version: 2023.10.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/2779410?v=4", "events_url": "https://api.github.com/users/BramVanroy/events{/privacy}", "followers_url": "https://api.github.com/users/BramVanroy/followers", "following_url": "https://api.github.com/users/BramVanroy/following{/other_user}", "gists_url": "https://api.github.com/users/BramVanroy/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/BramVanroy", "id": 2779410, "login": "BramVanroy", "node_id": "MDQ6VXNlcjI3Nzk0MTA=", "organizations_url": "https://api.github.com/users/BramVanroy/orgs", "received_events_url": "https://api.github.com/users/BramVanroy/received_events", "repos_url": "https://api.github.com/users/BramVanroy/repos", "site_admin": false, "starred_url": "https://api.github.com/users/BramVanroy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/BramVanroy/subscriptions", "type": "User", "url": "https://api.github.com/users/BramVanroy", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6720/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6720/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6719
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6719/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6719/comments
https://api.github.com/repos/huggingface/datasets/issues/6719/events
https://github.com/huggingface/datasets/issues/6719
2,169,585,727
I_kwDODunzps6BUUA_
6,719
Is there any way to solve hanging of IterableDataset using split by node + filtering during inference
{ "avatar_url": "https://avatars.githubusercontent.com/u/8136905?v=4", "events_url": "https://api.github.com/users/ssharpe42/events{/privacy}", "followers_url": "https://api.github.com/users/ssharpe42/followers", "following_url": "https://api.github.com/users/ssharpe42/following{/other_user}", "gists_url": "https://api.github.com/users/ssharpe42/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ssharpe42", "id": 8136905, "login": "ssharpe42", "node_id": "MDQ6VXNlcjgxMzY5MDU=", "organizations_url": "https://api.github.com/users/ssharpe42/orgs", "received_events_url": "https://api.github.com/users/ssharpe42/received_events", "repos_url": "https://api.github.com/users/ssharpe42/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ssharpe42/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ssharpe42/subscriptions", "type": "User", "url": "https://api.github.com/users/ssharpe42", "user_view_type": "public" }
[]
open
false
null
[]
null
[]
1970-01-01T00:00:00.000001
1,709
null
NONE
null
### Describe the bug I am using an iterable dataset in a multi-node setup, trying to do training/inference while filtering the data on the fly. I usually do not use `split_dataset_by_node` but it is very slow using the IterableDatasetShard in `accelerate` and `transformers`. When I filter after applying `split_dataset_by_node`, it results in shards that are not equal sizes due to unequal samples filtered from each one. The distributed process hangs when trying to accomplish this. Is there any way to resolve this or is it impossible to implement? ### Steps to reproduce the bug Here is a toy example of what I am trying to do that reproduces the behavior ``` # torchrun --nproc-per-node 2 file.py import os import pandas as pd import torch from accelerate import Accelerator from datasets import Features, Value, load_dataset from datasets.distributed import split_dataset_by_node from torch.utils.data import DataLoader accelerator = Accelerator(device_placement=True, dispatch_batches=False) if accelerator.is_main_process: if not os.path.exists("scratch_data"): os.mkdir("scratch_data") n_shards = 4 for i in range(n_shards): df = pd.DataFrame({"id": list(range(10 * i, 10 * (i + 1)))}) df.to_parquet(f"scratch_data/shard_{i}.parquet") world_size = accelerator.num_processes local_rank = accelerator.process_index def collate_fn(examples): input_ids = [] for example in examples: input_ids.append(example["id"]) return torch.LongTensor(input_ids) dataset = load_dataset( "parquet", data_dir="scratch_data", split="train", streaming=True ) dataset = ( split_dataset_by_node(dataset, rank=local_rank, world_size=world_size) .filter(lambda x: x["id"] < 35) .shuffle(seed=42, buffer_size=100) ) batch_size = 2 train_dataloader = DataLoader( dataset, batch_size=batch_size, collate_fn=collate_fn, num_workers=2 ) for x in train_dataloader: x = x.to(accelerator.device) print({"rank": local_rank, "id": x}) y = accelerator.gather_for_metrics(x) if accelerator.is_main_process: print("gathered", y) ``` ### Expected behavior Is there any way to continue training/inference on the GPUs that have remaining data left without waiting for the others? Is it impossible to filter when ### Environment info - `datasets` version: 2.18.0 - Platform: Linux-5.10.209-198.812.amzn2.x86_64-x86_64-with-glibc2.31 - Python version: 3.10.13 - `huggingface_hub` version: 0.21.3 - PyArrow version: 15.0.0 - Pandas version: 2.2.1 - `fsspec` version: 2023.6.0
null
{ "+1": 4, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 4, "url": "https://api.github.com/repos/huggingface/datasets/issues/6719/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6719/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6717
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6717/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6717/comments
https://api.github.com/repos/huggingface/datasets/issues/6717/events
https://github.com/huggingface/datasets/issues/6717
2,168,726,432
I_kwDODunzps6BRCOg
6,717
`remove_columns` method used with a streaming enable dataset mode produces a LibsndfileError on multichannel audio
{ "avatar_url": "https://avatars.githubusercontent.com/u/53187038?v=4", "events_url": "https://api.github.com/users/jhauret/events{/privacy}", "followers_url": "https://api.github.com/users/jhauret/followers", "following_url": "https://api.github.com/users/jhauret/following{/other_user}", "gists_url": "https://api.github.com/users/jhauret/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jhauret", "id": 53187038, "login": "jhauret", "node_id": "MDQ6VXNlcjUzMTg3MDM4", "organizations_url": "https://api.github.com/users/jhauret/orgs", "received_events_url": "https://api.github.com/users/jhauret/received_events", "repos_url": "https://api.github.com/users/jhauret/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jhauret/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jhauret/subscriptions", "type": "User", "url": "https://api.github.com/users/jhauret", "user_view_type": "public" }
[]
open
false
null
[]
null
[ "And it also works well with `dataset = dataset.select_columns([\"audio\"])`", "Same issue here, disable stream=True fix the problem" ]
1970-01-01T00:00:00.000001
1,723
null
NONE
null
### Describe the bug When loading a HF dataset in streaming mode and removing some columns, it is impossible to load a sample if the audio contains more than one channel. I have the impression that the time axis and channels are swapped or concatenated. ### Steps to reproduce the bug Minimal error code: ```python from datasets import load_dataset dataset_name = "zinc75/Vibravox_dummy" config_name = "BWE_Larynx_microphone" # if we use "ASR_Larynx_microphone" subset which is a monochannel audio, no error is thrown. dataset = load_dataset( path=dataset_name, name=config_name, split="train", streaming=True ) dataset = dataset.remove_columns(["sensor_id"]) # dataset = dataset.map(lambda x:x, remove_columns=["sensor_id"]) # The commented version does not produce an error, but loses the dataset features. sample = next(iter(dataset)) ``` Error: ``` Traceback (most recent call last): File "/home/julien/Bureau/github/vibravox/tmp.py", line 15, in <module> sample = next(iter(dataset)) ^^^^^^^^^^^^^^^^^^^ File "/home/julien/.pyenv/versions/vibravox/lib/python3.11/site-packages/datasets/iterable_dataset.py", line 1392, in __iter__ example = _apply_feature_types_on_example( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/julien/.pyenv/versions/vibravox/lib/python3.11/site-packages/datasets/iterable_dataset.py", line 1080, in _apply_feature_types_on_example encoded_example = features.encode_example(example) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/julien/.pyenv/versions/vibravox/lib/python3.11/site-packages/datasets/features/features.py", line 1889, in encode_example return encode_nested_example(self, example) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/julien/.pyenv/versions/vibravox/lib/python3.11/site-packages/datasets/features/features.py", line 1244, in encode_nested_example {k: encode_nested_example(schema[k], obj.get(k), level=level + 1) for k in schema} File "/home/julien/.pyenv/versions/vibravox/lib/python3.11/site-packages/datasets/features/features.py", line 1244, in <dictcomp> {k: encode_nested_example(schema[k], obj.get(k), level=level + 1) for k in schema} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/julien/.pyenv/versions/vibravox/lib/python3.11/site-packages/datasets/features/features.py", line 1300, in encode_nested_example return schema.encode_example(obj) if obj is not None else None ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/julien/.pyenv/versions/vibravox/lib/python3.11/site-packages/datasets/features/audio.py", line 98, in encode_example sf.write(buffer, value["array"], value["sampling_rate"], format="wav") File "/home/julien/.pyenv/versions/vibravox/lib/python3.11/site-packages/soundfile.py", line 343, in write with SoundFile(file, 'w', samplerate, channels, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/julien/.pyenv/versions/vibravox/lib/python3.11/site-packages/soundfile.py", line 658, in __init__ self._file = self._open(file, mode_int, closefd) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/julien/.pyenv/versions/vibravox/lib/python3.11/site-packages/soundfile.py", line 1216, in _open raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name)) soundfile.LibsndfileError: Error opening <_io.BytesIO object at 0x7fd795d24680>: Format not recognised. Process finished with exit code 1 ``` ### Expected behavior I would expect this code to run without error. ### Environment info - `datasets` version: 2.18.0 - Platform: Linux-6.5.0-21-generic-x86_64-with-glibc2.35 - Python version: 3.11.0 - `huggingface_hub` version: 0.21.3 - PyArrow version: 15.0.0 - Pandas version: 2.2.1 - `fsspec` version: 2023.10.0
null
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/huggingface/datasets/issues/6717/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6717/timeline
null
null
null
null
false
null
https://api.github.com/repos/huggingface/datasets/issues/6716
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6716/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6716/comments
https://api.github.com/repos/huggingface/datasets/issues/6716/events
https://github.com/huggingface/datasets/issues/6716
2,168,706,558
I_kwDODunzps6BQ9X-
6,716
Non-deterministic `Dataset.builder_name` value
{ "avatar_url": "https://avatars.githubusercontent.com/u/17039389?v=4", "events_url": "https://api.github.com/users/harupy/events{/privacy}", "followers_url": "https://api.github.com/users/harupy/followers", "following_url": "https://api.github.com/users/harupy/following{/other_user}", "gists_url": "https://api.github.com/users/harupy/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/harupy", "id": 17039389, "login": "harupy", "node_id": "MDQ6VXNlcjE3MDM5Mzg5", "organizations_url": "https://api.github.com/users/harupy/orgs", "received_events_url": "https://api.github.com/users/harupy/received_events", "repos_url": "https://api.github.com/users/harupy/repos", "site_admin": false, "starred_url": "https://api.github.com/users/harupy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/harupy/subscriptions", "type": "User", "url": "https://api.github.com/users/harupy", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "When `rotten_tomatoes` is printed out, the following warning message is also printed out:\r\n\r\n```\r\nYou can avoid this message in future by passing the argument `trust_remote_code=True`.\r\nPassing `trust_remote_code=True` will be mandatory to load this dataset from the next major release of `datasets`.\r\n```", "Hi ! This behavior happens because the dataset was originakky created using a dataset script [rotten_tomatoes.py](https://huggingface.co/datasets/rotten_tomatoes/blob/26f40d324d7b281d8b3fb1c47f30f8b9957f206b/rotten_tomatoes.py) and because we added features recently allowing to download the dataset directly from Parquet files (parquet builder) without running the dataset script (rotten_tomatoes). The flakiness must come from the availability of the Parquet files (we automatically export them in the refs/convert/parquet branch and we recently had to move some files).\r\n\r\nAnyway the easy fix on our side is to remove the dataset script completely, let me open a PR at https://huggingface.co/datasets/rotten_tomatoes\r\n\r\nEDIT: opened https://huggingface.co/datasets/rotten_tomatoes/discussions/6, feel free to comment there if you're ok with that change", "@lhoestq Thanks for the comment, explanation, and patch!", "> we automatically export them in the refs/convert/parquet branch\r\n\r\nWhen this operation is in progress, the parquet files become temporarily unavailable?", "> When this operation is in progress, the parquet files become temporarily unavailable?\r\n\r\nYes correct. I just merged the patch btw :)", "@lhoestq Thanks for merging the PR! I think this issue can be closed." ]
1970-01-01T00:00:00.000001
1,710
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug I'm not sure if this is a bug, but `print(ds.builder_name)` in the following code sometimes prints out `rotten_tomatoes` instead of `parquet`: ```python import datasets for _ in range(100): ds = datasets.load_dataset("rotten_tomatoes", split="train") print(ds.builder_name) # prints out "rotten_tomatoes" sometimes instead of "parquet" ``` Output: ``` ... parquet parquet parquet rotten_tomatoes parquet parquet parquet ... ``` Here's a reproduction using GitHub Actions: https://github.com/mlflow/mlflow/actions/runs/8153247984/job/22284263613?pr=11329#step:12:241 One of our tests is flaky because `builder_name` is not deterministic. ### Steps to reproduce the bug 1. Run the code above. ### Expected behavior Always prints out `parquet`? ### Environment info ``` Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.18.0 - Platform: Linux-6.5.0-1015-azure-x86_64-with-glibc2.34 - Python version: 3.8.18 - `huggingface_hub` version: 0.21.3 - PyArrow version: 15.0.0 - Pandas version: 2.0.3 - `fsspec` version: 2024.2.0 ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/17039389?v=4", "events_url": "https://api.github.com/users/harupy/events{/privacy}", "followers_url": "https://api.github.com/users/harupy/followers", "following_url": "https://api.github.com/users/harupy/following{/other_user}", "gists_url": "https://api.github.com/users/harupy/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/harupy", "id": 17039389, "login": "harupy", "node_id": "MDQ6VXNlcjE3MDM5Mzg5", "organizations_url": "https://api.github.com/users/harupy/orgs", "received_events_url": "https://api.github.com/users/harupy/received_events", "repos_url": "https://api.github.com/users/harupy/repos", "site_admin": false, "starred_url": "https://api.github.com/users/harupy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/harupy/subscriptions", "type": "User", "url": "https://api.github.com/users/harupy", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6716/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6716/timeline
null
completed
null
null
false
0
https://api.github.com/repos/huggingface/datasets/issues/6703
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6703/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6703/comments
https://api.github.com/repos/huggingface/datasets/issues/6703/events
https://github.com/huggingface/datasets/issues/6703
2,163,250,590
I_kwDODunzps6A8JWe
6,703
Unable to load dataset that was saved with `save_to_disk`
{ "avatar_url": "https://avatars.githubusercontent.com/u/27340033?v=4", "events_url": "https://api.github.com/users/casper-hansen/events{/privacy}", "followers_url": "https://api.github.com/users/casper-hansen/followers", "following_url": "https://api.github.com/users/casper-hansen/following{/other_user}", "gists_url": "https://api.github.com/users/casper-hansen/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/casper-hansen", "id": 27340033, "login": "casper-hansen", "node_id": "MDQ6VXNlcjI3MzQwMDMz", "organizations_url": "https://api.github.com/users/casper-hansen/orgs", "received_events_url": "https://api.github.com/users/casper-hansen/received_events", "repos_url": "https://api.github.com/users/casper-hansen/repos", "site_admin": false, "starred_url": "https://api.github.com/users/casper-hansen/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/casper-hansen/subscriptions", "type": "User", "url": "https://api.github.com/users/casper-hansen", "user_view_type": "public" }
[]
closed
false
null
[]
null
[ "`save_to_disk` uses a special serialization that can only be read using `load_from_disk`.\r\n\r\nContrary to `load_dataset`, `load_from_disk` directly loads Arrow files and uses the dataset directory as cache.\r\n\r\nOn the other hand `load_dataset` does a conversion step to get Arrow files from the raw data files (could be in JSON, CSV, Parquet etc.) and caches them in the `datasets` cache directory (default is `~/.cache/huggingface/datasets`). We haven't implemented any logic in `load_dataset` to support datasets saved with `save_to_disk` because they don't use the same cache.\r\n\r\nEDIT: note that you can save your dataset in Parquet format locally using `.to.parquet()` (make sure to shard in multiple files your dataset if it's multiple GBs - you can use `.shard()` + `.to_parquet()` to do that) and you'll be able to reload it using `load_dataset`", "@lhoestq, so is it correctly understood that if I run `to_parquet()` and then `save_to_disk()`, I can load it with `load_dataset`? If yes, then it would resolve this issue (and should probably be documented somewhere 😄)", "Here is an example:\r\n```python\r\nds.to_parquet(\"my/local/dir/data.parquet\")\r\n\r\n# later\r\nds = load_dataset(\"my/local/dir\")\r\n```\r\n\r\nand for bigger datasets:\r\n```python\r\nnum_shards = 1024 # set number of files to save (e.g. try to have files smaller than 5GB)\r\nfor shard_idx in num_shards:\r\n shard = ds.shard(index=shard_idx, num_shards=num_shards)\r\n shard.to_parquet(f\"my/local/dir/{shard_idx:05d}.parquet\") # 00000.parquet to 01023.parquet\r\n\r\n# later\r\nds = load_dataset(\"my/local/dir\")\r\n```\r\n\r\n\r\nI hope this helps :)", "Thanks for helping out! Does this approach work with `s3fs`? e.g. something like this:\r\n\r\n```python\r\nimport s3fs\r\ns3 = s3fs.S3FileSystem(anon=True)\r\nwith s3.open('mybucket/new-file.parquet', 'w') as f:\r\n ds.to_parquet(f)\r\n```\r\n\r\nThis is instead of `save_to_disk` to save to an S3 bucket.\r\n\r\nOtherwise, I am not sure how to make this work when saving the dataset to an S3 bucket. Would `dataset.set_format(\"arrow\")` work as a replacement?", "`load_dataset` does't support S3 buckets unfortunately :/", "> `load_dataset` does't support S3 buckets unfortunately :/\r\n\r\nI am aware but I have some code that downloads it to disk before using that method. The most important part is to store it in a format that load_dataset is compatible with. ", "Feel free to use Parquet then :)", "I ended up with this. Not ideal to save to local disk, but it works and loads via `load_datasets` after downloading from S3 with another method.\r\n\r\n```python\r\nwith tempfile.TemporaryDirectory() as dir:\r\n dataset_nbytes = ds._estimate_nbytes()\r\n max_shard_size_local = convert_file_size_to_int(max_shard_size)\r\n num_shards = int(dataset_nbytes / max_shard_size_local) + 1\r\n\r\n for shard_idx in range(num_shards):\r\n shard = ds.shard(index=shard_idx, num_shards=num_shards)\r\n shard.to_parquet(f\"{dir}/{shard_idx:05d}.parquet\")\r\n \r\n fs.upload(\r\n lpath=dir,\r\n rpath=s3_path,\r\n recursive=True,\r\n )\r\n```" ]
1970-01-01T00:00:00.000001
1,709
1970-01-01T00:00:00.000001
NONE
null
### Describe the bug I get the following error message: You are trying to load a dataset that was saved using `save_to_disk`. Please use `load_from_disk` instead. ### Steps to reproduce the bug 1. Save a dataset with `save_to_disk` 2. Try to load it with `load_datasets` ### Expected behavior I am able to load the dataset again with `load_datasets` which most packages uses over `load_from_disk`. I want to have a workaround that allows me to create the same indexing that `push_to_hub` creates for you before using `save_to_disk` - how can that be achieved? ### Environment info datasets 2.17.1, python 3.10
{ "avatar_url": "https://avatars.githubusercontent.com/u/27340033?v=4", "events_url": "https://api.github.com/users/casper-hansen/events{/privacy}", "followers_url": "https://api.github.com/users/casper-hansen/followers", "following_url": "https://api.github.com/users/casper-hansen/following{/other_user}", "gists_url": "https://api.github.com/users/casper-hansen/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/casper-hansen", "id": 27340033, "login": "casper-hansen", "node_id": "MDQ6VXNlcjI3MzQwMDMz", "organizations_url": "https://api.github.com/users/casper-hansen/orgs", "received_events_url": "https://api.github.com/users/casper-hansen/received_events", "repos_url": "https://api.github.com/users/casper-hansen/repos", "site_admin": false, "starred_url": "https://api.github.com/users/casper-hansen/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/casper-hansen/subscriptions", "type": "User", "url": "https://api.github.com/users/casper-hansen", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/huggingface/datasets/issues/6703/reactions" }
https://api.github.com/repos/huggingface/datasets/issues/6703/timeline
null
completed
null
null
false
0