html_url
stringlengths
46
51
number
int64
1
7.85k
title
stringlengths
1
290
user
dict
labels
listlengths
0
4
state
stringclasses
2 values
locked
bool
1 class
comments
listlengths
0
30
created_at
timestamp[ns, tz=UTC]date
2020-04-14 10:18:02
2025-11-05 18:11:12
updated_at
timestamp[ns, tz=UTC]date
2020-04-27 16:04:17
2025-11-06 09:44:34
closed_at
timestamp[ns, tz=UTC]date
2020-04-14 12:01:40
2025-11-05 16:02:32
author_association
stringclasses
4 values
draft
bool
2 classes
pull_request
dict
body
stringlengths
0
228k
closed_by
dict
reactions
dict
state_reason
stringclasses
4 values
sub_issues_summary
dict
issue_dependencies_summary
dict
is_pull_request
bool
2 classes
https://github.com/huggingface/datasets/issues/7545
7,545
Networked Pull Through Cache
{ "avatar_url": "https://avatars.githubusercontent.com/u/8764173?v=4", "events_url": "https://api.github.com/users/wrmedford/events{/privacy}", "followers_url": "https://api.github.com/users/wrmedford/followers", "following_url": "https://api.github.com/users/wrmedford/following{/other_user}", "gists_url": "https://api.github.com/users/wrmedford/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/wrmedford", "id": 8764173, "login": "wrmedford", "node_id": "MDQ6VXNlcjg3NjQxNzM=", "organizations_url": "https://api.github.com/users/wrmedford/orgs", "received_events_url": "https://api.github.com/users/wrmedford/received_events", "repos_url": "https://api.github.com/users/wrmedford/repos", "site_admin": false, "starred_url": "https://api.github.com/users/wrmedford/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/wrmedford/subscriptions", "type": "User", "url": "https://api.github.com/users/wrmedford", "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
[]
2025-04-30T15:16:33Z
2025-04-30T15:16:33Z
null
NONE
null
null
### Feature request Introduce a HF_DATASET_CACHE_NETWORK_LOCATION configuration (e.g. an environment variable) together with a companion network cache service. Enable a three-tier cache lookup for datasets: 1. Local on-disk cache 2. Configurable network cache proxy 3. Official Hugging Face Hub ### Motivation - Distributed training & ephemeral jobs: In high-performance or containerized clusters, relying solely on a local disk cache either becomes a streaming bottleneck or incurs a heavy cold-start penalty as each job must re-download datasets. - Traffic & cost reduction: A pull-through network cache lets multiple consumers share a common cache layer, reducing duplicate downloads from the Hub and lowering egress costs. - Better streaming adoption: By offloading repeat dataset pulls to a locally managed cache proxy, streaming workloads can achieve higher throughput and more predictable latency. - Proven pattern: Similar proxy-cache solutions (e.g. Harbor’s Proxy Cache for Docker images) have demonstrated reliability and performance at scale: https://goharbor.io/docs/2.1.0/administration/configure-proxy-cache/ ### Your contribution I’m happy to draft the initial PR for adding HF_DATASET_CACHE_NETWORK_LOCATION support in datasets and sketch out a minimal cache-service prototype. I have limited bandwidth so I would be looking for collaborators if anyone else is interested.
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/7545/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/pull/7544
7,544
Add try_original_type to DatasetDict.map
{ "avatar_url": "https://avatars.githubusercontent.com/u/11156001?v=4", "events_url": "https://api.github.com/users/yoshitomo-matsubara/events{/privacy}", "followers_url": "https://api.github.com/users/yoshitomo-matsubara/followers", "following_url": "https://api.github.com/users/yoshitomo-matsubara/following{/other_user}", "gists_url": "https://api.github.com/users/yoshitomo-matsubara/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yoshitomo-matsubara", "id": 11156001, "login": "yoshitomo-matsubara", "node_id": "MDQ6VXNlcjExMTU2MDAx", "organizations_url": "https://api.github.com/users/yoshitomo-matsubara/orgs", "received_events_url": "https://api.github.com/users/yoshitomo-matsubara/received_events", "repos_url": "https://api.github.com/users/yoshitomo-matsubara/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yoshitomo-matsubara/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yoshitomo-matsubara/subscriptions", "type": "User", "url": "https://api.github.com/users/yoshitomo-matsubara", "user_view_type": "public" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7544). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.", "Sure! I just committed the changes", "@lhoestq \r\nLet me know if there are other things to do before merge or other places to add `try_original_type` argument " ]
2025-04-29T04:39:44Z
2025-05-05T14:42:49Z
2025-05-05T14:42:49Z
CONTRIBUTOR
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7544.diff", "html_url": "https://github.com/huggingface/datasets/pull/7544", "merged_at": "2025-05-05T14:42:49Z", "patch_url": "https://github.com/huggingface/datasets/pull/7544.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7544" }
This PR resolves #7472 for DatasetDict The previously merged PR #7483 added `try_original_type` to ArrowDataset, but DatasetDict misses `try_original_type` Cc: @lhoestq
{ "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/7544/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/issues/7543
7,543
The memory-disk mapping failure issue of the map function(resolved, but there are some suggestions.)
{ "avatar_url": "https://avatars.githubusercontent.com/u/76415358?v=4", "events_url": "https://api.github.com/users/jxma20/events{/privacy}", "followers_url": "https://api.github.com/users/jxma20/followers", "following_url": "https://api.github.com/users/jxma20/following{/other_user}", "gists_url": "https://api.github.com/users/jxma20/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jxma20", "id": 76415358, "login": "jxma20", "node_id": "MDQ6VXNlcjc2NDE1MzU4", "organizations_url": "https://api.github.com/users/jxma20/orgs", "received_events_url": "https://api.github.com/users/jxma20/received_events", "repos_url": "https://api.github.com/users/jxma20/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jxma20/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jxma20/subscriptions", "type": "User", "url": "https://api.github.com/users/jxma20", "user_view_type": "public" }
[]
closed
false
[]
2025-04-29T03:04:59Z
2025-04-30T02:22:17Z
2025-04-30T02:22:17Z
NONE
null
null
### Describe the bug ## bug When the map function processes a large dataset, it temporarily stores the data in a cache file on the disk. After the data is stored, the memory occupied by it is released. Therefore, when using the map function to process a large-scale dataset, only a dataset space of the size of `writer_batch_size` will be occupied in memory. However, I found that the map function does not actually reduce memory usage when I used it. At first, I thought there was a bug in the program, causing a memory leak—meaning the memory was not released after the data was stored in the cache. But later, I used a Linux command to check for recently modified files during program execution and found that no new files were created or modified. This indicates that the program did not store the dataset in the disk cache. ## bug solved After modifying the parameters of the map function multiple times, I discovered the `cache_file_name` parameter. By changing it, the cache file can be stored in the specified directory. After making this change, I noticed that the cache file appeared. Initially, I found this quite incredible, but then I wondered if the cache file might have failed to be stored in a certain folder. This could be related to the fact that I don't have root privileges. So, I delved into the source code of the map function to find out where the cache file would be stored by default. Eventually, I found the function `def _get_cache_file_path(self, fingerprint):`, which automatically generates the storage path for the cache file. The output was as follows: `/tmp/hf_datasets-j5qco9ug/cache-f2830487643b9cc2.arrow`. My hypothesis was confirmed: the lack of root privileges indeed prevented the cache file from being stored, which in turn prevented the release of memory. Therefore, changing the storage location to a folder where I have write access resolved the issue. ### Steps to reproduce the bug my code `train_data = train_data.map(process_fun, remove_columns=['image_name', 'question_type', 'concern', 'question', 'candidate_answers', 'answer'])` ### Expected behavior Although my bug has been resolved, it still took me nearly a week to search for relevant information and debug the program. However, if a warning or error message about insufficient cache file write permissions could be provided during program execution, I might have been able to identify the cause more quickly. Therefore, I hope this aspect can be improved. I am documenting this bug here so that friends who encounter similar issues can solve their problems in a timely manner. ### Environment info python: 3.10.15 datasets: 3.5.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/76415358?v=4", "events_url": "https://api.github.com/users/jxma20/events{/privacy}", "followers_url": "https://api.github.com/users/jxma20/followers", "following_url": "https://api.github.com/users/jxma20/following{/other_user}", "gists_url": "https://api.github.com/users/jxma20/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jxma20", "id": 76415358, "login": "jxma20", "node_id": "MDQ6VXNlcjc2NDE1MzU4", "organizations_url": "https://api.github.com/users/jxma20/orgs", "received_events_url": "https://api.github.com/users/jxma20/received_events", "repos_url": "https://api.github.com/users/jxma20/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jxma20/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jxma20/subscriptions", "type": "User", "url": "https://api.github.com/users/jxma20", "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/7543/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/pull/7542
7,542
set dev version
{ "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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7542). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-04-28T14:03:48Z
2025-04-28T14:08:37Z
2025-04-28T14:04:00Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7542.diff", "html_url": "https://github.com/huggingface/datasets/pull/7542", "merged_at": "2025-04-28T14:04:00Z", "patch_url": "https://github.com/huggingface/datasets/pull/7542.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7542" }
null
{ "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/7542/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7541
7,541
release: 3.5.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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7541). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-04-28T14:00:59Z
2025-04-28T14:03:38Z
2025-04-28T14:01:54Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7541.diff", "html_url": "https://github.com/huggingface/datasets/pull/7541", "merged_at": "2025-04-28T14:01:54Z", "patch_url": "https://github.com/huggingface/datasets/pull/7541.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7541" }
null
{ "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/7541/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7540
7,540
support pyarrow 20
{ "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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7540). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-04-28T13:01:11Z
2025-04-28T13:23:53Z
2025-04-28T13:23:52Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7540.diff", "html_url": "https://github.com/huggingface/datasets/pull/7540", "merged_at": "2025-04-28T13:23:52Z", "patch_url": "https://github.com/huggingface/datasets/pull/7540.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7540" }
fix ``` TypeError: ArrayExtensionArray.to_pylist() got an unexpected keyword argument 'maps_as_pydicts' ```
{ "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": 1, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/huggingface/datasets/issues/7540/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7539
7,539
Fix IterableDataset state_dict shard_example_idx counting
{ "avatar_url": "https://avatars.githubusercontent.com/u/129883215?v=4", "events_url": "https://api.github.com/users/Harry-Yang0518/events{/privacy}", "followers_url": "https://api.github.com/users/Harry-Yang0518/followers", "following_url": "https://api.github.com/users/Harry-Yang0518/following{/other_user}", "gists_url": "https://api.github.com/users/Harry-Yang0518/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Harry-Yang0518", "id": 129883215, "login": "Harry-Yang0518", "node_id": "U_kgDOB73cTw", "organizations_url": "https://api.github.com/users/Harry-Yang0518/orgs", "received_events_url": "https://api.github.com/users/Harry-Yang0518/received_events", "repos_url": "https://api.github.com/users/Harry-Yang0518/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Harry-Yang0518/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Harry-Yang0518/subscriptions", "type": "User", "url": "https://api.github.com/users/Harry-Yang0518", "user_view_type": "public" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7539). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.", "Hi ! FYI I made a PR to fix https://github.com/huggingface/datasets/issues/7538 and it also fixed https://github.com/huggingface/datasets/issues/7475, so if I'm not mistaken this PR is not needed anymore" ]
2025-04-27T20:41:18Z
2025-05-06T14:24:25Z
2025-05-06T14:24:24Z
CONTRIBUTOR
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7539.diff", "html_url": "https://github.com/huggingface/datasets/pull/7539", "merged_at": null, "patch_url": "https://github.com/huggingface/datasets/pull/7539.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7539" }
# Fix IterableDataset's state_dict shard_example_idx reporting ## Description This PR fixes issue #7475 where the `shard_example_idx` value in `IterableDataset`'s `state_dict()` always equals the number of samples in a shard, even if only a few examples have been consumed. The issue is in the `_iter_arrow` method of the `ArrowExamplesIterable` class where it updates the `shard_example_idx` state by the full length of the batch (`len(pa_table)`) even when we're only partway through processing the examples. ## Changes Modified the `_iter_arrow` method of `ArrowExamplesIterable` to: 1. Track the actual number of examples processed 2. Only increment the `shard_example_idx` by the number of examples actually yielded 3. Handle partial batches correctly ## How to Test I've included a simple test case that demonstrates the fix: ```python from datasets import Dataset # Create a test dataset ds = Dataset.from_dict({"a": range(6)}).to_iterable_dataset(num_shards=1) # Iterate through part of the dataset for idx, example in enumerate(ds): print(example) if idx == 2: # Stop after 3 examples (0, 1, 2) state_dict = ds.state_dict() print("Checkpoint state_dict:", state_dict) break # Before the fix, the output would show shard_example_idx: 6 # After the fix, it shows shard_example_idx: 3, correctly reflecting the 3 processed examples ``` ## Implementation Details 1. Added logic to track the number of examples actually seen in the current shard 2. Modified the state update to only count examples actually yielded 3. Improved handling of partial batches and skipped examples This fix ensures that checkpointing and resuming works correctly with exactly the expected number of examples, rather than skipping ahead to the end of the batch.
{ "avatar_url": "https://avatars.githubusercontent.com/u/129883215?v=4", "events_url": "https://api.github.com/users/Harry-Yang0518/events{/privacy}", "followers_url": "https://api.github.com/users/Harry-Yang0518/followers", "following_url": "https://api.github.com/users/Harry-Yang0518/following{/other_user}", "gists_url": "https://api.github.com/users/Harry-Yang0518/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Harry-Yang0518", "id": 129883215, "login": "Harry-Yang0518", "node_id": "U_kgDOB73cTw", "organizations_url": "https://api.github.com/users/Harry-Yang0518/orgs", "received_events_url": "https://api.github.com/users/Harry-Yang0518/received_events", "repos_url": "https://api.github.com/users/Harry-Yang0518/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Harry-Yang0518/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Harry-Yang0518/subscriptions", "type": "User", "url": "https://api.github.com/users/Harry-Yang0518", "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/7539/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/issues/7538
7,538
`IterableDataset` drops samples when resuming from a checkpoint
{ "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" }
[ { "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
[ "Thanks for reporting ! I fixed the issue using RebatchedArrowExamplesIterable before the formatted iterable" ]
2025-04-27T19:34:49Z
2025-05-06T14:04:05Z
2025-05-06T14:03:42Z
COLLABORATOR
null
null
When resuming from a checkpoint, `IterableDataset` will drop samples if `num_shards % world_size == 0` and the underlying example supports `iter_arrow` and needs to be formatted. In that case, the `FormattedExamplesIterable` fetches a batch of samples from the child iterable's `iter_arrow` and yields them one by one (after formatting). However, the child increments the `shard_example_idx` counter (in its `iter_arrow`) before returning the batch for the whole batch size, which leads to a portion of samples being skipped if the iteration (of the parent iterable) is stopped mid-batch. Perhaps one way to avoid this would be by signalling the child iterable which samples (within the chunk) are processed by the parent and which are not, so that it can adjust the `shard_example_idx` counter accordingly. This would also mean the chunk needs to be sliced when resuming, but this is straightforward to implement. The following is a minimal reproducer of the bug: ```python from datasets import Dataset from datasets.distributed import split_dataset_by_node ds = Dataset.from_dict({"n": list(range(24))}) ds = ds.to_iterable_dataset(num_shards=4) world_size = 4 rank = 0 ds_rank = split_dataset_by_node(ds, rank, world_size) it = iter(ds_rank) examples = [] for idx, example in enumerate(it): examples.append(example) if idx == 2: state_dict = ds_rank.state_dict() break ds_rank.load_state_dict(state_dict) it_resumed = iter(ds_rank) examples_resumed = examples[:] for example in it: examples.append(example) for example in it_resumed: examples_resumed.append(example) print("ORIGINAL ITER EXAMPLES:", examples) print("RESUMED ITER EXAMPLES:", examples_resumed) ```
{ "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/7538/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7537
7,537
`datasets.map(..., num_proc=4)` multi-processing fails
{ "avatar_url": "https://avatars.githubusercontent.com/u/24477841?v=4", "events_url": "https://api.github.com/users/faaany/events{/privacy}", "followers_url": "https://api.github.com/users/faaany/followers", "following_url": "https://api.github.com/users/faaany/following{/other_user}", "gists_url": "https://api.github.com/users/faaany/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/faaany", "id": 24477841, "login": "faaany", "node_id": "MDQ6VXNlcjI0NDc3ODQx", "organizations_url": "https://api.github.com/users/faaany/orgs", "received_events_url": "https://api.github.com/users/faaany/received_events", "repos_url": "https://api.github.com/users/faaany/repos", "site_admin": false, "starred_url": "https://api.github.com/users/faaany/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/faaany/subscriptions", "type": "User", "url": "https://api.github.com/users/faaany", "user_view_type": "public" }
[]
open
false
[ "related: https://github.com/huggingface/datasets/issues/7510\n\nwe need to do more tests to see if latest `dill` is deterministic" ]
2025-04-25T01:53:47Z
2025-05-06T13:12:08Z
null
NONE
null
null
The following code fails in python 3.11+ ```python tokenized_datasets = datasets.map(tokenize_function, batched=True, num_proc=4, remove_columns=["text"]) ``` Error log: ```bash Traceback (most recent call last): File "/usr/local/lib/python3.12/dist-packages/multiprocess/process.py", line 315, in _bootstrap self.run() File "/usr/local/lib/python3.12/dist-packages/multiprocess/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.12/dist-packages/multiprocess/pool.py", line 114, in worker task = get() ^^^^^ File "/usr/local/lib/python3.12/dist-packages/multiprocess/queues.py", line 371, in get return _ForkingPickler.loads(res) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/dist-packages/dill/_dill.py", line 327, in loads return load(file, ignore, **kwds) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/dist-packages/dill/_dill.py", line 313, in load return Unpickler(file, ignore=ignore, **kwds).load() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/dist-packages/dill/_dill.py", line 525, in load obj = StockUnpickler.load(self) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/dist-packages/dill/_dill.py", line 659, in _create_code if len(args) == 16: return CodeType(*args) ^^^^^^^^^^^^^^^ TypeError: code() argument 13 must be str, not int ``` After upgrading dill to the latest 0.4.0 with "pip install --upgrade dill", it can pass. So it seems that there is a compatibility issue between dill 0.3.4 and python 3.11+, because python 3.10 works fine. Is the dill deterministic issue mentioned in https://github.com/huggingface/datasets/blob/main/setup.py#L117) still valid? Any plan to unpin?
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/7537/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7536
7,536
[Errno 13] Permission denied: on `.incomplete` file
{ "avatar_url": "https://avatars.githubusercontent.com/u/1282383?v=4", "events_url": "https://api.github.com/users/ryan-clancy/events{/privacy}", "followers_url": "https://api.github.com/users/ryan-clancy/followers", "following_url": "https://api.github.com/users/ryan-clancy/following{/other_user}", "gists_url": "https://api.github.com/users/ryan-clancy/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ryan-clancy", "id": 1282383, "login": "ryan-clancy", "node_id": "MDQ6VXNlcjEyODIzODM=", "organizations_url": "https://api.github.com/users/ryan-clancy/orgs", "received_events_url": "https://api.github.com/users/ryan-clancy/received_events", "repos_url": "https://api.github.com/users/ryan-clancy/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ryan-clancy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ryan-clancy/subscriptions", "type": "User", "url": "https://api.github.com/users/ryan-clancy", "user_view_type": "public" }
[]
closed
false
[ "It must be an issue with umask being used by multiple threads indeed. Maybe we can try to make a thread safe function to apply the umask (using filelock for example)", "> It must be an issue with umask being used by multiple threads indeed. Maybe we can try to make a thread safe function to apply the umask (using filelock for example)\n\n@lhoestq is this something which can go in a 3.5.1 release?", "Yes for sure", "@lhoestq - can you take a look at https://github.com/huggingface/datasets/pull/7547/?" ]
2025-04-24T20:52:45Z
2025-05-06T13:05:01Z
2025-05-06T13:05:01Z
CONTRIBUTOR
null
null
### Describe the bug When downloading a dataset, we frequently hit the below Permission Denied error. This looks to happen (at least) across datasets in HF, S3, and GCS. It looks like the `temp_file` being passed [here](https://github.com/huggingface/datasets/blob/main/src/datasets/utils/file_utils.py#L412) can sometimes be created with `000` permissions leading to the permission denied error (the user running the code is still the owner of the file). Deleting that particular file and re-running the code with 0 changes will usually succeed. Is there some race condition happening with the [umask](https://github.com/huggingface/datasets/blob/main/src/datasets/utils/file_utils.py#L416), which is process global, and the [file creation](https://github.com/huggingface/datasets/blob/main/src/datasets/utils/file_utils.py#L404)? ``` _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .venv/lib/python3.12/site-packages/datasets/load.py:2084: in load_dataset builder_instance.download_and_prepare( .venv/lib/python3.12/site-packages/datasets/builder.py:925: in download_and_prepare self._download_and_prepare( .venv/lib/python3.12/site-packages/datasets/builder.py:1649: in _download_and_prepare super()._download_and_prepare( .venv/lib/python3.12/site-packages/datasets/builder.py:979: in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) .venv/lib/python3.12/site-packages/datasets/packaged_modules/folder_based_builder/folder_based_builder.py:120: in _split_generators downloaded_files = dl_manager.download(files) .venv/lib/python3.12/site-packages/datasets/download/download_manager.py:159: in download downloaded_path_or_paths = map_nested( .venv/lib/python3.12/site-packages/datasets/utils/py_utils.py:514: in map_nested _single_map_nested((function, obj, batched, batch_size, types, None, True, None)) .venv/lib/python3.12/site-packages/datasets/utils/py_utils.py:382: in _single_map_nested return [mapped_item for batch in iter_batched(data_struct, batch_size) for mapped_item in function(batch)] .venv/lib/python3.12/site-packages/datasets/download/download_manager.py:206: in _download_batched return thread_map( .venv/lib/python3.12/site-packages/tqdm/contrib/concurrent.py:69: in thread_map return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs) .venv/lib/python3.12/site-packages/tqdm/contrib/concurrent.py:51: in _executor_map return list(tqdm_class(ex.map(fn, *iterables, chunksize=chunksize), **kwargs)) .venv/lib/python3.12/site-packages/tqdm/std.py:1181: in __iter__ for obj in iterable: ../../../_tool/Python/3.12.10/x64/lib/python3.12/concurrent/futures/_base.py:619: in result_iterator yield _result_or_cancel(fs.pop()) ../../../_tool/Python/3.12.10/x64/lib/python3.12/concurrent/futures/_base.py:317: in _result_or_cancel return fut.result(timeout) ../../../_tool/Python/3.12.10/x64/lib/python3.12/concurrent/futures/_base.py:449: in result return self.__get_result() ../../../_tool/Python/3.12.10/x64/lib/python3.12/concurrent/futures/_base.py:401: in __get_result raise self._exception ../../../_tool/Python/3.12.10/x64/lib/python3.12/concurrent/futures/thread.py:59: in run result = self.fn(*self.args, **self.kwargs) .venv/lib/python3.12/site-packages/datasets/download/download_manager.py:229: in _download_single out = cached_path(url_or_filename, download_config=download_config) .venv/lib/python3.12/site-packages/datasets/utils/file_utils.py:206: in cached_path output_path = get_from_cache( .venv/lib/python3.12/site-packages/datasets/utils/file_utils.py:412: in get_from_cache fsspec_get(url, temp_file, storage_options=storage_options, desc=download_desc, disable_tqdm=disable_tqdm) .venv/lib/python3.12/site-packages/datasets/utils/file_utils.py:331: in fsspec_get fs.get_file(path, temp_file.name, callback=callback) .venv/lib/python3.12/site-packages/fsspec/asyn.py:118: in wrapper return sync(self.loop, func, *args, **kwargs) .venv/lib/python3.12/site-packages/fsspec/asyn.py:103: in sync raise return_result .venv/lib/python3.12/site-packages/fsspec/asyn.py:56: in _runner result[0] = await coro _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <s3fs.core.S3FileSystem object at 0x7f27c18b2e70> rpath = '<my-bucket>/<my-prefix>/img_1.jpg' lpath = '/home/runner/_work/_temp/hf_cache/downloads/6c97983efa4e24e534557724655df8247a0bd04326cdfc4a95b638c11e78222d.incomplete' callback = <datasets.utils.file_utils.TqdmCallback object at 0x7f27c00cdbe0> version_id = None, kwargs = {} _open_file = <function S3FileSystem._get_file.<locals>._open_file at 0x7f27628d1120> body = <StreamingBody at 0x7f276344fa80 for ClientResponse at 0x7f27c015fce0> content_length = 521923, failed_reads = 0, bytes_read = 0 async def _get_file( self, rpath, lpath, callback=_DEFAULT_CALLBACK, version_id=None, **kwargs ): if os.path.isdir(lpath): return bucket, key, vers = self.split_path(rpath) async def _open_file(range: int): kw = self.req_kw.copy() if range: kw["Range"] = f"bytes={range}-" resp = await self._call_s3( "get_object", Bucket=bucket, Key=key, **version_id_kw(version_id or vers), **kw, ) return resp["Body"], resp.get("ContentLength", None) body, content_length = await _open_file(range=0) callback.set_size(content_length) failed_reads = 0 bytes_read = 0 try: > with open(lpath, "wb") as f0: E PermissionError: [Errno 13] Permission denied: '/home/runner/_work/_temp/hf_cache/downloads/6c97983efa4e24e534557724655df8247a0bd04326cdfc4a95b638c11e78222d.incomplete' .venv/lib/python3.12/site-packages/s3fs/core.py:1355: PermissionError ``` ### Steps to reproduce the bug I believe this is a race condition and cannot reliably re-produce it, but it happens fairly frequently in our GitHub Actions tests and can also be re-produced (with lesser frequency) on cloud VMs. ### Expected behavior The dataset loads properly with no permission denied error. ### Environment info - `datasets` version: 3.5.0 - Platform: Linux-5.10.0-34-cloud-amd64-x86_64-with-glibc2.31 - Python version: 3.12.10 - `huggingface_hub` version: 0.30.2 - PyArrow version: 19.0.1 - Pandas version: 2.2.3 - `fsspec` version: 2024.12.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/7536/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/pull/7535
7,535
Change dill version in requirements
{ "avatar_url": "https://avatars.githubusercontent.com/u/98061329?v=4", "events_url": "https://api.github.com/users/JGrel/events{/privacy}", "followers_url": "https://api.github.com/users/JGrel/followers", "following_url": "https://api.github.com/users/JGrel/following{/other_user}", "gists_url": "https://api.github.com/users/JGrel/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/JGrel", "id": 98061329, "login": "JGrel", "node_id": "U_kgDOBdhMEQ", "organizations_url": "https://api.github.com/users/JGrel/orgs", "received_events_url": "https://api.github.com/users/JGrel/received_events", "repos_url": "https://api.github.com/users/JGrel/repos", "site_admin": false, "starred_url": "https://api.github.com/users/JGrel/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/JGrel/subscriptions", "type": "User", "url": "https://api.github.com/users/JGrel", "user_view_type": "public" }
[]
open
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7535). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-04-24T19:44:28Z
2025-05-19T14:51:29Z
null
NONE
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7535.diff", "html_url": "https://github.com/huggingface/datasets/pull/7535", "merged_at": null, "patch_url": "https://github.com/huggingface/datasets/pull/7535.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7535" }
Change dill version to >=0.3.9,<0.4.5 and check for errors
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/7535/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/issues/7534
7,534
TensorFlow RaggedTensor Support (batch-level)
{ "avatar_url": "https://avatars.githubusercontent.com/u/7490199?v=4", "events_url": "https://api.github.com/users/Lundez/events{/privacy}", "followers_url": "https://api.github.com/users/Lundez/followers", "following_url": "https://api.github.com/users/Lundez/following{/other_user}", "gists_url": "https://api.github.com/users/Lundez/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lundez", "id": 7490199, "login": "Lundez", "node_id": "MDQ6VXNlcjc0OTAxOTk=", "organizations_url": "https://api.github.com/users/Lundez/orgs", "received_events_url": "https://api.github.com/users/Lundez/received_events", "repos_url": "https://api.github.com/users/Lundez/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lundez/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lundez/subscriptions", "type": "User", "url": "https://api.github.com/users/Lundez", "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
[ "Keras doesn't support other inputs other than tf.data.Dataset objects ? it's a bit painful to have to support and maintain this kind of integration\n\nIs there a way to use a `datasets.Dataset` with outputs formatted as tensors / ragged tensors instead ? like in https://huggingface.co/docs/datasets/use_with_tensorflow#dataset-format", "I'll give it a try when I get the time. But quite sure I already tested the `with_format` approach.\n\nKeras when using TF as backend converts the datasets into `tf.data.Dataset`, much like you do.", "Hi @Lundez! Thanks for raising this — very valid point, especially for Object Detection use-cases.\n\nYou're right that np_get_batch currently enforces numpy batching, which breaks RaggedTensor support due to its inability to handle nested structures. This likely needs a redesign to allow TensorFlow-native batching in specific formats.\n\nBefore diving into a code change though, could you confirm:\n\nDoes `.with_format(\"tensorflow\")` (without batching) return a `tf.data.Dataset` that works if batching is deferred to `model.fit()`?\n\nHave you tried something like:\n\n```python\ntf_dataset = dataset.with_format(\"tensorflow\").to_tf_dataset(\n columns=[\"image\", \"labels\"],\n label_cols=None,\n batch_size=None # No batching here\n)\nmodel.fit(tf_dataset.batch(BATCH_SIZE)) # Use RaggedTensor batching here\n```\n\nIf this works, it might be worth updating the documentation rather than changing batching logic inside datasets itself.\n\nThat said, happy to explore changes if batching needs to be supported natively for RaggedTensor. Just flagging that it’d require some careful design due to existing numpy assumptions.", "Hi, we've had to move on for now. \n\nWe have actually also moved to dense tensors to make it possible to xla complie the training. \n\nBut I'll check when I'm back from vacation which is far into the future. \n\nThanks" ]
2025-04-24T13:14:52Z
2025-06-30T17:03:39Z
null
NONE
null
null
### Feature request Hi, Currently datasets does not support RaggedTensor output on batch-level. When building a Object Detection Dataset (with TensorFlow) I need to enable RaggedTensors as that's how BBoxes & classes are expected from the Keras Model POV. Currently there's a error thrown saying that "Nested Data is not supported". It'd be very helpful if this was fixed! :) ### Motivation Enabling Object Detection pipelines for TensorFlow. ### Your contribution With guidance I'd happily help making the PR. The current implementation with DataCollator and later enforcing `np.array` is the problematic part (at the end of `np_get_batch` in `tf_utils.py`). As `numpy` don't support "Raggednes"
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/7534/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/pull/7533
7,533
Add custom fingerprint support to `from_generator`
{ "avatar_url": "https://avatars.githubusercontent.com/u/43753582?v=4", "events_url": "https://api.github.com/users/simonreise/events{/privacy}", "followers_url": "https://api.github.com/users/simonreise/followers", "following_url": "https://api.github.com/users/simonreise/following{/other_user}", "gists_url": "https://api.github.com/users/simonreise/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/simonreise", "id": 43753582, "login": "simonreise", "node_id": "MDQ6VXNlcjQzNzUzNTgy", "organizations_url": "https://api.github.com/users/simonreise/orgs", "received_events_url": "https://api.github.com/users/simonreise/received_events", "repos_url": "https://api.github.com/users/simonreise/repos", "site_admin": false, "starred_url": "https://api.github.com/users/simonreise/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/simonreise/subscriptions", "type": "User", "url": "https://api.github.com/users/simonreise", "user_view_type": "public" }
[]
closed
false
[ "This is great !\r\n\r\nWhat do you think of passing `config_id=` directly to the builder instead of just the suffix ? This would be a power user argument though, or for internal use. And in from_generator the new argument can be `fingerprint=` as in `Dataset.__init__()`\r\n\r\nThe `config_id` can be defined using something like `config_id = \"default-fingerprint=\" + fingerprint`\r\n\r\nI feel ike this could make the Dataset API more coherent if we avoid introducing a new argument while we can juste use `fingerprint=`", "@lhoestq could you please re-review the changes I made?", "@lhoestq ping\r\nI also added a simple test for the `fingerprint` parameter", "@lhoestq could you please review the PR? I implemented the requested changes and added a test for the added `fingerprint` arg", "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7533). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-04-23T19:31:35Z
2025-10-23T16:25:57Z
2025-10-23T16:25:57Z
CONTRIBUTOR
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7533.diff", "html_url": "https://github.com/huggingface/datasets/pull/7533", "merged_at": "2025-10-23T16:25:57Z", "patch_url": "https://github.com/huggingface/datasets/pull/7533.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7533" }
This PR adds `dataset_id_suffix` parameter to 'Dataset.from_generator' function. `Dataset.from_generator` function passes all of its arguments to `BuilderConfig.create_config_id`, including generator function itself. `BuilderConfig.create_config_id` function tries to hash all the args, which can take a large amount of time or even cause MemoryError if the dataset processed in a generator function is large enough. This PR allows user to pass a custom fingerprint (`dataset_id_suffix`) to be used as a suffix in a dataset name instead of the one generated by hashing the args. This PR is a possible solution of #7513
{ "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/7533/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7532
7,532
Document the HF_DATASETS_CACHE environment variable in the datasets cache documentation
{ "avatar_url": "https://avatars.githubusercontent.com/u/129883215?v=4", "events_url": "https://api.github.com/users/Harry-Yang0518/events{/privacy}", "followers_url": "https://api.github.com/users/Harry-Yang0518/followers", "following_url": "https://api.github.com/users/Harry-Yang0518/following{/other_user}", "gists_url": "https://api.github.com/users/Harry-Yang0518/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Harry-Yang0518", "id": 129883215, "login": "Harry-Yang0518", "node_id": "U_kgDOB73cTw", "organizations_url": "https://api.github.com/users/Harry-Yang0518/orgs", "received_events_url": "https://api.github.com/users/Harry-Yang0518/received_events", "repos_url": "https://api.github.com/users/Harry-Yang0518/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Harry-Yang0518/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Harry-Yang0518/subscriptions", "type": "User", "url": "https://api.github.com/users/Harry-Yang0518", "user_view_type": "public" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7532). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.", "Your clarification in your comment at https://github.com/huggingface/datasets/issues/7480#issuecomment-2833640084 sounds great, would you like to update this PR to include it ?", "Hi @lhoestq, I’ve updated the documentation to reflect the clarifications discussed in #7480. Let me know if anything else is needed!\r\n" ]
2025-04-22T00:23:13Z
2025-05-06T15:54:38Z
2025-05-06T15:54:38Z
CONTRIBUTOR
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7532.diff", "html_url": "https://github.com/huggingface/datasets/pull/7532", "merged_at": "2025-05-06T15:54:38Z", "patch_url": "https://github.com/huggingface/datasets/pull/7532.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7532" }
This pull request updates the Datasets documentation to include the `HF_DATASETS_CACHE` environment variable. While the current documentation only mentions `HF_HOME` for overriding the default cache directory, `HF_DATASETS_CACHE` is also a supported and useful option for specifying a custom cache location for datasets stored in Arrow format. This addition is based on the discussion in (https://github.com/huggingface/datasets/issues/7457), where users noted the absence of this variable in the documentation despite its functionality. The update adds a new section to `cache.mdx` that explains how to use `HF_DATASETS_CACHE` with an example. This change aims to improve clarity and help users better manage their cache directories when working in shared environments or with limited local storage. Closes #7457.
{ "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/7532/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/issues/7531
7,531
Deepspeed reward training hangs at end of training with Dataset.from_list
{ "avatar_url": "https://avatars.githubusercontent.com/u/60710414?v=4", "events_url": "https://api.github.com/users/Matt00n/events{/privacy}", "followers_url": "https://api.github.com/users/Matt00n/followers", "following_url": "https://api.github.com/users/Matt00n/following{/other_user}", "gists_url": "https://api.github.com/users/Matt00n/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Matt00n", "id": 60710414, "login": "Matt00n", "node_id": "MDQ6VXNlcjYwNzEwNDE0", "organizations_url": "https://api.github.com/users/Matt00n/orgs", "received_events_url": "https://api.github.com/users/Matt00n/received_events", "repos_url": "https://api.github.com/users/Matt00n/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Matt00n/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Matt00n/subscriptions", "type": "User", "url": "https://api.github.com/users/Matt00n", "user_view_type": "public" }
[]
open
false
[ "Hi ! How big is the dataset ? if you load it using `from_list`, the dataset lives in memory and has to be copied to every gpu process, which can be slow.\n\nIt's fasted if you load it from JSON files from disk, because in that case the dataset in converted to Arrow and loaded from disk using memory mapping. Memory mapping allows to quickly reload the dataset in other processes.\n\nMaybe we can change `from_list` and other methods to always use the disk though, instead of loading in memory, WDYT ?", "Thanks for raising this! As lhoestq mentioned, the root cause seems to be that `Dataset.from_list()` creates an in-memory dataset, which causes issues with DeepSpeed across multiple GPUs due to the cost of copying that memory to all processes.\n\nUsing `load_dataset(\"json\", ...)` works because Hugging Face datasets then convert the data to Apache Arrow and use **memory mapping**, which avoids this copying overhead.\n\nPossible improvement could be to add an option like `use_disk=True` to `Dataset.from_list()` to allow users to write to Arrow + memory-map the dataset, enabling compatibility with multi-process settings like DeepSpeed, while keeping the current fast behavior by default.\n\nWould love to hear if this direction sounds acceptable before attempting a PR.\n" ]
2025-04-21T17:29:20Z
2025-06-29T06:20:45Z
null
NONE
null
null
There seems to be a weird interaction between Deepspeed, the Dataset.from_list method and trl's RewardTrainer. On a multi-GPU setup (10 A100s), training always hangs at the very end of training until it times out. The training itself works fine until the end of training and running the same script with Deepspeed on a single GPU works without hangig. The issue persisted across a wide range of Deepspeed configs and training arguments. The issue went away when storing the exact same dataset as a JSON and using `dataset = load_dataset("json", ...)`. Here is my training script: ```python import pickle import os import random import warnings import torch from datasets import load_dataset, Dataset from transformers import AutoModelForSequenceClassification, AutoTokenizer from trl import RewardConfig, RewardTrainer, ModelConfig ####################################### Reward model ################################################# # Explicitly set arguments model_name_or_path = "Qwen/Qwen2.5-1.5B" output_dir = "Qwen2-0.5B-Reward-LoRA" per_device_train_batch_size = 2 num_train_epochs = 5 gradient_checkpointing = True learning_rate = 1.0e-4 logging_steps = 25 eval_strategy = "steps" eval_steps = 50 max_length = 2048 torch_dtype = "auto" trust_remote_code = False model_args = ModelConfig( model_name_or_path=model_name_or_path, model_revision=None, trust_remote_code=trust_remote_code, torch_dtype=torch_dtype, lora_task_type="SEQ_CLS", # Make sure task type is seq_cls ) training_args = RewardConfig( output_dir=output_dir, per_device_train_batch_size=per_device_train_batch_size, num_train_epochs=num_train_epochs, gradient_checkpointing=gradient_checkpointing, learning_rate=learning_rate, logging_steps=logging_steps, eval_strategy=eval_strategy, eval_steps=eval_steps, max_length=max_length, gradient_checkpointing_kwargs=dict(use_reentrant=False), center_rewards_coefficient = 0.01, fp16=False, bf16=True, save_strategy="no", dataloader_num_workers=0, # deepspeed="./configs/deepspeed_config.json", ) ################ # Model & Tokenizer ################ model_kwargs = dict( revision=model_args.model_revision, use_cache=False if training_args.gradient_checkpointing else True, torch_dtype=model_args.torch_dtype, ) tokenizer = AutoTokenizer.from_pretrained( model_args.model_name_or_path, use_fast=True ) model = AutoModelForSequenceClassification.from_pretrained( model_args.model_name_or_path, num_labels=1, trust_remote_code=model_args.trust_remote_code, **model_kwargs ) # Align padding tokens between tokenizer and model model.config.pad_token_id = tokenizer.pad_token_id # If post-training a base model, use ChatML as the default template if tokenizer.chat_template is None: model, tokenizer = setup_chat_format(model, tokenizer) if model_args.use_peft and model_args.lora_task_type != "SEQ_CLS": warnings.warn( "You are using a `task_type` that is different than `SEQ_CLS` for PEFT. This will lead to silent bugs" " Make sure to pass --lora_task_type SEQ_CLS when using this script with PEFT.", UserWarning, ) ############## # Load dataset ############## with open('./prefs.pkl', 'rb') as fh: loaded_data = pickle.load(fh) random.shuffle(loaded_data) dataset = [] for a_wins, a, b in loaded_data: if a_wins == 0: a, b = b, a dataset.append({'chosen': a, 'rejected': b}) dataset = Dataset.from_list(dataset) # Split the dataset into training and evaluation sets train_eval_split = dataset.train_test_split(test_size=0.15, shuffle=True, seed=42) # Access the training and evaluation datasets train_dataset = train_eval_split['train'] eval_dataset = train_eval_split['test'] ########## # Training ########## trainer = RewardTrainer( model=model, processing_class=tokenizer, args=training_args, train_dataset=train_dataset, eval_dataset=eval_dataset, ) trainer.train() ``` Replacing `dataset = Dataset.from_list(dataset)` with ```python with open('./prefs.json', 'w') as fh: json.dump(dataset, fh) dataset = load_dataset("json", data_files="./prefs.json", split='train') ``` resolves the issue.
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/7531/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7530
7,530
How to solve "Spaces stuck in Building" problems
{ "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" }
[]
closed
false
[ "I'm facing the same issue—Space stuck in \"Building\" even after restart and Factory rebuild. Any fix?\n", "> I'm facing the same issue—Space stuck in \"Building\" even after restart and Factory rebuild. Any fix?\n\nAlso see https://github.com/huggingface/huggingface_hub/issues/3019", "I'm facing the same issue. The build fails with the same error, and restarting won't help. Is there a fix or ETA? " ]
2025-04-21T03:08:38Z
2025-04-22T07:49:52Z
2025-04-22T07:49:52Z
NONE
null
null
### Describe the bug Public spaces may stuck in Building after restarting, error log as follows: build error Unexpected job error ERROR: failed to push spaces-registry.huggingface.tech/spaces/*:cpu-*-*: unexpected status from HEAD request to https://spaces-registry.huggingface.tech/v2/spaces/*/manifests/cpu-*-*: 401 Unauthorized ### Steps to reproduce the bug Restart space / Factory rebuild cannot avoid it ### Expected behavior Fix this problem ### Environment info no requirements.txt can still happen python gradio spaces
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/7530/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7529
7,529
audio folder builder cannot detect custom split name
{ "avatar_url": "https://avatars.githubusercontent.com/u/37548991?v=4", "events_url": "https://api.github.com/users/phineas-pta/events{/privacy}", "followers_url": "https://api.github.com/users/phineas-pta/followers", "following_url": "https://api.github.com/users/phineas-pta/following{/other_user}", "gists_url": "https://api.github.com/users/phineas-pta/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/phineas-pta", "id": 37548991, "login": "phineas-pta", "node_id": "MDQ6VXNlcjM3NTQ4OTkx", "organizations_url": "https://api.github.com/users/phineas-pta/orgs", "received_events_url": "https://api.github.com/users/phineas-pta/received_events", "repos_url": "https://api.github.com/users/phineas-pta/repos", "site_admin": false, "starred_url": "https://api.github.com/users/phineas-pta/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/phineas-pta/subscriptions", "type": "User", "url": "https://api.github.com/users/phineas-pta", "user_view_type": "public" }
[]
open
false
[]
2025-04-20T16:53:21Z
2025-04-20T16:53:21Z
null
NONE
null
null
### Describe the bug when using audio folder builder (`load_dataset("audiofolder", data_dir="/path/to/folder")`), it cannot detect custom split name other than train/validation/test ### Steps to reproduce the bug i have the following folder structure ``` my_dataset/ ├── train/ │ ├── lorem.wav │ ├── … │ └── metadata.csv ├── test/ │ ├── ipsum.wav │ ├── … │ └── metadata.csv ├── validation/ │ ├── dolor.wav │ ├── … │ └── metadata.csv └── custom/ ├── sit.wav ├── … └── metadata.csv ``` using `ds = load_dataset("audiofolder", data_dir="/path/to/my_dataset")` ### Expected behavior i got `ds` with only 3 splits train/validation/test, whenever i rename train/validation/test folder it also disappear if i re-create `ds` ### Environment info - `datasets` version: 3.5.0 - Platform: Windows-11-10.0.26100-SP0 - Python version: 3.12.8 - `huggingface_hub` version: 0.30.2 - PyArrow version: 18.1.0 - Pandas version: 2.2.3 - `fsspec` version: 2024.9.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/7529/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7528
7,528
Data Studio Error: Convert JSONL incorrectly
{ "avatar_url": "https://avatars.githubusercontent.com/u/144962041?v=4", "events_url": "https://api.github.com/users/zxccade/events{/privacy}", "followers_url": "https://api.github.com/users/zxccade/followers", "following_url": "https://api.github.com/users/zxccade/following{/other_user}", "gists_url": "https://api.github.com/users/zxccade/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zxccade", "id": 144962041, "login": "zxccade", "node_id": "U_kgDOCKPx-Q", "organizations_url": "https://api.github.com/users/zxccade/orgs", "received_events_url": "https://api.github.com/users/zxccade/received_events", "repos_url": "https://api.github.com/users/zxccade/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zxccade/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zxccade/subscriptions", "type": "User", "url": "https://api.github.com/users/zxccade", "user_view_type": "public" }
[]
open
false
[ "Hi ! Your JSONL file is incompatible with Arrow / Parquet. Indeed in Arrow / Parquet every dict should have the same keys, while in your dataset the bboxes have varying keys.\n\nThis causes the Data Studio to treat the bboxes as if each row was missing the keys from other rows.\n\nFeel free to take a look at the docs on object segmentation to see how to format a dataset with bboxes: https://huggingface.co/docs/datasets/object_detection" ]
2025-04-19T13:21:44Z
2025-05-06T13:18:38Z
null
NONE
null
null
### Describe the bug Hi there, I uploaded a dataset here https://huggingface.co/datasets/V-STaR-Bench/V-STaR, but I found that Data Studio incorrectly convert the "bboxes" value for the whole dataset. Therefore, anyone who downloaded the dataset via the API would get the wrong "bboxes" value in the data file. Could you help me address the issue? Many thanks, ### Steps to reproduce the bug The JSONL file of [V_STaR_test_release.jsonl](https://huggingface.co/datasets/V-STaR-Bench/V-STaR/blob/main/V_STaR_test_release.jsonl) has the correct values of every "bboxes" for each sample. But in the Data Studio, we can see that the values of "bboxes" have changed, and load the dataset via API will also get the wrong values. ### Expected behavior Fix the bug to correctly download my dataset. ### Environment info - `datasets` version: 2.16.1 - Platform: Linux-5.14.0-427.22.1.el9_4.x86_64-x86_64-with-glibc2.34 - Python version: 3.10.16 - `huggingface_hub` version: 0.29.3 - PyArrow version: 19.0.0 - Pandas version: 2.2.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/7528/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7527
7,527
Auto-merge option for `convert-to-parquet`
{ "avatar_url": "https://avatars.githubusercontent.com/u/17013474?v=4", "events_url": "https://api.github.com/users/klamike/events{/privacy}", "followers_url": "https://api.github.com/users/klamike/followers", "following_url": "https://api.github.com/users/klamike/following{/other_user}", "gists_url": "https://api.github.com/users/klamike/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/klamike", "id": 17013474, "login": "klamike", "node_id": "MDQ6VXNlcjE3MDEzNDc0", "organizations_url": "https://api.github.com/users/klamike/orgs", "received_events_url": "https://api.github.com/users/klamike/received_events", "repos_url": "https://api.github.com/users/klamike/repos", "site_admin": false, "starred_url": "https://api.github.com/users/klamike/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/klamike/subscriptions", "type": "User", "url": "https://api.github.com/users/klamike", "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
[ "Alternatively, there could be an option to switch from submitting PRs to just committing changes directly to `main`.", "Why not, I'd be in favor of `--merge-pull-request` to call `HfApi().merge_pull_request()` at the end of the conversion :) feel free to open a PR if you'd like", "#self-assign", "Closing since convert to parquet has been removed... https://github.com/huggingface/datasets/pull/7592#issuecomment-3073053138" ]
2025-04-18T16:03:22Z
2025-07-18T19:09:03Z
2025-07-18T19:09:03Z
CONTRIBUTOR
null
null
### Feature request Add a command-line option, e.g. `--auto-merge-pull-request` that enables automatic merging of the commits created by the `convert-to-parquet` tool. ### Motivation Large datasets may result in dozens of PRs due to the splitting mechanism. Each of these has to be manually accepted via the website. ### Your contribution Happy to look into submitting a PR if this is of interest to maintainers.
{ "avatar_url": "https://avatars.githubusercontent.com/u/17013474?v=4", "events_url": "https://api.github.com/users/klamike/events{/privacy}", "followers_url": "https://api.github.com/users/klamike/followers", "following_url": "https://api.github.com/users/klamike/following{/other_user}", "gists_url": "https://api.github.com/users/klamike/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/klamike", "id": 17013474, "login": "klamike", "node_id": "MDQ6VXNlcjE3MDEzNDc0", "organizations_url": "https://api.github.com/users/klamike/orgs", "received_events_url": "https://api.github.com/users/klamike/received_events", "repos_url": "https://api.github.com/users/klamike/repos", "site_admin": false, "starred_url": "https://api.github.com/users/klamike/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/klamike/subscriptions", "type": "User", "url": "https://api.github.com/users/klamike", "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/7527/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7526
7,526
Faster downloads/uploads with Xet storage
{ "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
[]
2025-04-18T14:46:42Z
2025-05-12T12:09:09Z
null
MEMBER
null
null
![Image](https://github.com/user-attachments/assets/6e247f4a-d436-4428-a682-fe18ebdc73a9) ## Xet is out ! Over the past few weeks, Hugging Face’s [Xet Team](https://huggingface.co/xet-team) took a major step forward by [migrating the first Model and Dataset repositories off LFS and to Xet storage](https://huggingface.co/posts/jsulz/911431940353906). See more information on the HF blog: https://huggingface.co/blog/xet-on-the-hub You can already enable Xet on Hugging Face account to benefit from faster downloads and uploads :) We finalized an official integration with the `huggingface_hub` library that means you get the benefits of Xet without any significant changes to your current workflow. ## Previous versions of `datasets` For older versions of `datasets` you might see this warning in `push_to_hub()`: ``` Uploading files as bytes or binary IO objects is not supported by Xet Storage. ``` This means the `huggingface_hub` + Xet integration isn't enabled for your version of `datasets`. You can fix this by updating to `datasets>=3.6.0` and `huggingface_hub>=0.31.0` ``` pip install -U datasets huggingface_hub ``` ## The future Stay tuned for more Xet optimizations, especially on [Xet-optimized Parquet](https://huggingface.co/blog/improve_parquet_dedupe)
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 7, "total_count": 7, "url": "https://api.github.com/repos/huggingface/datasets/issues/7526/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/pull/7525
7,525
Fix indexing in split commit messages
{ "avatar_url": "https://avatars.githubusercontent.com/u/17013474?v=4", "events_url": "https://api.github.com/users/klamike/events{/privacy}", "followers_url": "https://api.github.com/users/klamike/followers", "following_url": "https://api.github.com/users/klamike/following{/other_user}", "gists_url": "https://api.github.com/users/klamike/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/klamike", "id": 17013474, "login": "klamike", "node_id": "MDQ6VXNlcjE3MDEzNDc0", "organizations_url": "https://api.github.com/users/klamike/orgs", "received_events_url": "https://api.github.com/users/klamike/received_events", "repos_url": "https://api.github.com/users/klamike/repos", "site_admin": false, "starred_url": "https://api.github.com/users/klamike/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/klamike/subscriptions", "type": "User", "url": "https://api.github.com/users/klamike", "user_view_type": "public" }
[]
closed
false
[ "Hi ! this is expected and is coherent with other naming conventions in `datasets` such as parquet shards naming" ]
2025-04-17T17:06:26Z
2025-04-28T14:26:27Z
2025-04-28T14:26:27Z
CONTRIBUTOR
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7525.diff", "html_url": "https://github.com/huggingface/datasets/pull/7525", "merged_at": null, "patch_url": "https://github.com/huggingface/datasets/pull/7525.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7525" }
When a large commit is split up, it seems the commit index in the message is zero-based while the total number is one-based. I came across this running `convert-to-parquet` and was wondering why there was no `6-of-6` commit. This PR fixes that by adding one to the commit index, so both are one-based. Current behavior: <img width="463" alt="Screenshot 2025-04-17 at 1 00 17 PM" src="https://github.com/user-attachments/assets/7f3d389e-cb92-405d-a3c2-f2b1cdf0cb79" />
{ "avatar_url": "https://avatars.githubusercontent.com/u/17013474?v=4", "events_url": "https://api.github.com/users/klamike/events{/privacy}", "followers_url": "https://api.github.com/users/klamike/followers", "following_url": "https://api.github.com/users/klamike/following{/other_user}", "gists_url": "https://api.github.com/users/klamike/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/klamike", "id": 17013474, "login": "klamike", "node_id": "MDQ6VXNlcjE3MDEzNDc0", "organizations_url": "https://api.github.com/users/klamike/orgs", "received_events_url": "https://api.github.com/users/klamike/received_events", "repos_url": "https://api.github.com/users/klamike/repos", "site_admin": false, "starred_url": "https://api.github.com/users/klamike/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/klamike/subscriptions", "type": "User", "url": "https://api.github.com/users/klamike", "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/7525/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7524
7,524
correct use with polars example
{ "avatar_url": "https://avatars.githubusercontent.com/u/43832476?v=4", "events_url": "https://api.github.com/users/SiQube/events{/privacy}", "followers_url": "https://api.github.com/users/SiQube/followers", "following_url": "https://api.github.com/users/SiQube/following{/other_user}", "gists_url": "https://api.github.com/users/SiQube/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/SiQube", "id": 43832476, "login": "SiQube", "node_id": "MDQ6VXNlcjQzODMyNDc2", "organizations_url": "https://api.github.com/users/SiQube/orgs", "received_events_url": "https://api.github.com/users/SiQube/received_events", "repos_url": "https://api.github.com/users/SiQube/repos", "site_admin": false, "starred_url": "https://api.github.com/users/SiQube/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SiQube/subscriptions", "type": "User", "url": "https://api.github.com/users/SiQube", "user_view_type": "public" }
[]
closed
false
[]
2025-04-17T10:19:19Z
2025-04-28T13:48:34Z
2025-04-28T13:48:33Z
CONTRIBUTOR
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7524.diff", "html_url": "https://github.com/huggingface/datasets/pull/7524", "merged_at": "2025-04-28T13:48:33Z", "patch_url": "https://github.com/huggingface/datasets/pull/7524.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7524" }
null
{ "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/7524/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7523
7,523
mention av in video docs
{ "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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7523). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-04-16T13:11:12Z
2025-04-16T13:13:45Z
2025-04-16T13:11:42Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7523.diff", "html_url": "https://github.com/huggingface/datasets/pull/7523", "merged_at": "2025-04-16T13:11:42Z", "patch_url": "https://github.com/huggingface/datasets/pull/7523.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7523" }
null
{ "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/7523/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7522
7,522
Preserve formatting in concatenated IterableDataset
{ "avatar_url": "https://avatars.githubusercontent.com/u/5140987?v=4", "events_url": "https://api.github.com/users/francescorubbo/events{/privacy}", "followers_url": "https://api.github.com/users/francescorubbo/followers", "following_url": "https://api.github.com/users/francescorubbo/following{/other_user}", "gists_url": "https://api.github.com/users/francescorubbo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/francescorubbo", "id": 5140987, "login": "francescorubbo", "node_id": "MDQ6VXNlcjUxNDA5ODc=", "organizations_url": "https://api.github.com/users/francescorubbo/orgs", "received_events_url": "https://api.github.com/users/francescorubbo/received_events", "repos_url": "https://api.github.com/users/francescorubbo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/francescorubbo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/francescorubbo/subscriptions", "type": "User", "url": "https://api.github.com/users/francescorubbo", "user_view_type": "public" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7522). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-04-16T02:37:33Z
2025-05-19T15:07:38Z
2025-05-19T15:07:37Z
CONTRIBUTOR
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7522.diff", "html_url": "https://github.com/huggingface/datasets/pull/7522", "merged_at": "2025-05-19T15:07:37Z", "patch_url": "https://github.com/huggingface/datasets/pull/7522.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7522" }
Fixes #7515
{ "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/7522/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7521
7,521
fix: Image Feature in Datasets Library Fails to Handle bytearray Objects from Spark DataFrames (#7517)
{ "avatar_url": "https://avatars.githubusercontent.com/u/73196164?v=4", "events_url": "https://api.github.com/users/giraffacarp/events{/privacy}", "followers_url": "https://api.github.com/users/giraffacarp/followers", "following_url": "https://api.github.com/users/giraffacarp/following{/other_user}", "gists_url": "https://api.github.com/users/giraffacarp/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/giraffacarp", "id": 73196164, "login": "giraffacarp", "node_id": "MDQ6VXNlcjczMTk2MTY0", "organizations_url": "https://api.github.com/users/giraffacarp/orgs", "received_events_url": "https://api.github.com/users/giraffacarp/received_events", "repos_url": "https://api.github.com/users/giraffacarp/repos", "site_admin": false, "starred_url": "https://api.github.com/users/giraffacarp/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/giraffacarp/subscriptions", "type": "User", "url": "https://api.github.com/users/giraffacarp", "user_view_type": "public" }
[]
closed
false
[ "@lhoestq let me know if you prefer to change the spark iterator so it outputs `bytes`", "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7521). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-04-15T21:23:58Z
2025-05-07T14:17:29Z
2025-05-07T14:17:29Z
CONTRIBUTOR
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7521.diff", "html_url": "https://github.com/huggingface/datasets/pull/7521", "merged_at": "2025-05-07T14:17:29Z", "patch_url": "https://github.com/huggingface/datasets/pull/7521.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7521" }
## Task Support bytes-like objects (bytes and bytearray) in Features classes ### Description The `Features` classes only accept `bytes` objects for binary data, but not `bytearray`. This leads to errors when using `IterableDataset.from_spark()` with Spark DataFrames as they contain `bytearray` objects, even though both `bytes` and `bytearray` are valid [*bytes-like objects* in Python](https://docs.python.org/3/glossary.html#term-bytes-like-object). ### Changes - Updated `Features` classes to accept both `bytes` and `bytearray` types for binary data fields. ### Reasoning - `bytes` and `bytearray` serve the same purpose for binary data, with the only difference being mutability. - Modifying the Spark iterator to convert `bytearray` to `bytes` would be a workaround, not a true fix. I think the correct solution is to accept all bytes-like objects as input. - This approach is more robust and future-proof since Python 3.12+ provides a [standard way to check for buffer protocol](https://docs.python.org/3/c-api/buffer.html#bufferobjects). ### Testing - Added tests to cover `bytearray` inputs for image features. ### Related Issues - Fixes: #7517
{ "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/7521/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/issues/7520
7,520
Update items in the dataset without `map`
{ "avatar_url": "https://avatars.githubusercontent.com/u/122402293?v=4", "events_url": "https://api.github.com/users/mashdragon/events{/privacy}", "followers_url": "https://api.github.com/users/mashdragon/followers", "following_url": "https://api.github.com/users/mashdragon/following{/other_user}", "gists_url": "https://api.github.com/users/mashdragon/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mashdragon", "id": 122402293, "login": "mashdragon", "node_id": "U_kgDOB0u19Q", "organizations_url": "https://api.github.com/users/mashdragon/orgs", "received_events_url": "https://api.github.com/users/mashdragon/received_events", "repos_url": "https://api.github.com/users/mashdragon/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mashdragon/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mashdragon/subscriptions", "type": "User", "url": "https://api.github.com/users/mashdragon", "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
[ "Hello!\n\nHave you looked at `Dataset.shard`? [Docs](https://huggingface.co/docs/datasets/en/process#shard)\n\nUsing this method you could break your dataset in N shards. Apply `map` on each shard and concatenate them back." ]
2025-04-15T19:39:01Z
2025-04-19T18:47:46Z
null
NONE
null
null
### Feature request I would like to be able to update items in my dataset without affecting all rows. At least if there was a range option, I would be able to process those items, save the dataset, and then continue. If I am supposed to split the dataset first, that is not clear, since the docs suggest that any of those functions returns a new object, so I don't think I can do that. ### Motivation I am applying an extremely time-consuming function to each item in my `Dataset`. Unfortunately, datasets only supports updating values via `map`, so if my computer dies in the middle of this long-running process, I lose all progress. This is far from ideal. I would like to use `datasets` throughout this processing, but this limitation is now forcing me to write my own dataset format just to do this intermediary operation. It would be less intuitive but I suppose I could split and then concatenate the dataset before saving? But this feels very inefficient. ### Your contribution I can test the feature.
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/7520/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/pull/7519
7,519
pdf docs fixes
{ "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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7519). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-04-15T13:35:56Z
2025-04-15T13:38:31Z
2025-04-15T13:36:03Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7519.diff", "html_url": "https://github.com/huggingface/datasets/pull/7519", "merged_at": "2025-04-15T13:36:03Z", "patch_url": "https://github.com/huggingface/datasets/pull/7519.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7519" }
close https://github.com/huggingface/datasets/issues/7494
{ "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/7519/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/issues/7518
7,518
num_proc parallelization works only for first ~10s.
{ "avatar_url": "https://avatars.githubusercontent.com/u/33901783?v=4", "events_url": "https://api.github.com/users/pshishodiaa/events{/privacy}", "followers_url": "https://api.github.com/users/pshishodiaa/followers", "following_url": "https://api.github.com/users/pshishodiaa/following{/other_user}", "gists_url": "https://api.github.com/users/pshishodiaa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/pshishodiaa", "id": 33901783, "login": "pshishodiaa", "node_id": "MDQ6VXNlcjMzOTAxNzgz", "organizations_url": "https://api.github.com/users/pshishodiaa/orgs", "received_events_url": "https://api.github.com/users/pshishodiaa/received_events", "repos_url": "https://api.github.com/users/pshishodiaa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/pshishodiaa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pshishodiaa/subscriptions", "type": "User", "url": "https://api.github.com/users/pshishodiaa", "user_view_type": "public" }
[]
open
false
[ "Hi, can you check if the processes are still alive ? It's a bit weird because `datasets` does check if processes crash and return an error in that case", "Thank you for reverting quickly. I digged a bit, and realized my disk's IOPS is also limited - which is causing this. will check further and report if it's an issue of hf datasets' side or mine. " ]
2025-04-15T11:44:03Z
2025-04-15T13:12:13Z
null
NONE
null
null
### Describe the bug When I try to load an already downloaded dataset with num_proc=64, the speed is very high for the first 10-20 seconds acheiving 30-40K samples / s, and 100% utilization for all cores but it soon drops to <= 1000 with almost 0% utilization for most cores. ### Steps to reproduce the bug ``` // download dataset with cli !huggingface-cli download --repo-type dataset timm/imagenet-1k-wds --max-workers 32 from datasets import load_dataset ds = load_dataset("timm/imagenet-1k-wds", num_proc=64) ``` ### Expected behavior 100% core utilization throughout. ### Environment info Azure A100-80GB, 16 cores VM ![Image](https://github.com/user-attachments/assets/69d00fe3-d720-4474-9439-21e046d85034)
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/7518/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7517
7,517
Image Feature in Datasets Library Fails to Handle bytearray Objects from Spark DataFrames
{ "avatar_url": "https://avatars.githubusercontent.com/u/73196164?v=4", "events_url": "https://api.github.com/users/giraffacarp/events{/privacy}", "followers_url": "https://api.github.com/users/giraffacarp/followers", "following_url": "https://api.github.com/users/giraffacarp/following{/other_user}", "gists_url": "https://api.github.com/users/giraffacarp/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/giraffacarp", "id": 73196164, "login": "giraffacarp", "node_id": "MDQ6VXNlcjczMTk2MTY0", "organizations_url": "https://api.github.com/users/giraffacarp/orgs", "received_events_url": "https://api.github.com/users/giraffacarp/received_events", "repos_url": "https://api.github.com/users/giraffacarp/repos", "site_admin": false, "starred_url": "https://api.github.com/users/giraffacarp/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/giraffacarp/subscriptions", "type": "User", "url": "https://api.github.com/users/giraffacarp", "user_view_type": "public" }
[]
closed
false
[ "Hi ! The `Image()` type accepts either\n- a `bytes` object containing the image bytes\n- a `str` object containing the image path\n- a `PIL.Image` object\n\nbut it doesn't support `bytearray`, maybe you can convert to `bytes` beforehand ?", "Hi @lhoestq, \nconverting to bytes is certainly possible and would work around the error. However, the core issue is that `Dataset` and `IterableDataset` behave differently with the features.\n\nI’d be happy to work on a fix for this issue.", "I see, that's an issue indeed. Feel free to ping me if I can help with reviews or any guidance\n\nIf it can help, the code that takes a Spark DataFrame and iterates on the rows for `IterableDataset` is here: \n\nhttps://github.com/huggingface/datasets/blob/6a96bf313085d7538a999b929a550e14e1d406c9/src/datasets/packaged_modules/spark/spark.py#L49-L53", "#self-assign" ]
2025-04-15T11:29:17Z
2025-05-07T14:17:30Z
2025-05-07T14:17:30Z
CONTRIBUTOR
null
null
### Describe the bug When using `IterableDataset.from_spark()` with a Spark DataFrame containing image data, the `Image` feature class fails to properly process this data type, causing an `AttributeError: 'bytearray' object has no attribute 'get'` ### Steps to reproduce the bug 1. Create a Spark DataFrame with a column containing image data as bytearray objects 2. Define a Feature schema with an Image feature 3. Create an IterableDataset using `IterableDataset.from_spark()` 4. Attempt to iterate through the dataset ``` from pyspark.sql import SparkSession from datasets import Dataset, IterableDataset, Features, Image, Value # initialize spark spark = SparkSession.builder.appName("MinimalRepro").getOrCreate() # create spark dataframe data = [(0, open("image.png", "rb").read())] df = spark.createDataFrame(data, "idx: int, image: binary") # convert to dataset features = Features({"idx": Value("int64"), "image": Image()}) ds = Dataset.from_spark(df, features=features) ds_iter = IterableDataset.from_spark(df, features=features) # iterate print(next(iter(ds))) print(next(iter(ds_iter))) ``` ### Expected behavior The features should work on `IterableDataset` the same way they work on `Dataset` ### Environment info - `datasets` version: 3.5.0 - Platform: macOS-15.3.2-arm64-arm-64bit - Python version: 3.12.7 - `huggingface_hub` version: 0.30.2 - PyArrow version: 18.1.0 - Pandas version: 2.2.3 - `fsspec` version: 2024.12.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/7517/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7516
7,516
unsloth/DeepSeek-R1-Distill-Qwen-32B server error
{ "avatar_url": "https://avatars.githubusercontent.com/u/164353862?v=4", "events_url": "https://api.github.com/users/Editor-1/events{/privacy}", "followers_url": "https://api.github.com/users/Editor-1/followers", "following_url": "https://api.github.com/users/Editor-1/following{/other_user}", "gists_url": "https://api.github.com/users/Editor-1/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Editor-1", "id": 164353862, "login": "Editor-1", "node_id": "U_kgDOCcvXRg", "organizations_url": "https://api.github.com/users/Editor-1/orgs", "received_events_url": "https://api.github.com/users/Editor-1/received_events", "repos_url": "https://api.github.com/users/Editor-1/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Editor-1/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Editor-1/subscriptions", "type": "User", "url": "https://api.github.com/users/Editor-1", "user_view_type": "public" }
[]
closed
false
[]
2025-04-15T09:26:53Z
2025-04-15T09:57:26Z
2025-04-15T09:57:26Z
NONE
null
null
### Describe the bug hfhubhttperror: 500 server error: internal server error for url: https://huggingface.co/api/models/unsloth/deepseek-r1-distill-qwen-32b-bnb-4bit/commits/main (request id: root=1-67fe23fa-3a2150eb444c2a823c388579;de3aed68-c397-4da5-94d4-6565efd3b919) internal error - we're working hard to fix this as soon as possible! ### Steps to reproduce the bug unsloth/DeepSeek-R1-Distill-Qwen-32B server error ### Expected behavior Network repair ### Environment info The web side is also unavailable
{ "avatar_url": "https://avatars.githubusercontent.com/u/164353862?v=4", "events_url": "https://api.github.com/users/Editor-1/events{/privacy}", "followers_url": "https://api.github.com/users/Editor-1/followers", "following_url": "https://api.github.com/users/Editor-1/following{/other_user}", "gists_url": "https://api.github.com/users/Editor-1/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Editor-1", "id": 164353862, "login": "Editor-1", "node_id": "U_kgDOCcvXRg", "organizations_url": "https://api.github.com/users/Editor-1/orgs", "received_events_url": "https://api.github.com/users/Editor-1/received_events", "repos_url": "https://api.github.com/users/Editor-1/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Editor-1/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Editor-1/subscriptions", "type": "User", "url": "https://api.github.com/users/Editor-1", "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/7516/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7515
7,515
`concatenate_datasets` does not preserve Pytorch format for IterableDataset
{ "avatar_url": "https://avatars.githubusercontent.com/u/5140987?v=4", "events_url": "https://api.github.com/users/francescorubbo/events{/privacy}", "followers_url": "https://api.github.com/users/francescorubbo/followers", "following_url": "https://api.github.com/users/francescorubbo/following{/other_user}", "gists_url": "https://api.github.com/users/francescorubbo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/francescorubbo", "id": 5140987, "login": "francescorubbo", "node_id": "MDQ6VXNlcjUxNDA5ODc=", "organizations_url": "https://api.github.com/users/francescorubbo/orgs", "received_events_url": "https://api.github.com/users/francescorubbo/received_events", "repos_url": "https://api.github.com/users/francescorubbo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/francescorubbo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/francescorubbo/subscriptions", "type": "User", "url": "https://api.github.com/users/francescorubbo", "user_view_type": "public" }
[]
closed
false
[ "Hi ! Oh indeed it would be cool to return the same format in that case. Would you like to submit a PR ? The function that does the concatenation is here:\n\nhttps://github.com/huggingface/datasets/blob/90e5bf8a8599b625d6103ee5ac83b98269991141/src/datasets/iterable_dataset.py#L3375-L3380", "Thank you for the pointer, @lhoestq ! See #7522 " ]
2025-04-15T04:36:34Z
2025-05-19T15:07:38Z
2025-05-19T15:07:38Z
CONTRIBUTOR
null
null
### Describe the bug When concatenating datasets with `concatenate_datasets`, I would expect the resulting combined dataset to be in the same format as the inputs (assuming it's consistent). This is indeed the behavior when combining `Dataset`, but not when combining `IterableDataset`. Specifically, when applying `concatenate_datasets` to a list of `IterableDataset` in Pytorch format (i.e. using `.with_format(Pytorch)`), the output `IterableDataset` is not in Pytorch format. ### Steps to reproduce the bug ``` import datasets ds = datasets.Dataset.from_dict({"a": [1,2,3]}) iterable_ds = ds.to_iterable_dataset() datasets.concatenate_datasets([ds.with_format("torch")]) # <- this preserves Pytorch format datasets.concatenate_datasets([iterable_ds.with_format("torch")]) # <- this does NOT preserves Pytorch format ``` ### Expected behavior Pytorch format should be preserved when combining IterableDataset in Pytorch format. ### Environment info datasets==3.5.0, Python 3.11.11, torch==2.2.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": 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/7515/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/pull/7514
7,514
Do not hash `generator` in `BuilderConfig.create_config_id`
{ "avatar_url": "https://avatars.githubusercontent.com/u/43753582?v=4", "events_url": "https://api.github.com/users/simonreise/events{/privacy}", "followers_url": "https://api.github.com/users/simonreise/followers", "following_url": "https://api.github.com/users/simonreise/following{/other_user}", "gists_url": "https://api.github.com/users/simonreise/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/simonreise", "id": 43753582, "login": "simonreise", "node_id": "MDQ6VXNlcjQzNzUzNTgy", "organizations_url": "https://api.github.com/users/simonreise/orgs", "received_events_url": "https://api.github.com/users/simonreise/received_events", "repos_url": "https://api.github.com/users/simonreise/repos", "site_admin": false, "starred_url": "https://api.github.com/users/simonreise/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/simonreise/subscriptions", "type": "User", "url": "https://api.github.com/users/simonreise", "user_view_type": "public" }
[]
closed
false
[]
2025-04-15T01:26:43Z
2025-04-23T11:55:55Z
2025-04-15T16:27:51Z
CONTRIBUTOR
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7514.diff", "html_url": "https://github.com/huggingface/datasets/pull/7514", "merged_at": null, "patch_url": "https://github.com/huggingface/datasets/pull/7514.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7514" }
`Dataset.from_generator` function passes all of its arguments to `BuilderConfig.create_config_id`, including generator function itself. `BuilderConfig.create_config_id` function tries to hash all the args, and hashing a `generator` can take a large amount of time or even cause MemoryError if the dataset processed in a generator function is large enough. Maybe we should pop generator from `config_kwargs_to_add_to_suffix` before hashing to avoid it. There is a more detailed description of the problem this PR solves in #7513
{ "avatar_url": "https://avatars.githubusercontent.com/u/43753582?v=4", "events_url": "https://api.github.com/users/simonreise/events{/privacy}", "followers_url": "https://api.github.com/users/simonreise/followers", "following_url": "https://api.github.com/users/simonreise/following{/other_user}", "gists_url": "https://api.github.com/users/simonreise/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/simonreise", "id": 43753582, "login": "simonreise", "node_id": "MDQ6VXNlcjQzNzUzNTgy", "organizations_url": "https://api.github.com/users/simonreise/orgs", "received_events_url": "https://api.github.com/users/simonreise/received_events", "repos_url": "https://api.github.com/users/simonreise/repos", "site_admin": false, "starred_url": "https://api.github.com/users/simonreise/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/simonreise/subscriptions", "type": "User", "url": "https://api.github.com/users/simonreise", "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/7514/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/issues/7513
7,513
MemoryError while creating dataset from generator
{ "avatar_url": "https://avatars.githubusercontent.com/u/43753582?v=4", "events_url": "https://api.github.com/users/simonreise/events{/privacy}", "followers_url": "https://api.github.com/users/simonreise/followers", "following_url": "https://api.github.com/users/simonreise/following{/other_user}", "gists_url": "https://api.github.com/users/simonreise/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/simonreise", "id": 43753582, "login": "simonreise", "node_id": "MDQ6VXNlcjQzNzUzNTgy", "organizations_url": "https://api.github.com/users/simonreise/orgs", "received_events_url": "https://api.github.com/users/simonreise/received_events", "repos_url": "https://api.github.com/users/simonreise/repos", "site_admin": false, "starred_url": "https://api.github.com/users/simonreise/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/simonreise/subscriptions", "type": "User", "url": "https://api.github.com/users/simonreise", "user_view_type": "public" }
[]
closed
false
[ "Upd: created a PR that can probably solve the problem: #7514", "Hi ! We need to take the generator into account for the cache. The generator is hashed to make the dataset fingerprint used by the cache. This way you can reload the Dataset from the cache without regenerating in subsequent `from_generator` calls.\n\nMaybe instead of removing generator from the hasher input, we can let users pass their own Dataset fingerprint to `from_generator`, and if it's specified we don't need to hash anything", "Upd: I successfully generated a dataset from my large geospatial data with `generator` excluded from hashing and saved it to disk without running into memory errors. So, it looks like there are no other bottlenecks in dataset generation in my case\n\nMaybe letting users pass their own fingerprint to skip hashing can be a great solution to that issue!", "@lhoestq I tried to implement user-defined dataset fingerprint in #7533 . Am I doing it right?" ]
2025-04-15T01:02:02Z
2025-10-23T22:55:10Z
2025-10-23T22:55:10Z
CONTRIBUTOR
null
null
### Describe the bug # TL:DR `Dataset.from_generator` function passes all of its arguments to `BuilderConfig.create_config_id`, including `generator` function itself. `BuilderConfig.create_config_id` function tries to hash all the args, which can take a large amount of time or even cause MemoryError if the dataset processed in a generator function is large enough. Maybe we should pop `generator` from `config_kwargs_to_add_to_suffix` before hashing to avoid it. # Full description I have a pretty large spatial imagery dataset that is generated from two xbatcher.BatchGenerators via custom `dataset_generator` function that looks like this if simplified: ``` def dataset_generator(): for index in samples: data_dict = { "key": index, "x": x_batches[index].data, "y": y_batches[index].data, } yield data_dict ``` Then I use `datasets.Dataset.from_generator` to generate the dataset itself. ``` # Create dataset ds = datasets.Dataset.from_generator( dataset_generator, features=feat, cache_dir=(output / ".cache"), ) ``` It works nicely with pretty small data, but if the dataset is huge and barely fits in memory, it crashes with memory error: <details> <summary>Full stack trace</summary> ``` File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\remote_sensing_processor\segmentation\semantic\tiles.py:248](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/remote_sensing_processor/segmentation/semantic/tiles.py#line=247), in generate_tiles(x, y, output, tile_size, shuffle, split, x_dtype, y_dtype, x_nodata, y_nodata) 245 yield data_dict 247 # Create dataset --> 248 ds = datasets.Dataset.from_generator( 249 dataset_generator, 250 features=feat, 251 cache_dir=(output / ".cache"), 252 ) 254 # Save dataset 255 ds.save_to_disk(output / name) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\arrow_dataset.py:1105](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/arrow_dataset.py#line=1104), in Dataset.from_generator(generator, features, cache_dir, keep_in_memory, gen_kwargs, num_proc, split, **kwargs) 1052 """Create a Dataset from a generator. 1053 1054 Args: (...) 1101 ``` 1102 """ 1103 from .io.generator import GeneratorDatasetInputStream -> 1105 return GeneratorDatasetInputStream( 1106 generator=generator, 1107 features=features, 1108 cache_dir=cache_dir, 1109 keep_in_memory=keep_in_memory, 1110 gen_kwargs=gen_kwargs, 1111 num_proc=num_proc, 1112 split=split, 1113 **kwargs, 1114 ).read() File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\io\generator.py:29](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/io/generator.py#line=28), in GeneratorDatasetInputStream.__init__(self, generator, features, cache_dir, keep_in_memory, streaming, gen_kwargs, num_proc, split, **kwargs) 9 def __init__( 10 self, 11 generator: Callable, (...) 19 **kwargs, 20 ): 21 super().__init__( 22 features=features, 23 cache_dir=cache_dir, (...) 27 **kwargs, 28 ) ---> 29 self.builder = Generator( 30 cache_dir=cache_dir, 31 features=features, 32 generator=generator, 33 gen_kwargs=gen_kwargs, 34 split=split, 35 **kwargs, 36 ) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\builder.py:343](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/builder.py#line=342), in DatasetBuilder.__init__(self, cache_dir, dataset_name, config_name, hash, base_path, info, features, token, repo_id, data_files, data_dir, storage_options, writer_batch_size, **config_kwargs) 341 config_kwargs["data_dir"] = data_dir 342 self.config_kwargs = config_kwargs --> 343 self.config, self.config_id = self._create_builder_config( 344 config_name=config_name, 345 custom_features=features, 346 **config_kwargs, 347 ) 349 # prepare info: DatasetInfo are a standardized dataclass across all datasets 350 # Prefill datasetinfo 351 if info is None: 352 # TODO FOR PACKAGED MODULES IT IMPORTS DATA FROM src/packaged_modules which doesn't make sense File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\builder.py:604](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/builder.py#line=603), in DatasetBuilder._create_builder_config(self, config_name, custom_features, **config_kwargs) 598 builder_config._resolve_data_files( 599 base_path=self.base_path, 600 download_config=DownloadConfig(token=self.token, storage_options=self.storage_options), 601 ) 603 # compute the config id that is going to be used for caching --> 604 config_id = builder_config.create_config_id( 605 config_kwargs, 606 custom_features=custom_features, 607 ) 608 is_custom = (config_id not in self.builder_configs) and config_id != "default" 609 if is_custom: File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\builder.py:187](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/builder.py#line=186), in BuilderConfig.create_config_id(self, config_kwargs, custom_features) 185 suffix = Hasher.hash(config_kwargs_to_add_to_suffix) 186 else: --> 187 suffix = Hasher.hash(config_kwargs_to_add_to_suffix) 189 if custom_features is not None: 190 m = Hasher() File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\fingerprint.py:188](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/fingerprint.py#line=187), in Hasher.hash(cls, value) 186 @classmethod 187 def hash(cls, value: Any) -> str: --> 188 return cls.hash_bytes(dumps(value)) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:109](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=108), in dumps(obj) 107 """Pickle an object to a string.""" 108 file = BytesIO() --> 109 dump(obj, file) 110 return file.getvalue() File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:103](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=102), in dump(obj, file) 101 def dump(obj, file): 102 """Pickle an object to a file.""" --> 103 Pickler(file, recurse=True).dump(obj) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:420](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=419), in Pickler.dump(self, obj) 418 def dump(self, obj): #NOTE: if settings change, need to update attributes 419 logger.trace_setup(self) --> 420 StockPickler.dump(self, obj) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:484](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=483), in _Pickler.dump(self, obj) 482 if self.proto >= 4: 483 self.framer.start_framing() --> 484 self.save(obj) 485 self.write(STOP) 486 self.framer.end_framing() File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:558](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=557), in _Pickler.save(self, obj, save_persistent_id) 556 f = self.dispatch.get(t) 557 if f is not None: --> 558 f(self, obj) # Call unbound method with explicit self 559 return 561 # Check private dispatch table if any, or else 562 # copyreg.dispatch_table File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:1217](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=1216), in save_module_dict(pickler, obj) 1214 if is_dill(pickler, child=False) and pickler._session: 1215 # we only care about session the first pass thru 1216 pickler._first_pass = False -> 1217 StockPickler.save_dict(pickler, obj) 1218 logger.trace(pickler, "# D2") 1219 return File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:990](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=989), in _Pickler.save_dict(self, obj) 987 self.write(MARK + DICT) 989 self.memoize(obj) --> 990 self._batch_setitems(obj.items()) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:83](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=82), in Pickler._batch_setitems(self, items) 80 from datasets.fingerprint import Hasher 82 items = sorted(items, key=lambda x: Hasher.hash(x[0])) ---> 83 dill.Pickler._batch_setitems(self, items) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:1014](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=1013), in _Pickler._batch_setitems(self, items) 1012 for k, v in tmp: 1013 save(k) -> 1014 save(v) 1015 write(SETITEMS) 1016 elif n: File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:558](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=557), in _Pickler.save(self, obj, save_persistent_id) 556 f = self.dispatch.get(t) 557 if f is not None: --> 558 f(self, obj) # Call unbound method with explicit self 559 return 561 # Check private dispatch table if any, or else 562 # copyreg.dispatch_table File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:1985](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=1984), in save_function(pickler, obj) 1982 if state_dict: 1983 state = state, state_dict -> 1985 _save_with_postproc(pickler, (_create_function, ( 1986 obj.__code__, globs, obj.__name__, obj.__defaults__, 1987 closure 1988 ), state), obj=obj, postproc_list=postproc_list) 1990 # Lift closure cell update to earliest function (#458) 1991 if _postproc: File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:1117](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=1116), in _save_with_postproc(pickler, reduction, is_pickler_dill, obj, postproc_list) 1115 continue 1116 else: -> 1117 pickler.save_reduce(*reduction) 1118 # pop None created by calling preprocessing step off stack 1119 pickler.write(POP) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:690](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=689), in _Pickler.save_reduce(self, func, args, state, listitems, dictitems, state_setter, obj) 688 else: 689 save(func) --> 690 save(args) 691 write(REDUCE) 693 if obj is not None: 694 # If the object is already in the memo, this means it is 695 # recursive. In this case, throw away everything we put on the 696 # stack, and fetch the object back from the memo. File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:558](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=557), in _Pickler.save(self, obj, save_persistent_id) 556 f = self.dispatch.get(t) 557 if f is not None: --> 558 f(self, obj) # Call unbound method with explicit self 559 return 561 # Check private dispatch table if any, or else 562 # copyreg.dispatch_table File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:905](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=904), in _Pickler.save_tuple(self, obj) 903 if n <= 3 and self.proto >= 2: 904 for element in obj: --> 905 save(element) 906 # Subtle. Same as in the big comment below. 907 if id(obj) in memo: File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:601](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=600), in _Pickler.save(self, obj, save_persistent_id) 597 raise PicklingError("Tuple returned by %s must have " 598 "two to six elements" % reduce) 600 # Save the reduce() output and finally memoize the object --> 601 self.save_reduce(obj=obj, *rv) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:715](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=714), in _Pickler.save_reduce(self, func, args, state, listitems, dictitems, state_setter, obj) 713 if state is not None: 714 if state_setter is None: --> 715 save(state) 716 write(BUILD) 717 else: 718 # If a state_setter is specified, call it instead of load_build 719 # to update obj's with its previous state. 720 # First, push state_setter and its tuple of expected arguments 721 # (obj, state) onto the stack. File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:558](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=557), in _Pickler.save(self, obj, save_persistent_id) 556 f = self.dispatch.get(t) 557 if f is not None: --> 558 f(self, obj) # Call unbound method with explicit self 559 return 561 # Check private dispatch table if any, or else 562 # copyreg.dispatch_table File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:1217](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=1216), in save_module_dict(pickler, obj) 1214 if is_dill(pickler, child=False) and pickler._session: 1215 # we only care about session the first pass thru 1216 pickler._first_pass = False -> 1217 StockPickler.save_dict(pickler, obj) 1218 logger.trace(pickler, "# D2") 1219 return File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:990](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=989), in _Pickler.save_dict(self, obj) 987 self.write(MARK + DICT) 989 self.memoize(obj) --> 990 self._batch_setitems(obj.items()) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:83](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=82), in Pickler._batch_setitems(self, items) 80 from datasets.fingerprint import Hasher 82 items = sorted(items, key=lambda x: Hasher.hash(x[0])) ---> 83 dill.Pickler._batch_setitems(self, items) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:1014](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=1013), in _Pickler._batch_setitems(self, items) 1012 for k, v in tmp: 1013 save(k) -> 1014 save(v) 1015 write(SETITEMS) 1016 elif n: [... skipping similar frames: Pickler.save at line 70 (1 times), Pickler.save at line 414 (1 times)] File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:601](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=600), in _Pickler.save(self, obj, save_persistent_id) 597 raise PicklingError("Tuple returned by %s must have " 598 "two to six elements" % reduce) 600 # Save the reduce() output and finally memoize the object --> 601 self.save_reduce(obj=obj, *rv) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:715](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=714), in _Pickler.save_reduce(self, func, args, state, listitems, dictitems, state_setter, obj) 713 if state is not None: 714 if state_setter is None: --> 715 save(state) 716 write(BUILD) 717 else: 718 # If a state_setter is specified, call it instead of load_build 719 # to update obj's with its previous state. 720 # First, push state_setter and its tuple of expected arguments 721 # (obj, state) onto the stack. File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:558](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=557), in _Pickler.save(self, obj, save_persistent_id) 556 f = self.dispatch.get(t) 557 if f is not None: --> 558 f(self, obj) # Call unbound method with explicit self 559 return 561 # Check private dispatch table if any, or else 562 # copyreg.dispatch_table File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:905](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=904), in _Pickler.save_tuple(self, obj) 903 if n <= 3 and self.proto >= 2: 904 for element in obj: --> 905 save(element) 906 # Subtle. Same as in the big comment below. 907 if id(obj) in memo: File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:558](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=557), in _Pickler.save(self, obj, save_persistent_id) 556 f = self.dispatch.get(t) 557 if f is not None: --> 558 f(self, obj) # Call unbound method with explicit self 559 return 561 # Check private dispatch table if any, or else 562 # copyreg.dispatch_table File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:1217](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=1216), in save_module_dict(pickler, obj) 1214 if is_dill(pickler, child=False) and pickler._session: 1215 # we only care about session the first pass thru 1216 pickler._first_pass = False -> 1217 StockPickler.save_dict(pickler, obj) 1218 logger.trace(pickler, "# D2") 1219 return File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:990](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=989), in _Pickler.save_dict(self, obj) 987 self.write(MARK + DICT) 989 self.memoize(obj) --> 990 self._batch_setitems(obj.items()) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:83](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=82), in Pickler._batch_setitems(self, items) 80 from datasets.fingerprint import Hasher 82 items = sorted(items, key=lambda x: Hasher.hash(x[0])) ---> 83 dill.Pickler._batch_setitems(self, items) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:1014](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=1013), in _Pickler._batch_setitems(self, items) 1012 for k, v in tmp: 1013 save(k) -> 1014 save(v) 1015 write(SETITEMS) 1016 elif n: File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:601](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=600), in _Pickler.save(self, obj, save_persistent_id) 597 raise PicklingError("Tuple returned by %s must have " 598 "two to six elements" % reduce) 600 # Save the reduce() output and finally memoize the object --> 601 self.save_reduce(obj=obj, *rv) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:715](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=714), in _Pickler.save_reduce(self, func, args, state, listitems, dictitems, state_setter, obj) 713 if state is not None: 714 if state_setter is None: --> 715 save(state) 716 write(BUILD) 717 else: 718 # If a state_setter is specified, call it instead of load_build 719 # to update obj's with its previous state. 720 # First, push state_setter and its tuple of expected arguments 721 # (obj, state) onto the stack. File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:558](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=557), in _Pickler.save(self, obj, save_persistent_id) 556 f = self.dispatch.get(t) 557 if f is not None: --> 558 f(self, obj) # Call unbound method with explicit self 559 return 561 # Check private dispatch table if any, or else 562 # copyreg.dispatch_table File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:905](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=904), in _Pickler.save_tuple(self, obj) 903 if n <= 3 and self.proto >= 2: 904 for element in obj: --> 905 save(element) 906 # Subtle. Same as in the big comment below. 907 if id(obj) in memo: File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:558](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=557), in _Pickler.save(self, obj, save_persistent_id) 556 f = self.dispatch.get(t) 557 if f is not None: --> 558 f(self, obj) # Call unbound method with explicit self 559 return 561 # Check private dispatch table if any, or else 562 # copyreg.dispatch_table File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:1217](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=1216), in save_module_dict(pickler, obj) 1214 if is_dill(pickler, child=False) and pickler._session: 1215 # we only care about session the first pass thru 1216 pickler._first_pass = False -> 1217 StockPickler.save_dict(pickler, obj) 1218 logger.trace(pickler, "# D2") 1219 return File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:990](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=989), in _Pickler.save_dict(self, obj) 987 self.write(MARK + DICT) 989 self.memoize(obj) --> 990 self._batch_setitems(obj.items()) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:83](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=82), in Pickler._batch_setitems(self, items) 80 from datasets.fingerprint import Hasher 82 items = sorted(items, key=lambda x: Hasher.hash(x[0])) ---> 83 dill.Pickler._batch_setitems(self, items) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:1014](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=1013), in _Pickler._batch_setitems(self, items) 1012 for k, v in tmp: 1013 save(k) -> 1014 save(v) 1015 write(SETITEMS) 1016 elif n: File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:601](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=600), in _Pickler.save(self, obj, save_persistent_id) 597 raise PicklingError("Tuple returned by %s must have " 598 "two to six elements" % reduce) 600 # Save the reduce() output and finally memoize the object --> 601 self.save_reduce(obj=obj, *rv) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:690](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=689), in _Pickler.save_reduce(self, func, args, state, listitems, dictitems, state_setter, obj) 688 else: 689 save(func) --> 690 save(args) 691 write(REDUCE) 693 if obj is not None: 694 # If the object is already in the memo, this means it is 695 # recursive. In this case, throw away everything we put on the 696 # stack, and fetch the object back from the memo. File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:558](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=557), in _Pickler.save(self, obj, save_persistent_id) 556 f = self.dispatch.get(t) 557 if f is not None: --> 558 f(self, obj) # Call unbound method with explicit self 559 return 561 # Check private dispatch table if any, or else 562 # copyreg.dispatch_table File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:920](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=919), in _Pickler.save_tuple(self, obj) 918 write(MARK) 919 for element in obj: --> 920 save(element) 922 if id(obj) in memo: 923 # Subtle. d was not in memo when we entered save_tuple(), so 924 # the process of saving the tuple's elements must have saved (...) 928 # could have been done in the "for element" loop instead, but 929 # recursive tuples are a rare thing. 930 get = self.get(memo[id(obj)][0]) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:601](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=600), in _Pickler.save(self, obj, save_persistent_id) 597 raise PicklingError("Tuple returned by %s must have " 598 "two to six elements" % reduce) 600 # Save the reduce() output and finally memoize the object --> 601 self.save_reduce(obj=obj, *rv) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:715](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=714), in _Pickler.save_reduce(self, func, args, state, listitems, dictitems, state_setter, obj) 713 if state is not None: 714 if state_setter is None: --> 715 save(state) 716 write(BUILD) 717 else: 718 # If a state_setter is specified, call it instead of load_build 719 # to update obj's with its previous state. 720 # First, push state_setter and its tuple of expected arguments 721 # (obj, state) onto the stack. File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:558](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=557), in _Pickler.save(self, obj, save_persistent_id) 556 f = self.dispatch.get(t) 557 if f is not None: --> 558 f(self, obj) # Call unbound method with explicit self 559 return 561 # Check private dispatch table if any, or else 562 # copyreg.dispatch_table File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:1217](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=1216), in save_module_dict(pickler, obj) 1214 if is_dill(pickler, child=False) and pickler._session: 1215 # we only care about session the first pass thru 1216 pickler._first_pass = False -> 1217 StockPickler.save_dict(pickler, obj) 1218 logger.trace(pickler, "# D2") 1219 return File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:990](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=989), in _Pickler.save_dict(self, obj) 987 self.write(MARK + DICT) 989 self.memoize(obj) --> 990 self._batch_setitems(obj.items()) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:83](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=82), in Pickler._batch_setitems(self, items) 80 from datasets.fingerprint import Hasher 82 items = sorted(items, key=lambda x: Hasher.hash(x[0])) ---> 83 dill.Pickler._batch_setitems(self, items) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:1014](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=1013), in _Pickler._batch_setitems(self, items) 1012 for k, v in tmp: 1013 save(k) -> 1014 save(v) 1015 write(SETITEMS) 1016 elif n: File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:558](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=557), in _Pickler.save(self, obj, save_persistent_id) 556 f = self.dispatch.get(t) 557 if f is not None: --> 558 f(self, obj) # Call unbound method with explicit self 559 return 561 # Check private dispatch table if any, or else 562 # copyreg.dispatch_table File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:1217](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=1216), in save_module_dict(pickler, obj) 1214 if is_dill(pickler, child=False) and pickler._session: 1215 # we only care about session the first pass thru 1216 pickler._first_pass = False -> 1217 StockPickler.save_dict(pickler, obj) 1218 logger.trace(pickler, "# D2") 1219 return File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:990](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=989), in _Pickler.save_dict(self, obj) 987 self.write(MARK + DICT) 989 self.memoize(obj) --> 990 self._batch_setitems(obj.items()) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:83](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=82), in Pickler._batch_setitems(self, items) 80 from datasets.fingerprint import Hasher 82 items = sorted(items, key=lambda x: Hasher.hash(x[0])) ---> 83 dill.Pickler._batch_setitems(self, items) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:1019](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=1018), in _Pickler._batch_setitems(self, items) 1017 k, v = tmp[0] 1018 save(k) -> 1019 save(v) 1020 write(SETITEM) 1021 # else tmp is empty, and we're done File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:601](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=600), in _Pickler.save(self, obj, save_persistent_id) 597 raise PicklingError("Tuple returned by %s must have " 598 "two to six elements" % reduce) 600 # Save the reduce() output and finally memoize the object --> 601 self.save_reduce(obj=obj, *rv) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:715](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=714), in _Pickler.save_reduce(self, func, args, state, listitems, dictitems, state_setter, obj) 713 if state is not None: 714 if state_setter is None: --> 715 save(state) 716 write(BUILD) 717 else: 718 # If a state_setter is specified, call it instead of load_build 719 # to update obj's with its previous state. 720 # First, push state_setter and its tuple of expected arguments 721 # (obj, state) onto the stack. File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:558](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=557), in _Pickler.save(self, obj, save_persistent_id) 556 f = self.dispatch.get(t) 557 if f is not None: --> 558 f(self, obj) # Call unbound method with explicit self 559 return 561 # Check private dispatch table if any, or else 562 # copyreg.dispatch_table File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:1217](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=1216), in save_module_dict(pickler, obj) 1214 if is_dill(pickler, child=False) and pickler._session: 1215 # we only care about session the first pass thru 1216 pickler._first_pass = False -> 1217 StockPickler.save_dict(pickler, obj) 1218 logger.trace(pickler, "# D2") 1219 return File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:990](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=989), in _Pickler.save_dict(self, obj) 987 self.write(MARK + DICT) 989 self.memoize(obj) --> 990 self._batch_setitems(obj.items()) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:83](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=82), in Pickler._batch_setitems(self, items) 80 from datasets.fingerprint import Hasher 82 items = sorted(items, key=lambda x: Hasher.hash(x[0])) ---> 83 dill.Pickler._batch_setitems(self, items) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:1014](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=1013), in _Pickler._batch_setitems(self, items) 1012 for k, v in tmp: 1013 save(k) -> 1014 save(v) 1015 write(SETITEMS) 1016 elif n: [... skipping similar frames: Pickler.save at line 70 (1 times), Pickler.save at line 414 (1 times)] File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:558](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=557), in _Pickler.save(self, obj, save_persistent_id) 556 f = self.dispatch.get(t) 557 if f is not None: --> 558 f(self, obj) # Call unbound method with explicit self 559 return 561 # Check private dispatch table if any, or else 562 # copyreg.dispatch_table File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:1217](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=1216), in save_module_dict(pickler, obj) 1214 if is_dill(pickler, child=False) and pickler._session: 1215 # we only care about session the first pass thru 1216 pickler._first_pass = False -> 1217 StockPickler.save_dict(pickler, obj) 1218 logger.trace(pickler, "# D2") 1219 return File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:990](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=989), in _Pickler.save_dict(self, obj) 987 self.write(MARK + DICT) 989 self.memoize(obj) --> 990 self._batch_setitems(obj.items()) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:83](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=82), in Pickler._batch_setitems(self, items) 80 from datasets.fingerprint import Hasher 82 items = sorted(items, key=lambda x: Hasher.hash(x[0])) ---> 83 dill.Pickler._batch_setitems(self, items) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:1014](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=1013), in _Pickler._batch_setitems(self, items) 1012 for k, v in tmp: 1013 save(k) -> 1014 save(v) 1015 write(SETITEMS) 1016 elif n: [... skipping similar frames: Pickler.save at line 70 (1 times), Pickler.save at line 414 (1 times)] File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:601](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=600), in _Pickler.save(self, obj, save_persistent_id) 597 raise PicklingError("Tuple returned by %s must have " 598 "two to six elements" % reduce) 600 # Save the reduce() output and finally memoize the object --> 601 self.save_reduce(obj=obj, *rv) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:715](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=714), in _Pickler.save_reduce(self, func, args, state, listitems, dictitems, state_setter, obj) 713 if state is not None: 714 if state_setter is None: --> 715 save(state) 716 write(BUILD) 717 else: 718 # If a state_setter is specified, call it instead of load_build 719 # to update obj's with its previous state. 720 # First, push state_setter and its tuple of expected arguments 721 # (obj, state) onto the stack. File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:558](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=557), in _Pickler.save(self, obj, save_persistent_id) 556 f = self.dispatch.get(t) 557 if f is not None: --> 558 f(self, obj) # Call unbound method with explicit self 559 return 561 # Check private dispatch table if any, or else 562 # copyreg.dispatch_table File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:920](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=919), in _Pickler.save_tuple(self, obj) 918 write(MARK) 919 for element in obj: --> 920 save(element) 922 if id(obj) in memo: 923 # Subtle. d was not in memo when we entered save_tuple(), so 924 # the process of saving the tuple's elements must have saved (...) 928 # could have been done in the "for element" loop instead, but 929 # recursive tuples are a rare thing. 930 get = self.get(memo[id(obj)][0]) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\datasets\utils\_dill.py:70](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/datasets/utils/_dill.py#line=69), in Pickler.save(self, obj, save_persistent_id) 68 if obj_type is FunctionType: 69 obj = getattr(obj, "_torchdynamo_orig_callable", obj) ---> 70 dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\site-packages\dill\_dill.py:414](file:///C:/ProgramData/miniforge3/envs/geo/Lib/site-packages/dill/_dill.py#line=413), in Pickler.save(self, obj, save_persistent_id) 412 msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType 413 raise PicklingError(msg) --> 414 StockPickler.save(self, obj, save_persistent_id) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:558](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=557), in _Pickler.save(self, obj, save_persistent_id) 556 f = self.dispatch.get(t) 557 if f is not None: --> 558 f(self, obj) # Call unbound method with explicit self 559 return 561 # Check private dispatch table if any, or else 562 # copyreg.dispatch_table File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:809](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=808), in _Pickler.save_bytes(self, obj) 806 self.save_reduce(codecs.encode, 807 (str(obj, 'latin1'), 'latin1'), obj=obj) 808 return --> 809 self._save_bytes_no_memo(obj) 810 self.memoize(obj) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:797](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=796), in _Pickler._save_bytes_no_memo(self, obj) 795 self._write_large_bytes(BINBYTES8 + pack("<Q", n), obj) 796 elif n >= self.framer._FRAME_SIZE_TARGET: --> 797 self._write_large_bytes(BINBYTES + pack("<I", n), obj) 798 else: 799 self.write(BINBYTES + pack("<I", n) + obj) File [C:\ProgramData\miniforge3\envs\geo\Lib\pickle.py:254](file:///C:/ProgramData/miniforge3/envs/geo/Lib/pickle.py#line=253), in _Framer.write_large_bytes(self, header, payload) 247 # Perform direct write of the header and payload of the large binary 248 # object. Be careful not to concatenate the header and the payload 249 # prior to calling 'write' as we do not want to allocate a large 250 # temporary bytes object. 251 # We intentionally do not insert a protocol 4 frame opcode to make 252 # it possible to optimize file.read calls in the loader. 253 write(header) --> 254 write(payload) MemoryError: ``` </details> Memory error is an expected type of error in such case, but when I started digging down, I found out that it occurs in a kinda unexpected place - in `create_config_id` function. It tries to hash `config_kwargs_to_add_to_suffix`, including generator function itself. I modified the `BuilderConfig.create_config_id` code like this to check which values are hashed and how much time it takes to hash them and ran it on a toy dataset: ``` print(config_kwargs_to_add_to_suffix) start_time = time.time() if all(isinstance(v, (str, bool, int, float)) for v in config_kwargs_to_add_to_suffix.values()): suffix = ",".join( str(k) + "=" + urllib.parse.quote_plus(str(v)) for k, v in config_kwargs_to_add_to_suffix.items() ) if len(suffix) > 32: # hash if too long suffix = Hasher.hash(config_kwargs_to_add_to_suffix) else: suffix = Hasher.hash(config_kwargs_to_add_to_suffix) end_time = time.time() print(f"Execution time: {end_time - start_time:.4f} seconds") print(suffix) ``` In my case the content of `config_kwargs_to_add_to_suffix` was like this: ``` {'features': {'key': Value(dtype='int64', id=None), 'x': Array3D(shape=(44, 128, 128), dtype='float32', id=None), 'y_class': Array2D(shape=(128, 128), dtype='int32', id=None)}, 'gen_kwargs': None, 'generator': <function generate_tiles.<locals>.dataset_generator at 0x00000139D10D7920>, 'split': NamedSplit('train')} ``` Also I noticed that hashing took a significant amount of time - 43.1482 seconds, while the overall function execution (with data loading, batching and saving dataset) took 2min 45s. The output of `create_config_id` is just a dataset id, so, it is inappropirately large amount of time. But when I added `config_kwargs_to_add_to_suffix.pop("generator", None)`, the hashing took only 0.0060 seconds. Maybe we shouldn't hash the generator function, as it can be really computationally and memory expensive. ### Steps to reproduce the bug This is a simplified example of a workflow I used to generate dataset. But I think that you can use almost any workflow to reproduce that bug. ``` import pystac import pystac_client import planetary_computer import numpy as np import xarray as xr import rioxarray as rxr import dask import xbatcher import datasets # Loading a dataset, in our case - single Landsat image catalog = pystac_client.Client.open( "https://planetarycomputer.microsoft.com/api/stac/v1", modifier=planetary_computer.sign_inplace, ) brazil = [-60.2, -3.31] time_of_interest = "2021-06-01/2021-08-31" search = catalog.search(collections=["landsat-c2-l2"], intersects={"type": "Point", "coordinates": brazil}, datetime=time_of_interest) items = search.item_collection() item = min(items, key=lambda item: pystac.extensions.eo.EOExtension.ext(item).cloud_cover) # Getting x data bands = [] for band in ["red", "green", "blue", "nir08", "coastal", "swir16", "swir22", "lwir11"]: with rxr.open_rasterio(item.assets[band].href, chunks=True, lock=True) as raster: raster = raster.to_dataset('band') #print(raster) raster = raster.rename({1: band}) bands.append(raster) x = xr.merge(bands).squeeze().to_array("band").persist() # Getting y data with rxr.open_rasterio(item.assets['qa_pixel'].href, chunks=True, lock=True) as raster: y = raster.squeeze().persist() # Setting up batches generators x_batches = xbatcher.BatchGenerator(ds=x, input_dims={"x": 256, "y": 256}) y_batches = xbatcher.BatchGenerator(ds=y, input_dims={"x": 256, "y": 256}) # Filtering samples that contain only nodata samples = list(range(len(x_batches))) samples_filtered = [] for i in samples: if not np.array_equal(np.unique(x_batches[i]), np.array([0.])) and not np.array_equal(np.unique(y_batches[i]), np.array([0])): samples_filtered.append(i) samples = samples_filtered np.random.shuffle(samples) # Setting up features feat = { "key": datasets.Value(dtype="int64"), "x": datasets.Array3D(dtype="float32", shape=(4, 256, 256)), "y": datasets.Array2D(dtype="int32", shape=(256, 256)) } feat = datasets.Features(feat) # Setting up a generator def dataset_generator(): for index in samples: data_dict = { "key": index, "x": x_batches[index].data, "y": y_batches[index].data, } yield data_dict # Create dataset ds = datasets.Dataset.from_generator( dataset_generator, features=feat, cache_dir="temp/cache", ) ``` Please, try adding `config_kwargs_to_add_to_suffix.pop("generator", None)` to `BuilderConfig.create_config_id` and then measuring how much time it takes to run ``` if all(isinstance(v, (str, bool, int, float)) for v in config_kwargs_to_add_to_suffix.values()): suffix = ",".join( str(k) + "=" + urllib.parse.quote_plus(str(v)) for k, v in config_kwargs_to_add_to_suffix.items() ) if len(suffix) > 32: # hash if too long suffix = Hasher.hash(config_kwargs_to_add_to_suffix) else: suffix = Hasher.hash(config_kwargs_to_add_to_suffix) ``` code block with and without `config_kwargs_to_add_to_suffix.pop("generator", None)` In my case the difference was 3.3828 seconds without popping generator function and 0.0010 seconds with popping. ### Expected behavior Much faster hashing and no MemoryErrors ### Environment info - `datasets` version: 3.5.0 - Platform: Windows-11-10.0.26100-SP0 - Python version: 3.12.9 - `huggingface_hub` version: 0.30.1 - PyArrow version: 17.0.0 - Pandas version: 2.2.2 - `fsspec` version: 2024.12.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/43753582?v=4", "events_url": "https://api.github.com/users/simonreise/events{/privacy}", "followers_url": "https://api.github.com/users/simonreise/followers", "following_url": "https://api.github.com/users/simonreise/following{/other_user}", "gists_url": "https://api.github.com/users/simonreise/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/simonreise", "id": 43753582, "login": "simonreise", "node_id": "MDQ6VXNlcjQzNzUzNTgy", "organizations_url": "https://api.github.com/users/simonreise/orgs", "received_events_url": "https://api.github.com/users/simonreise/received_events", "repos_url": "https://api.github.com/users/simonreise/repos", "site_admin": false, "starred_url": "https://api.github.com/users/simonreise/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/simonreise/subscriptions", "type": "User", "url": "https://api.github.com/users/simonreise", "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/7513/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7512
7,512
.map() fails if function uses pyvista
{ "avatar_url": "https://avatars.githubusercontent.com/u/11832922?v=4", "events_url": "https://api.github.com/users/el-hult/events{/privacy}", "followers_url": "https://api.github.com/users/el-hult/followers", "following_url": "https://api.github.com/users/el-hult/following{/other_user}", "gists_url": "https://api.github.com/users/el-hult/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/el-hult", "id": 11832922, "login": "el-hult", "node_id": "MDQ6VXNlcjExODMyOTIy", "organizations_url": "https://api.github.com/users/el-hult/orgs", "received_events_url": "https://api.github.com/users/el-hult/received_events", "repos_url": "https://api.github.com/users/el-hult/repos", "site_admin": false, "starred_url": "https://api.github.com/users/el-hult/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/el-hult/subscriptions", "type": "User", "url": "https://api.github.com/users/el-hult", "user_view_type": "public" }
[]
open
false
[ "I found a similar (?) issue in https://github.com/huggingface/datasets/issues/6435, where someone had issues with forks and CUDA. According to https://huggingface.co/docs/datasets/main/en/process#multiprocessing we should do \n\n```\nfrom multiprocess import set_start_method\nset_start_method(\"spawn\")\n```\n\nto avoid the fork. The updated code\n\n```python\nimport numpy as np\nimport pyvista as pv\nimport datasets\nimport multiprocess\n\ndata = [{\"coords\": np.random.rand(5, 3)} for _ in range(3)]\n\ndef render_point(example):\n plotter = pv.Plotter(off_screen=True)\n cloud = pv.PolyData(example[\"coords\"])\n plotter.add_mesh(cloud)\n img = plotter.screenshot(return_img=True)\n return {\"image\": img}\n\n\n# breaks if num_proc>1\nmultiprocess.set_start_method(\"spawn\")\nds = datasets.Dataset.from_list(data).map(render_point, num_proc=2)\n```\n\ninstead fails with `TypeError: fork_exec() takes exactly 23 arguments (21 given)` which also seems like a bug to me." ]
2025-04-14T19:43:02Z
2025-04-14T20:01:53Z
null
NONE
null
null
### Describe the bug Using PyVista inside a .map() produces a crash with `objc[78796]: +[NSResponder initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.` ### Steps to reproduce the bug Run ```python import numpy as np import pyvista as pv import datasets data = [{"coords": np.random.rand(5, 3)} for _ in range(3)] def render_point(example): plotter = pv.Plotter(off_screen=True) cloud = pv.PolyData(example["coords"]) plotter.add_mesh(cloud) img = plotter.screenshot(return_img=True) return {"image": img} # breaks if num_proc>1 ds = datasets.Dataset.from_list(data).map(render_point, num_proc=2) ``` ### Expected behavior It should work. Just like when I use a process pool to make it work. ```python import numpy as np import pyvista as pv import multiprocessing data = [{"coords": np.random.rand(5, 3)} for _ in range(3)] def render_point(example): plotter = pv.Plotter(off_screen=True) cloud = pv.PolyData(example["coords"]) plotter.add_mesh(cloud) img = plotter.screenshot(return_img=True) return {"image": img} if __name__ == "__main__": with multiprocessing.Pool(processes=2) as pool: results = pool.map(render_point, data) print(results[0]["image"].shape) ``` ### Environment info - `datasets` version: 3.3.2 - Platform: macOS-15.3.2-arm64-arm-64bit - Python version: 3.11.10 - `huggingface_hub` version: 0.28.1 - PyArrow version: 18.1.0 - Pandas version: 2.2.3 - `fsspec` version: 2024.10.0 And then I suppose pyvista info is good to have. ```python import pyvista as pv print(pv.Report()) ``` gives -------------------------------------------------------------------------------- Date: Mon Apr 14 21:42:08 2025 CEST OS : Darwin (macOS 15.3.2) CPU(s) : 10 Machine : arm64 Architecture : 64bit RAM : 32.0 GiB Environment : IPython File system : apfs GPU Vendor : Apple GPU Renderer : Apple M1 Max GPU Version : 4.1 Metal - 89.3 MathText Support : True Python 3.11.10 (main, Oct 7 2024, 23:25:27) [Clang 18.1.8 ] pyvista : 0.44.2 vtk : 9.4.0 numpy : 2.2.2 matplotlib : 3.10.0 scooby : 0.10.0 pooch : 1.8.2 pillow : 11.1.0 imageio : 2.36.1 PyQt5 : 5.15.11 IPython : 8.30.0 scipy : 1.14.1 tqdm : 4.67.1 jupyterlab : 4.3.5 nest_asyncio : 1.6.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/7512/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7510
7,510
Incompatibile dill version (0.3.9) in datasets 2.18.0 - 3.5.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/98061329?v=4", "events_url": "https://api.github.com/users/JGrel/events{/privacy}", "followers_url": "https://api.github.com/users/JGrel/followers", "following_url": "https://api.github.com/users/JGrel/following{/other_user}", "gists_url": "https://api.github.com/users/JGrel/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/JGrel", "id": 98061329, "login": "JGrel", "node_id": "U_kgDOBdhMEQ", "organizations_url": "https://api.github.com/users/JGrel/orgs", "received_events_url": "https://api.github.com/users/JGrel/received_events", "repos_url": "https://api.github.com/users/JGrel/repos", "site_admin": false, "starred_url": "https://api.github.com/users/JGrel/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/JGrel/subscriptions", "type": "User", "url": "https://api.github.com/users/JGrel", "user_view_type": "public" }
[]
closed
false
[ "Hi ! We can bump `dill` to 0.3.9 if we make sure it's deterministic and doesn't break the caching mechanism in `datasets`.\n\nWould you be interested in opening a PR ? Then we can run the CI to see if it works", "Hi!. Yeah I can do it. Should I make any changes besides dill versions?", "There are probably some usage of internal functions from `dill` that we'll need to update in `datasets`\n\nIf you run `pytest tests/test_fingerprint.py` you should already have a good idea of what works and what doesn't.\nBut feel free to open a PR anyway, this way we can run the full CI and see the results\n", "Hi, sorry for no response from my side. I will try to do it today.", "Created pull request: [LINK](https://github.com/huggingface/datasets/pull/7535)\nTried to run tests by using command you have send and got few errors:\n\n![Image](https://github.com/user-attachments/assets/acbf1feb-4dd1-416e-a118-c91abe0d188b)", "Thanks for running the test ! So it appears we have two issues to fix:\n1. 'log' is not defined: it seems an internal `dill` function has disappeared, so we should adapt the `datasets` code that was using it\n2. there are some hashes mismatches, which means `dill` doesn't seem to output the same dump when passed the same ipython function twice, or the same function but located at a different line in a python file" ]
2025-04-14T07:22:44Z
2025-09-15T08:37:49Z
2025-09-15T08:37:49Z
NONE
null
null
### Describe the bug Datasets 2.18.0 - 3.5.0 has a dependency on dill < 0.3.9. This causes errors with dill >= 0.3.9. Could you please take a look into it and make it compatible? ### Steps to reproduce the bug 1. Install setuptools >= 2.18.0 2. Install dill >=0.3.9 3. Run pip check 4. Output: 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 dill<0.3.9,>=0.3.0, but you have dill 0.3.9 which is incompatible. ### Expected behavior Pip install both libraries without any errors ### Environment info Datasets version: 2.18 - 3.5 Python: 3.11
{ "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": 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/7510/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7509
7,509
Dataset uses excessive memory when loading files
{ "avatar_url": "https://avatars.githubusercontent.com/u/36810152?v=4", "events_url": "https://api.github.com/users/avishaiElmakies/events{/privacy}", "followers_url": "https://api.github.com/users/avishaiElmakies/followers", "following_url": "https://api.github.com/users/avishaiElmakies/following{/other_user}", "gists_url": "https://api.github.com/users/avishaiElmakies/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/avishaiElmakies", "id": 36810152, "login": "avishaiElmakies", "node_id": "MDQ6VXNlcjM2ODEwMTUy", "organizations_url": "https://api.github.com/users/avishaiElmakies/orgs", "received_events_url": "https://api.github.com/users/avishaiElmakies/received_events", "repos_url": "https://api.github.com/users/avishaiElmakies/repos", "site_admin": false, "starred_url": "https://api.github.com/users/avishaiElmakies/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/avishaiElmakies/subscriptions", "type": "User", "url": "https://api.github.com/users/avishaiElmakies", "user_view_type": "public" }
[]
open
false
[ "small update: I converted the jsons to parquet and it now works well with 32 proc and the same node. \nI still think this needs to be understood, since json is a very popular and easy-to-use format. ", "Hi ! The JSON loader loads full files in memory, unless they are JSON Lines. In this case it iterates on the JSON Lines in a memory efficient manner.\n\nI know there is an `ijson` package that works similarly but for general JSON files, maybe it can help and remove the need to load full JSON files in memory", "Hi, i understand that json files are probably loaded into memory to read them but aren't they released when we write all the file content into arrow or something? ", "Yes correct, the JSON data is only in memory during the conversion to Arrow. Then, the data is memory mapped from you disk", "so the json files are all loaded into memory before converting to arrow? or do they convert 1 json at a time and then they are realeased?\nI don't understand how 200GB worth of jsons fill a 378GB node's memory.", "Each process converts one JSON file at at time, So the total memory usage is num_proc * json_file_size * overhead, where overhead can be around 2 or 3 for the conversion.\n\nSo it's indeed surprising that you run out of memory. Is the dataset available somewhere ? or a subset maybe ?", "This is a tokenized dataset I created for training a speech-language model with a few features (so it is not private but not easily available). I can send/upload a shard or two and you can copy them however many times you want so you can debug. this should give you something comparable to what I have, but will be easier than creating it yourself. so if you want that, let me know :)", "Maybe you can measure the memory usage when loading 1 file with num_proc=1 ? This should already be helpful.\n\nMemory usage for tokenized data can be bigger than just text, for example the tokens type can be inferred as int64 and the lists offsets are int32", "OK, I will try to do this in the near future. I am a little swamped at the moment. do you have a preferred tool?\n\nalso My data is just list of ints, there is no offsets", "> so the json files are all loaded into memory before converting to arrow? or do they convert 1 json at a time and then they are realeased? I don't understand how 200GB worth of jsons fill a 378GB node's memory.\n\nHello! Is your query solved? I have the same confusion and would like to ask you for advice", "no, the issue is still present. I converted the json files to parquet, but json seems to have a problem.\n\nUnfortunately i didn't have the time to try and profile the memory usage for 1 file. So if you want to do that, it will be great! ", "My dataset is about image descriptions, stored as a 20MB JSON file on disk. However, I need to use the map function to preprocess the images, and after computation, the preprocessed dataset amounts to 70GB. My server has 122GB of RAM, but it still runs out of memory (OOM). This issue is very similar to yours.\n\nAfter some research during this period, I found that the map function does not perform disk mapping in memory while working. Using the command find /DataB/mjx -type f -mmin -10, I discovered that no temporary cache files were modified or created during program execution, meaning the data was continuously loaded into memory. After several attempts, I found that adding the parameter cache_file_name=\"your/path\" to the map function can enable memory-disk mapping. This is a strange setting, but after adding this parameter, the memory usage dropped to only 7GB, indicating that once the writer_batch_size worth of data is read into the disk cache, the corresponding data in memory is released. However, I don't think this is the intended behavior by the author, as memory-disk caching should have been enabled without needing this additional parameter.\n\nFinally, here is my map function call. I hope it helps you.\ntrain_data = train_data.map(process_fun, cache_file_name='./cache_file', remove_columns=['image_name', 'question_type', 'concern', 'question', 'candidate_answers', 'answer'])" ]
2025-04-13T21:09:49Z
2025-04-28T15:18:55Z
null
NONE
null
null
### Describe the bug Hi I am having an issue when loading a dataset. I have about 200 json files each about 1GB (total about 215GB). each row has a few features which are a list of ints. I am trying to load the dataset using `load_dataset`. The dataset is about 1.5M samples I use `num_proc=32` and a node with 378GB of memory. About a third of the way there I get an OOM. I also saw an old bug with a similar issue, which says to set `writer_batch_size`. I tried to lower it to 10, but it still crashed. I also tried to lower the `num_proc` to 16 and even 8, but still the same issue. ### Steps to reproduce the bug `dataset = load_dataset("json", data_dir=data_config.train_path, num_proc=data_config.num_proc, writer_batch_size=50)["train"]` ### Expected behavior Loading a dataset with more than 100GB to spare should not cause an OOM error. maybe i am missing something but I would love some help. ### Environment info - `datasets` version: 3.5.0 - Platform: Linux-6.6.20-aufs-1-x86_64-with-glibc2.36 - Python version: 3.11.2 - `huggingface_hub` version: 0.29.1 - PyArrow version: 19.0.1 - Pandas version: 2.2.3 - `fsspec` version: 2024.9.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/7509/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7508
7,508
Iterating over Image feature columns is extremely slow
{ "avatar_url": "https://avatars.githubusercontent.com/u/11831521?v=4", "events_url": "https://api.github.com/users/sohamparikh/events{/privacy}", "followers_url": "https://api.github.com/users/sohamparikh/followers", "following_url": "https://api.github.com/users/sohamparikh/following{/other_user}", "gists_url": "https://api.github.com/users/sohamparikh/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sohamparikh", "id": 11831521, "login": "sohamparikh", "node_id": "MDQ6VXNlcjExODMxNTIx", "organizations_url": "https://api.github.com/users/sohamparikh/orgs", "received_events_url": "https://api.github.com/users/sohamparikh/received_events", "repos_url": "https://api.github.com/users/sohamparikh/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sohamparikh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sohamparikh/subscriptions", "type": "User", "url": "https://api.github.com/users/sohamparikh", "user_view_type": "public" }
[]
open
false
[ "Hi ! Could it be because the `Image()` type in dataset does `image = Image.open(image_path)` and also `image.load()` which actually loads the image data in memory ? This is needed to avoid too many open files issues, see https://github.com/huggingface/datasets/issues/3985", "Yes, that seems to be it. For my purposes, I've cast the column to `Image(decode=False)`, and only load the images when necessary, which is much much faster" ]
2025-04-10T19:00:54Z
2025-04-15T17:57:08Z
null
NONE
null
null
We are trying to load datasets where the image column stores `PIL.PngImagePlugin.PngImageFile` images. However, iterating over these datasets is extremely slow. What I have found: 1. It is the presence of the image column that causes the slowdown. Removing the column from the dataset results in blazingly fast (as expected) times 2. It is ~2x faster to iterate when the column contains a single image as opposed to a list of images i.e., the feature is a Sequence of Image objects. We often need multiple images per sample, so we need to work with a list of images 3. It is ~17x faster to store paths to PNG files and load them using `PIL.Image.open`, as opposed to iterating over a `Dataset` with an Image column, and ~30x faster compared to `Sequence` of `Image`s. See a simple script below with an openly available dataset. It would be great to understand the standard practices for storing and loading multimodal datasets (image + text). https://huggingface.co/docs/datasets/en/image_load seems a bit underdeveloped? (e.g., `dataset.decode` only works with `IterableDataset`, but it's not clear from the doc) Thanks! ```python from datasets import load_dataset, load_from_disk from PIL import Image from pathlib import Path ds = load_dataset("getomni-ai/ocr-benchmark") for idx, sample in enumerate(ds["test"]): image = sample["image"] image.save(f"/tmp/ds_files/images/image_{idx}.png") ds.save_to_disk("/tmp/ds_columns") # Remove the 'image' column ds["test"] = ds["test"].remove_columns(["image"]) # Create image paths for each sample image_paths = [f"images/image_{idx}.png" for idx in range(len(ds["test"]))] # Add the 'image_path' column to the dataset ds["test"] = ds["test"].add_column("image_path", image_paths) # Save the updated dataset ds.save_to_disk("/tmp/ds_files") files_path = Path("/tmp/ds_files") column_path = Path("/tmp/ds_columns") # load and benchmark ds_file = load_from_disk(files_path) ds_column = load_from_disk(column_path) import time images_files = [] start = time.time() for idx in range(len(ds_file["test"])): image_path = files_path / ds_file["test"][idx]["image_path"] image = Image.open(image_path) images_files.append(image) end = time.time() print(f"Time taken to load images from files: {end - start} seconds") # Time taken to load images from files: 1.2364635467529297 seconds images_column = [] start = time.time() for idx in range(len(ds_column["test"])): images_column.append(ds_column["test"][idx]["image"]) end = time.time() print(f"Time taken to load images from columns: {end - start} seconds") # Time taken to load images from columns: 20.49347186088562 seconds ```
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/7508/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7507
7,507
Front-end statistical data quantity deviation
{ "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" }
[]
open
false
[ "Hi ! the format of this dataset is not supported by the Dataset Viewer. It looks like this dataset was saved using `save_to_disk()` which is meant for local storage / easy reload without compression, not for sharing online." ]
2025-04-10T02:51:38Z
2025-04-15T12:54:51Z
null
NONE
null
null
### Describe the bug While browsing the dataset at https://huggingface.co/datasets/NeuML/wikipedia-20250123, I noticed that a dataset with nearly 7M entries was estimated to be only 4M in size—almost half the actual amount. According to the post-download loading and the dataset_info (https://huggingface.co/datasets/NeuML/wikipedia-20250123/blob/main/train/dataset_info.json), the true data volume is indeed close to 7M. This significant discrepancy could mislead users when sorting datasets by row count. Why not directly retrieve this information from dataset_info? Not sure if this is the right place to report this bug, but leaving it here for the team's awareness.
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/7507/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7506
7,506
HfHubHTTPError: 429 Client Error: Too Many Requests for URL when trying to access Fineweb-10BT on 4A100 GPUs using SLURM
{ "avatar_url": "https://avatars.githubusercontent.com/u/66202555?v=4", "events_url": "https://api.github.com/users/calvintanama/events{/privacy}", "followers_url": "https://api.github.com/users/calvintanama/followers", "following_url": "https://api.github.com/users/calvintanama/following{/other_user}", "gists_url": "https://api.github.com/users/calvintanama/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/calvintanama", "id": 66202555, "login": "calvintanama", "node_id": "MDQ6VXNlcjY2MjAyNTU1", "organizations_url": "https://api.github.com/users/calvintanama/orgs", "received_events_url": "https://api.github.com/users/calvintanama/received_events", "repos_url": "https://api.github.com/users/calvintanama/repos", "site_admin": false, "starred_url": "https://api.github.com/users/calvintanama/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/calvintanama/subscriptions", "type": "User", "url": "https://api.github.com/users/calvintanama", "user_view_type": "public" }
[]
open
false
[ "Hi ! make sure to be logged in with your HF account (e.g. using `huggingface-cli login` or passing `token=` to `load_dataset()`), otherwise you'll get rate limited at one point", "Hey @calvintanama! Just building on what @lhoestq mentioned above — I ran into similar issues in multi-GPU SLURM setups and here’s what worked for me...\n\nThis 429 Client Error: Too Many Requests comes from the Hugging Face Hub’s rate limiting, which restricts unauthenticated or high-volume access (especially in multi-GPU/distributed setups like SLURM).\n\nAs @lhoestq mentioned, the solution is to make sure you are authenticated with the Hugging Face Hub in every process (especially on each GPU/worker node). You can do this by:\n\nRunning huggingface-cli login (interactive)\n\nOr passing your token explicitly:\n\n```python\nload_dataset(\"HuggingFaceFW/fineweb\", token=\"hf_your_token_here\")\n# If you’re using a SLURM cluster, ensure every node/process receives access to the token via env var:\n```\n\n```bash\nexport HF_TOKEN=hf_your_token_here\n```\n\nand then in Python:\n```python\nfrom datasets import load_dataset\nload_dataset(\"HuggingFaceFW/fineweb\", token=os.environ[\"HF_TOKEN\"])\n```\nAlso consider downloading the dataset beforehand with load_dataset(..., streaming=False) and storing it locally if you're repeatedly training with it." ]
2025-04-09T06:32:04Z
2025-06-29T06:04:59Z
null
NONE
null
null
### Describe the bug I am trying to run some finetunings on 4 A100 GPUs using SLURM using axolotl training framework which in turn uses Huggingface's Trainer and Accelerate on [Fineweb-10BT](https://huggingface.co/datasets/HuggingFaceFW/fineweb), but I end up running into 429 Client Error: Too Many Requests for URL error when I call next(dataloader_iter). Funny is, that I can run some test fine tuning (for just 200 training steps) in 1 A100 GPU using SLURM. Is there any rate limiter set for querying dataset? I could run the fine tuning with the same settings (4 A100 GPUs in SLURM) last month. ### Steps to reproduce the bug You would need a server installed with SLURM 1. Create conda environment 1.1 conda create -n example_env -c conda-forge gxx=11 python=3.10 1.2 conda activate example_env 1.3 pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu124 1.4 conda install nvidia/label/cuda-12.4.0::cuda-toolkit 1.5 Download flash_attn-2.7.4.post1+cu12torch2.5cxx11abiFALSE-cp310-cp310-linux_x86_64.whl 1.6 pip3 install packaging 1.7 pip3 install ninja 1.8 pip3 install mlflow 1.9 Clone https://github.com/calvintanama/axolotl.git 1.10 `cd` to `axolotl` 1.11 pip3 install -e '.[deepspeed]' 2. Run the training 2.1. Create a folder called `config_run` in axolotl directory 2.2. Copy `config/phi3_pruned_extra_pretrain_22_29_bottleneck_residual_8_a100_4.yaml` to `config_run` 2.3. Change yaml file in the `config_run` accordingly 2.4. Change directory and conda environment name in `jobs/train_phi3_22_29_bottleneck_residual_8_a100_4_temp.sh` 2.5. `jobs/train_phi3_22_29_bottleneck_residual_8_a100_4_temp.sh` ### Expected behavior This should not cause any error, but gotten ``` File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/accelerate/data_loader.py", line 552, in __iter__ [rank3]: current_batch = next(dataloader_iter) [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 701, in __next__ [rank3]: data = self._next_data() [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 757, in _next_data [rank3]: data = self._dataset_fetcher.fetch(index) # may raise StopIteration [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 33, in fetch [rank3]: data.append(next(self.dataset_iter)) [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/accelerate/data_loader.py", line 338, in __iter__ [rank3]: for element in self.dataset: [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 2266, in __iter__ [rank3]: for key, example in ex_iterable: [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 1866, in __iter__ [rank3]: for key, example in self.ex_iterable: [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 1084, in __iter__ [rank3]: yield from self._iter() [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 1263, in _iter [rank3]: for key, transformed_example in outputs: [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 1258, in <genexpr> [rank3]: outputs = ( [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 1244, in iter_outputs [rank3]: for i, key_example in inputs_iterator: [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 1106, in iter_batched_inputs [rank3]: for key, example in iterator: [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 1866, in __iter__ [rank3]: for key, example in self.ex_iterable: [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 1535, in __iter__ [rank3]: for x in self.ex_iterable: [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 374, in __iter__ [rank3]: for key, pa_table in self.generate_tables_fn(**gen_kwags): [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/datasets/packaged_modules/parquet/parquet.py", line 90, in _generate_tables [rank3]: if parquet_fragment.row_groups: [rank3]: File "pyarrow/_dataset_parquet.pyx", line 386, in pyarrow._dataset_parquet.ParquetFileFragment.row_groups.__get__ [rank3]: File "pyarrow/_dataset_parquet.pyx", line 393, in pyarrow._dataset_parquet.ParquetFileFragment.metadata.__get__ [rank3]: File "pyarrow/_dataset_parquet.pyx", line 382, in pyarrow._dataset_parquet.ParquetFileFragment.ensure_complete_metadata [rank3]: File "pyarrow/error.pxi", line 89, in pyarrow.lib.check_status [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/datasets/utils/file_utils.py", line 827, in read_with_retries [rank3]: out = read(*args, **kwargs) [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/huggingface_hub/hf_file_system.py", line 1013, in read [rank3]: return super().read(length) [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/fsspec/spec.py", line 1941, in read [rank3]: out = self.cache._fetch(self.loc, self.loc + length) [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/fsspec/caching.py", line 234, in _fetch [rank3]: self.cache = self.fetcher(start, end) # new block replaces old [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/huggingface_hub/hf_file_system.py", line 976, in _fetch_range [rank3]: hf_raise_for_status(r) [rank3]: File "/home/hk-project-test-p0023745/cd7437/miniconda3/envs/llmpruning_train_temp/lib/python3.10/site-packages/huggingface_hub/utils/_http.py", line 482, in hf_raise_for_status [rank3]: raise _format(HfHubHTTPError, str(e), response) from e [rank3]: huggingface_hub.errors.HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/datasets/HuggingFaceFW/fineweb/resolve/0f039043b23fe1d4eed300b504aa4b4a68f1c7ba/sample/10BT/006_00000.parquet ``` ### Environment info - datasets 3.5.0 - torch 2.5.1 - transformers 4.46.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/7506/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7505
7,505
HfHubHTTPError: 403 Forbidden: None. Cannot access content at: https://hf.co/api/s3proxy
{ "avatar_url": "https://avatars.githubusercontent.com/u/1412262?v=4", "events_url": "https://api.github.com/users/hissain/events{/privacy}", "followers_url": "https://api.github.com/users/hissain/followers", "following_url": "https://api.github.com/users/hissain/following{/other_user}", "gists_url": "https://api.github.com/users/hissain/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hissain", "id": 1412262, "login": "hissain", "node_id": "MDQ6VXNlcjE0MTIyNjI=", "organizations_url": "https://api.github.com/users/hissain/orgs", "received_events_url": "https://api.github.com/users/hissain/received_events", "repos_url": "https://api.github.com/users/hissain/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hissain/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hissain/subscriptions", "type": "User", "url": "https://api.github.com/users/hissain", "user_view_type": "public" }
[]
open
false
[]
2025-04-08T14:08:40Z
2025-04-08T14:08:40Z
null
NONE
null
null
I have already logged in Huggingface using CLI with my valid token. Now trying to download the datasets using following code: from transformers import WhisperProcessor, WhisperForConditionalGeneration, WhisperTokenizer, Trainer, TrainingArguments, DataCollatorForSeq2Seq from datasets import load_dataset, DatasetDict, Audio def load_and_preprocess_dataset(): dataset = load_dataset("mozilla-foundation/common_voice_17_0", "bn") dataset = dataset.remove_columns(["accent", "age", "client_id", "down_votes", "gender", "locale", "segment", "up_votes"]) dataset = dataset.cast_column("audio", Audio(sampling_rate=16000)) dataset = dataset["train"].train_test_split(test_size=0.1) dataset = DatasetDict({ "train": dataset["train"], "test": dataset["test"] }) return dataset load_and_preprocess_dataset() I am getting following error: Downloading data: 100%  25/25 [00:01<00:00, 25.31files/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/github/bangla-asr/.venv/lib/python3.11/site-packages/huggingface_hub/utils/_http.py:409, in hf_raise_for_status(response, endpoint_name) 408 try: --> 409 response.raise_for_status() 410 except HTTPError as e: File ~/github/bangla-asr/.venv/lib/python3.11/site-packages/requests/models.py:1024, in Response.raise_for_status(self) 1023 if http_error_msg: -> 1024 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: BlockSIEL for url: https://hf.co/api/s3proxy?GET=https%3A%2F%2Fhf-hub-lfs-us-east-1.s3.us-east-1.amazonaws.com%2Frepos%2Fa3%2F86%2Fa386bf65687d8a6928c1ea57c383aa3faade32f5171150e25af3fc1cfc273db8%2F67f1ac9cabd539bfbff3acbc549b60647833a250dc638866f22bf1b64e68806d%3FX-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Content-Sha256%3DUNSIGNED-PAYLOAD%26X-Amz-Credential%3DAKIA2JU7TKAQLC2QXPN7%252F20250408%252Fus-east-1%252Fs3%252Faws4_request%26X-Amz-Date%3D20250408T134345Z%26X-Amz-Expires%3D3600%26X-Amz-Signature%3D621e731d4fd6d08afbf568379797746ab8e2b853b6728ff5e1122fef6e56880b%26X-Amz-SignedHeaders%3Dhost%26response-content-disposition%3Dinline%253B%2520filename%252A%253DUTF-8%2527%2527bn_validated_1.tar%253B%2520filename%253D%2522bn_validated_1.tar%2522%253B%26response-content-type%3Dapplication%252Fx-tar%26x-id%3DGetObject&HEAD=https%3A%2F%2Fhf-hub-lfs-us-east-1.s3.us-east-1.amazonaws.com%2Frepos%2Fa3%2F86%2Fa386bf65687d8a6928c1ea57c383aa3faade32f5171150e25af3fc1cfc273db8%2F67f1ac9cabd539bfbff3acbc549b60647833a250dc638866f22bf1b64e68806d%3FX-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Content-Sha256%3DUNSIGNED-PAYLOAD%26X-Amz-Credential%3DAKIA2JU7TKAQLC2QXPN7%252F20250408%252Fus-east-1%252Fs3%252Faws4_request%26X-Amz-Date%3D20250408T134345Z%26X-Amz-Expires%3D3600%26X-Amz-Signature%3D15254fb79d30b0dc36b94a28138e675e0e00bb475b8a3ae774418500b095a661%26X-Amz-SignedHeaders%3Dhost&sign=eyJhbGciOiJIUzI1NiJ9.eyJyZWRpcmVjdF9kb21haW4iOiJoZi1odWItbGZzLXVzLWVhc3QtMS5zMy51cy1lYXN0LTEuYW1hem9uYXdzLmNvbSIsImlhdCI6MTc0NDExOTgyNSwiZXhwIjoxNzQ0MjA2MjI1LCJpc3MiOiJodHRwczovL2h1Z2dpbmdmYWNlLmNvIn0.5sJzudFDU3SmOdOLlwmQCOfQFf2r7y9590HoX8WBkRk The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[16], line 15 9 dataset = DatasetDict({ 10 "train": dataset["train"], 11 "test": dataset["test"] 12 }) 13 return dataset ---> 15 load_and_preprocess_dataset() 17 # def setup_model(): 18 # processor = WhisperProcessor.from_pretrained("openai/whisper-base") ... 475 range_header = response.request.headers.get("Range") HfHubHTTPError: 403 Forbidden: None. Cannot access content at: https://hf.co/api/s3proxy?GET=https%3A%2F%2Fhf-hub-lfs-us-east-1.s3.us-east-1.amazonaws.com%2Frepos%2Fa3%2F86%2Fa386bf6568724a6928c1ea57c383aa3faade32f5171150e25af3fc1cfc273db8%2F67f1ac9cabd539bfbff3acbc549b60647833a250dc638786f22bf1b64e68806d%3FX-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Content-Sha256%3DUNSIGNED-PAYLOAD%26X-Amz-Credential%3DAKIA2JU7TKAQLC2QXPN7%252F20250408%252Fus-east-1%252Fs3%252Faws4_request%26X-Amz-Date%3D20250408T134345Z%26X-Amz-Expires%3D3600%26X-Amz-Signature%3D621e731d4fd6d08afbf568379797746ab394b853b6728ff5e1122fef6e56880b%26X-Amz-SignedHeaders%3Dhost%26response-content-disposition%3Dinline%253B%2520filename%252A%253DUTF-8%2527%2527bn_validated_1.tar%253B%2520filename%253D%2522bn_validated_1.tar%2522%253B%26response-content-type%3Dapplication%252Fx-tar%26x-id%3DGetObject&HEAD=https%3A%2F%2Fhf-hub-lfs-us-east-1.s3.us-east-1.amazonaws.com%2Frepos%2Fa3%2F86%2Fa386bf65687ab76928c1ea57c383aa3faade32f5171150e25af3fc1cfc273db8%2F67f1ac9cabd539bfbff3acbc549b60647833a250d2338866f222f1b64e68806d%3FX-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Content-Sha256%3DUNSIGNED-PAYLOAD%26X-Amz-Credential%3DAKIA2JU7TKAQLC2QXPN7%252F20250408%252Fus-east-1%252Fs3%252Faws4_request%26X-Amz-Date%3D20250408T134345Z%26X-Amz-Expires%3D3600%26X-Amz-Signature%3D15254fb79d30b0dc36b94a28138e675e0e00bb475b8a3ae774418500b095a661%26X-Amz-SignedHeaders%3Dhost&sign=eyJhbGciOiJIUzI1NiJ9.eyJyZWRpcmVjds9kb21haW4iOiJoZi1odWItbGZzLXVzLWVhc3QtMS5zMy51cy1lYXN0LTEuYW1hem9uYXdzLmNvbSIsImlhdCI6MTc0NDExOT2yNSwiZXhwIjoxNzQ0MjA2MjI1LCJpc3MiOiJodHRwczovL2h1Z2dpbmdmYWNlLmNvIn0.5sJzudFDU3SmOdOLlwmQdOfQFf2r7y9590HoX8WBkRk. Make sure your token has the correct permissions. **What's wrong with the code?** Please note that the error is happening only when I am running from my office network due to probably proxy. Which URL, I need to take a proxy exception?
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/7505/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7504
7,504
BuilderConfig ParquetConfig(...) doesn't have a 'use_auth_token' key.
{ "avatar_url": "https://avatars.githubusercontent.com/u/20015750?v=4", "events_url": "https://api.github.com/users/tteguayco/events{/privacy}", "followers_url": "https://api.github.com/users/tteguayco/followers", "following_url": "https://api.github.com/users/tteguayco/following{/other_user}", "gists_url": "https://api.github.com/users/tteguayco/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tteguayco", "id": 20015750, "login": "tteguayco", "node_id": "MDQ6VXNlcjIwMDE1NzUw", "organizations_url": "https://api.github.com/users/tteguayco/orgs", "received_events_url": "https://api.github.com/users/tteguayco/received_events", "repos_url": "https://api.github.com/users/tteguayco/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tteguayco/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tteguayco/subscriptions", "type": "User", "url": "https://api.github.com/users/tteguayco", "user_view_type": "public" }
[]
open
false
[ "I encountered the same error, have you resolved it?", "Hi ! `use_auth_token` has been deprecated and removed some time ago. You should use `token` instead in `load_dataset()`", "Hi @lhoestq, I'd like to take this up.\n\nAs discussed in #7504, the issue arises when `use_auth_token` is passed to `load_dataset`, which forwards it to the config's `__init__`, where it's no longer a valid key.\n\nTo address this, I’ll intercept and strip `use_auth_token` inside `load_dataset()` (similar to how we handle `trust_remote_code`). A warning will be logged, and users will be encouraged to use `token` instead.\n\nThis avoids breaking older scripts that still use `use_auth_token`." ]
2025-04-08T10:55:03Z
2025-06-28T09:18:09Z
null
NONE
null
null
### Describe the bug Trying to run the following fine-tuning script (based on this page [here](https://github.com/huggingface/instruction-tuned-sd)): ``` ! accelerate launch /content/instruction-tuned-sd/finetune_instruct_pix2pix.py \ --pretrained_model_name_or_path=${MODEL_ID} \ --dataset_name=${DATASET_NAME} \ --use_ema \ --enable_xformers_memory_efficient_attention \ --resolution=512 --random_flip \ --train_batch_size=2 --gradient_accumulation_steps=4 --gradient_checkpointing \ --max_train_steps=500 \ --checkpointing_steps=25 --checkpoints_total_limit=1 \ --learning_rate=5e-05 --max_grad_norm=1 --lr_warmup_steps=20 \ --conditioning_dropout_prob=0.1 \ --mixed_precision=fp16 \ --seed=42 \ --output_dir=${OUTPUT_DIR} \ --original_image_column=before \ --edit_prompt=prompt \ --edited_image=after ``` but I keep getting the following error: ``` Traceback (most recent call last): File "/content/instruction-tuned-sd/finetune_instruct_pix2pix.py", line 1137, in <module> main() File "/content/instruction-tuned-sd/finetune_instruct_pix2pix.py", line 652, in main dataset = load_dataset( ^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/datasets/load.py", line 2129, in load_dataset builder_instance = load_dataset_builder( ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/datasets/load.py", line 1886, in load_dataset_builder builder_instance: DatasetBuilder = builder_cls( ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/datasets/builder.py", line 342, in __init__ self.config, self.config_id = self._create_builder_config( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/datasets/builder.py", line 590, in _create_builder_config raise ValueError(f"BuilderConfig {builder_config} doesn't have a '{key}' key.") ValueError: BuilderConfig ParquetConfig(name='default', version=0.0.0, data_dir=None, data_files={'train': ['data/train-*']}, description=None, batch_size=None, columns=None, features=None, filters=None) doesn't have a 'use_auth_token' key. Traceback (most recent call last): File "/usr/local/bin/accelerate", line 10, in <module> sys.exit(main()) ^^^^^^ ``` Any ideas? `datasets` version should be `3.2.0`. ### Steps to reproduce the bug Just running the script above. ### Expected behavior No errors ### Environment info Python 3.11.11 datasets==3.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/7504/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7503
7,503
Inconsistency between load_dataset and load_from_disk functionality
{ "avatar_url": "https://avatars.githubusercontent.com/u/60975422?v=4", "events_url": "https://api.github.com/users/zzzzzec/events{/privacy}", "followers_url": "https://api.github.com/users/zzzzzec/followers", "following_url": "https://api.github.com/users/zzzzzec/following{/other_user}", "gists_url": "https://api.github.com/users/zzzzzec/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zzzzzec", "id": 60975422, "login": "zzzzzec", "node_id": "MDQ6VXNlcjYwOTc1NDIy", "organizations_url": "https://api.github.com/users/zzzzzec/orgs", "received_events_url": "https://api.github.com/users/zzzzzec/received_events", "repos_url": "https://api.github.com/users/zzzzzec/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zzzzzec/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zzzzzec/subscriptions", "type": "User", "url": "https://api.github.com/users/zzzzzec", "user_view_type": "public" }
[]
open
false
[ "Hi ! you can find more info here: https://github.com/huggingface/datasets/issues/5044#issuecomment-1263714347\n\n> What's the recommended approach for this use case? Should I manually process my gsm8k-new dataset to make it compatible with load_dataset? Is there a standard way to convert between these formats?\n\nYou can use push_to_hub() or to_parquet() for example", "Hi @zzzzzec & @lhoestq 👋\n\nThanks for raising and discussing this — I've submitted a patch that improves this exact scenario." ]
2025-04-08T03:46:22Z
2025-06-28T08:51:16Z
null
NONE
null
null
## Issue Description I've encountered confusion when using `load_dataset` and `load_from_disk` in the datasets library. Specifically, when working offline with the gsm8k dataset, I can load it using a local path: ```python import datasets ds = datasets.load_dataset('/root/xxx/datasets/gsm8k', 'main') ``` output: ```text DatasetDict({ train: Dataset({ features: ['question', 'answer'], num_rows: 7473 }) test: Dataset({ features: ['question', 'answer'], num_rows: 1319 }) }) ``` This works as expected. However, after processing the dataset (converting answer format from #### to \boxed{}) ```python import datasets ds = datasets.load_dataset('/root/xxx/datasets/gsm8k', 'main') ds_train = ds['train'] ds_test = ds['test'] import re def convert(sample): solution = sample['answer'] solution = re.sub(r'####\s*(\S+)', r'\\boxed{\1}', solution) sample = { 'problem': sample['question'], 'solution': solution } return sample ds_train = ds_train.map(convert, remove_columns=['question', 'answer']) ds_test = ds_test.map(convert,remove_columns=['question', 'answer']) ``` I saved it using save_to_disk: ```python from datasets.dataset_dict import DatasetDict data_dict = DatasetDict({ 'train': ds_train, 'test': ds_test }) data_dict.save_to_disk('/root/xxx/datasets/gsm8k-new') ``` But now I can only load it using load_from_disk: ```python new_ds = load_from_disk('/root/xxx/datasets/gsm8k-new') ``` output: ```text DatasetDict({ train: Dataset({ features: ['problem', 'solution'], num_rows: 7473 }) test: Dataset({ features: ['problem', 'solution'], num_rows: 1319 }) }) ``` Attempting to use load_dataset produces unexpected results: ```python new_ds = load_dataset('/root/xxx/datasets/gsm8k-new') ``` output: ```text DatasetDict({ train: Dataset({ features: ['_data_files', '_fingerprint', '_format_columns', '_format_kwargs', '_format_type', '_output_all_columns', '_split'], num_rows: 1 }) test: Dataset({ features: ['_data_files', '_fingerprint', '_format_columns', '_format_kwargs', '_format_type', '_output_all_columns', '_split'], num_rows: 1 }) }) ``` Questions 1. Why is it designed such that after using `save_to_disk`, the dataset cannot be loaded with `load_dataset`? For small projects with limited code, it might be relatively easy to change all instances of `load_dataset` to `load_from_disk`. However, for complex frameworks like TRL or lighteval, diving into the framework code to change `load_dataset` to `load_from_disk` is extremely tedious and error-prone. Additionally, `load_from_disk` cannot load datasets directly downloaded from the hub, which means that if you need to modify a dataset, you have to choose between using `load_from_disk` or `load_dataset`. This creates an unnecessary dichotomy in the API and complicates workflow when working with modified datasets. 2. What's the recommended approach for this use case? Should I manually process my gsm8k-new dataset to make it compatible with load_dataset? Is there a standard way to convert between these formats? thanks~
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/7503/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7502
7,502
`load_dataset` of size 40GB creates a cache of >720GB
{ "avatar_url": "https://avatars.githubusercontent.com/u/61748653?v=4", "events_url": "https://api.github.com/users/pietrolesci/events{/privacy}", "followers_url": "https://api.github.com/users/pietrolesci/followers", "following_url": "https://api.github.com/users/pietrolesci/following{/other_user}", "gists_url": "https://api.github.com/users/pietrolesci/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/pietrolesci", "id": 61748653, "login": "pietrolesci", "node_id": "MDQ6VXNlcjYxNzQ4NjUz", "organizations_url": "https://api.github.com/users/pietrolesci/orgs", "received_events_url": "https://api.github.com/users/pietrolesci/received_events", "repos_url": "https://api.github.com/users/pietrolesci/repos", "site_admin": false, "starred_url": "https://api.github.com/users/pietrolesci/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pietrolesci/subscriptions", "type": "User", "url": "https://api.github.com/users/pietrolesci", "user_view_type": "public" }
[]
closed
false
[ "Hi ! Parquet is a compressed format. When you load a dataset, it uncompresses the Parquet data into Arrow data on your disk. That's why you can indeed end up with 720GB of uncompressed data on disk. The uncompression is needed to enable performant dataset objects (especially for random access).\n\nTo save some storage you can instead load the dataset with `streaming=True`. This way you get an `IterableDataset` that reads the Parquet data iteratively without ever writing to disk.\n\nPS: `ReadInstruction` might not be implemented for `streaming=True`, if it's the case you can use `ds.take()` and `ds.skip()` instead", "Hi @lhoestq, thanks a lot for your answer. This makes perfect sense. I will try using the streaming mode. Closing the issue." ]
2025-04-07T16:52:34Z
2025-04-15T15:22:12Z
2025-04-15T15:22:11Z
NONE
null
null
Hi there, I am trying to load a dataset from the Hugging Face Hub and split it into train and validation splits. Somehow, when I try to do it with `load_dataset`, it exhausts my disk quota. So, I tried manually downloading the parquet files from the hub and loading them as follows: ```python ds = DatasetDict( { "train": load_dataset( "parquet", data_dir=f"{local_dir}/{tok}", cache_dir=cache_dir, num_proc=min(12, os.cpu_count()), # type: ignore split=ReadInstruction("train", from_=0, to=NUM_TRAIN, unit="abs"), # type: ignore ), "validation": load_dataset( "parquet", data_dir=f"{local_dir}/{tok}", cache_dir=cache_dir, num_proc=min(12, os.cpu_count()), # type: ignore split=ReadInstruction("train", from_=NUM_TRAIN, unit="abs"), # type: ignore ) } ) ``` which still strangely creates 720GB of cache. In addition, if I remove the raw parquet file folder (`f"{local_dir}/{tok}"` in this example), I am not able to load anything. So, I am left wondering what this cache is doing. Am I missing something? Is there a solution to this problem? Thanks a lot in advance for your help! A related issue: https://github.com/huggingface/transformers/issues/10204#issue-809007443. --- Python: 3.11.11 datasets: 3.5.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/61748653?v=4", "events_url": "https://api.github.com/users/pietrolesci/events{/privacy}", "followers_url": "https://api.github.com/users/pietrolesci/followers", "following_url": "https://api.github.com/users/pietrolesci/following{/other_user}", "gists_url": "https://api.github.com/users/pietrolesci/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/pietrolesci", "id": 61748653, "login": "pietrolesci", "node_id": "MDQ6VXNlcjYxNzQ4NjUz", "organizations_url": "https://api.github.com/users/pietrolesci/orgs", "received_events_url": "https://api.github.com/users/pietrolesci/received_events", "repos_url": "https://api.github.com/users/pietrolesci/repos", "site_admin": false, "starred_url": "https://api.github.com/users/pietrolesci/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pietrolesci/subscriptions", "type": "User", "url": "https://api.github.com/users/pietrolesci", "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/7502/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7501
7,501
Nested Feature raises ArrowNotImplementedError: Unsupported cast using function cast_struct
{ "avatar_url": "https://avatars.githubusercontent.com/u/26623948?v=4", "events_url": "https://api.github.com/users/yaner-here/events{/privacy}", "followers_url": "https://api.github.com/users/yaner-here/followers", "following_url": "https://api.github.com/users/yaner-here/following{/other_user}", "gists_url": "https://api.github.com/users/yaner-here/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yaner-here", "id": 26623948, "login": "yaner-here", "node_id": "MDQ6VXNlcjI2NjIzOTQ4", "organizations_url": "https://api.github.com/users/yaner-here/orgs", "received_events_url": "https://api.github.com/users/yaner-here/received_events", "repos_url": "https://api.github.com/users/yaner-here/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yaner-here/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yaner-here/subscriptions", "type": "User", "url": "https://api.github.com/users/yaner-here", "user_view_type": "public" }
[]
closed
false
[ "Solved by the default `load_dataset(features)` parameters. Do not use `Sequence` for the `list` in `list[any]` json schema, just simply use `[]`. For example, `\"b\": Sequence({...})` fails but `\"b\": [{...}]` works fine." ]
2025-04-07T12:35:39Z
2025-04-07T12:43:04Z
2025-04-07T12:43:03Z
NONE
null
null
### Describe the bug `datasets.Features` seems to be unable to handle json file that contains fields of `list[dict]`. ### Steps to reproduce the bug ```json // test.json {"a": 1, "b": [{"c": 2, "d": 3}, {"c": 4, "d": 5}]} {"a": 5, "b": [{"c": 7, "d": 8}, {"c": 9, "d": 10}]} ``` ```python import json from datasets import Dataset, Features, Value, Sequence, load_dataset annotation_feature = Features({ "a": Value("int32"), "b": Sequence({ "c": Value("int32"), "d": Value("int32"), }), }) annotation_dataset = load_dataset( "json", data_files="test.json", features=annotation_feature ) ``` ``` ArrowNotImplementedError: Unsupported cast from list<item: struct<c: int32, d: int32>> to struct using function cast_struct The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) Cell In[46], line 11 2 from datasets import Dataset, Features, Value, Sequence, load_dataset 4 annotation_feature = Features({ 5 "a": Value("int32"), 6 "b": Sequence({ (...) 9 }), 10 }) ---> 11 annotation_dataset = load_dataset( 12 "json", 13 data_files="test.json", 14 features=annotation_feature 15 ) ``` ### Expected behavior A `datasets.Datasets` instance should be initialized. ### Environment info - `datasets` version: 3.5.0 - Platform: Linux-6.11.0-21-generic-x86_64-with-glibc2.39 - Python version: 3.11.11 - `huggingface_hub` version: 0.30.1 - PyArrow version: 19.0.1 - Pandas version: 2.2.3 - `fsspec` version: 2024.12.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/26623948?v=4", "events_url": "https://api.github.com/users/yaner-here/events{/privacy}", "followers_url": "https://api.github.com/users/yaner-here/followers", "following_url": "https://api.github.com/users/yaner-here/following{/other_user}", "gists_url": "https://api.github.com/users/yaner-here/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yaner-here", "id": 26623948, "login": "yaner-here", "node_id": "MDQ6VXNlcjI2NjIzOTQ4", "organizations_url": "https://api.github.com/users/yaner-here/orgs", "received_events_url": "https://api.github.com/users/yaner-here/received_events", "repos_url": "https://api.github.com/users/yaner-here/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yaner-here/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yaner-here/subscriptions", "type": "User", "url": "https://api.github.com/users/yaner-here", "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/7501/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7500
7,500
Make `with_format` correctly indicate that a `Dataset` is compatible with PyTorch's `Dataset` class
{ "avatar_url": "https://avatars.githubusercontent.com/u/3817460?v=4", "events_url": "https://api.github.com/users/benglewis/events{/privacy}", "followers_url": "https://api.github.com/users/benglewis/followers", "following_url": "https://api.github.com/users/benglewis/following{/other_user}", "gists_url": "https://api.github.com/users/benglewis/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/benglewis", "id": 3817460, "login": "benglewis", "node_id": "MDQ6VXNlcjM4MTc0NjA=", "organizations_url": "https://api.github.com/users/benglewis/orgs", "received_events_url": "https://api.github.com/users/benglewis/received_events", "repos_url": "https://api.github.com/users/benglewis/repos", "site_admin": false, "starred_url": "https://api.github.com/users/benglewis/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/benglewis/subscriptions", "type": "User", "url": "https://api.github.com/users/benglewis", "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
[ "Does the torch `DataLoader` really require the dataset to be a subclass of `torch.utils.data.Dataset` ? Or is there a simpler type we could use ?\n\nPS: also note that a dataset without `with_format()` can also be used in a torch `DataLoader` . Calling `with_format(\"torch\")` simply makes the output of the dataset torch Tensors in an efficient way." ]
2025-04-06T09:56:09Z
2025-04-15T12:57:39Z
null
NONE
null
null
### Feature request Currently `datasets` does not correctly indicate to the Python type-checker (e.g. `pyright` / `Pylance`) that the output of `with_format` is compatible with PyTorch's `Dataloader` since it does not indicate that the HuggingFace `Dataset` is compatible with the PyTorch `Dataset` class. It would be great if we could get the typing to work nicely. ### Motivation To avoid casting types in our Python code. ### Your contribution I would be happy to contribute a PR if this is something that may be accepted and could work with the current approach. This doesn't have to be for just PyTorch, but I imagine that the same thing would be useful for `tensorflow` and such, but we only have a need for PyTorch at this stage.
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/7500/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/pull/7499
7,499
Added cache dirs to load and file_utils
{ "avatar_url": "https://avatars.githubusercontent.com/u/43501738?v=4", "events_url": "https://api.github.com/users/gmongaras/events{/privacy}", "followers_url": "https://api.github.com/users/gmongaras/followers", "following_url": "https://api.github.com/users/gmongaras/following{/other_user}", "gists_url": "https://api.github.com/users/gmongaras/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gmongaras", "id": 43501738, "login": "gmongaras", "node_id": "MDQ6VXNlcjQzNTAxNzM4", "organizations_url": "https://api.github.com/users/gmongaras/orgs", "received_events_url": "https://api.github.com/users/gmongaras/received_events", "repos_url": "https://api.github.com/users/gmongaras/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gmongaras/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gmongaras/subscriptions", "type": "User", "url": "https://api.github.com/users/gmongaras", "user_view_type": "public" }
[]
closed
false
[ "hi ! the `hf_hub_download` cache_dir is a different cache directory than the one for `datasets`.\r\n\r\n`hf_hub_download` uses the `huggingface_hub` cache which is located in by default in `~/.cache/huggingface/hub`, while `datasets` uses a different cache for Arrow files and map() results `~/.cache/huggingface/datasets`", "Is there a way to change the default cache directory for both of these on calling load_dataset? Currently, cache_dir makes dealing with where I want files to go a bit confusing as the documentation doesn't mention it only relocates.../datasets and not .../hub.", "You can set `HF_HOME` which is the common parent directory for those two caches. Or individually `HF_DATASETS_CACHE` and `HF_HUB_CACHE`", "Got it. Can this be added to the documentation for load_dataset and related functions to avoid confusion with cache_dir?", "done in https://github.com/huggingface/datasets/pull/7532 :)" ]
2025-04-04T22:36:04Z
2025-05-07T14:07:34Z
2025-05-07T14:07:34Z
NONE
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7499.diff", "html_url": "https://github.com/huggingface/datasets/pull/7499", "merged_at": null, "patch_url": "https://github.com/huggingface/datasets/pull/7499.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7499" }
When adding "cache_dir" to datasets.load_dataset, the cache_dir gets lost in the function calls, changing the cache dir to the default path. This fixes a few of these instances.
{ "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/7499/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/issues/7498
7,498
Extreme memory bandwidth.
{ "avatar_url": "https://avatars.githubusercontent.com/u/185079645?v=4", "events_url": "https://api.github.com/users/J0SZ/events{/privacy}", "followers_url": "https://api.github.com/users/J0SZ/followers", "following_url": "https://api.github.com/users/J0SZ/following{/other_user}", "gists_url": "https://api.github.com/users/J0SZ/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/J0SZ", "id": 185079645, "login": "J0SZ", "node_id": "U_kgDOCwgXXQ", "organizations_url": "https://api.github.com/users/J0SZ/orgs", "received_events_url": "https://api.github.com/users/J0SZ/received_events", "repos_url": "https://api.github.com/users/J0SZ/repos", "site_admin": false, "starred_url": "https://api.github.com/users/J0SZ/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/J0SZ/subscriptions", "type": "User", "url": "https://api.github.com/users/J0SZ", "user_view_type": "public" }
[]
open
false
[]
2025-04-03T11:09:08Z
2025-04-03T11:11:22Z
null
NONE
null
null
### Describe the bug When I use hf datasets on 4 GPU with 40 workers I get some extreme memory bandwidth of constant ~3GB/s. However, if I wrap the dataset in `IterableDataset`, this issue is gone and the data also loads way faster (4x faster training on 1 worker). It seems like the workers don't share memory and basically duplicate the data 4x40. ### Steps to reproduce the bug Trainer arguments: ``` dataloader_pin_memory=True, dataloader_num_workers=40, dataloader_prefetch_factor=2, dataloader_persistent_workers=True, ``` Call trainer: ``` trainer = Trainer( model=model, args=train_args, train_dataset=load_from_disk('..').with_fromat('torch'), ) ``` The dataset has 600GB and consists of 1225 files. ### Expected behavior The optimal bandwidth should be 100MB/s to keep up with GPU. ### Environment info Linux Python 3.11 datasets==3.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/7498/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7497
7,497
How to convert videos to images?
{ "avatar_url": "https://avatars.githubusercontent.com/u/171649931?v=4", "events_url": "https://api.github.com/users/Loki-Lu/events{/privacy}", "followers_url": "https://api.github.com/users/Loki-Lu/followers", "following_url": "https://api.github.com/users/Loki-Lu/following{/other_user}", "gists_url": "https://api.github.com/users/Loki-Lu/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Loki-Lu", "id": 171649931, "login": "Loki-Lu", "node_id": "U_kgDOCjsriw", "organizations_url": "https://api.github.com/users/Loki-Lu/orgs", "received_events_url": "https://api.github.com/users/Loki-Lu/received_events", "repos_url": "https://api.github.com/users/Loki-Lu/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Loki-Lu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Loki-Lu/subscriptions", "type": "User", "url": "https://api.github.com/users/Loki-Lu", "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
[ "Hi ! there is some documentation here on how to read video frames: https://huggingface.co/docs/datasets/video_load" ]
2025-04-03T07:08:39Z
2025-04-15T12:35:15Z
null
NONE
null
null
### Feature request Does someone know how to return the images from videos? ### Motivation I am trying to use openpi(https://github.com/Physical-Intelligence/openpi) to finetune my Lerobot dataset(V2.0 and V2.1). I find that although the codedaset is v2.0, they are different. It seems like Lerobot V2.0 has two version, one is data include images infos and another one is separate to data and videos. Does someone know how to return the images from videos?
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/7497/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7496
7,496
Json builder: Allow features to override problematic Arrow types
{ "avatar_url": "https://avatars.githubusercontent.com/u/1017189?v=4", "events_url": "https://api.github.com/users/edmcman/events{/privacy}", "followers_url": "https://api.github.com/users/edmcman/followers", "following_url": "https://api.github.com/users/edmcman/following{/other_user}", "gists_url": "https://api.github.com/users/edmcman/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/edmcman", "id": 1017189, "login": "edmcman", "node_id": "MDQ6VXNlcjEwMTcxODk=", "organizations_url": "https://api.github.com/users/edmcman/orgs", "received_events_url": "https://api.github.com/users/edmcman/received_events", "repos_url": "https://api.github.com/users/edmcman/repos", "site_admin": false, "starred_url": "https://api.github.com/users/edmcman/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/edmcman/subscriptions", "type": "User", "url": "https://api.github.com/users/edmcman", "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
[ "Hi ! It would be cool indeed, currently the JSON data are generally loaded here: \n\nhttps://github.com/huggingface/datasets/blob/90e5bf8a8599b625d6103ee5ac83b98269991141/src/datasets/packaged_modules/json/json.py#L137-L140\n\nMaybe we can pass a Arrow `schema` to avoid errors ?" ]
2025-04-02T19:27:16Z
2025-04-15T13:06:09Z
null
NONE
null
null
### Feature request In the JSON builder, use explicitly requested feature types before or while converting to Arrow. ### Motivation Working with JSON datasets is really hard because of Arrow. At the very least, it seems like it should be possible to work-around these problems by explicitly setting problematic columns's types. But it seems like this is not possible because the features are only used *after* converting to arrow. Here's a simple example where the Arrow error could potentially be avoided by converting the column to a string: https://colab.research.google.com/drive/16QHRdbUwKSrpwVfGwu8V8AHr8v2dv0dt?usp=sharing ### Your contribution Maybe with some guidance. I'm not very familiar with arrow or pandas.
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/7496/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7495
7,495
Columns in the dataset obtained though load_dataset do not correspond to the one in the dataset viewer since 3.4.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/48770768?v=4", "events_url": "https://api.github.com/users/bruno-hays/events{/privacy}", "followers_url": "https://api.github.com/users/bruno-hays/followers", "following_url": "https://api.github.com/users/bruno-hays/following{/other_user}", "gists_url": "https://api.github.com/users/bruno-hays/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bruno-hays", "id": 48770768, "login": "bruno-hays", "node_id": "MDQ6VXNlcjQ4NzcwNzY4", "organizations_url": "https://api.github.com/users/bruno-hays/orgs", "received_events_url": "https://api.github.com/users/bruno-hays/received_events", "repos_url": "https://api.github.com/users/bruno-hays/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bruno-hays/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bruno-hays/subscriptions", "type": "User", "url": "https://api.github.com/users/bruno-hays", "user_view_type": "public" }
[]
closed
false
[ "Hi, the dataset viewer shows all the possible columns and their types, but `load_dataset()` iterates through all the columns that you defined. It seems that you only have one column (‘audio’) defined in your dataset because when I ran `print(ds.column_names)`, the only name I got was “audio”. You need to clearly define all the other features of the dataset as columns to enable your original code to work. Furthermore, you can run this code to print out all the features of your dataset: \n```python\nfrom datasets import load_dataset_builder\nds_builder = load_dataset_builder(\"BrunoHays/Accueil_UBS\")\nprint(ds_builder.info.features)\n```\n", "@phoebecd \nGood catch, even in datasets<3.4.0, the only feature is \"audio\".\nThis datasets follows the [audio folder](https://huggingface.co/docs/datasets/en/audio_dataset#audiofolder) structure with metadata.csv.\nMaybe I missed something or there is a bug when having and audio_folder with a metadata file\n\nWhat do you think @lhoestq ?", "I opened a PR to fix the issue :) https://huggingface.co/datasets/BrunoHays/Accueil_UBS/discussions/2\n\nWe expect the metadata file to be in the <split>/ folder now to allow one CSV metadata file per split. But in the PR I just added a manual configuration instead of moving the file and updating all the relative paths it contains." ]
2025-04-02T17:01:11Z
2025-07-02T23:24:57Z
2025-07-02T23:24:57Z
CONTRIBUTOR
null
null
### Describe the bug I have noticed that on my dataset named [BrunoHays/Accueil_UBS](https://huggingface.co/datasets/BrunoHays/Accueil_UBS), since the version 3.4.0, every column except audio is missing when I load the dataset. Interestingly, the dataset viewer still shows the correct columns ### Steps to reproduce the bug ```python from datasets import load_dataset ds = load_dataset("BrunoHays/Accueil_UBS", streaming=True) print(next(iter(ds["test"])).keys()) ``` With datasets >= 3.4.0: -> dict_keys(['audio']) With datasets == 3.3.2: -> dict_keys(['audio', 'id', 'speaker', 'sentence', 'raw_sentence', 'start_timestamp', 'end_timestamp', 'overlap']) ### Expected behavior All the columns should be present ### Environment info - `datasets` version: 3.3.2 - Platform: macOS-14.6.1-x86_64-i386-64bit - Python version: 3.10.15 - `huggingface_hub` version: 0.30.1 - PyArrow version: 16.1.0 - Pandas version: 1.5.3 - `fsspec` version: 2023.10.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/48770768?v=4", "events_url": "https://api.github.com/users/bruno-hays/events{/privacy}", "followers_url": "https://api.github.com/users/bruno-hays/followers", "following_url": "https://api.github.com/users/bruno-hays/following{/other_user}", "gists_url": "https://api.github.com/users/bruno-hays/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bruno-hays", "id": 48770768, "login": "bruno-hays", "node_id": "MDQ6VXNlcjQ4NzcwNzY4", "organizations_url": "https://api.github.com/users/bruno-hays/orgs", "received_events_url": "https://api.github.com/users/bruno-hays/received_events", "repos_url": "https://api.github.com/users/bruno-hays/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bruno-hays/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bruno-hays/subscriptions", "type": "User", "url": "https://api.github.com/users/bruno-hays", "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/7495/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7494
7,494
Broken links in pdf loading documentation
{ "avatar_url": "https://avatars.githubusercontent.com/u/75789232?v=4", "events_url": "https://api.github.com/users/VyoJ/events{/privacy}", "followers_url": "https://api.github.com/users/VyoJ/followers", "following_url": "https://api.github.com/users/VyoJ/following{/other_user}", "gists_url": "https://api.github.com/users/VyoJ/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/VyoJ", "id": 75789232, "login": "VyoJ", "node_id": "MDQ6VXNlcjc1Nzg5MjMy", "organizations_url": "https://api.github.com/users/VyoJ/orgs", "received_events_url": "https://api.github.com/users/VyoJ/received_events", "repos_url": "https://api.github.com/users/VyoJ/repos", "site_admin": false, "starred_url": "https://api.github.com/users/VyoJ/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/VyoJ/subscriptions", "type": "User", "url": "https://api.github.com/users/VyoJ", "user_view_type": "public" }
[]
closed
false
[ "thanks for reporting ! I fixed the links, the docs will be updated in the next release" ]
2025-04-02T06:45:22Z
2025-04-15T13:36:25Z
2025-04-15T13:36:04Z
NONE
null
null
### Describe the bug Hi, just a couple of small issues I ran into while reading the docs for [loading pdf data](https://huggingface.co/docs/datasets/main/en/document_load): 1. The link for the [`Create a pdf dataset`](https://huggingface.co/docs/datasets/main/en/document_load#pdffolder) points to https://huggingface.co/docs/datasets/main/en/pdf_dataset instead of https://huggingface.co/docs/datasets/main/en/document_dataset and hence gives a 404 error. 2. At the top of the page, it's mentioned that to work with pdf datasets we need to have the `pdfplumber` package installed but the link to its installation guide points to `pytorch/vision` [installation instructions](https://github.com/pytorch/vision#installation) instead of `pdfplumber`'s [guide](https://github.com/jsvine/pdfplumber#installation) I love the work on enabling pdf dataset support and these small tweaks would help everyone navigate the docs better. Thanks! ### Steps to reproduce the bug The issue is on the [Load Document Data](https://huggingface.co/docs/datasets/main/en/document_load) page of the datasets docs. ### Expected behavior 1. For solving the first issue, I went through the [source .mdx code](https://github.com/huggingface/datasets/blob/main/docs/source/document_load.mdx?plain=1#L188) of the datasets docs and found that the link is pointing to `./pdf_dataset` instead of `./document_dataset` 2. For the second issue, I went through the [source .mdx code](https://github.com/huggingface/datasets/blob/main/docs/source/document_load.mdx?plain=1#L13) of the datasets docs and found that the link is `pytorch/vision` [installation instructions](https://github.com/pytorch/vision#installation) instead of `pdfplumber`'s [guide](https://github.com/jsvine/pdfplumber#installation) Just replacing these two links should fix the bugs ### Environment info datasets v3.5.0 (main at the time of writing)
{ "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/7494/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7493
7,493
push_to_hub does not upload videos
{ "avatar_url": "https://avatars.githubusercontent.com/u/9339403?v=4", "events_url": "https://api.github.com/users/DominikVincent/events{/privacy}", "followers_url": "https://api.github.com/users/DominikVincent/followers", "following_url": "https://api.github.com/users/DominikVincent/following{/other_user}", "gists_url": "https://api.github.com/users/DominikVincent/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/DominikVincent", "id": 9339403, "login": "DominikVincent", "node_id": "MDQ6VXNlcjkzMzk0MDM=", "organizations_url": "https://api.github.com/users/DominikVincent/orgs", "received_events_url": "https://api.github.com/users/DominikVincent/received_events", "repos_url": "https://api.github.com/users/DominikVincent/repos", "site_admin": false, "starred_url": "https://api.github.com/users/DominikVincent/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DominikVincent/subscriptions", "type": "User", "url": "https://api.github.com/users/DominikVincent", "user_view_type": "public" }
[]
open
false
[ "Hi ! the `Video` type is still experimental, and in particular `push_to_hub` doesn't upload videos at the moment (only the paths).\n\nThere is an open question to either upload the videos inside the Parquet files, or rather have them as separate files (which is great to enable remote seeking/streaming)", "im having the same issue (btw i mistook this to be xet error https://huggingface.co/spaces/xet-team/README/discussions/4 )\n\n@jsulz suggested me to use `upload_folder` but it exceeds hf limits (>10k files per folder and >100k files in total)\n\nfrom my reading of the docs, in my case i have to save as either parquet or webdataset and then use `upload_folder`\n\ni tried `ds.to_parquet(\"...\")` but the parquet file also doesnt contain video, as of `datasets` v4.0\n\nso i think the only workaround for my case is webdataset", "in that case you can create a VideoFolder dataset instead, see the docs at http://huggingface.co/docs/datasets/video_dataset#videofolder" ]
2025-04-01T17:00:20Z
2025-09-02T10:32:36Z
null
NONE
null
null
### Describe the bug Hello, I would like to upload a video dataset (some .mp4 files and some segments within them), i.e. rows correspond to subsequences from videos. Videos might be referenced by several rows. I created a dataset locally and it references the videos and the video readers can read them correctly. I use push_to_hub() to upload the dataset to the hub. Expectation: A user uses `load_dataset` and can load the videos. However, the videos seem to be just referenced via paths on the computer and not uploaded to the hub. Therefore a target user cannot load the videos in the dataset. ### Steps to reproduce the bug 1. create a video dataset with paths e.g. { ["videos"]: [path1, path2, ...]} 2. dataset.push_to_hub 3. on a different computer (or same pc if relative paths are used in a different folder): ``` dataset = load_dataset("siplab/egosim", split="train") video = dataset[0]["video_head"] ``` 3. will fail ### Expected behavior Expectation: A user uses `load_dataset` and can load the videos. ### Environment info datasets 3.1.0 Python 3.8.18
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/7493/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/pull/7492
7,492
Closes #7457
{ "avatar_url": "https://avatars.githubusercontent.com/u/129883215?v=4", "events_url": "https://api.github.com/users/Harry-Yang0518/events{/privacy}", "followers_url": "https://api.github.com/users/Harry-Yang0518/followers", "following_url": "https://api.github.com/users/Harry-Yang0518/following{/other_user}", "gists_url": "https://api.github.com/users/Harry-Yang0518/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Harry-Yang0518", "id": 129883215, "login": "Harry-Yang0518", "node_id": "U_kgDOB73cTw", "organizations_url": "https://api.github.com/users/Harry-Yang0518/orgs", "received_events_url": "https://api.github.com/users/Harry-Yang0518/received_events", "repos_url": "https://api.github.com/users/Harry-Yang0518/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Harry-Yang0518/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Harry-Yang0518/subscriptions", "type": "User", "url": "https://api.github.com/users/Harry-Yang0518", "user_view_type": "public" }
[]
closed
false
[ "This PR fixes issue #7457" ]
2025-03-30T20:41:20Z
2025-04-13T22:05:07Z
2025-04-13T22:05:07Z
CONTRIBUTOR
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7492.diff", "html_url": "https://github.com/huggingface/datasets/pull/7492", "merged_at": null, "patch_url": "https://github.com/huggingface/datasets/pull/7492.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7492" }
This PR updates the documentation to include the HF_DATASETS_CACHE environment variable, which allows users to customize the cache location for datasets—similar to HF_HUB_CACHE for models.
{ "avatar_url": "https://avatars.githubusercontent.com/u/129883215?v=4", "events_url": "https://api.github.com/users/Harry-Yang0518/events{/privacy}", "followers_url": "https://api.github.com/users/Harry-Yang0518/followers", "following_url": "https://api.github.com/users/Harry-Yang0518/following{/other_user}", "gists_url": "https://api.github.com/users/Harry-Yang0518/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Harry-Yang0518", "id": 129883215, "login": "Harry-Yang0518", "node_id": "U_kgDOB73cTw", "organizations_url": "https://api.github.com/users/Harry-Yang0518/orgs", "received_events_url": "https://api.github.com/users/Harry-Yang0518/received_events", "repos_url": "https://api.github.com/users/Harry-Yang0518/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Harry-Yang0518/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Harry-Yang0518/subscriptions", "type": "User", "url": "https://api.github.com/users/Harry-Yang0518", "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/7492/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7491
7,491
docs: update cache.mdx to include HF_DATASETS_CACHE documentation
{ "avatar_url": "https://avatars.githubusercontent.com/u/129883215?v=4", "events_url": "https://api.github.com/users/Harry-Yang0518/events{/privacy}", "followers_url": "https://api.github.com/users/Harry-Yang0518/followers", "following_url": "https://api.github.com/users/Harry-Yang0518/following{/other_user}", "gists_url": "https://api.github.com/users/Harry-Yang0518/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Harry-Yang0518", "id": 129883215, "login": "Harry-Yang0518", "node_id": "U_kgDOB73cTw", "organizations_url": "https://api.github.com/users/Harry-Yang0518/orgs", "received_events_url": "https://api.github.com/users/Harry-Yang0518/received_events", "repos_url": "https://api.github.com/users/Harry-Yang0518/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Harry-Yang0518/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Harry-Yang0518/subscriptions", "type": "User", "url": "https://api.github.com/users/Harry-Yang0518", "user_view_type": "public" }
[]
closed
false
[ "Already included HF_DATASETS_CACHE" ]
2025-03-30T20:35:03Z
2025-03-30T20:36:40Z
2025-03-30T20:36:40Z
CONTRIBUTOR
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7491.diff", "html_url": "https://github.com/huggingface/datasets/pull/7491", "merged_at": null, "patch_url": "https://github.com/huggingface/datasets/pull/7491.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7491" }
null
{ "avatar_url": "https://avatars.githubusercontent.com/u/129883215?v=4", "events_url": "https://api.github.com/users/Harry-Yang0518/events{/privacy}", "followers_url": "https://api.github.com/users/Harry-Yang0518/followers", "following_url": "https://api.github.com/users/Harry-Yang0518/following{/other_user}", "gists_url": "https://api.github.com/users/Harry-Yang0518/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Harry-Yang0518", "id": 129883215, "login": "Harry-Yang0518", "node_id": "U_kgDOB73cTw", "organizations_url": "https://api.github.com/users/Harry-Yang0518/orgs", "received_events_url": "https://api.github.com/users/Harry-Yang0518/received_events", "repos_url": "https://api.github.com/users/Harry-Yang0518/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Harry-Yang0518/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Harry-Yang0518/subscriptions", "type": "User", "url": "https://api.github.com/users/Harry-Yang0518", "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/7491/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7490
7,490
(refactor) remove redundant logic in _check_valid_index_key
{ "avatar_url": "https://avatars.githubusercontent.com/u/2980993?v=4", "events_url": "https://api.github.com/users/suzyahyah/events{/privacy}", "followers_url": "https://api.github.com/users/suzyahyah/followers", "following_url": "https://api.github.com/users/suzyahyah/following{/other_user}", "gists_url": "https://api.github.com/users/suzyahyah/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/suzyahyah", "id": 2980993, "login": "suzyahyah", "node_id": "MDQ6VXNlcjI5ODA5OTM=", "organizations_url": "https://api.github.com/users/suzyahyah/orgs", "received_events_url": "https://api.github.com/users/suzyahyah/received_events", "repos_url": "https://api.github.com/users/suzyahyah/repos", "site_admin": false, "starred_url": "https://api.github.com/users/suzyahyah/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/suzyahyah/subscriptions", "type": "User", "url": "https://api.github.com/users/suzyahyah", "user_view_type": "public" }
[]
open
false
[]
2025-03-30T11:45:42Z
2025-03-30T11:50:22Z
null
NONE
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7490.diff", "html_url": "https://github.com/huggingface/datasets/pull/7490", "merged_at": null, "patch_url": "https://github.com/huggingface/datasets/pull/7490.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7490" }
This PR contributes a minor refactor, in a small function in `src/datasets/formatting/formatting.py`. No change in logic. In the original code, there are separate if-conditionals for `isinstance(key, range)` and `isinstance(key, Iterable)`, with essentially the same logic. This PR combines these two using a single if statement. **Considerations** 1. Although range in python is guaranteed to have integers, internally calling `int()` on an object that is already an int is negligible. (In python it returns the original object. It doesn't create a new integer object or perform any actual conversion) 2. Technically a range is already an Iterable, and we could just do `isinstance(key, Iterable)` but I explicitly did `isinstance(key, (range, Iterable))` just to be super obvious and consistent that both cases are handled because I see `slice, range, Iterable` everywhere in this `formatting.py` 3. This PR removes the `if len(key)>0` conditional. I think it is cleaner to have it this way for three reasons. - There was originally no else statement and the code would have failed silently anyway. - The if len(key)>0 should be caught much earlier, rather than in `formatting.py`. - There are actually multiple cases where this would fail, if len(key)>0, if key is non numeric or float, or if key is a list of lists. It's clunky to state all this and the error be thrown during max or indexing. **Previous PR and Issues Checks** 1. No known PR or Issues (both closed or open) in hf datasets repository **Tests** 1. Tested using Dataset (load_dataset("wikitext", "wikitext-103-raw-v1")), Pytorch DataLoader, with a Pytorch BatchSampler (list of indexes returned instead of single index).
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/7490/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7489
7,489
fix: loading of datasets from Disk(#7373)
{ "avatar_url": "https://avatars.githubusercontent.com/u/40773225?v=4", "events_url": "https://api.github.com/users/sam-hey/events{/privacy}", "followers_url": "https://api.github.com/users/sam-hey/followers", "following_url": "https://api.github.com/users/sam-hey/following{/other_user}", "gists_url": "https://api.github.com/users/sam-hey/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sam-hey", "id": 40773225, "login": "sam-hey", "node_id": "MDQ6VXNlcjQwNzczMjI1", "organizations_url": "https://api.github.com/users/sam-hey/orgs", "received_events_url": "https://api.github.com/users/sam-hey/received_events", "repos_url": "https://api.github.com/users/sam-hey/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sam-hey/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sam-hey/subscriptions", "type": "User", "url": "https://api.github.com/users/sam-hey", "user_view_type": "public" }
[]
open
false
[ "@nepfaff Could you confirm if this fixes the issue for you? I checked Memray, and everything looked good on my end.\r\n\r\nInstall: `pip install git+https://github.com/sam-hey/datasets.git@fix/concatenate_datasets`\r\n", "Will aim to get to this soon. I don't have a rapid testing pipeline setup but need to wait for some AWS nodes to become free", "I now set up a small experiment:\r\n\r\n```python\r\n# Log initial RAM usage\r\n process = psutil.Process(os.getpid())\r\n initial_ram = process.memory_info().rss / (1024 * 1024) # Convert to MB\r\n logging.info(f\"Initial RAM usage: {initial_ram:.2f} MB\")\r\n\r\n chunk_datasets = [\r\n Dataset.load_from_disk(dataset_path, keep_in_memory=False) for _ in range(N)\r\n ]\r\n combined_dataset = concatenate_datasets(chunk_datasets)\r\n\r\n # Log final RAM usage\r\n final_ram = process.memory_info().rss / (1024 * 1024) # Convert to MB\r\n ram_diff = final_ram - initial_ram\r\n logging.info(f\"Final RAM usage: {final_ram:.2f} MB\")\r\n logging.info(f\"RAM usage increase: {ram_diff:.2f} MB\")\r\n```\r\n\r\nThe RAM usage is linearly correlated with `N` on datasets master!\r\n\r\nFor my test dataset:\r\n- N=5 => RAM usage increase: 26302.91 MB\r\n- N=10 => RAM usage increase: 52315.18 MB\r\n- N=20 => RAM usage increase: 104510.65 MB\r\n- N=40 => RAM usage increase: 209166.30 MB\r\n\r\nUnfortunately, your patch doesn't seem to change this:\r\n```bash\r\npip install git+https://github.com/sam-hey/datasets.git@fix/concatenate_datasets\r\npip list | grep datasets\r\ndatasets 3.5.1.dev0\r\n```\r\nGives exactly the same RAM statistics.\r\n\r\n**Edit:** The results are a bit flawed as the memory increase all seems to come from `Dataset.load_from_disk(dataset_path, keep_in_memory=False)` here (which I don't think should happen either?) and not from `concatenate_datasets`. This seems different from my large-scale setup that runs out of memory during `concatenate_datasets` but I don't seem to be able to replicate this here...", "Thanks a lot, @nepfaff, for taking a look at this! It seems that `concatenate_datasets()` is fixed with this PR. I can also confirm that loading a large number of files requires significant memory. However, as I understand it, this is expected/a bug since the memory consumption stems from `pa.memory_map()`, which returns a memory-mapped file.\r\n\r\nThis behavior might be related to this bug: https://github.com/apache/arrow/issues/34423 \r\n\r\n<img width=\"1728\" alt=\"Screenshot 2025-04-03 at 16 01 11\" src=\"https://github.com/user-attachments/assets/475691d8-3aba-4d7e-b8ef-5e7552c70b14\" />\r\n", "Great ! have you tested that it also fixes the memory issue in your case @iamollas ?\r\n\r\nHappy to know that it works for you @sam-hey ! Looking forward to merging this", "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7489). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-03-29T16:22:58Z
2025-04-24T16:36:36Z
null
NONE
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7489.diff", "html_url": "https://github.com/huggingface/datasets/pull/7489", "merged_at": null, "patch_url": "https://github.com/huggingface/datasets/pull/7489.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7489" }
Fixes dataset loading from disk by ensuring that memory maps and streams are properly closed. For more details, see https://github.com/huggingface/datasets/issues/7373.
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/7489/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7488
7,488
Support underscore int read instruction
{ "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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7488). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.", "you rock, Quentin - thank you!" ]
2025-03-28T16:01:15Z
2025-03-28T16:20:44Z
2025-03-28T16:20:43Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7488.diff", "html_url": "https://github.com/huggingface/datasets/pull/7488", "merged_at": "2025-03-28T16:20:43Z", "patch_url": "https://github.com/huggingface/datasets/pull/7488.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7488" }
close https://github.com/huggingface/datasets/issues/7481
{ "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/7488/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7487
7,487
Write pdf in map
{ "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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7487). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-03-28T15:49:25Z
2025-03-28T17:09:53Z
2025-03-28T17:09:51Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7487.diff", "html_url": "https://github.com/huggingface/datasets/pull/7487", "merged_at": "2025-03-28T17:09:51Z", "patch_url": "https://github.com/huggingface/datasets/pull/7487.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7487" }
Fix this error when mapping a PDF dataset ``` pyarrow.lib.ArrowInvalid: Could not convert <pdfplumber.pdf.PDF object at 0x13498ee40> with type PDF: did not recognize Python value type when inferring an Arrow data type ``` and also let map() outputs be lists of images or pdfs
{ "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/7487/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/issues/7486
7,486
`shared_datadir` fixture is missing
{ "avatar_url": "https://avatars.githubusercontent.com/u/1289205?v=4", "events_url": "https://api.github.com/users/lahwaacz/events{/privacy}", "followers_url": "https://api.github.com/users/lahwaacz/followers", "following_url": "https://api.github.com/users/lahwaacz/following{/other_user}", "gists_url": "https://api.github.com/users/lahwaacz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lahwaacz", "id": 1289205, "login": "lahwaacz", "node_id": "MDQ6VXNlcjEyODkyMDU=", "organizations_url": "https://api.github.com/users/lahwaacz/orgs", "received_events_url": "https://api.github.com/users/lahwaacz/received_events", "repos_url": "https://api.github.com/users/lahwaacz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lahwaacz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lahwaacz/subscriptions", "type": "User", "url": "https://api.github.com/users/lahwaacz", "user_view_type": "public" }
[]
closed
false
[ "OK I was missing the `pytest-datadir` package. Sorry for the noise!" ]
2025-03-27T18:17:12Z
2025-03-27T19:49:11Z
2025-03-27T19:49:10Z
NONE
null
null
### Describe the bug Running the tests for the latest release fails due to missing `shared_datadir` fixture. ### Steps to reproduce the bug Running `pytest` while building a package for Arch Linux leads to these errors: ``` ==================================== ERRORS ==================================== _________ ERROR at setup of test_pdf_feature_encode_example[<lambda>1] _________ [gw44] linux -- Python 3.13.2 /build/python-datasets/src/datasets-3.5.0/test-env/bin/python file /build/python-datasets/src/datasets-3.5.0/tests/features/test_pdf.py, line 8 @require_pdfplumber @pytest.mark.parametrize( "build_example", [ lambda pdf_path: pdf_path, lambda pdf_path: open(pdf_path, "rb").read(), lambda pdf_path: {"path": pdf_path}, lambda pdf_path: {"path": pdf_path, "bytes": None}, lambda pdf_path: {"path": pdf_path, "bytes": open(pdf_path, "rb").read()}, lambda pdf_path: {"path": None, "bytes": open(pdf_path, "rb").read()}, lambda pdf_path: {"bytes": open(pdf_path, "rb").read()}, ], ) def test_pdf_feature_encode_example(shared_datadir, build_example): E fixture 'shared_datadir' not found > available fixtures: _hf_gated_dataset_repo_txt_data, arrow_file, arrow_path, audio_file, bz2_csv_path, bz2_file, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, ci_hfh_hf_hub_url, ci_hub_config, cleanup_repo, csv2_path, csv_path, data_dir_with_hidden_files, dataset, dataset_dict, disable_implicit_token, disable_tqdm_output, doctest_namespace, geoparquet_path, gz_file, hf_api, hf_gated_dataset_repo_txt_data, hf_private_dataset_repo_txt_data, hf_private_dataset_repo_txt_data_, hf_private_dataset_repo_zipped_img_data, hf_private_dataset_repo_zipped_img_data_, hf_private_dataset_repo_zipped_txt_data, hf_private_dataset_repo_zipped_txt_data_, hf_token, image_file, json_dict_of_lists_path, json_list_of_dicts_path, jsonl2_path, jsonl_312_path, jsonl_gz_path, jsonl_path, jsonl_str_path, lz4_file, mock_fsspec, mockfs, monkeypatch, parquet_path, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, set_ci_hub_access_token, set_sqlalchemy_silence_uber_warning, set_test_cache_config, set_update_download_counts_to_false, seven_zip_file, sqlite_path, tar_file, tar_jsonl_path, tar_nested_jsonl_path, temporary_repo, tensor_file, testrun_uid, text2_path, text_dir, text_dir_with_unsupported_extension, text_file, text_file_content, text_gz_path, text_path, text_path_with_unicode_new_lines, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, tmpfs, worker_id, xml_file, xz_file, zero_time_out_for_remote_code, zip_csv_path, zip_csv_with_dir_path, zip_file, zip_image_path, zip_jsonl_path, zip_jsonl_with_dir_path, zip_nested_jsonl_path, zip_text_path, zip_text_with_dir_path, zip_unsupported_ext_path, zip_uppercase_csv_path, zstd_file > use 'pytest --fixtures [testpath]' for help on them. /build/python-datasets/src/datasets-3.5.0/tests/features/test_pdf.py:8 _________ ERROR at setup of test_pdf_feature_encode_example[<lambda>2] _________ [gw44] linux -- Python 3.13.2 /build/python-datasets/src/datasets-3.5.0/test-env/bin/python file /build/python-datasets/src/datasets-3.5.0/tests/features/test_pdf.py, line 8 @require_pdfplumber @pytest.mark.parametrize( "build_example", [ lambda pdf_path: pdf_path, lambda pdf_path: open(pdf_path, "rb").read(), lambda pdf_path: {"path": pdf_path}, lambda pdf_path: {"path": pdf_path, "bytes": None}, lambda pdf_path: {"path": pdf_path, "bytes": open(pdf_path, "rb").read()}, lambda pdf_path: {"path": None, "bytes": open(pdf_path, "rb").read()}, lambda pdf_path: {"bytes": open(pdf_path, "rb").read()}, ], ) def test_pdf_feature_encode_example(shared_datadir, build_example): E fixture 'shared_datadir' not found > available fixtures: _hf_gated_dataset_repo_txt_data, arrow_file, arrow_path, audio_file, bz2_csv_path, bz2_file, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, ci_hfh_hf_hub_url, ci_hub_config, cleanup_repo, csv2_path, csv_path, data_dir_with_hidden_files, dataset, dataset_dict, disable_implicit_token, disable_tqdm_output, doctest_namespace, geoparquet_path, gz_file, hf_api, hf_gated_dataset_repo_txt_data, hf_private_dataset_repo_txt_data, hf_private_dataset_repo_txt_data_, hf_private_dataset_repo_zipped_img_data, hf_private_dataset_repo_zipped_img_data_, hf_private_dataset_repo_zipped_txt_data, hf_private_dataset_repo_zipped_txt_data_, hf_token, image_file, json_dict_of_lists_path, json_list_of_dicts_path, jsonl2_path, jsonl_312_path, jsonl_gz_path, jsonl_path, jsonl_str_path, lz4_file, mock_fsspec, mockfs, monkeypatch, parquet_path, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, set_ci_hub_access_token, set_sqlalchemy_silence_uber_warning, set_test_cache_config, set_update_download_counts_to_false, seven_zip_file, sqlite_path, tar_file, tar_jsonl_path, tar_nested_jsonl_path, temporary_repo, tensor_file, testrun_uid, text2_path, text_dir, text_dir_with_unsupported_extension, text_file, text_file_content, text_gz_path, text_path, text_path_with_unicode_new_lines, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, tmpfs, worker_id, xml_file, xz_file, zero_time_out_for_remote_code, zip_csv_path, zip_csv_with_dir_path, zip_file, zip_image_path, zip_jsonl_path, zip_jsonl_with_dir_path, zip_nested_jsonl_path, zip_text_path, zip_text_with_dir_path, zip_unsupported_ext_path, zip_uppercase_csv_path, zstd_file > use 'pytest --fixtures [testpath]' for help on them. /build/python-datasets/src/datasets-3.5.0/tests/features/test_pdf.py:8 _________ ERROR at setup of test_pdf_feature_encode_example[<lambda>3] _________ [gw44] linux -- Python 3.13.2 /build/python-datasets/src/datasets-3.5.0/test-env/bin/python file /build/python-datasets/src/datasets-3.5.0/tests/features/test_pdf.py, line 8 @require_pdfplumber @pytest.mark.parametrize( "build_example", [ lambda pdf_path: pdf_path, lambda pdf_path: open(pdf_path, "rb").read(), lambda pdf_path: {"path": pdf_path}, lambda pdf_path: {"path": pdf_path, "bytes": None}, lambda pdf_path: {"path": pdf_path, "bytes": open(pdf_path, "rb").read()}, lambda pdf_path: {"path": None, "bytes": open(pdf_path, "rb").read()}, lambda pdf_path: {"bytes": open(pdf_path, "rb").read()}, ], ) def test_pdf_feature_encode_example(shared_datadir, build_example): E fixture 'shared_datadir' not found > available fixtures: _hf_gated_dataset_repo_txt_data, arrow_file, arrow_path, audio_file, bz2_csv_path, bz2_file, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, ci_hfh_hf_hub_url, ci_hub_config, cleanup_repo, csv2_path, csv_path, data_dir_with_hidden_files, dataset, dataset_dict, disable_implicit_token, disable_tqdm_output, doctest_namespace, geoparquet_path, gz_file, hf_api, hf_gated_dataset_repo_txt_data, hf_private_dataset_repo_txt_data, hf_private_dataset_repo_txt_data_, hf_private_dataset_repo_zipped_img_data, hf_private_dataset_repo_zipped_img_data_, hf_private_dataset_repo_zipped_txt_data, hf_private_dataset_repo_zipped_txt_data_, hf_token, image_file, json_dict_of_lists_path, json_list_of_dicts_path, jsonl2_path, jsonl_312_path, jsonl_gz_path, jsonl_path, jsonl_str_path, lz4_file, mock_fsspec, mockfs, monkeypatch, parquet_path, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, set_ci_hub_access_token, set_sqlalchemy_silence_uber_warning, set_test_cache_config, set_update_download_counts_to_false, seven_zip_file, sqlite_path, tar_file, tar_jsonl_path, tar_nested_jsonl_path, temporary_repo, tensor_file, testrun_uid, text2_path, text_dir, text_dir_with_unsupported_extension, text_file, text_file_content, text_gz_path, text_path, text_path_with_unicode_new_lines, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, tmpfs, worker_id, xml_file, xz_file, zero_time_out_for_remote_code, zip_csv_path, zip_csv_with_dir_path, zip_file, zip_image_path, zip_jsonl_path, zip_jsonl_with_dir_path, zip_nested_jsonl_path, zip_text_path, zip_text_with_dir_path, zip_unsupported_ext_path, zip_uppercase_csv_path, zstd_file > use 'pytest --fixtures [testpath]' for help on them. /build/python-datasets/src/datasets-3.5.0/tests/features/test_pdf.py:8 _________ ERROR at setup of test_pdf_feature_encode_example[<lambda>4] _________ [gw44] linux -- Python 3.13.2 /build/python-datasets/src/datasets-3.5.0/test-env/bin/python file /build/python-datasets/src/datasets-3.5.0/tests/features/test_pdf.py, line 8 @require_pdfplumber @pytest.mark.parametrize( "build_example", [ lambda pdf_path: pdf_path, lambda pdf_path: open(pdf_path, "rb").read(), lambda pdf_path: {"path": pdf_path}, lambda pdf_path: {"path": pdf_path, "bytes": None}, lambda pdf_path: {"path": pdf_path, "bytes": open(pdf_path, "rb").read()}, lambda pdf_path: {"path": None, "bytes": open(pdf_path, "rb").read()}, lambda pdf_path: {"bytes": open(pdf_path, "rb").read()}, ], ) def test_pdf_feature_encode_example(shared_datadir, build_example): E fixture 'shared_datadir' not found > available fixtures: _hf_gated_dataset_repo_txt_data, arrow_file, arrow_path, audio_file, bz2_csv_path, bz2_file, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, ci_hfh_hf_hub_url, ci_hub_config, cleanup_repo, csv2_path, csv_path, data_dir_with_hidden_files, dataset, dataset_dict, disable_implicit_token, disable_tqdm_output, doctest_namespace, geoparquet_path, gz_file, hf_api, hf_gated_dataset_repo_txt_data, hf_private_dataset_repo_txt_data, hf_private_dataset_repo_txt_data_, hf_private_dataset_repo_zipped_img_data, hf_private_dataset_repo_zipped_img_data_, hf_private_dataset_repo_zipped_txt_data, hf_private_dataset_repo_zipped_txt_data_, hf_token, image_file, json_dict_of_lists_path, json_list_of_dicts_path, jsonl2_path, jsonl_312_path, jsonl_gz_path, jsonl_path, jsonl_str_path, lz4_file, mock_fsspec, mockfs, monkeypatch, parquet_path, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, set_ci_hub_access_token, set_sqlalchemy_silence_uber_warning, set_test_cache_config, set_update_download_counts_to_false, seven_zip_file, sqlite_path, tar_file, tar_jsonl_path, tar_nested_jsonl_path, temporary_repo, tensor_file, testrun_uid, text2_path, text_dir, text_dir_with_unsupported_extension, text_file, text_file_content, text_gz_path, text_path, text_path_with_unicode_new_lines, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, tmpfs, worker_id, xml_file, xz_file, zero_time_out_for_remote_code, zip_csv_path, zip_csv_with_dir_path, zip_file, zip_image_path, zip_jsonl_path, zip_jsonl_with_dir_path, zip_nested_jsonl_path, zip_text_path, zip_text_with_dir_path, zip_unsupported_ext_path, zip_uppercase_csv_path, zstd_file > use 'pytest --fixtures [testpath]' for help on them. /build/python-datasets/src/datasets-3.5.0/tests/features/test_pdf.py:8 _________ ERROR at setup of test_pdf_feature_encode_example[<lambda>5] _________ [gw44] linux -- Python 3.13.2 /build/python-datasets/src/datasets-3.5.0/test-env/bin/python file /build/python-datasets/src/datasets-3.5.0/tests/features/test_pdf.py, line 8 @require_pdfplumber @pytest.mark.parametrize( "build_example", [ lambda pdf_path: pdf_path, lambda pdf_path: open(pdf_path, "rb").read(), lambda pdf_path: {"path": pdf_path}, lambda pdf_path: {"path": pdf_path, "bytes": None}, lambda pdf_path: {"path": pdf_path, "bytes": open(pdf_path, "rb").read()}, lambda pdf_path: {"path": None, "bytes": open(pdf_path, "rb").read()}, lambda pdf_path: {"bytes": open(pdf_path, "rb").read()}, ], ) def test_pdf_feature_encode_example(shared_datadir, build_example): E fixture 'shared_datadir' not found > available fixtures: _hf_gated_dataset_repo_txt_data, arrow_file, arrow_path, audio_file, bz2_csv_path, bz2_file, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, ci_hfh_hf_hub_url, ci_hub_config, cleanup_repo, csv2_path, csv_path, data_dir_with_hidden_files, dataset, dataset_dict, disable_implicit_token, disable_tqdm_output, doctest_namespace, geoparquet_path, gz_file, hf_api, hf_gated_dataset_repo_txt_data, hf_private_dataset_repo_txt_data, hf_private_dataset_repo_txt_data_, hf_private_dataset_repo_zipped_img_data, hf_private_dataset_repo_zipped_img_data_, hf_private_dataset_repo_zipped_txt_data, hf_private_dataset_repo_zipped_txt_data_, hf_token, image_file, json_dict_of_lists_path, json_list_of_dicts_path, jsonl2_path, jsonl_312_path, jsonl_gz_path, jsonl_path, jsonl_str_path, lz4_file, mock_fsspec, mockfs, monkeypatch, parquet_path, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, set_ci_hub_access_token, set_sqlalchemy_silence_uber_warning, set_test_cache_config, set_update_download_counts_to_false, seven_zip_file, sqlite_path, tar_file, tar_jsonl_path, tar_nested_jsonl_path, temporary_repo, tensor_file, testrun_uid, text2_path, text_dir, text_dir_with_unsupported_extension, text_file, text_file_content, text_gz_path, text_path, text_path_with_unicode_new_lines, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, tmpfs, worker_id, xml_file, xz_file, zero_time_out_for_remote_code, zip_csv_path, zip_csv_with_dir_path, zip_file, zip_image_path, zip_jsonl_path, zip_jsonl_with_dir_path, zip_nested_jsonl_path, zip_text_path, zip_text_with_dir_path, zip_unsupported_ext_path, zip_uppercase_csv_path, zstd_file > use 'pytest --fixtures [testpath]' for help on them. /build/python-datasets/src/datasets-3.5.0/tests/features/test_pdf.py:8 _________ ERROR at setup of test_pdf_feature_encode_example[<lambda>6] _________ [gw44] linux -- Python 3.13.2 /build/python-datasets/src/datasets-3.5.0/test-env/bin/python file /build/python-datasets/src/datasets-3.5.0/tests/features/test_pdf.py, line 8 @require_pdfplumber @pytest.mark.parametrize( "build_example", [ lambda pdf_path: pdf_path, lambda pdf_path: open(pdf_path, "rb").read(), lambda pdf_path: {"path": pdf_path}, lambda pdf_path: {"path": pdf_path, "bytes": None}, lambda pdf_path: {"path": pdf_path, "bytes": open(pdf_path, "rb").read()}, lambda pdf_path: {"path": None, "bytes": open(pdf_path, "rb").read()}, lambda pdf_path: {"bytes": open(pdf_path, "rb").read()}, ], ) def test_pdf_feature_encode_example(shared_datadir, build_example): E fixture 'shared_datadir' not found > available fixtures: _hf_gated_dataset_repo_txt_data, arrow_file, arrow_path, audio_file, bz2_csv_path, bz2_file, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, ci_hfh_hf_hub_url, ci_hub_config, cleanup_repo, csv2_path, csv_path, data_dir_with_hidden_files, dataset, dataset_dict, disable_implicit_token, disable_tqdm_output, doctest_namespace, geoparquet_path, gz_file, hf_api, hf_gated_dataset_repo_txt_data, hf_private_dataset_repo_txt_data, hf_private_dataset_repo_txt_data_, hf_private_dataset_repo_zipped_img_data, hf_private_dataset_repo_zipped_img_data_, hf_private_dataset_repo_zipped_txt_data, hf_private_dataset_repo_zipped_txt_data_, hf_token, image_file, json_dict_of_lists_path, json_list_of_dicts_path, jsonl2_path, jsonl_312_path, jsonl_gz_path, jsonl_path, jsonl_str_path, lz4_file, mock_fsspec, mockfs, monkeypatch, parquet_path, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, set_ci_hub_access_token, set_sqlalchemy_silence_uber_warning, set_test_cache_config, set_update_download_counts_to_false, seven_zip_file, sqlite_path, tar_file, tar_jsonl_path, tar_nested_jsonl_path, temporary_repo, tensor_file, testrun_uid, text2_path, text_dir, text_dir_with_unsupported_extension, text_file, text_file_content, text_gz_path, text_path, text_path_with_unicode_new_lines, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, tmpfs, worker_id, xml_file, xz_file, zero_time_out_for_remote_code, zip_csv_path, zip_csv_with_dir_path, zip_file, zip_image_path, zip_jsonl_path, zip_jsonl_with_dir_path, zip_nested_jsonl_path, zip_text_path, zip_text_with_dir_path, zip_unsupported_ext_path, zip_uppercase_csv_path, zstd_file > use 'pytest --fixtures [testpath]' for help on them. /build/python-datasets/src/datasets-3.5.0/tests/features/test_pdf.py:8 _______________ ERROR at setup of test_dataset_with_pdf_feature ________________ [gw44] linux -- Python 3.13.2 /build/python-datasets/src/datasets-3.5.0/test-env/bin/python file /build/python-datasets/src/datasets-3.5.0/tests/features/test_pdf.py, line 34 @require_pdfplumber def test_dataset_with_pdf_feature(shared_datadir): E fixture 'shared_datadir' not found > available fixtures: _hf_gated_dataset_repo_txt_data, arrow_file, arrow_path, audio_file, bz2_csv_path, bz2_file, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, ci_hfh_hf_hub_url, ci_hub_config, cleanup_repo, csv2_path, csv_path, data_dir_with_hidden_files, dataset, dataset_dict, disable_implicit_token, disable_tqdm_output, doctest_namespace, geoparquet_path, gz_file, hf_api, hf_gated_dataset_repo_txt_data, hf_private_dataset_repo_txt_data, hf_private_dataset_repo_txt_data_, hf_private_dataset_repo_zipped_img_data, hf_private_dataset_repo_zipped_img_data_, hf_private_dataset_repo_zipped_txt_data, hf_private_dataset_repo_zipped_txt_data_, hf_token, image_file, json_dict_of_lists_path, json_list_of_dicts_path, jsonl2_path, jsonl_312_path, jsonl_gz_path, jsonl_path, jsonl_str_path, lz4_file, mock_fsspec, mockfs, monkeypatch, parquet_path, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, set_ci_hub_access_token, set_sqlalchemy_silence_uber_warning, set_test_cache_config, set_update_download_counts_to_false, seven_zip_file, sqlite_path, tar_file, tar_jsonl_path, tar_nested_jsonl_path, temporary_repo, tensor_file, testrun_uid, text2_path, text_dir, text_dir_with_unsupported_extension, text_file, text_file_content, text_gz_path, text_path, text_path_with_unicode_new_lines, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, tmpfs, worker_id, xml_file, xz_file, zero_time_out_for_remote_code, zip_csv_path, zip_csv_with_dir_path, zip_file, zip_image_path, zip_jsonl_path, zip_jsonl_with_dir_path, zip_nested_jsonl_path, zip_text_path, zip_text_with_dir_path, zip_unsupported_ext_path, zip_uppercase_csv_path, zstd_file > use 'pytest --fixtures [testpath]' for help on them. /build/python-datasets/src/datasets-3.5.0/tests/features/test_pdf.py:34 _________ ERROR at setup of test_pdf_feature_encode_example[<lambda>0] _________ [gw46] linux -- Python 3.13.2 /build/python-datasets/src/datasets-3.5.0/test-env/bin/python file /build/python-datasets/src/datasets-3.5.0/tests/features/test_pdf.py, line 8 @require_pdfplumber @pytest.mark.parametrize( "build_example", [ lambda pdf_path: pdf_path, lambda pdf_path: open(pdf_path, "rb").read(), lambda pdf_path: {"path": pdf_path}, lambda pdf_path: {"path": pdf_path, "bytes": None}, lambda pdf_path: {"path": pdf_path, "bytes": open(pdf_path, "rb").read()}, lambda pdf_path: {"path": None, "bytes": open(pdf_path, "rb").read()}, lambda pdf_path: {"bytes": open(pdf_path, "rb").read()}, ], ) def test_pdf_feature_encode_example(shared_datadir, build_example): E fixture 'shared_datadir' not found > available fixtures: _hf_gated_dataset_repo_txt_data, arrow_file, arrow_path, audio_file, bz2_csv_path, bz2_file, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, ci_hfh_hf_hub_url, ci_hub_config, cleanup_repo, csv2_path, csv_path, data_dir_with_hidden_files, dataset, dataset_dict, disable_implicit_token, disable_tqdm_output, doctest_namespace, geoparquet_path, gz_file, hf_api, hf_gated_dataset_repo_txt_data, hf_private_dataset_repo_txt_data, hf_private_dataset_repo_txt_data_, hf_private_dataset_repo_zipped_img_data, hf_private_dataset_repo_zipped_img_data_, hf_private_dataset_repo_zipped_txt_data, hf_private_dataset_repo_zipped_txt_data_, hf_token, image_file, json_dict_of_lists_path, json_list_of_dicts_path, jsonl2_path, jsonl_312_path, jsonl_gz_path, jsonl_path, jsonl_str_path, lz4_file, mock_fsspec, mockfs, monkeypatch, parquet_path, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, set_ci_hub_access_token, set_sqlalchemy_silence_uber_warning, set_test_cache_config, set_update_download_counts_to_false, seven_zip_file, sqlite_path, tar_file, tar_jsonl_path, tar_nested_jsonl_path, temporary_repo, tensor_file, testrun_uid, text2_path, text_dir, text_dir_with_unsupported_extension, text_file, text_file_content, text_gz_path, text_path, text_path_with_unicode_new_lines, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, tmpfs, worker_id, xml_file, xz_file, zero_time_out_for_remote_code, zip_csv_path, zip_csv_with_dir_path, zip_file, zip_image_path, zip_jsonl_path, zip_jsonl_with_dir_path, zip_nested_jsonl_path, zip_text_path, zip_text_with_dir_path, zip_unsupported_ext_path, zip_uppercase_csv_path, zstd_file > use 'pytest --fixtures [testpath]' for help on them. /build/python-datasets/src/datasets-3.5.0/tests/features/test_pdf.py:8 ``` ### Expected behavior All fixtures used in tests should be available. ### Environment info Arch Linux build system, building the [python-datasets](https://gitlab.archlinux.org/archlinux/packaging/packages/python-datasets) package. There are actually [many deselected tests](https://gitlab.archlinux.org/archlinux/packaging/packages/python-datasets/-/blob/6f97957f0c326cc7b3da6b7f12326305bcaef374/PKGBUILD#L66-148) which were failing on previous releases, but these errors popped up in 3.5.0.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1289205?v=4", "events_url": "https://api.github.com/users/lahwaacz/events{/privacy}", "followers_url": "https://api.github.com/users/lahwaacz/followers", "following_url": "https://api.github.com/users/lahwaacz/following{/other_user}", "gists_url": "https://api.github.com/users/lahwaacz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lahwaacz", "id": 1289205, "login": "lahwaacz", "node_id": "MDQ6VXNlcjEyODkyMDU=", "organizations_url": "https://api.github.com/users/lahwaacz/orgs", "received_events_url": "https://api.github.com/users/lahwaacz/received_events", "repos_url": "https://api.github.com/users/lahwaacz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lahwaacz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lahwaacz/subscriptions", "type": "User", "url": "https://api.github.com/users/lahwaacz", "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/7486/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/pull/7485
7,485
set dev version
{ "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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7485). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-03-27T16:39:34Z
2025-03-27T16:41:59Z
2025-03-27T16:39:42Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7485.diff", "html_url": "https://github.com/huggingface/datasets/pull/7485", "merged_at": "2025-03-27T16:39:42Z", "patch_url": "https://github.com/huggingface/datasets/pull/7485.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7485" }
null
{ "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/7485/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7484
7,484
release: 3.5.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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7484). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-03-27T16:33:27Z
2025-03-27T16:35:44Z
2025-03-27T16:34:22Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7484.diff", "html_url": "https://github.com/huggingface/datasets/pull/7484", "merged_at": "2025-03-27T16:34:22Z", "patch_url": "https://github.com/huggingface/datasets/pull/7484.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7484" }
null
{ "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/7484/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7483
7,483
Support skip_trying_type
{ "avatar_url": "https://avatars.githubusercontent.com/u/11156001?v=4", "events_url": "https://api.github.com/users/yoshitomo-matsubara/events{/privacy}", "followers_url": "https://api.github.com/users/yoshitomo-matsubara/followers", "following_url": "https://api.github.com/users/yoshitomo-matsubara/following{/other_user}", "gists_url": "https://api.github.com/users/yoshitomo-matsubara/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yoshitomo-matsubara", "id": 11156001, "login": "yoshitomo-matsubara", "node_id": "MDQ6VXNlcjExMTU2MDAx", "organizations_url": "https://api.github.com/users/yoshitomo-matsubara/orgs", "received_events_url": "https://api.github.com/users/yoshitomo-matsubara/received_events", "repos_url": "https://api.github.com/users/yoshitomo-matsubara/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yoshitomo-matsubara/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yoshitomo-matsubara/subscriptions", "type": "User", "url": "https://api.github.com/users/yoshitomo-matsubara", "user_view_type": "public" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7483). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.", "Cool ! Can you run `make style` to fix code formatting ?\r\n\r\nI was also thinking of naming the argument `try_original_type` and have it `True` by default", "@lhoestq \r\n\r\nThank you for the suggestion! I renamed the argument with `True` by default and ran `make style`\r\nDoes it look good?", "Thanks @lhoestq !\r\n\r\nLet me know if there are anything that I can do for this PR. Otherwise, looking forward to seeing this update in the package soon!", "CI failures are unrelated, merging :)", "Great, thanks for your support!\r\nI can't wait for the next release :)" ]
2025-03-27T07:07:20Z
2025-04-29T04:14:57Z
2025-04-09T09:53:10Z
CONTRIBUTOR
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7483.diff", "html_url": "https://github.com/huggingface/datasets/pull/7483", "merged_at": "2025-04-09T09:53:10Z", "patch_url": "https://github.com/huggingface/datasets/pull/7483.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7483" }
This PR addresses Issue #7472 cc: @lhoestq
{ "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/7483/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7482
7,482
Implement capability to restore non-nullability in Features
{ "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
[ "Interestingly, this does not close #7479. The Features are not correctly maintained when calling `from_dict` with the custom Features.", "Unfortunately this PR does not fix the reported issue. After more digging:\r\n\r\n- when the dataset is created, nullability information is lost in Features;\r\n- even with this PR, it will get lost eventually because of internal copying/recreation of the Features object without accounting for the nullable fields;\r\n- even if that is also fixed, and Features.arrow_schema correctly holds the nullability info, [casting the arrow Table](https://github.com/huggingface/datasets/blob/5f8d2ad9a1b0bccfd962d998987228addfd5be9f/src/datasets/arrow_dataset.py#L677) with a less strict schema to a more strict one (with nullability) will fail (only on deeper structs, not on flat fields). \r\n\r\nInterestingly, passing custom Features does not immediately load the underlying data with the right arrow_schema. Instead, the workflow is like this:\r\n\r\n- load pyarrow table with any of the methods (from_dict, from_pandas, etc.), which will always AUTO INFER rather than use a provided schema\r\n- the loaded table with auto-schema will be used to initialize the `Dataset` class, and only during construction will [CAST](https://github.com/huggingface/datasets/blob/5f8d2ad9a1b0bccfd962d998987228addfd5be9f/src/datasets/arrow_dataset.py#L677) the table to the user-provided schema if needed, if it differs from the auto-inferred one.\r\n\r\nSo I figured, since many/all of the pyarrow [`Table.from_*`](https://arrow.apache.org/docs/python/generated/pyarrow.Table.html) methods have a `schema=` argument, we should already load the Table with the correct schema to begin with. As an example, I tried changing this line:\r\n\r\nhttps://github.com/huggingface/datasets/blob/5f8d2ad9a1b0bccfd962d998987228addfd5be9f/src/datasets/arrow_dataset.py#L940\r\n\r\nto include the arrow_schema, if provided:\r\n\r\n```python\r\npa_table = InMemoryTable.from_pydict(mapping=mapping, schema=features.arrow_schema if features is not None else None)\r\n```\r\n\r\nBut that leads to:\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"/home/ampere/vanroy/datasets/scratch.py\", line 33, in <module>\r\n ds = Dataset.from_dict(\r\n ^^^^^^^^^^^^^^^^^^\r\n File \"/home/local/vanroy/datasets/src/datasets/arrow_dataset.py\", line 957, in from_dict\r\n pa_table = InMemoryTable.from_pydict(mapping=mapping, schema=features.arrow_schema if features is not None else None)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/local/vanroy/datasets/src/datasets/table.py\", line 758, in from_pydict\r\n return cls(pa.Table.from_pydict(*args, **kwargs))\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"pyarrow/table.pxi\", line 1968, in pyarrow.lib._Tabular.from_pydict\r\n File \"pyarrow/table.pxi\", line 6354, in pyarrow.lib._from_pydict\r\n File \"pyarrow/array.pxi\", line 402, in pyarrow.lib.asarray\r\n File \"pyarrow/array.pxi\", line 252, in pyarrow.lib.array\r\n File \"pyarrow/array.pxi\", line 114, in pyarrow.lib._handle_arrow_array_protocol\r\n File \"/home/local/vanroy/datasets/src/datasets/arrow_writer.py\", line 201, in __arrow_array__\r\n raise ValueError(\"TypedSequence is supposed to be used with pa.array(typed_sequence, type=None)\")\r\nValueError: TypedSequence is supposed to be used with pa.array(typed_sequence, type=None)\r\n```\r\n\r\nand I am not too familiar with pyarrow to solve this.\r\n\r\nSo ultimately I'm a bit at a loss here. I *think*, if we'd want to do this right, the automatic casting in init should be removed in favor of handling the logic inside `Dataset.from_*`, by passing the schema explicitly to `pa.Table.from_*(..., schema=schema)`. But I lack the knowledge of pyarrow to go further than what I've written about above.\r\n", "It's indeed a bit more work to support nullable since in addition to your comments, there are unclear behavior when it comes to concatenating nullable with non-nullable, and maybe how to handle non-nullable lists and nested data.\r\n\r\nBut yup I agree having the `Dataset.from_*` function pass the `schema` to the `pa.Table.from*` would be the way.\r\n\r\nJust one comment about this error: \r\n\r\n```\r\nValueError: TypedSequence is supposed to be used with pa.array(typed_sequence, type=None)\r\n```\r\n\r\nThis happens because `Dataset.from_dict` uses `OptimizedTypedSequence` by default, which should only be used if the user doesn't specify a schema" ]
2025-03-26T22:16:09Z
2025-05-15T15:00:59Z
2025-05-15T15:00:59Z
CONTRIBUTOR
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7482.diff", "html_url": "https://github.com/huggingface/datasets/pull/7482", "merged_at": null, "patch_url": "https://github.com/huggingface/datasets/pull/7482.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7482" }
This PR attempts to keep track of non_nullable pyarrow fields when converting a `pa.Schema` to `Features`. At the same time, when outputting the `arrow_schema`, the original non-nullable fields are restored. This allows for more consistent behavior and avoids breaking behavior as illustrated in #7479. I am by no means a pyarrow expert so some logic in `find_non_nullable_fields` may not perfect. Not sure if more logic (type checks) are needed for deep-checking a given schema. Maybe there are other pyarrow structures that need to be covered? Tests are added, but again, these may not have sufficient coverage in terms of pyarrow structure types. closes #7479
{ "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/7482/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/issues/7481
7,481
deal with python `10_000` legal number in slice syntax
{ "avatar_url": "https://avatars.githubusercontent.com/u/196988264?v=4", "events_url": "https://api.github.com/users/sfc-gh-sbekman/events{/privacy}", "followers_url": "https://api.github.com/users/sfc-gh-sbekman/followers", "following_url": "https://api.github.com/users/sfc-gh-sbekman/following{/other_user}", "gists_url": "https://api.github.com/users/sfc-gh-sbekman/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sfc-gh-sbekman", "id": 196988264, "login": "sfc-gh-sbekman", "node_id": "U_kgDOC73NaA", "organizations_url": "https://api.github.com/users/sfc-gh-sbekman/orgs", "received_events_url": "https://api.github.com/users/sfc-gh-sbekman/received_events", "repos_url": "https://api.github.com/users/sfc-gh-sbekman/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sfc-gh-sbekman/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sfc-gh-sbekman/subscriptions", "type": "User", "url": "https://api.github.com/users/sfc-gh-sbekman", "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
[ "should be an easy fix, I opened a PR" ]
2025-03-26T20:10:54Z
2025-03-28T16:20:44Z
2025-03-28T16:20:44Z
NONE
null
null
### Feature request ``` In [6]: ds = datasets.load_dataset("HuggingFaceH4/ultrachat_200k", split="train_sft[:1000]") In [7]: ds = datasets.load_dataset("HuggingFaceH4/ultrachat_200k", split="train_sft[:1_000]") [dozens of frames skipped] File /usr/local/lib/python3.10/dist-packages/datasets/arrow_reader.py:444, in _str_to_read_instruction(spec) 442 res = _SUB_SPEC_RE.match(spec) 443 if not res: --> 444 raise ValueError(f"Unrecognized instruction format: {spec}") ValueError: Unrecognized instruction format: train_sft[:1_000] ``` It took me a while to understand what the problem was. But apparently `pyarrow` doesn't allow python numbers that may include `_` as in `1_000`. The `_` aids readability since `10_000_000` vs `10000000` is obviously easier to grasp of what the actual number is. Feature request: ideally `datasets` being a python module will do the right thing and convert python numbers into whatever pyarrow supports - in this case stripping `_`s. Second best it'd err and tell the user that using numbers with `_` in split slices is not acceptible, so that the user won't have to deal with a huge pyarrow assert they know nothing about. Thank you!
{ "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/7481/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7480
7,480
HF_DATASETS_CACHE ignored?
{ "avatar_url": "https://avatars.githubusercontent.com/u/31896?v=4", "events_url": "https://api.github.com/users/stephenroller/events{/privacy}", "followers_url": "https://api.github.com/users/stephenroller/followers", "following_url": "https://api.github.com/users/stephenroller/following{/other_user}", "gists_url": "https://api.github.com/users/stephenroller/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/stephenroller", "id": 31896, "login": "stephenroller", "node_id": "MDQ6VXNlcjMxODk2", "organizations_url": "https://api.github.com/users/stephenroller/orgs", "received_events_url": "https://api.github.com/users/stephenroller/received_events", "repos_url": "https://api.github.com/users/stephenroller/repos", "site_admin": false, "starred_url": "https://api.github.com/users/stephenroller/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stephenroller/subscriptions", "type": "User", "url": "https://api.github.com/users/stephenroller", "user_view_type": "public" }
[]
open
false
[ "FWIW, it does eventually write to /tmp/roller/datasets when generating the final version.", "Hey, I’d love to work on this issue but I am a beginner, can I work it with you?", "Hi @lhoestq,\nI'd like to look into this issue but I'm still learning. Could you share any quick pointers on the HF_DATASETS_CACHE behavior here? Thanks!", "Hi ! `HF_DATASETS_CACHE` is only for the cache files of the `datasets` library, not for the `huggingface_hub` cache for files downloaded from the Hugging Face Hub.\n\nYou should either specify `HF_HOME` (parent cache path for everything HF) or both `HF_DATASETS_CACHE` and `HF_HUB_CACHE`", "\n\nThanks for clarifying, @lhoestq! To make sure I’ve got it right:\n\n1. **HF_DATASETS_CACHE** only controls where the **datasets** library writes its own cache files (e.g. processed shards, Arrow files, etc.).\n2. Anything downloaded via **huggingface_hub** (models, tokenizers, raw files) still goes into the Hub cache (by default `~/.cache/huggingface/hub`), unless you set **HF_HUB_CACHE** or the parent **HF_HOME**.\n\nSo if you want everything off NFS and onto local disk you have two options:\n\n- **Set both** \n ```bash\n export HF_DATASETS_CACHE=/tmp/roller/datasets \n export HF_HUB_CACHE=/tmp/roller/hub\n ```\n- **Or set** \n ```bash\n export HF_HOME=/tmp/roller\n ```\n which will apply to both subdirectories.\n\nIs that correct? And would it make sense to add a note to the docs clarifying the distinction (or even support S3 for the Hub cache in the future)? I’m happy to draft a small docs PR if that would help.", "Hi, yes that's correct, thanks for the clarification ! A note in the docs would be welcome, thanks", "I'm downloading a HF model through vLLM, setting both HF_HUB_CACHE and HF_HOME, and still my `hub` and `xet` end up in $HOME. Anyone an idea what gives?", "If you set HF_HOME you should be fine\n\nEven HF_XET_CACHE is placed in HF_HOME by default according to the [docs](https://huggingface.co/docs/huggingface_hub/en/package_reference/environment_variables#hfxetcache):\n\n> **HF_XET_CACHE**\n> To configure where Xet chunks (byte ranges from files managed by Xet backend) are cached locally.\n> Defaults to \"$HF_HOME/xet\" (e.g. \"~/.cache/huggingface/xet\" by default).\n\nCan you check you don't have HF_XET_CACHE or HF_HUB_CACHE that would override HF_HOME ?" ]
2025-03-26T17:19:34Z
2025-10-23T15:59:18Z
null
NONE
null
null
### Describe the bug I'm struggling to get things to respect HF_DATASETS_CACHE. Rationale: I'm on a system that uses NFS for homedir, so downloading to NFS is expensive, slow, and wastes valuable quota compared to local disk. Instead, it seems to rely mostly on HF_HUB_CACHE. Current version: 3.2.1dev. In the process of testing 3.4.0 ### Steps to reproduce the bug [Currently writing using datasets 3.2.1dev. Will follow up with 3.4.0 results] dump.py: ```python from datasets import load_dataset dataset = load_dataset("HuggingFaceFW/fineweb", name="sample-100BT", split="train") ``` Repro steps ```bash # ensure no cache $ mv ~/.cache/huggingface ~/.cache/huggingface.bak $ export HF_DATASETS_CACHE=/tmp/roller/datasets $ rm -rf ${HF_DATASETS_CACHE} $ env | grep HF | grep -v TOKEN HF_DATASETS_CACHE=/tmp/roller/datasets $ python dump.py # (omitted for brevity) # (while downloading) $ du -hcs ~/.cache/huggingface/hub 18G hub 18G total # (after downloading) $ du -hcs ~/.cache/huggingface/hub ``` It's a shame because datasets supports s3 (which I could really use right now) but hub does not. ### Expected behavior * ~/.cache/huggingface/hub stays empty * /tmp/roller/datasets becomes full of stuff ### Environment info [Currently writing using datasets 3.2.1dev. Will follow up with 3.4.0 results]
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/7480/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7479
7,479
Features.from_arrow_schema is destructive
{ "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
[]
2025-03-26T16:46:43Z
2025-03-26T16:46:58Z
null
CONTRIBUTOR
null
null
### Describe the bug I came across this, perhaps niche, bug where `Features` does not/cannot account for pyarrow's `nullable=False` option in Fields. Interestingly, I found that in regular "flat" fields this does not necessarily lead to conflicts, but when a non-nullable field is in a struct, an incompatibility arises. It's not easy to explain in words, so the minimal example below should help I hope. Note that I suggest a solution in the comments in the code, simply allowing `Dataset.to_parquet` to allow for a `schema` argument which, when provided, will override the default ds.features.arrow_schema. ### Steps to reproduce the bug ```python import os from datasets import Dataset, Features import pyarrow as pa import pyarrow.parquet as pq # HF datasets is destructive when you call Features.from_arrow_schema(schema) on a schema # because it will not account for nullable and non-nullable fields in structs (it will always allow nullable) # Reloading the same dataset with the original schema will raise an error because the schema is not the same anymore non_nullable_schema = pa.schema( [ pa.field("text", pa.string(), nullable=False), pa.field("meta", pa.struct( [ pa.field("date", pa.list_(pa.string()), nullable=False), ], ), ), ] ) print("ORIGINAL SCHEMA") print(non_nullable_schema) print() feats = Features.from_arrow_schema(non_nullable_schema) print("FEATUR-IZED SCHEMA (nullable-restrictions are gone)") print(feats.arrow_schema) print() ds = Dataset.from_dict( { "text": ["a", "b", "c"], "meta": [{"date": ["2021-01-01"]}, {"date": ["2021-01-02"]}, {"date": ["2021-01-03"]}], }, features=feats, ) fname = "tmp.parquet" # This is not possible: TypeError: pyarrow.parquet.core.ParquetWriter() got multiple values for keyword argument 'schema' # Though I believe this would be the easiest fix: allow schema to be passed to to_parquet and overwrite the schema in the dataset # ds.to_parquet(fname, schema=non_nullable_schema) ds.to_parquet(fname) try: _ = pq.read_table(fname, schema=non_nullable_schema) finally: os.unlink(fname) ``` ### Expected behavior - Non-destructive behavior when converting an arrow schema to Features; or - the ability to override the default arrow schema with a custom one ### Environment info - `datasets` version: 3.2.0 - Platform: Linux-5.14.0-427.20.1.el9_4.x86_64-x86_64-with-glibc2.34 - Python version: 3.11.10 - `huggingface_hub` version: 0.27.1 - PyArrow version: 18.1.0 - Pandas version: 2.2.3 - `fsspec` version: 2024.9.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/7479/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/pull/7478
7,478
update fsspec 2025.3.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/487783?v=4", "events_url": "https://api.github.com/users/peteski22/events{/privacy}", "followers_url": "https://api.github.com/users/peteski22/followers", "following_url": "https://api.github.com/users/peteski22/following{/other_user}", "gists_url": "https://api.github.com/users/peteski22/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/peteski22", "id": 487783, "login": "peteski22", "node_id": "MDQ6VXNlcjQ4Nzc4Mw==", "organizations_url": "https://api.github.com/users/peteski22/orgs", "received_events_url": "https://api.github.com/users/peteski22/received_events", "repos_url": "https://api.github.com/users/peteski22/repos", "site_admin": false, "starred_url": "https://api.github.com/users/peteski22/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/peteski22/subscriptions", "type": "User", "url": "https://api.github.com/users/peteski22", "user_view_type": "public" }
[]
closed
false
[ "Sorry for tagging you @lhoestq but since you merged the linked PR, I wondered if you might be able to help me get this triaged so it can be reviewed/rejected etc. 🙏🏼 ", "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7478). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-03-26T09:53:05Z
2025-03-28T19:15:54Z
2025-03-28T15:51:55Z
CONTRIBUTOR
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7478.diff", "html_url": "https://github.com/huggingface/datasets/pull/7478", "merged_at": "2025-03-28T15:51:54Z", "patch_url": "https://github.com/huggingface/datasets/pull/7478.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7478" }
It appears there have been two releases of fsspec since this dependency was last updated, it would be great if Datasets could be updated so that it didn't hold back the usage of newer fsspec versions in consuming projects. PR based on https://github.com/huggingface/datasets/pull/7352
{ "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/7478/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/issues/7477
7,477
What is the canonical way to compress a Dataset?
{ "avatar_url": "https://avatars.githubusercontent.com/u/6130352?v=4", "events_url": "https://api.github.com/users/eric-czech/events{/privacy}", "followers_url": "https://api.github.com/users/eric-czech/followers", "following_url": "https://api.github.com/users/eric-czech/following{/other_user}", "gists_url": "https://api.github.com/users/eric-czech/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/eric-czech", "id": 6130352, "login": "eric-czech", "node_id": "MDQ6VXNlcjYxMzAzNTI=", "organizations_url": "https://api.github.com/users/eric-czech/orgs", "received_events_url": "https://api.github.com/users/eric-czech/received_events", "repos_url": "https://api.github.com/users/eric-czech/repos", "site_admin": false, "starred_url": "https://api.github.com/users/eric-czech/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/eric-czech/subscriptions", "type": "User", "url": "https://api.github.com/users/eric-czech", "user_view_type": "public" }
[]
open
false
[ "I saw this post by @lhoestq: https://discuss.huggingface.co/t/increased-arrow-table-size-by-factor-of-2/26561/4 suggesting that there is at least some internal code for writing sharded parquet datasets non-concurrently. This appears to be that code: https://github.com/huggingface/datasets/blob/94ccd1b4fada8a92cea96dc8df4e915041d695b6/src/datasets/arrow_dataset.py#L5380-L5397\n\nIs there any fundamental reason (e.g. race conditions) that this kind of operation couldn't exist as a utility or method on a `Dataset` with a `num_proc` argument? I am not seeing any other issues explicitly for that ask. \n", "We simply haven't implemented a method to save as sharded parquet locally yet ^^'\n\nRight now the only sharded parquet export method is `push_to_hub()` which writes to HF. But we can have a local one as well. \n\nIn the meantime the easiest way to export as sharded parquet locally is to `.shard()` and `.to_parquet()` (see code from my comment [here](https://github.com/huggingface/datasets/issues/7047#issuecomment-2233163406))", "> In the meantime the easiest way to export as sharded parquet locally is to .shard() and .to_parquet()\n\nMakes sense, BUT how can it be done concurrently? I could of course use multiprocessing myself or a dozen other libraries for parallelizing single-node/local operations like that.\n\nWhat I'm asking though is, what is the way to do this that is most canonical for `datasets` specifically? I.e. what is least likely to causing pickling or other issues because it is used frequently internally by `datasets` and already likely tests for a lot of library-native edge-cases?", "Everything in `datasets` is picklable :) and even better: since the data are memory mapped from disk, pickling in one process and unpickling in another doesn't do any copy - it instantaneously reloads the memory map.\n\nSo feel free to use the library you prefer to parallelize your operations.\n\n(it's another story in distributed setups though, because in that case you either need to copy and send the data or setup a distributed filesystem)" ]
2025-03-25T16:47:51Z
2025-04-03T09:13:11Z
null
NONE
null
null
Given that Arrow is the preferred backend for a Dataset, what is a user supposed to do if they want concurrent reads, concurrent writes AND on-disk compression for a larger dataset? Parquet would be the obvious answer except that there is no native support for writing sharded, parquet datasets concurrently [[1](https://github.com/huggingface/datasets/issues/7047)]. Am I missing something? And if so, why is this not the standard/default way that `Dataset`'s work as they do in Xarray, Ray Data, Composer, etc.?
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/7477/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/pull/7476
7,476
Priotitize json
{ "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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7476). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-03-25T15:44:31Z
2025-03-25T15:47:00Z
2025-03-25T15:45:00Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7476.diff", "html_url": "https://github.com/huggingface/datasets/pull/7476", "merged_at": "2025-03-25T15:45:00Z", "patch_url": "https://github.com/huggingface/datasets/pull/7476.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7476" }
`datasets` should load the JSON data in https://huggingface.co/datasets/facebook/natural_reasoning, not the PDF
{ "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/7476/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/issues/7475
7,475
IterableDataset's state_dict shard_example_idx is always equal to the number of samples in a shard
{ "avatar_url": "https://avatars.githubusercontent.com/u/48770768?v=4", "events_url": "https://api.github.com/users/bruno-hays/events{/privacy}", "followers_url": "https://api.github.com/users/bruno-hays/followers", "following_url": "https://api.github.com/users/bruno-hays/following{/other_user}", "gists_url": "https://api.github.com/users/bruno-hays/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bruno-hays", "id": 48770768, "login": "bruno-hays", "node_id": "MDQ6VXNlcjQ4NzcwNzY4", "organizations_url": "https://api.github.com/users/bruno-hays/orgs", "received_events_url": "https://api.github.com/users/bruno-hays/received_events", "repos_url": "https://api.github.com/users/bruno-hays/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bruno-hays/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bruno-hays/subscriptions", "type": "User", "url": "https://api.github.com/users/bruno-hays", "user_view_type": "public" }
[]
closed
false
[ "Hey, I’d love to work on this issue but I am a beginner, can I work it with you?", "Hello. I'm sorry but I don't have much time to get in the details for now.\nHave you managed to reproduce the issue with the code provided ?\nIf you want to work on it, you can self-assign and ask @lhoestq for directions", "Hi Bruno, I am trying to reproduce it this later in this week and let you know what I found.", "#self-assign", "Good catch, I tried and if the dataset is bigger (e.g. `range(9999)`) it returns `\"shard_example_idx\": 1000` with is the `config.DEFAULT_MAX_BATCH_SIZE`\n\nhttps://github.com/huggingface/datasets/blob/94ccd1b4fada8a92cea96dc8df4e915041d695b6/src/datasets/arrow_dataset.py#L5313-L5317\n\nIt looks like the state_dict is incorrect in that case, it should account for this and use the `RebatchedArrowExamplesIterable` which buffers the batch of 1000 rows and counts the iteration within the batch in the state_dict", "\nHello @lhoestq,\n\nI’ve been debugging the `IterableDataset.state_dict()` behavior and applied a patch to `ArrowExamplesIterable._iter_arrow()` in an attempt to fix the issue described in #7475—specifically, that `shard_example_idx` always equals the number of samples in the shard, even if only a few examples have been consumed.\n\n### What I Tried\n\nI updated `_iter_arrow` to slice off already-consumed rows and increment the state only by the number of actual examples yielded, like this:\n\n```python\nclass ArrowExamplesIterable(_BaseExamplesIterable):\n # ... __init__ and _init_state_dict as before ...\n\n def _iter_arrow(self):\n shard_idx_start = self._state_dict[\"shard_idx\"] if self._state_dict else 0\n\n for gen_kwargs in islice(\n _split_gen_kwargs(self.kwargs, max_num_jobs=self.num_shards),\n shard_idx_start, None\n ):\n shard_example_idx_start = self._state_dict[\"shard_example_idx\"] if self._state_dict else 0\n shard_example_idx = 0\n\n for key, pa_table in self.generate_tables_fn(**gen_kwargs):\n num_rows = len(pa_table)\n next_idx = shard_example_idx + num_rows\n\n if next_idx <= shard_example_idx_start:\n shard_example_idx = next_idx\n continue\n\n offset = max(0, shard_example_idx_start - shard_example_idx)\n sliced_table = pa_table.slice(offset)\n\n if self._state_dict:\n self._state_dict[\"shard_example_idx\"] += len(sliced_table)\n\n yield key, sliced_table\n shard_example_idx = next_idx\n\n if self._state_dict:\n self._state_dict[\"shard_idx\"] += 1\n self._state_dict[\"shard_example_idx\"] = 0\n```\n\nI verified that the updated code was being used, and I added debug prints to confirm the table slicing and counter updates.\n\n### The Issue Still Exists\n\nDespite the changes, the behavior remains the same. Running this minimal repro:\n\n```python\nds = Dataset.from_dict({\"a\": range(6)}).to_iterable_dataset(num_shards=1)\nfor idx, example in enumerate(ds):\n print(example)\n if idx == 2:\n print(\"checkpoint\")\n print(ds.state_dict())\n break\n```\n\nStill outputs:\n\n```bash\n{'a': 0}\n{'a': 1}\n{'a': 2}\ncheckpoint\n{'examples_iterable': {'shard_idx': 0, 'shard_example_idx': 6, 'type': 'ArrowExamplesIterable'}, 'epoch': 0}\n```\n\nEven though only 3 examples were consumed, `shard_example_idx` jumps to 6.\n\n### Questions\n\n- Could there be another place (e.g., in `__iter__`, `RebatchedArrowExamplesIterable`, or the `IterableDataset` wrapper) that's still using the old logic and overriding the state?\n- Is there a better location to intercept and count yielded examples?\n- Would you recommend tracking a new `true_example_idx` to avoid modifying existing behavior?\n\nLet me know your thoughts—happy to iterate further and submit a PR once we align on the right approach. Thanks again for your help and feedback!", "I found a fix using RebatchedArrowExamplesIterable, let me know if it's all good for you now", "Hi @lhoestq, thanks for the quick fix and for referencing RebatchedArrowExamplesIterable! 🙌\n\nI just tested your patch locally and can confirm that shard_example_idx is now tracking correctly when only a subset of examples is consumed. This resolves the issue I was seeing in #7475.\n\nReally appreciate the guidance earlier on where to look—it was a great learning opportunity. If there are other parts of the IterableDataset internals that could use cleanup or testing, I’d be happy to help." ]
2025-03-25T13:58:07Z
2025-05-06T14:22:19Z
2025-05-06T14:05:07Z
CONTRIBUTOR
null
null
### Describe the bug I've noticed a strange behaviour with Iterable state_dict: the value of shard_example_idx is always equal to the amount of samples in a shard. ### Steps to reproduce the bug I am reusing the example from the doc ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(6)}).to_iterable_dataset(num_shards=1) state_dict = None # Iterate through the dataset and print examples for idx, example in enumerate(ds): print(example) if idx == 2: state_dict = ds.state_dict() print("checkpoint") break print(state_dict) ``` Returns: ``` {'a': 0} {'a': 1} checkpoint {'examples_iterable': {'shard_idx': 0, 'shard_example_idx': 6, 'type': 'ArrowExamplesIterable'}, 'epoch': 0} ``` ### Expected behavior shard_example_idx should be 2 instead of 6 If we run with num_shards=2, then shard_example_idx is 3 instead of 2 and so on. ### Environment info - `datasets` version: 3.4.1 - Platform: macOS-14.6.1-arm64-arm-64bit - Python version: 3.12.9 - `huggingface_hub` version: 0.29.3 - PyArrow version: 19.0.1 - Pandas version: 2.2.3 - `fsspec` version: 2024.12.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/7475/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/pull/7474
7,474
Remove conditions for Python < 3.9
{ "avatar_url": "https://avatars.githubusercontent.com/u/17618148?v=4", "events_url": "https://api.github.com/users/cyyever/events{/privacy}", "followers_url": "https://api.github.com/users/cyyever/followers", "following_url": "https://api.github.com/users/cyyever/following{/other_user}", "gists_url": "https://api.github.com/users/cyyever/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/cyyever", "id": 17618148, "login": "cyyever", "node_id": "MDQ6VXNlcjE3NjE4MTQ4", "organizations_url": "https://api.github.com/users/cyyever/orgs", "received_events_url": "https://api.github.com/users/cyyever/received_events", "repos_url": "https://api.github.com/users/cyyever/repos", "site_admin": false, "starred_url": "https://api.github.com/users/cyyever/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/cyyever/subscriptions", "type": "User", "url": "https://api.github.com/users/cyyever", "user_view_type": "public" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7474). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.", "Thanks ! can you run `make style` to fix code formatting ? then we can merge", "@lhoestq Done" ]
2025-03-25T03:08:04Z
2025-04-16T00:11:06Z
2025-04-15T16:07:55Z
CONTRIBUTOR
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7474.diff", "html_url": "https://github.com/huggingface/datasets/pull/7474", "merged_at": "2025-04-15T16:07:54Z", "patch_url": "https://github.com/huggingface/datasets/pull/7474.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7474" }
This PR remove conditions for Python < 3.9.
{ "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/7474/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/issues/7473
7,473
Webdataset data format problem
{ "avatar_url": "https://avatars.githubusercontent.com/u/1017189?v=4", "events_url": "https://api.github.com/users/edmcman/events{/privacy}", "followers_url": "https://api.github.com/users/edmcman/followers", "following_url": "https://api.github.com/users/edmcman/following{/other_user}", "gists_url": "https://api.github.com/users/edmcman/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/edmcman", "id": 1017189, "login": "edmcman", "node_id": "MDQ6VXNlcjEwMTcxODk=", "organizations_url": "https://api.github.com/users/edmcman/orgs", "received_events_url": "https://api.github.com/users/edmcman/received_events", "repos_url": "https://api.github.com/users/edmcman/repos", "site_admin": false, "starred_url": "https://api.github.com/users/edmcman/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/edmcman/subscriptions", "type": "User", "url": "https://api.github.com/users/edmcman", "user_view_type": "public" }
[]
closed
false
[ "I was able to work around it" ]
2025-03-21T17:23:52Z
2025-03-21T19:19:58Z
2025-03-21T19:19:58Z
NONE
null
null
### Describe the bug Please see https://huggingface.co/datasets/ejschwartz/idioms/discussions/1 Error code: FileFormatMismatchBetweenSplitsError All three splits, train, test, and validation, use webdataset. But only the train split has more than one file. How can I force the other two splits to also be interpreted as being the webdataset format? (I don't think there is currently a way, but happy to be told that I am wrong.) ### Steps to reproduce the bug ``` import datasets datasets.load_dataset("ejschwartz/idioms") ### Expected behavior The dataset loads. Alternatively, there is a YAML syntax for manually specifying the format. ### Environment info - `datasets` version: 3.2.0 - Platform: Linux-6.8.0-52-generic-x86_64-with-glibc2.35 - Python version: 3.10.12 - `huggingface_hub` version: 0.28.1 - PyArrow version: 19.0.0 - Pandas version: 2.2.3 - `fsspec` version: 2024.9.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/1017189?v=4", "events_url": "https://api.github.com/users/edmcman/events{/privacy}", "followers_url": "https://api.github.com/users/edmcman/followers", "following_url": "https://api.github.com/users/edmcman/following{/other_user}", "gists_url": "https://api.github.com/users/edmcman/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/edmcman", "id": 1017189, "login": "edmcman", "node_id": "MDQ6VXNlcjEwMTcxODk=", "organizations_url": "https://api.github.com/users/edmcman/orgs", "received_events_url": "https://api.github.com/users/edmcman/received_events", "repos_url": "https://api.github.com/users/edmcman/repos", "site_admin": false, "starred_url": "https://api.github.com/users/edmcman/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/edmcman/subscriptions", "type": "User", "url": "https://api.github.com/users/edmcman", "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/7473/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7472
7,472
Label casting during `map` process is canceled after the `map` process
{ "avatar_url": "https://avatars.githubusercontent.com/u/11156001?v=4", "events_url": "https://api.github.com/users/yoshitomo-matsubara/events{/privacy}", "followers_url": "https://api.github.com/users/yoshitomo-matsubara/followers", "following_url": "https://api.github.com/users/yoshitomo-matsubara/following{/other_user}", "gists_url": "https://api.github.com/users/yoshitomo-matsubara/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yoshitomo-matsubara", "id": 11156001, "login": "yoshitomo-matsubara", "node_id": "MDQ6VXNlcjExMTU2MDAx", "organizations_url": "https://api.github.com/users/yoshitomo-matsubara/orgs", "received_events_url": "https://api.github.com/users/yoshitomo-matsubara/received_events", "repos_url": "https://api.github.com/users/yoshitomo-matsubara/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yoshitomo-matsubara/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yoshitomo-matsubara/subscriptions", "type": "User", "url": "https://api.github.com/users/yoshitomo-matsubara", "user_view_type": "public" }
[]
closed
false
[ "Hi ! By default `map()` tries to keep the types of each column of the dataset, so here it reuses the int type since all your float values can be converted to integers. But I agree it would be nice to store float values as float values and don't try to reuse the same type in this case.\n\nIn the meantime, you can either store the float values in a new column, or pass the output `features=` manually to `map()`", "Hi @lhoestq \n\nThank you for the answer & suggestion!\n\nCan we add some flag to `map()` function like `reuses_original_type=True` and skip reusing the original type when it's False?\n\nLet me know if it sounds like a reasonable solution. I am happy to submit a PR for this.", "In general we try to avoid adding new parameters when it's already possible to achieve the same results with existing parameters (here `features=`). But since it's not always convenient to know in advance the `features=` I'm open to contributions to adding this parameter yes", "Thank you for sharing the context. Good to know that. \n\nI submitted a PR #7483. Could you review the PR?", "Hi @lhoestq \n\nLet me know if there is something that I should add to [the PR](https://github.com/huggingface/datasets/pull/7483)!", "Closing this issue as the PR #7483 was merged" ]
2025-03-21T07:56:22Z
2025-04-10T05:11:15Z
2025-04-10T05:11:14Z
CONTRIBUTOR
null
null
### Describe the bug When preprocessing a multi-label dataset, I introduced a step to convert int labels to float labels as [BCEWithLogitsLoss](https://pytorch.org/docs/stable/generated/torch.nn.BCEWithLogitsLoss.html) expects float labels and forward function of models in transformers package internally use `BCEWithLogitsLoss` However, the casting was canceled after `.map` process and the label values still use int values, which leads to an error ``` File "/home/yoshitomo/anaconda3/envs/torchdistill/lib/python3.10/site-packages/transformers/models/bert/modeling_bert.py", line 1711, in forward loss = loss_fct(logits, labels) File "/home/yoshitomo/anaconda3/envs/torchdistill/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/home/yoshitomo/anaconda3/envs/torchdistill/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl return forward_call(*args, **kwargs) File "/home/yoshitomo/anaconda3/envs/torchdistill/lib/python3.10/site-packages/torch/nn/modules/loss.py", line 819, in forward return F.binary_cross_entropy_with_logits( File "/home/yoshitomo/anaconda3/envs/torchdistill/lib/python3.10/site-packages/torch/nn/functional.py", line 3628, in binary_cross_entropy_with_logits return torch.binary_cross_entropy_with_logits( RuntimeError: result type Float can't be cast to the desired output type Long ``` This seems like happening only when the original labels are int values (see examples below) ### Steps to reproduce the bug If the original dataset uses a list of int labels, it will cancel the int->float casting ```python from datasets import Dataset data = { 'text': ['text1', 'text2', 'text3', 'text4'], 'labels': [[0, 1, 2], [3], [3, 4], [3]] } dataset = Dataset.from_dict(data) label_set = set([label for labels in data['labels'] for label in labels]) label2idx = {label: idx for idx, label in enumerate(sorted(label_set))} def multi_labels_to_ids(labels): ids = [0.0] * len(label2idx) for label in labels: ids[label2idx[label]] = 1.0 return ids def preprocess(examples): result = {'sentence': [[0, 3, 4] for _ in range(len(examples['labels']))]} print('"labels" are int', examples['labels']) result['labels'] = [multi_labels_to_ids(l) for l in examples['labels']] print('"labels" were converted to multi-label format with float values', result['labels']) return result preprocessed_dataset = dataset.map(preprocess, batched=True, remove_columns=['labels', 'text']) print(preprocessed_dataset[0]['labels']) # Output: "[1, 1, 1, 0, 0]" # Expected: "[1.0, 1.0, 1.0, 0.0, 0.0]" ``` If the original dataset uses non-int labels, it works as expected. ```python from datasets import Dataset data = { 'text': ['text1', 'text2', 'text3', 'text4'], 'labels': [['label1', 'label2', 'label3'], ['label4'], ['label4', 'label5'], ['label4']] } dataset = Dataset.from_dict(data) label_set = set([label for labels in data['labels'] for label in labels]) label2idx = {label: idx for idx, label in enumerate(sorted(label_set))} def multi_labels_to_ids(labels): ids = [0.0] * len(label2idx) for label in labels: ids[label2idx[label]] = 1.0 return ids def preprocess(examples): result = {'sentence': [[0, 3, 4] for _ in range(len(examples['labels']))]} print('"labels" are int', examples['labels']) result['labels'] = [multi_labels_to_ids(l) for l in examples['labels']] print('"labels" were converted to multi-label format with float values', result['labels']) return result preprocessed_dataset = dataset.map(preprocess, batched=True, remove_columns=['labels', 'text']) print(preprocessed_dataset[0]['labels']) # Output: "[1.0, 1.0, 1.0, 0.0, 0.0]" # Expected: "[1.0, 1.0, 1.0, 0.0, 0.0]" ``` Note that the only difference between these two examples is > 'labels': [[0, 1, 2], [3], [3, 4], [3]] v.s > 'labels': [['label1', 'label2', 'label3'], ['label4'], ['label4', 'label5'], ['label4']] ### Expected behavior Even if the original dataset uses a list of int labels, the int->float casting during `.map` process should not be canceled as shown in the above example ### Environment info OS Ubuntu 22.04 LTS Python 3.10.11 datasets v3.4.1
{ "avatar_url": "https://avatars.githubusercontent.com/u/11156001?v=4", "events_url": "https://api.github.com/users/yoshitomo-matsubara/events{/privacy}", "followers_url": "https://api.github.com/users/yoshitomo-matsubara/followers", "following_url": "https://api.github.com/users/yoshitomo-matsubara/following{/other_user}", "gists_url": "https://api.github.com/users/yoshitomo-matsubara/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yoshitomo-matsubara", "id": 11156001, "login": "yoshitomo-matsubara", "node_id": "MDQ6VXNlcjExMTU2MDAx", "organizations_url": "https://api.github.com/users/yoshitomo-matsubara/orgs", "received_events_url": "https://api.github.com/users/yoshitomo-matsubara/received_events", "repos_url": "https://api.github.com/users/yoshitomo-matsubara/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yoshitomo-matsubara/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yoshitomo-matsubara/subscriptions", "type": "User", "url": "https://api.github.com/users/yoshitomo-matsubara", "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/7472/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7471
7,471
Adding argument to `_get_data_files_patterns`
{ "avatar_url": "https://avatars.githubusercontent.com/u/34004152?v=4", "events_url": "https://api.github.com/users/SangbumChoi/events{/privacy}", "followers_url": "https://api.github.com/users/SangbumChoi/followers", "following_url": "https://api.github.com/users/SangbumChoi/following{/other_user}", "gists_url": "https://api.github.com/users/SangbumChoi/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/SangbumChoi", "id": 34004152, "login": "SangbumChoi", "node_id": "MDQ6VXNlcjM0MDA0MTUy", "organizations_url": "https://api.github.com/users/SangbumChoi/orgs", "received_events_url": "https://api.github.com/users/SangbumChoi/received_events", "repos_url": "https://api.github.com/users/SangbumChoi/repos", "site_admin": false, "starred_url": "https://api.github.com/users/SangbumChoi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SangbumChoi/subscriptions", "type": "User", "url": "https://api.github.com/users/SangbumChoi", "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
[ "Hi ! The pattern can be specified in advance in YAML in the README.md of the dataset :)\n\nFor example\n\n```\n---\nconfigs:\n- config_name: default\n data_files:\n - split: train\n path: \"train/*\"\n - split: test\n path: \"test/*\"\n---\n```\n\nSee the docs at https://huggingface.co/docs/hub/en/datasets-manual-configuration", "@lhoestq How can we choose in this case ? https://huggingface.co/datasets/datasets-examples/doc-image-5\n", "choose what ? sorry I didn't get it ^^'" ]
2025-03-21T07:17:53Z
2025-03-27T12:30:52Z
2025-03-26T07:26:27Z
NONE
null
null
### Feature request How about adding if the user already know about the pattern? https://github.com/huggingface/datasets/blob/a256b85cbc67aa3f0e75d32d6586afc507cf535b/src/datasets/data_files.py#L252 ### Motivation While using this load_dataset people might use 10M of images for the local files. However, due to searching all the appropriate file pattern in fsspec, purely searching this pattern takes more than 10 hours (real use-case). ### Your contribution Yeah I can make this happen if this seems valid. @lhoestq WDYT? such like ``` def _get_data_files_patterns(pattern_resolver: Callable[[str], list[str]], patterns: PATTERNS) -> dict[str, list[str]]: ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/34004152?v=4", "events_url": "https://api.github.com/users/SangbumChoi/events{/privacy}", "followers_url": "https://api.github.com/users/SangbumChoi/followers", "following_url": "https://api.github.com/users/SangbumChoi/following{/other_user}", "gists_url": "https://api.github.com/users/SangbumChoi/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/SangbumChoi", "id": 34004152, "login": "SangbumChoi", "node_id": "MDQ6VXNlcjM0MDA0MTUy", "organizations_url": "https://api.github.com/users/SangbumChoi/orgs", "received_events_url": "https://api.github.com/users/SangbumChoi/received_events", "repos_url": "https://api.github.com/users/SangbumChoi/repos", "site_admin": false, "starred_url": "https://api.github.com/users/SangbumChoi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SangbumChoi/subscriptions", "type": "User", "url": "https://api.github.com/users/SangbumChoi", "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/7471/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7470
7,470
Is it possible to shard a single-sharded IterableDataset?
{ "avatar_url": "https://avatars.githubusercontent.com/u/511073?v=4", "events_url": "https://api.github.com/users/jonathanasdf/events{/privacy}", "followers_url": "https://api.github.com/users/jonathanasdf/followers", "following_url": "https://api.github.com/users/jonathanasdf/following{/other_user}", "gists_url": "https://api.github.com/users/jonathanasdf/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jonathanasdf", "id": 511073, "login": "jonathanasdf", "node_id": "MDQ6VXNlcjUxMTA3Mw==", "organizations_url": "https://api.github.com/users/jonathanasdf/orgs", "received_events_url": "https://api.github.com/users/jonathanasdf/received_events", "repos_url": "https://api.github.com/users/jonathanasdf/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jonathanasdf/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jonathanasdf/subscriptions", "type": "User", "url": "https://api.github.com/users/jonathanasdf", "user_view_type": "public" }
[]
closed
false
[ "Hi ! Maybe you can look for an option in your dataset to partition your data based on a deterministic filter ? For example each worker could stream the data based on `row.id % num_shards` or something like that ?", "So the recommendation is to start out with multiple shards initially and re-sharding after is not expected to work? :(\n\nWould something like the following work? Some DiskCachingIterableDataset, where worker 0 streams from the datasource, but also writes to disk, and all of the other workers read from what worker 0 wrote? Then that would produce a stream with a deterministic order and we can subsample.", "To be honest it would be cool to support native multiprocessing in `IterableDataset.map` so you can parallelize any specific processing step without having to rely on a torch Dataloader. What do you think ?\n\nrelated: https://github.com/huggingface/datasets/issues/7193 https://github.com/huggingface/datasets/issues/3444 \noriginal issue: https://github.com/huggingface/datasets/issues/2642\n\nAlternatively the DiskCachingIterableDataset idea works, just note that to make it work with a torch Dataloader with num_workers>0 you'll need:\n1. to make your own `torch.utils.data.IterableDataset` and have rank=0 stream the data and share them with the other workers (either via disk as suggested or IPC)\n2. take into account that`datasets.IterableDataset` will yield 0 examples for ranks with id>0 if there is only one shard, but in your case it's ok since you'd only stream from rank=0", "Ohh that would be pretty cool!\n\nThanks for the suggestions, as there's no actionable items for this repo I'm going to close this issue now.", "Another usecase for this resharding:\n\nIf we have a bunch of jsonl files, and we load it as an IterableDataset with multiple dataloader workers, each file gets naively assigned to a worker.\n\nIf the files were not carefully produced to be equally sized, eg if the very last file is significantly shorter, containing just a few examples, and it gets assigned onto a dataloader worker by itself, then the examples in that file will be significantly oversampled.\n\nIt would be nice if datasets had an internal way to rebalance this without requiring offline reprocessing of the data files" ]
2025-03-21T04:33:37Z
2025-05-09T22:51:46Z
2025-03-26T06:49:28Z
NONE
null
null
I thought https://github.com/huggingface/datasets/pull/7252 might be applicable but looking at it maybe not. Say we have a process, eg. a database query, that can return data in slightly different order each time. So, the initial query needs to be run by a single thread (not to mention running multiple times incurs more cost too). But the results are also big enough that we don't want to materialize it entirely and instead stream it with an IterableDataset. But after we have the results we want to split it up across workers to parallelize processing. Is something like this possible to do? Here's a failed attempt. The end result should be that each of the shards has unique data, but unfortunately with this attempt the generator gets run once in each shard and the results end up with duplicates... ``` import random import datasets def gen(): print('RUNNING GENERATOR!') items = list(range(10)) random.shuffle(items) yield from items ds = datasets.IterableDataset.from_generator(gen) print('dataset contents:') for item in ds: print(item) print() print('dataset contents (2):') for item in ds: print(item) print() num_shards = 3 def sharded(shard_id): for i, example in enumerate(ds): if i % num_shards in shard_id: yield example ds1 = datasets.IterableDataset.from_generator( sharded, gen_kwargs={'shard_id': list(range(num_shards))} ) for shard in range(num_shards): print('shard', shard) for item in ds1.shard(num_shards, shard): print(item) ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/511073?v=4", "events_url": "https://api.github.com/users/jonathanasdf/events{/privacy}", "followers_url": "https://api.github.com/users/jonathanasdf/followers", "following_url": "https://api.github.com/users/jonathanasdf/following{/other_user}", "gists_url": "https://api.github.com/users/jonathanasdf/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jonathanasdf", "id": 511073, "login": "jonathanasdf", "node_id": "MDQ6VXNlcjUxMTA3Mw==", "organizations_url": "https://api.github.com/users/jonathanasdf/orgs", "received_events_url": "https://api.github.com/users/jonathanasdf/received_events", "repos_url": "https://api.github.com/users/jonathanasdf/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jonathanasdf/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jonathanasdf/subscriptions", "type": "User", "url": "https://api.github.com/users/jonathanasdf", "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/7470/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7469
7,469
Custom split name with the web interface
{ "avatar_url": "https://avatars.githubusercontent.com/u/15141326?v=4", "events_url": "https://api.github.com/users/vince62s/events{/privacy}", "followers_url": "https://api.github.com/users/vince62s/followers", "following_url": "https://api.github.com/users/vince62s/following{/other_user}", "gists_url": "https://api.github.com/users/vince62s/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/vince62s", "id": 15141326, "login": "vince62s", "node_id": "MDQ6VXNlcjE1MTQxMzI2", "organizations_url": "https://api.github.com/users/vince62s/orgs", "received_events_url": "https://api.github.com/users/vince62s/received_events", "repos_url": "https://api.github.com/users/vince62s/repos", "site_admin": false, "starred_url": "https://api.github.com/users/vince62s/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vince62s/subscriptions", "type": "User", "url": "https://api.github.com/users/vince62s", "user_view_type": "public" }
[]
closed
false
[]
2025-03-20T20:45:59Z
2025-03-21T07:20:37Z
2025-03-21T07:20:37Z
NONE
null
null
### Describe the bug According the doc here: https://huggingface.co/docs/hub/datasets-file-names-and-splits#custom-split-name it should infer the split name from the subdir of data or the beg of the name of the files in data. When doing this manually through web upload it does not work. it uses "train" as a unique split. example: https://huggingface.co/datasets/eole-nlp/estimator_chatml ### Steps to reproduce the bug follow the link above ### Expected behavior there should be two splits "mlqe" and "1720_da" ### Environment info website
{ "avatar_url": "https://avatars.githubusercontent.com/u/15141326?v=4", "events_url": "https://api.github.com/users/vince62s/events{/privacy}", "followers_url": "https://api.github.com/users/vince62s/followers", "following_url": "https://api.github.com/users/vince62s/following{/other_user}", "gists_url": "https://api.github.com/users/vince62s/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/vince62s", "id": 15141326, "login": "vince62s", "node_id": "MDQ6VXNlcjE1MTQxMzI2", "organizations_url": "https://api.github.com/users/vince62s/orgs", "received_events_url": "https://api.github.com/users/vince62s/received_events", "repos_url": "https://api.github.com/users/vince62s/repos", "site_admin": false, "starred_url": "https://api.github.com/users/vince62s/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vince62s/subscriptions", "type": "User", "url": "https://api.github.com/users/vince62s", "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/7469/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7468
7,468
function `load_dataset` can't solve folder path with regex characters like "[]"
{ "avatar_url": "https://avatars.githubusercontent.com/u/89294013?v=4", "events_url": "https://api.github.com/users/Hpeox/events{/privacy}", "followers_url": "https://api.github.com/users/Hpeox/followers", "following_url": "https://api.github.com/users/Hpeox/following{/other_user}", "gists_url": "https://api.github.com/users/Hpeox/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Hpeox", "id": 89294013, "login": "Hpeox", "node_id": "MDQ6VXNlcjg5Mjk0MDEz", "organizations_url": "https://api.github.com/users/Hpeox/orgs", "received_events_url": "https://api.github.com/users/Hpeox/received_events", "repos_url": "https://api.github.com/users/Hpeox/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Hpeox/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Hpeox/subscriptions", "type": "User", "url": "https://api.github.com/users/Hpeox", "user_view_type": "public" }
[]
open
false
[ "Hi ! Have you tried escaping the glob special characters `[` and `]` ?\n\nbtw note that`AbstractFileSystem.glob` doesn't support regex, instead it supports glob patterns as in the python library [glob](https://docs.python.org/3/library/glob.html)\n" ]
2025-03-20T05:21:59Z
2025-03-25T10:18:12Z
null
NONE
null
null
### Describe the bug When using the `load_dataset` function with a folder path containing regex special characters (such as "[]"), the issue occurs due to how the path is handled in the `resolve_pattern` function. This function passes the unprocessed path directly to `AbstractFileSystem.glob`, which supports regular expressions. As a result, the globbing mechanism interprets these characters as regex patterns, leading to a traversal of the entire disk partition instead of confining the search to the intended directory. ### Steps to reproduce the bug just create a folder like `E:\[D_DATA]\koch_test`, then `load_dataset("parquet", data_dir="E:\[D_DATA]\\test", split="train")` it will keep searching the whole disk. I add two `print` in `glob` and `resolve_pattern` to see the path ### Expected behavior it should load the dataset as in normal folders ### Environment info - `datasets` version: 3.3.2 - Platform: Windows-10-10.0.22631-SP0 - Python version: 3.10.16 - `huggingface_hub` version: 0.29.1 - PyArrow version: 19.0.1 - Pandas version: 2.2.3 - `fsspec` version: 2024.12.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/7468/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7467
7,467
load_dataset with streaming hangs on parquet datasets
{ "avatar_url": "https://avatars.githubusercontent.com/u/10550252?v=4", "events_url": "https://api.github.com/users/The0nix/events{/privacy}", "followers_url": "https://api.github.com/users/The0nix/followers", "following_url": "https://api.github.com/users/The0nix/following{/other_user}", "gists_url": "https://api.github.com/users/The0nix/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/The0nix", "id": 10550252, "login": "The0nix", "node_id": "MDQ6VXNlcjEwNTUwMjUy", "organizations_url": "https://api.github.com/users/The0nix/orgs", "received_events_url": "https://api.github.com/users/The0nix/received_events", "repos_url": "https://api.github.com/users/The0nix/repos", "site_admin": false, "starred_url": "https://api.github.com/users/The0nix/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/The0nix/subscriptions", "type": "User", "url": "https://api.github.com/users/The0nix", "user_view_type": "public" }
[]
open
false
[ "Hi ! The issue comes from `pyarrow`, I reported it here: https://github.com/apache/arrow/issues/45214 (feel free to comment / thumb up).\n\nAlternatively we can try to find something else than `ParquetFileFragment.to_batches()` to iterate on Parquet data and keep the option the pass `filters=`..." ]
2025-03-18T23:33:54Z
2025-03-25T10:28:04Z
null
NONE
null
null
### Describe the bug When I try to load a dataset with parquet files (e.g. "bigcode/the-stack") the dataset loads, but python interpreter can't exit and hangs ### Steps to reproduce the bug ```python3 import datasets print('Start') dataset = datasets.load_dataset("bigcode/the-stack", data_dir="data/yaml", streaming=True, split="train") it = iter(dataset) next(it) print('Finish') ``` The program prints finish but doesn't exit and hangs indefinitely. I tried this on two different machines and several datasets. ### Expected behavior The program exits successfully ### Environment info datasets==3.4.1 Python 3.12.9. MacOS and Ubuntu Linux
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/7467/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/pull/7466
7,466
Fix local pdf loading
{ "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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7466). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-03-18T14:09:06Z
2025-03-18T14:11:52Z
2025-03-18T14:09:21Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7466.diff", "html_url": "https://github.com/huggingface/datasets/pull/7466", "merged_at": "2025-03-18T14:09:21Z", "patch_url": "https://github.com/huggingface/datasets/pull/7466.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7466" }
fir this error when accessing a local pdf ``` File ~/.pyenv/versions/3.12.2/envs/hf-datasets/lib/python3.12/site-packages/pdfminer/psparser.py:220, in PSBaseParser.seek(self, pos) 218 """Seeks the parser to the given position.""" 219 log.debug("seek: %r", pos) --> 220 self.fp.seek(pos) 221 # reset the status for nextline() 222 self.bufpos = pos ValueError: seek of closed file ```
{ "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/7466/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7464
7,464
Minor fix for metadata files in extension counter
{ "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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7464). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-03-17T21:57:11Z
2025-03-18T15:21:43Z
2025-03-18T15:21:41Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7464.diff", "html_url": "https://github.com/huggingface/datasets/pull/7464", "merged_at": "2025-03-18T15:21:41Z", "patch_url": "https://github.com/huggingface/datasets/pull/7464.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7464" }
null
{ "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/7464/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7463
7,463
Adds EXR format to store depth images in float32
{ "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
[ "Hi ! I'mn wondering if this shouldn't this be an `Image()` type and decoded as a `PIL.Image` ?\r\n\r\nThis would make it easier to integrate with the rest of the HF ecosystem, and you could still get a numpy array using `ds = ds.with_format(\"numpy\")` which sets all the images to be formatted as numpy arrays", "@lhoestq do you mean to add the decoder, and exr extension to the image format? Yes, that probably would be better ", "yes exactly" ]
2025-03-17T17:42:40Z
2025-04-02T12:33:39Z
null
NONE
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7463.diff", "html_url": "https://github.com/huggingface/datasets/pull/7463", "merged_at": null, "patch_url": "https://github.com/huggingface/datasets/pull/7463.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7463" }
This PR adds the EXR feature to store depth images (or can be normals, etc) in float32. It relies on [openexr_numpy](https://github.com/martinResearch/openexr_numpy/tree/main) to manipulate EXR images.
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/7463/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7462
7,462
set dev version
{ "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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7462). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-03-17T16:00:53Z
2025-03-17T16:03:31Z
2025-03-17T16:01:08Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7462.diff", "html_url": "https://github.com/huggingface/datasets/pull/7462", "merged_at": "2025-03-17T16:01:08Z", "patch_url": "https://github.com/huggingface/datasets/pull/7462.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7462" }
null
{ "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/7462/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/issues/7461
7,461
List of images behave differently on IterableDataset and Dataset
{ "avatar_url": "https://avatars.githubusercontent.com/u/1288009?v=4", "events_url": "https://api.github.com/users/FredrikNoren/events{/privacy}", "followers_url": "https://api.github.com/users/FredrikNoren/followers", "following_url": "https://api.github.com/users/FredrikNoren/following{/other_user}", "gists_url": "https://api.github.com/users/FredrikNoren/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/FredrikNoren", "id": 1288009, "login": "FredrikNoren", "node_id": "MDQ6VXNlcjEyODgwMDk=", "organizations_url": "https://api.github.com/users/FredrikNoren/orgs", "received_events_url": "https://api.github.com/users/FredrikNoren/received_events", "repos_url": "https://api.github.com/users/FredrikNoren/repos", "site_admin": false, "starred_url": "https://api.github.com/users/FredrikNoren/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/FredrikNoren/subscriptions", "type": "User", "url": "https://api.github.com/users/FredrikNoren", "user_view_type": "public" }
[]
closed
false
[ "Hi ! Can you try with `datasets` ^3.4 released recently ? on my side it works with IterableDataset on the recent version :)\n\n```python\nIn [20]: def train_iterable_gen():\n ...: images = np.array(load_image(\"https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg\").resize((128, 128)))\n ...: yield {\n ...: \"images\": np.expand_dims(images, axis=0),\n ...: \"messages\": [\n ...: {\n ...: \"role\": \"user\",\n ...: \"content\": [{\"type\": \"image\", \"url\": \"https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg\" }]\n ...: },\n ...: {\n ...: \"role\": \"assistant\",\n ...: \"content\": [{\"type\": \"text\", \"text\": \"duck\" }]\n ...: }\n ...: ]\n ...: }\n ...: \n ...: train_ds = IterableDataset.from_generator(train_iterable_gen,\n ...: features=Features({\n ...: 'images': [datasets.Image(mode=None, decode=True, id=None)],\n ...: 'messages': [{'content': [{'text': datasets.Value(dtype='string', id=None), 'type': datasets.Value(dtype='string', id=None) }],\n ...: 'role': datasets.Value(dtype='string', id=None)}]\n ...: } )\n ...: )\n\n\nIn [21]: \n\nIn [21]: next(iter(train_ds))\n/Users/quentinlhoest/hf/datasets/src/datasets/features/image.py:338: UserWarning: Downcasting array dtype int64 to uint8 to be compatible with 'Pillow'\n warnings.warn(f\"Downcasting array dtype {dtype} to {dest_dtype} to be compatible with 'Pillow'\")\nOut[21]: \n{'images': [<PIL.PngImagePlugin.PngImageFile image mode=RGB size=128x128>],\n 'messages': [{'content': [{'text': None, 'type': 'image'}], 'role': 'user'},\n {'content': [{'type': 'text', 'text': 'duck'}], 'role': 'assistant'}]}\n```", "Hm I tried it here and it works as expected, even on datasets 3.3.2. I guess maybe something in the SFTTrainer is doing additional processing on the dataset, I'll have a look there.\n\nThanks @lhoestq!" ]
2025-03-17T15:59:23Z
2025-03-18T08:57:17Z
2025-03-18T08:57:16Z
NONE
null
null
### Describe the bug This code: ```python def train_iterable_gen(): images = np.array(load_image("https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg").resize((128, 128))) yield { "images": np.expand_dims(images, axis=0), "messages": [ { "role": "user", "content": [{"type": "image", "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" }] }, { "role": "assistant", "content": [{"type": "text", "text": "duck" }] } ] } train_ds = Dataset.from_generator(train_iterable_gen, features=Features({ 'images': [datasets.Image(mode=None, decode=True, id=None)], 'messages': [{'content': [{'text': datasets.Value(dtype='string', id=None), 'type': datasets.Value(dtype='string', id=None) }], 'role': datasets.Value(dtype='string', id=None)}] } ) ) ``` works as I'd expect; if I iterate the dataset then the `images` column returns a `List[PIL.Image.Image]`, i.e. `'images': [<PIL.PngImagePlugin.PngImageFile image mode=RGB size=128x128 at 0x77EFB7EF4680>]`. But if I change `Dataset` to `IterableDataset`, the `images` column changes into `'images': [{'path': None, 'bytes': ..]` ### Steps to reproduce the bug The code above + ```python def load_image(url): response = requests.get(url) image = Image.open(io.BytesIO(response.content)) return image ``` I'm feeding it to SFTTrainer ### Expected behavior Dataset and IterableDataset would behave the same ### Environment info ```yaml requires-python = ">=3.12" dependencies = [ "av>=14.1.0", "boto3>=1.36.7", "datasets>=3.3.2", "docker>=7.1.0", "google-cloud-storage>=2.19.0", "grpcio>=1.70.0", "grpcio-tools>=1.70.0", "moviepy>=2.1.2", "open-clip-torch>=2.31.0", "opencv-python>=4.11.0.86; sys_platform == 'darwin'", "opencv-python-headless>=4.11.0.86; sys_platform == 'linux'", "pandas>=2.2.3", "pillow>=10.4.0", "plotly>=6.0.0", "py-spy>=0.4.0", "pydantic>=2.10.6", "pydantic-settings>=2.7.1", "pymysql>=1.1.1", "ray[data,default,serve,train,tune]>=2.43.0", "torch>=2.6.0", "torchmetrics>=1.6.1", "torchvision>=0.21.0", "transformers[torch]@git+https://github.com/huggingface/transformers", "wandb>=0.19.4", # https://github.com/Dao-AILab/flash-attention/issues/833 "flash-attn @ https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.3/flash_attn-2.7.3+cu12torch2.6cxx11abiFALSE-cp312-cp312-linux_x86_64.whl; sys_platform == 'linux'", "trl@https://github.com/huggingface/trl.git", "peft>=0.14.0", ] ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/1288009?v=4", "events_url": "https://api.github.com/users/FredrikNoren/events{/privacy}", "followers_url": "https://api.github.com/users/FredrikNoren/followers", "following_url": "https://api.github.com/users/FredrikNoren/following{/other_user}", "gists_url": "https://api.github.com/users/FredrikNoren/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/FredrikNoren", "id": 1288009, "login": "FredrikNoren", "node_id": "MDQ6VXNlcjEyODgwMDk=", "organizations_url": "https://api.github.com/users/FredrikNoren/orgs", "received_events_url": "https://api.github.com/users/FredrikNoren/received_events", "repos_url": "https://api.github.com/users/FredrikNoren/repos", "site_admin": false, "starred_url": "https://api.github.com/users/FredrikNoren/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/FredrikNoren/subscriptions", "type": "User", "url": "https://api.github.com/users/FredrikNoren", "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/7461/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/pull/7460
7,460
release: 3.4.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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7460). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-03-17T15:58:31Z
2025-03-17T16:01:14Z
2025-03-17T15:59:19Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7460.diff", "html_url": "https://github.com/huggingface/datasets/pull/7460", "merged_at": "2025-03-17T15:59:19Z", "patch_url": "https://github.com/huggingface/datasets/pull/7460.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7460" }
null
{ "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/7460/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7459
7,459
Fix data_files filtering
{ "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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7459). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-03-17T15:20:21Z
2025-03-17T15:25:56Z
2025-03-17T15:25:54Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7459.diff", "html_url": "https://github.com/huggingface/datasets/pull/7459", "merged_at": "2025-03-17T15:25:53Z", "patch_url": "https://github.com/huggingface/datasets/pull/7459.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7459" }
close https://github.com/huggingface/datasets/issues/7458
{ "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/7459/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/issues/7458
7,458
Loading the `laion/filtered-wit` dataset in streaming mode fails on v3.4.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/23343961?v=4", "events_url": "https://api.github.com/users/nikita-savelyevv/events{/privacy}", "followers_url": "https://api.github.com/users/nikita-savelyevv/followers", "following_url": "https://api.github.com/users/nikita-savelyevv/following{/other_user}", "gists_url": "https://api.github.com/users/nikita-savelyevv/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nikita-savelyevv", "id": 23343961, "login": "nikita-savelyevv", "node_id": "MDQ6VXNlcjIzMzQzOTYx", "organizations_url": "https://api.github.com/users/nikita-savelyevv/orgs", "received_events_url": "https://api.github.com/users/nikita-savelyevv/received_events", "repos_url": "https://api.github.com/users/nikita-savelyevv/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nikita-savelyevv/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nikita-savelyevv/subscriptions", "type": "User", "url": "https://api.github.com/users/nikita-savelyevv", "user_view_type": "public" }
[]
closed
false
[ "thanks for reporting, I released 3.4.1 with a fix" ]
2025-03-17T14:54:02Z
2025-03-17T16:02:04Z
2025-03-17T15:25:55Z
NONE
null
null
### Describe the bug Loading https://huggingface.co/datasets/laion/filtered-wit in streaming mode fails after update to `datasets==3.4.0`. The dataset loads fine on v3.3.2. ### Steps to reproduce the bug Steps to reproduce: ``` pip install datastes==3.4.0 python -c "from datasets import load_dataset; load_dataset('laion/filtered-wit', split='train', streaming=True)" ``` Results in: ``` $ python -c "from datasets import load_dataset; load_dataset('laion/filtered-wit', split='train', streaming=True)" Repo card metadata block was not found. Setting CardData to empty. Resolving data files: 100%|█████████████████████████████████████████████████████████████████████████████████████████████| 560/560 [00:00<00:00, 2280.24it/s] Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/load.py", line 2080, in load_dataset return builder_instance.as_streaming_dataset(split=split) File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/builder.py", line 1265, in as_streaming_dataset splits_generators = {sg.name: sg for sg in self._split_generators(dl_manager)} File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/packaged_modules/parquet/parquet.py", line 49, in _split_generators data_files = dl_manager.download_and_extract(self.config.data_files) File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 169, in download_and_extract return self.extract(self.download(url_or_urls)) File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 121, in extract urlpaths = map_nested(self._extract, url_or_urls, map_tuple=True) File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 496, in map_nested mapped = [ File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 497, in <listcomp> map_nested( File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 513, in map_nested mapped = [ File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 514, in <listcomp> _single_map_nested((function, obj, batched, batch_size, types, None, True, None)) File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 375, in _single_map_nested return function(data_struct) File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 131, in _extract raise NotImplementedError( NotImplementedError: Extraction protocol for TAR archives like 'hf://datasets/laion/filtered-wit@c38ca7464e9934d9a49f88b3f60f5ad63b245465/data/00000.tar' is not implemented in streaming mode. Please use `dl_manager.iter_archive` instead. Example usage: url = dl_manager.download(url) tar_archive_iterator = dl_manager.iter_archive(url) for filename, file in tar_archive_iterator: ... ``` ### Expected behavior Dataset loads successfully. ### Environment info Ubuntu 20.04.6. Python 3.9. Datasets 3.4.0. pip freeze: ``` aiohappyeyeballs==2.6.1 aiohttp==3.11.14 aiosignal==1.3.2 async-timeout==5.0.1 attrs==25.3.0 certifi==2025.1.31 charset-normalizer==3.4.1 datasets==3.4.0 dill==0.3.8 filelock==3.18.0 frozenlist==1.5.0 fsspec==2024.12.0 huggingface-hub==0.29.3 idna==3.10 multidict==6.1.0 multiprocess==0.70.16 numpy==2.0.2 packaging==24.2 pandas==2.2.3 propcache==0.3.0 pyarrow==19.0.1 python-dateutil==2.9.0.post0 pytz==2025.1 PyYAML==6.0.2 requests==2.32.3 six==1.17.0 tqdm==4.67.1 typing_extensions==4.12.2 tzdata==2025.1 urllib3==2.3.0 xxhash==3.5.0 yarl==1.18.3 ```
{ "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/7458/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7457
7,457
Document the HF_DATASETS_CACHE env variable
{ "avatar_url": "https://avatars.githubusercontent.com/u/92166725?v=4", "events_url": "https://api.github.com/users/LSerranoPEReN/events{/privacy}", "followers_url": "https://api.github.com/users/LSerranoPEReN/followers", "following_url": "https://api.github.com/users/LSerranoPEReN/following{/other_user}", "gists_url": "https://api.github.com/users/LSerranoPEReN/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/LSerranoPEReN", "id": 92166725, "login": "LSerranoPEReN", "node_id": "U_kgDOBX5aRQ", "organizations_url": "https://api.github.com/users/LSerranoPEReN/orgs", "received_events_url": "https://api.github.com/users/LSerranoPEReN/received_events", "repos_url": "https://api.github.com/users/LSerranoPEReN/repos", "site_admin": false, "starred_url": "https://api.github.com/users/LSerranoPEReN/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/LSerranoPEReN/subscriptions", "type": "User", "url": "https://api.github.com/users/LSerranoPEReN", "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
[ "Strongly agree to this, in addition, I am also suffering to change the cache location similar to other issues (since I changed the environmental variables).\nhttps://github.com/huggingface/datasets/issues/6886", "`HF_DATASETS_CACHE` should be documented there indeed, feel free to open a PR :) ", "Hey, I’d love to work on this issue! Could you assign it to me?", "sure ! you can also comment #self-assign in an issue and a bot assigns you automatically :)" ]
2025-03-17T12:24:50Z
2025-05-06T15:54:39Z
2025-05-06T15:54:39Z
NONE
null
null
### Feature request Hello, I have a use case where my team is sharing models and dataset in shared directory to avoid duplication. I noticed that the [cache documentation for datasets](https://huggingface.co/docs/datasets/main/en/cache) only mention the `HF_HOME` environment variable but never the `HF_DATASETS_CACHE`. It should be nice to add `HF_DATASETS_CACHE` to datasets documentation if it's an intended feature. If it's not, I think a depreciation warning would be appreciated. ### Motivation This variable is fully working and similar to what `HF_HUB_CACHE` does for models, so it's nice to know that this exists. This seems to be a quick change to implement. ### Your contribution I could contribute since this is only affecting a small portion of the documentation
{ "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/7457/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7456
7,456
.add_faiss_index and .add_elasticsearch_index returns ImportError at Google Colab
{ "avatar_url": "https://avatars.githubusercontent.com/u/109490785?v=4", "events_url": "https://api.github.com/users/MapleBloom/events{/privacy}", "followers_url": "https://api.github.com/users/MapleBloom/followers", "following_url": "https://api.github.com/users/MapleBloom/following{/other_user}", "gists_url": "https://api.github.com/users/MapleBloom/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/MapleBloom", "id": 109490785, "login": "MapleBloom", "node_id": "U_kgDOBoayYQ", "organizations_url": "https://api.github.com/users/MapleBloom/orgs", "received_events_url": "https://api.github.com/users/MapleBloom/received_events", "repos_url": "https://api.github.com/users/MapleBloom/repos", "site_admin": false, "starred_url": "https://api.github.com/users/MapleBloom/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MapleBloom/subscriptions", "type": "User", "url": "https://api.github.com/users/MapleBloom", "user_view_type": "public" }
[]
open
false
[ "I can fix this.\nIt's mainly because faiss-gpu requires python<=3.10 but the default python version in colab is 3.11. We just have to downgrade the CPython version down to 3.10 and it should work fine.\n", "I think I just had no chance to meet with faiss-cpu.\nIt could be import problem? \n_has_faiss gets its value at the beginning of datasets/search.\nI tried to call object before import faiss, so _has_faiss took False. And never updated later. ", "Yes you can't meet the requirements because faiss-cpu runs only on\r\npython3.10 and lower but the default version for colab is python3.11 which\r\nresults in pip not being able to find wheels for faiss-cpu with python3.11.\r\n\r\nOn Mon, 17 Mar, 2025, 3:56 pm MapleBloom, ***@***.***> wrote:\r\n\r\n> I think I just had no chance to meet with faiss-cpu.\r\n> It could be import problem?\r\n> _has_faiss gets its value at the beginning of datasets/search.\r\n> I tried to call object before import faiss, so _has_faiss took False. And\r\n> never updated later.\r\n>\r\n> —\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/huggingface/datasets/issues/7456#issuecomment-2728975672>,\r\n> or unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/AVUSZMBVD7LEDDUGALOTVN32U2PMBAVCNFSM6AAAAABZDBA426VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRYHE3TKNRXGI>\r\n> .\r\n> You are receiving this because you commented.Message ID:\r\n> ***@***.***>\r\n> [image: MapleBloom]*MapleBloom* left a comment (huggingface/datasets#7456)\r\n> <https://github.com/huggingface/datasets/issues/7456#issuecomment-2728975672>\r\n>\r\n> I think I just had no chance to meet with faiss-cpu.\r\n> It could be import problem?\r\n> _has_faiss gets its value at the beginning of datasets/search.\r\n> I tried to call object before import faiss, so _has_faiss took False. And\r\n> never updated later.\r\n>\r\n> —\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/huggingface/datasets/issues/7456#issuecomment-2728975672>,\r\n> or unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/AVUSZMBVD7LEDDUGALOTVN32U2PMBAVCNFSM6AAAAABZDBA426VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRYHE3TKNRXGI>\r\n> .\r\n> You are receiving this because you commented.Message ID:\r\n> ***@***.***>\r\n>\r\n", "> you can't meet the requirements\n\nIt is not the case (or I didn't reach this point) because the same code in notebook\n```importlib.util.find_spec(\"faiss\")```\nfinds faiss. I've mention it.\nI think the problem is in the very moment when _has_faiss takes its value and never try again. \n(or it couldn't find the path that was easily found when started from my code)", "When you run the first cell containing pip install faiss-cpu does it\r\ninstall it?\r\n\r\nOn Mon, 17 Mar, 2025, 8:01 pm MapleBloom, ***@***.***> wrote:\r\n\r\n> you can't meet the requirements\r\n>\r\n> It is not the case (or I didn't reach this point) because the same code in\r\n> notebook\r\n> importlib.util.find_spec(\"faiss\")\r\n> finds faiss. I've mention it.\r\n> I think the problem is in the very moment when _has_faiss takes its value\r\n> and never try again.\r\n> (or it couldn't find the path that was easily found when started from my\r\n> code)\r\n>\r\n> —\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/huggingface/datasets/issues/7456#issuecomment-2729737414>,\r\n> or unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/AVUSZMCCE6BPZCOVAWXKIY32U3MFVAVCNFSM6AAAAABZDBA426VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRZG4ZTONBRGQ>\r\n> .\r\n> You are receiving this because you commented.Message ID:\r\n> ***@***.***>\r\n> [image: MapleBloom]*MapleBloom* left a comment (huggingface/datasets#7456)\r\n> <https://github.com/huggingface/datasets/issues/7456#issuecomment-2729737414>\r\n>\r\n> you can't meet the requirements\r\n>\r\n> It is not the case (or I didn't reach this point) because the same code in\r\n> notebook\r\n> importlib.util.find_spec(\"faiss\")\r\n> finds faiss. I've mention it.\r\n> I think the problem is in the very moment when _has_faiss takes its value\r\n> and never try again.\r\n> (or it couldn't find the path that was easily found when started from my\r\n> code)\r\n>\r\n> —\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/huggingface/datasets/issues/7456#issuecomment-2729737414>,\r\n> or unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/AVUSZMCCE6BPZCOVAWXKIY32U3MFVAVCNFSM6AAAAABZDBA426VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRZG4ZTONBRGQ>\r\n> .\r\n> You are receiving this because you commented.Message ID:\r\n> ***@***.***>\r\n>\r\n", "> When you run the first cell containing pip install faiss-cpu does it\n> install it?\n> […](#)\n\nYes. It was installed succesfully. \nMethods of datasets library that depends on _has_faiss constant didn't start to work." ]
2025-03-16T00:51:49Z
2025-03-17T15:57:19Z
null
NONE
null
null
### Describe the bug At Google Colab ```!pip install faiss-cpu``` works ```import faiss``` no error but ```embeddings_dataset.add_faiss_index(column='embeddings')``` returns ``` [/usr/local/lib/python3.11/dist-packages/datasets/search.py](https://localhost:8080/#) in init(self, device, string_factory, metric_type, custom_index) 247 self.faiss_index = custom_index 248 if not _has_faiss: --> 249 raise ImportError( 250 "You must install Faiss to use FaissIndex. To do so you can run conda install -c pytorch faiss-cpu or conda install -c pytorch faiss-gpu. " 251 "A community supported package is also available on pypi: pip install faiss-cpu or pip install faiss-gpu. " ``` because ```_has_faiss = importlib.util.find_spec("faiss") is not None``` at the beginning of ```datasets/search.py``` returns ```False``` when the same code at colab notebook returns ```ModuleSpec(name='faiss', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7b7851449f50>, origin='/usr/local/lib/python3.11/dist-packages/faiss/init.py', submodule_search_locations=['/usr/local/lib/python3.11/dist-packages/faiss'])``` But ``` import datasets datasets.search._has_faiss ``` at ```colab notebook``` also returns ```False``` The same story with ```_has_elasticsearch``` ### Steps to reproduce the bug 1. Follow https://huggingface.co/learn/nlp-course/chapter5/6?fw=pt at Google Colab 2. till ```embeddings_dataset.add_faiss_index(column='embeddings')``` 3. ```embeddings_dataset.add_elasticsearch_index(column='embeddings')``` 4. https://colab.research.google.com/drive/1h2cjuiClblqzbNQgrcoLYOC8zBqTLLcv#scrollTo=3ddzRp72auOF ### Expected behavior I've only started Tutorial and don't know exactly. But something tells me that ```embeddings_dataset.add_faiss_index(column='embeddings')``` should work without ```Import Error``` ### Environment info Google Colab notebook with default 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/7456/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7455
7,455
Problems with local dataset after upgrade from 3.3.2 to 3.4.0
{ "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
[ "Hi ! I just released 3.4.1 with a fix, let me know if it's working now !" ]
2025-03-15T09:22:50Z
2025-03-17T16:20:43Z
null
NONE
null
null
### Describe the bug I was not able to open a local saved dataset anymore that was created using an older datasets version after the upgrade yesterday from datasets 3.3.2 to 3.4.0 The traceback is ``` Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/datasets/packaged_modules/arrow/arrow.py", line 67, in _generate_tables batches = pa.ipc.open_stream(f) File "/usr/local/lib/python3.10/dist-packages/pyarrow/ipc.py", line 190, in open_stream return RecordBatchStreamReader(source, options=options, File "/usr/local/lib/python3.10/dist-packages/pyarrow/ipc.py", line 52, in __init__ self._open(source, options=options, memory_pool=memory_pool) File "pyarrow/ipc.pxi", line 1006, in pyarrow.lib._RecordBatchStreamReader._open File "pyarrow/error.pxi", line 155, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 92, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Expected to read 538970747 metadata bytes, but only read 2126 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1855, in _prepare_split_single for _, table in generator: File "/usr/local/lib/python3.10/dist-packages/datasets/packaged_modules/arrow/arrow.py", line 69, in _generate_tables reader = pa.ipc.open_file(f) File "/usr/local/lib/python3.10/dist-packages/pyarrow/ipc.py", line 234, in open_file return RecordBatchFileReader( File "/usr/local/lib/python3.10/dist-packages/pyarrow/ipc.py", line 110, in __init__ self._open(source, footer_offset=footer_offset, File "pyarrow/ipc.pxi", line 1090, in pyarrow.lib._RecordBatchFileReader._open File "pyarrow/error.pxi", line 155, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 92, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Not an Arrow file ``` ### Steps to reproduce the bug Load a dataset from a local folder with ``` dataset = load_dataset( args.train_data_dir, cache_dir=args.cache_dir, ) ``` as it is done for example in the training script for SD3 controlnet. This is the minimal script to test it: ``` from datasets import load_dataset def main(): dataset = load_dataset( "local_dataset", ) print(dataset) print("Sample data:", dataset["train"][0]) if __name__ == "__main__": main() ```` ### Expected behavior Work in 3.4.0 like in 3.3.2 ### Environment info - `datasets` version: 3.4.0 - Platform: Linux-5.15.0-75-generic-x86_64-with-glibc2.35 - Python version: 3.10.12 - `huggingface_hub` version: 0.29.3 - PyArrow version: 19.0.1 - Pandas version: 2.2.3 - `fsspec` version: 2024.12.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/7455/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/pull/7454
7,454
set dev version
{ "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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7454). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-03-14T16:48:19Z
2025-03-14T16:50:31Z
2025-03-14T16:48:28Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7454.diff", "html_url": "https://github.com/huggingface/datasets/pull/7454", "merged_at": "2025-03-14T16:48:28Z", "patch_url": "https://github.com/huggingface/datasets/pull/7454.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7454" }
null
{ "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/7454/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7453
7,453
release: 3.4.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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7453). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-03-14T16:30:45Z
2025-03-14T16:38:10Z
2025-03-14T16:38:08Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7453.diff", "html_url": "https://github.com/huggingface/datasets/pull/7453", "merged_at": "2025-03-14T16:38:08Z", "patch_url": "https://github.com/huggingface/datasets/pull/7453.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7453" }
null
{ "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/7453/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7452
7,452
minor docs changes
{ "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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7452). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-03-14T14:14:04Z
2025-03-14T14:16:38Z
2025-03-14T14:14:20Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7452.diff", "html_url": "https://github.com/huggingface/datasets/pull/7452", "merged_at": "2025-03-14T14:14:20Z", "patch_url": "https://github.com/huggingface/datasets/pull/7452.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7452" }
before the release
{ "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/7452/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7451
7,451
Fix resuming after `ds.set_epoch(new_epoch)`
{ "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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7451). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-03-14T10:31:25Z
2025-03-14T10:50:11Z
2025-03-14T10:50:09Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7451.diff", "html_url": "https://github.com/huggingface/datasets/pull/7451", "merged_at": "2025-03-14T10:50:09Z", "patch_url": "https://github.com/huggingface/datasets/pull/7451.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7451" }
close https://github.com/huggingface/datasets/issues/7447
{ "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/7451/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/pull/7450
7,450
Add IterableDataset.decode with multithreading
{ "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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7450). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-03-13T10:41:35Z
2025-03-14T10:35:37Z
2025-03-14T10:35:35Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7450.diff", "html_url": "https://github.com/huggingface/datasets/pull/7450", "merged_at": "2025-03-14T10:35:35Z", "patch_url": "https://github.com/huggingface/datasets/pull/7450.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7450" }
Useful for dataset streaming for multimodal datasets, and especially for lerobot. It speeds up streaming up to 20 times. When decoding is enabled (default), media types are decoded: * audio -> dict of "array" and "sampling_rate" and "path" * image -> PIL.Image * video -> torchvision.io.VideoReader You can enable multithreading using `num_threads`. This is especially useful to speed up remote data streaming. However it can be slower than `num_threads=0` for local data on fast disks. PS: Disabling decoding is useful if you want to iterate on the paths or bytes of the media files without actually decoding their content. Example: Speed up streaming with multithreading: ```py >>> import os >>> from datasets import load_dataset >>> from tqdm import tqdm >>> ds = load_dataset("sshh12/planet-textures", split="train", streaming=True) >>> num_threads = min(32, (os.cpu_count() or 1) + 4) >>> ds = ds.decode(num_threads=num_threads) >>> for _ in tqdm(ds): # 20 times faster ! ... ... ``` why not multiprocessing ? decoding is done with the GIL released in soundfile/PIL/torchvision so multiprocessing would just use more memory TODO - [x] test - [x] add to docs
{ "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/7450/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/issues/7449
7,449
Cannot load data with different schemas from different parquet files
{ "avatar_url": "https://avatars.githubusercontent.com/u/39846316?v=4", "events_url": "https://api.github.com/users/li-plus/events{/privacy}", "followers_url": "https://api.github.com/users/li-plus/followers", "following_url": "https://api.github.com/users/li-plus/following{/other_user}", "gists_url": "https://api.github.com/users/li-plus/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/li-plus", "id": 39846316, "login": "li-plus", "node_id": "MDQ6VXNlcjM5ODQ2MzE2", "organizations_url": "https://api.github.com/users/li-plus/orgs", "received_events_url": "https://api.github.com/users/li-plus/received_events", "repos_url": "https://api.github.com/users/li-plus/repos", "site_admin": false, "starred_url": "https://api.github.com/users/li-plus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/li-plus/subscriptions", "type": "User", "url": "https://api.github.com/users/li-plus", "user_view_type": "public" }
[]
closed
false
[ "Hi ! `load_dataset` expects all the data_files to have the same schema.\n\nMaybe you can try enforcing certain `features` using:\n\n```python\nfeatures = Features({\"conversations\": {'content': Value('string'), 'role': Value('string',)}})\nds = load_dataset(..., features=features)\n```", "Thanks! It works if I explicitly specify all nested fields of the data." ]
2025-03-13T08:14:49Z
2025-03-17T07:27:48Z
2025-03-17T07:27:46Z
NONE
null
null
### Describe the bug Cannot load samples with optional fields from different files. The schema cannot be correctly derived. ### Steps to reproduce the bug When I place two samples with an optional field `some_extra_field` within a single parquet file, it can be loaded via `load_dataset`. ```python import pandas as pd from datasets import load_dataset data = [ {'conversations': {'role': 'user', 'content': 'hello'}}, {'conversations': {'role': 'user', 'content': 'hi', 'some_extra_field': 'some_value'}} ] df = pd.DataFrame(data) df.to_parquet('data.parquet') dataset = load_dataset('parquet', data_files='data.parquet', split='train') print(dataset.features) ``` The schema can be derived. `some_extra_field` is set to None for the first row where it is absent. ``` {'conversations': {'content': Value(dtype='string', id=None), 'role': Value(dtype='string', id=None), 'some_extra_field': Value(dtype='string', id=None)}} ``` However, when I separate the samples into different files, it cannot be loaded. ```python import pandas as pd from datasets import load_dataset data1 = [{'conversations': {'role': 'user', 'content': 'hello'}}] pd.DataFrame(data1).to_parquet('data1.parquet') data2 = [{'conversations': {'role': 'user', 'content': 'hi', 'some_extra_field': 'some_value'}}] pd.DataFrame(data2).to_parquet('data2.parquet') dataset = load_dataset('parquet', data_files=['data1.parquet', 'data2.parquet'], split='train') print(dataset.features) ``` Traceback: ``` Traceback (most recent call last): File "/home/tiger/.local/lib/python3.9/site-packages/datasets/builder.py", line 1854, in _prepare_split_single for _, table in generator: File "/home/tiger/.local/lib/python3.9/site-packages/datasets/packaged_modules/parquet/parquet.py", line 106, in _generate_tables yield f"{file_idx}_{batch_idx}", self._cast_table(pa_table) File "/home/tiger/.local/lib/python3.9/site-packages/datasets/packaged_modules/parquet/parquet.py", line 73, in _cast_table pa_table = table_cast(pa_table, self.info.features.arrow_schema) File "/home/tiger/.local/lib/python3.9/site-packages/datasets/table.py", line 2292, in table_cast return cast_table_to_schema(table, schema) File "/home/tiger/.local/lib/python3.9/site-packages/datasets/table.py", line 2245, in cast_table_to_schema arrays = [ File "/home/tiger/.local/lib/python3.9/site-packages/datasets/table.py", line 2246, in <listcomp> cast_array_to_feature( File "/home/tiger/.local/lib/python3.9/site-packages/datasets/table.py", line 1795, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/tiger/.local/lib/python3.9/site-packages/datasets/table.py", line 1795, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/tiger/.local/lib/python3.9/site-packages/datasets/table.py", line 2108, in cast_array_to_feature raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}") TypeError: Couldn't cast array of type struct<content: string, role: string, some_extra_field: string> to {'content': Value(dtype='string', id=None), 'role': Value(dtype='string', id=None)} ``` ### Expected behavior Correctly load data with optional fields from different parquet files. ### Environment info - `datasets` version: 3.3.2 - Platform: Linux-5.10.135.bsk.4-amd64-x86_64-with-glibc2.31 - Python version: 3.9.2 - `huggingface_hub` version: 0.28.1 - PyArrow version: 17.0.0 - Pandas version: 2.2.2 - `fsspec` version: 2024.3.1
{ "avatar_url": "https://avatars.githubusercontent.com/u/39846316?v=4", "events_url": "https://api.github.com/users/li-plus/events{/privacy}", "followers_url": "https://api.github.com/users/li-plus/followers", "following_url": "https://api.github.com/users/li-plus/following{/other_user}", "gists_url": "https://api.github.com/users/li-plus/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/li-plus", "id": 39846316, "login": "li-plus", "node_id": "MDQ6VXNlcjM5ODQ2MzE2", "organizations_url": "https://api.github.com/users/li-plus/orgs", "received_events_url": "https://api.github.com/users/li-plus/received_events", "repos_url": "https://api.github.com/users/li-plus/repos", "site_admin": false, "starred_url": "https://api.github.com/users/li-plus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/li-plus/subscriptions", "type": "User", "url": "https://api.github.com/users/li-plus", "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/7449/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7448
7,448
`datasets.disable_caching` doesn't work
{ "avatar_url": "https://avatars.githubusercontent.com/u/35629974?v=4", "events_url": "https://api.github.com/users/UCC-team/events{/privacy}", "followers_url": "https://api.github.com/users/UCC-team/followers", "following_url": "https://api.github.com/users/UCC-team/following{/other_user}", "gists_url": "https://api.github.com/users/UCC-team/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/UCC-team", "id": 35629974, "login": "UCC-team", "node_id": "MDQ6VXNlcjM1NjI5OTc0", "organizations_url": "https://api.github.com/users/UCC-team/orgs", "received_events_url": "https://api.github.com/users/UCC-team/received_events", "repos_url": "https://api.github.com/users/UCC-team/repos", "site_admin": false, "starred_url": "https://api.github.com/users/UCC-team/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/UCC-team/subscriptions", "type": "User", "url": "https://api.github.com/users/UCC-team", "user_view_type": "public" }
[]
open
false
[ "cc", "Yes I have the same issue. It's a confusingly named function. See [here](https://github.com/huggingface/datasets/blob/main/src/datasets/fingerprint.py#L115-L130)\n\n```\n...\nIf disabled, the library will no longer reload cached datasets files when applying transforms to the datasets.\n More precisely, if the caching is disabled:\n - cache files are always recreated\n - cache files are written to a temporary directory that is deleted when session closes\n - cache files are named using a random hash instead of the dataset fingerprint\n```\n\nAlso, unfortunately the member variable `ds.cache_files` is not populated either.\n\nI'll let you know if I find a solution." ]
2025-03-13T06:40:12Z
2025-03-22T04:37:07Z
null
NONE
null
null
When I use `Dataset.from_generator(my_gen)` to load my dataset, it simply skips my changes to the generator function. I tried `datasets.disable_caching`, but it doesn't work!
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/7448/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7447
7,447
Epochs shortened after resuming mid-epoch with Iterable dataset+StatefulDataloader(persistent_workers=True)
{ "avatar_url": "https://avatars.githubusercontent.com/u/4356534?v=4", "events_url": "https://api.github.com/users/dhruvdcoder/events{/privacy}", "followers_url": "https://api.github.com/users/dhruvdcoder/followers", "following_url": "https://api.github.com/users/dhruvdcoder/following{/other_user}", "gists_url": "https://api.github.com/users/dhruvdcoder/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dhruvdcoder", "id": 4356534, "login": "dhruvdcoder", "node_id": "MDQ6VXNlcjQzNTY1MzQ=", "organizations_url": "https://api.github.com/users/dhruvdcoder/orgs", "received_events_url": "https://api.github.com/users/dhruvdcoder/received_events", "repos_url": "https://api.github.com/users/dhruvdcoder/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dhruvdcoder/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dhruvdcoder/subscriptions", "type": "User", "url": "https://api.github.com/users/dhruvdcoder", "user_view_type": "public" }
[]
closed
false
[ "Thanks for reporting ! Maybe we should store the epoch in the state_dict, and then when the dataset is iterated on again after setting a new epoch it should restart from scratch instead of resuming ? wdyt ?", "But why does this only happen when `persistent_workers=True`? I would expect it to work correctly even without storing the epoch number in the state_dict of the iterable dataset. ", "I think persistent_workers=False simply ignores the dataset state_dict when it starts a new epoch, that's why the issue doesn't appear in that case", "I opened https://github.com/huggingface/datasets/pull/7451 to fix the issue, let me know if it works for you", "I just released `datasets` 3.4 that includes the fix :)\n\nPS: in your script you probably want to set the epoch like this, otherwise it's still set to 0 after the first epoch:\n\n```diff\n if state_dict is None:\n- ds.set_epoch(epoch)\n epoch += 1\n+ ds.set_epoch(epoch)\n```", "@lhoestq \nIf I understand correctly, the issue was:\nwhen training saves a checkpoint of dataloader in epoch 1, the resumed training only consumes partial data in epoch 2, 3, etc.\n\nHowever, with the fix we are facing the issue that:\nwhen training saves a checkpoint of dataloader in epoch 2, the resumed training starts from scratch instead of consuming remaining partial data in epoch 2.\n\nThis makes training inconsistent between resuming from a checkpoint vs. original training if continued without a checkpoint." ]
2025-03-12T21:41:05Z
2025-07-09T23:04:57Z
2025-03-14T10:50:10Z
NONE
null
null
### Describe the bug When `torchdata.stateful_dataloader.StatefulDataloader(persistent_workers=True)` the epochs after resuming only iterate through the examples that were left in the epoch when the training was interrupted. For example, in the script below training is interrupted on step 124 (epoch 1) when 3 batches are left. Then after resuming, the rest of epochs (2 and 3) only iterate through these 3 batches. ### Steps to reproduce the bug Run the following script with and with PERSISTENT_WORKERS=true. ```python # !/usr/bin/env python3 # torch==2.5.1 # datasets==3.3.2 # torchdata>=0.9.0 import datasets import pprint from torchdata.stateful_dataloader import StatefulDataLoader import os PERSISTENT_WORKERS = ( os.environ.get("PERSISTENT_WORKERS", "False").lower() == "true" ) # PERSISTENT_WORKERS = True # Incorrect resume # ds = datasets.load_from_disk("dataset").to_iterable_dataset(num_shards=4) def generator(): for i in range(128): yield {"x": i} ds = datasets.Dataset.from_generator( generator, features=datasets.Features({"x": datasets.Value("int32")}) ).to_iterable_dataset(num_shards=4) dl = StatefulDataLoader( ds, batch_size=2, num_workers=2, persistent_workers=PERSISTENT_WORKERS ) global_step = 0 epoch = 0 ds_state_dict = None state_dict = None resumed = False while True: if epoch >= 3: break if state_dict is not None: dl.load_state_dict(state_dict) state_dict = None ds_state_dict = None resumed = True print("resumed") for i, batch in enumerate(dl): print(f"epoch: {epoch}, global_step: {global_step}, batch: {batch}") global_step += 1 # consume datapoint # simulate error if global_step == 124 and not resumed: ds_state_dict = ds.state_dict() state_dict = dl.state_dict() print("checkpoint") print("ds_state_dict") pprint.pprint(ds_state_dict) print("dl_state_dict") pprint.pprint(state_dict) break if state_dict is None: ds.set_epoch(epoch) epoch += 1 ``` The script checkpoints when there are three batches left in the second epoch. After resuming, only the last three batches are repeated in the rest of the epochs. If it helps, following are the two state_dicts for the dataloader save at the same step with the two settings. The left one is for `PERSISTENT_WORKERS=False` ![Image](https://github.com/user-attachments/assets/c97d6502-d7bd-4ef4-ae2d-66fe1a9732b1) ### Expected behavior All the elements in the dataset should be iterated through in the epochs following the one where we resumed. The expected behavior can be seen by setting `PERSISTENT_WORKERS=False`. ### Environment info torch==2.5.1 datasets==3.3.2 torchdata>=0.9.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/7447/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/issues/7446
7,446
pyarrow.lib.ArrowTypeError: Expected dict key of type str or bytes, got 'int'
{ "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
[ "I think the Counter object you used in 'labels' may be the issue, since the {2:1} inside is the dict and 2 is the int", "> I think the Counter object you used in 'labels' may be the issue, since the {2:1} inside is the dict and 2 is the int我认为您在 'labels' 中使用的 Counter 对象可能是问题所在,因为里面的 {2:1} 是 dict,而 2 是 int\n\nYes, that's the point." ]
2025-03-12T07:48:37Z
2025-07-04T05:14:45Z
2025-07-04T05:14:45Z
NONE
null
null
### Describe the bug A dict with its keys are all str but get following error ```python test_data=[{'input_ids':[1,2,3],'labels':[[Counter({2:1})]]}] dataset = datasets.Dataset.from_list(test_data) ``` ```bash pyarrow.lib.ArrowTypeError: Expected dict key of type str or bytes, got 'int' ``` ### Steps to reproduce the bug . ### Expected behavior . ### Environment info datasets 3.3.2
{ "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/7446/reactions" }
completed
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false
https://github.com/huggingface/datasets/pull/7445
7,445
Fix small bugs with async map
{ "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" }
[]
closed
false
[ "The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7445). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update." ]
2025-03-11T18:30:57Z
2025-03-13T10:38:03Z
2025-03-13T10:37:58Z
MEMBER
false
{ "diff_url": "https://github.com/huggingface/datasets/pull/7445.diff", "html_url": "https://github.com/huggingface/datasets/pull/7445", "merged_at": "2025-03-13T10:37:58Z", "patch_url": "https://github.com/huggingface/datasets/pull/7445.patch", "url": "https://api.github.com/repos/huggingface/datasets/pulls/7445" }
helpful for the next PR to enable parallel image/audio/video decoding and make multimodal datasets go brr (e.g. for lerobot) - fix with_indices - fix resuming with save_state_dict() / load_state_dict() - omg that wasn't easy - remove unnecessary decoding in map() to enable parallelism in FormattedExampleIterable later small bonus: keeping features in batch()
{ "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/7445/reactions" }
null
null
null
true
https://github.com/huggingface/datasets/issues/7444
7,444
Excessive warnings when resuming an IterableDataset+buffered shuffle+DDP.
{ "avatar_url": "https://avatars.githubusercontent.com/u/4356534?v=4", "events_url": "https://api.github.com/users/dhruvdcoder/events{/privacy}", "followers_url": "https://api.github.com/users/dhruvdcoder/followers", "following_url": "https://api.github.com/users/dhruvdcoder/following{/other_user}", "gists_url": "https://api.github.com/users/dhruvdcoder/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dhruvdcoder", "id": 4356534, "login": "dhruvdcoder", "node_id": "MDQ6VXNlcjQzNTY1MzQ=", "organizations_url": "https://api.github.com/users/dhruvdcoder/orgs", "received_events_url": "https://api.github.com/users/dhruvdcoder/received_events", "repos_url": "https://api.github.com/users/dhruvdcoder/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dhruvdcoder/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dhruvdcoder/subscriptions", "type": "User", "url": "https://api.github.com/users/dhruvdcoder", "user_view_type": "public" }
[]
open
false
[ "I had a similar issue when loading the saved iterable dataset state to fast-forward to the mid-train location before resuming. This happened when I shuffled a concatenated dataset. A `iterable_data_state_dict.json` file was saved during checkpointing in the Trainer with:\n```\ndef _save_rng_state(self, output_dir):\n super()._save_rng_state(output_dir)\n if self.args.should_save:\n with open(os.path.join(output_dir, f'iterable_data_state_dict.json'), 'w', encoding='utf-8') as fo:\n json.dump(self.train_dataset.state_dict(), fo, ensure_ascii=False)\n```\nThen when resuming training, I use `load_state_dict` to get the dataset state:\n```\nif training_args.resume_from_checkpoint:\n if isinstance(training_args.resume_from_checkpoint, bool):\n resume_from_checkpoint = get_last_checkpoint(training_args.output_dir)\n else:\n resume_from_checkpoint = training_args.resume_from_checkpoint\n last_ckpt_iterable_data_state_dict_file_path = os.path.join(resume_from_checkpoint, f'iterable_data_state_dict.json')\n if not training_args.ignore_data_skip:\n raise ValueError(f'Please set `ignore_data_skip`=True to skip tokenization.')\n with open(last_ckpt_iterable_data_state_dict_file_path, 'r', encoding='utf-8') as f:\n train_dataset_state_dict = json.load(f)\n train_dataset.load_state_dict(train_dataset_state_dict)\n print(f'Loaded train_dataset state from {last_ckpt_iterable_data_state_dict_file_path}')\n```\n\nThen code works fine before I shuffled a subset of the training data to:\n```\nmath_dataset = concatenate_datasets([A, B]).to_iterable_dataset()\nshuffled_math_dataset = math_dataset.shuffle(seed=42, buffer_size=1000000)\n```\n\nOther than the warning, a real problem is that the loss bumped after loading a ckpt:\n\n<img width=\"400\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/c8944e81-9df9-4857-82de-6ab9ebc1b066\" />" ]
2025-03-11T16:34:39Z
2025-05-13T09:41:03Z
null
NONE
null
null
### Describe the bug I have a large dataset that I shared into 1024 shards and save on the disk during pre-processing. During training, I load the dataset using load_from_disk() and convert it into an iterable dataset, shuffle it and split the shards to different DDP nodes using the recommended method. However, when the training is resumed mid-epoch, I get thousands of identical warning messages: ``` Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. ``` ### Steps to reproduce the bug 1. Run a multi-node training job using the following python script and interrupt the training after a few seconds to save a mid-epoch checkpoint. ```python #!/usr/bin/env python import os import time from typing import Dict, List import torch import lightning as pl from torch.utils.data import DataLoader from datasets import Dataset from datasets.distributed import split_dataset_by_node import datasets from transformers import AutoTokenizer from more_itertools import flatten, chunked from torchdata.stateful_dataloader import StatefulDataLoader from lightning.pytorch.callbacks.on_exception_checkpoint import ( OnExceptionCheckpoint, ) datasets.logging.set_verbosity_debug() def dummy_generator(): # Generate 60 examples: integers from $0$ to $59$ # 64 sequences of different lengths dataset = [ list(range(3, 10)), list(range(10, 15)), list(range(15, 21)), list(range(21, 27)), list(range(27, 31)), list(range(31, 36)), list(range(36, 45)), list(range(45, 50)), ] for i in range(8): for j, ids in enumerate(dataset): yield {"token_ids": [idx + i * 50 for idx in ids]} def group_texts( examples: Dict[str, List[List[int]]], block_size: int, eos_token_id: int, bos_token_id: int, pad_token_id: int, ) -> Dict[str, List[List[int]]]: real_block_size = block_size - 2 # make space for bos and eos # colapse the sequences into a single list of tokens and then create blocks of real_block_size input_ids = [] attention_mask = [] for block in chunked(flatten(examples["token_ids"]), real_block_size): s = [bos_token_id] + list(block) + [eos_token_id] ls = len(s) attn = [True] * ls s += [pad_token_id] * (block_size - ls) attn += [False] * (block_size - ls) input_ids.append(s) attention_mask.append(attn) return {"input_ids": input_ids, "attention_mask": attention_mask} def collate_fn(batch): return { "input_ids": torch.tensor( [item["input_ids"] for item in batch], dtype=torch.long ), "attention_mask": torch.tensor( [item["attention_mask"] for item in batch], dtype=torch.long ), } class DummyModule(pl.LightningModule): def __init__(self): super().__init__() # A dummy linear layer (not used for actual computation) self.layer = torch.nn.Linear(1, 1) self.ds = None self.prepare_data_per_node = False def on_train_start(self): # This hook is called once training begins on each process. print(f"[Rank {self.global_rank}] Training started.", flush=True) self.data_file = open(f"data_{self.global_rank}.txt", "w") def on_train_end(self): self.data_file.close() def training_step(self, batch, batch_idx): # Print batch information to verify data loading. time.sleep(5) # print("batch", batch, flush=True) print( f"\n[Rank {self.global_rank}] Training step, epoch {self.trainer.current_epoch}, batch {batch_idx}: {batch['input_ids']}", flush=True, ) self.data_file.write( f"[Rank {self.global_rank}] Training step, epoch {self.trainer.current_epoch}, batch {batch_idx}: {batch['input_ids']}\n" ) # Compute a dummy loss (here, simply a constant tensor) loss = torch.tensor(0.0, requires_grad=True) return loss def on_train_epoch_start(self): epoch = self.trainer.current_epoch print( f"[Rank {self.global_rank}] Training epoch {epoch} started.", flush=True, ) self.data_file.write( f"[Rank {self.global_rank}] Training epoch {epoch} started.\n" ) def configure_optimizers(self): # Return a dummy optimizer. return torch.optim.SGD(self.parameters(), lr=0.001) class DM(pl.LightningDataModule): def __init__(self): super().__init__() self.ds = None self.prepare_data_per_node = False def set_epoch(self, epoch: int): self.ds.set_epoch(epoch) def prepare_data(self): # download the dataset dataset = Dataset.from_generator(dummy_generator) # save the dataset dataset.save_to_disk("dataset", num_shards=4) def setup(self, stage: str): # load the dataset ds = datasets.load_from_disk("dataset").to_iterable_dataset( num_shards=4 ) ds = ds.map( group_texts, batched=True, batch_size=5, fn_kwargs={ "block_size": 5, "eos_token_id": 1, "bos_token_id": 0, "pad_token_id": 2, }, remove_columns=["token_ids"], ).shuffle(seed=42, buffer_size=8) ds = split_dataset_by_node( ds, rank=self.trainer.global_rank, world_size=self.trainer.world_size, ) self.ds = ds def train_dataloader(self): print( f"[Rank {self.trainer.global_rank}] Preparing train_dataloader...", flush=True, ) rank = self.trainer.global_rank print( f"[Rank {rank}] Global rank: {self.trainer.global_rank}", flush=True, ) world_size = self.trainer.world_size print(f"[Rank {rank}] World size: {world_size}", flush=True) return StatefulDataLoader( self.ds, batch_size=2, num_workers=2, collate_fn=collate_fn, drop_last=True, persistent_workers=True, ) if __name__ == "__main__": print("Starting Lightning training", flush=True) # Optionally, print some SLURM environment info for debugging. print(f"SLURM_NNODES: {os.environ.get('SLURM_NNODES', '1')}", flush=True) # Determine the number of nodes from SLURM (defaulting to 1 if not set) num_nodes = int(os.environ.get("SLURM_NNODES", "1")) model = DummyModule() dm = DM() on_exception = OnExceptionCheckpoint( dirpath="checkpoints", filename="on_exception", ) # Configure the Trainer to use distributed data parallel (DDP). trainer = pl.Trainer( accelerator="gpu" if torch.cuda.is_available() else "cpu", devices=1, strategy=( "ddp" if num_nodes > 1 else "auto" ), # Use DDP strategy for multi-node training. num_nodes=num_nodes, max_epochs=2, logger=False, enable_checkpointing=True, num_sanity_val_steps=0, enable_progress_bar=False, callbacks=[on_exception], ) # resume (uncomment to resume) # trainer.fit(model, datamodule=dm, ckpt_path="checkpoints/on_exception.ckpt") # train trainer.fit(model, datamodule=dm) ``` ```bash #!/bin/bash #SBATCH --job-name=pl_ddp_test #SBATCH --nodes=2 # Adjust number of nodes as needed #SBATCH --ntasks-per-node=1 # One GPU (process) per node #SBATCH --cpus-per-task=3 # At least as many dataloader workers as required #SBATCH --gres=gpu:1 # Request one GPU per node #SBATCH --time=00:10:00 # Job runtime (adjust as needed) #SBATCH --partition=gpu-preempt # Partition or queue name #SBATCH -o script.out # Disable Python output buffering. export PYTHONUNBUFFERED=1 echo "SLURM job starting on $(date)" echo "Running on nodes: $SLURM_NODELIST" echo "Current directory: $(pwd)" ls -l # Launch the script using srun so that each process starts the Lightning module. srun script.py ``` 2. Uncomment the "resume" line (second to last) and comment the original `trainer.fit` call (last line). It will produce the following log. ``` [Rank 0] Preparing train_dataloader... [Rank 0] Global rank: 0 [Rank 0] World size: 2 [Rank 1] Preparing train_dataloader... [Rank 1] Global rank: 1 [Rank 1] World size: 2 Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. Assigning 2 shards (or data sources) of the dataset to each node. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. node#0 dataloader worker#1, ': Starting to iterate over 1/2 shards. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. node#0 dataloader worker#0, ': Starting to iterate over 1/2 shards. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. Set __getitem__(key) output type to arrow for no columns (when key is int or slice) and don't output other (un-formatted) columns. Set __getitem__(key) output type to arrow for no columns (when key is int or slice) and don't output other (un-formatted) columns. node#0 dataloader worker#1, ': Finished iterating over 1/1 shards. node#0 dataloader worker#0, ': Finished iterating over 1/1 shards. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. [Rank 0] Training started. [Rank 0] Training epoch 0 started. [Rank 0] Training epoch 1 started. Assigning 2 shards (or data sources) of the dataset to each node. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. node#0 dataloader worker#1, ': Starting to iterate over 1/2 shards. node#0 dataloader worker#0, ': Starting to iterate over 1/2 shards. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. node#1 dataloader worker#1, ': Starting to iterate over 1/2 shards. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. node#1 dataloader worker#0, ': Starting to iterate over 1/2 shards. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. Set __getitem__(key) output type to arrow for no columns (when key is int or slice) and don't output other (un-formatted) columns. Set __getitem__(key) output type to arrow for no columns (when key is int or slice) and don't output other (un-formatted) columns. node#0 dataloader worker#1, ': Finished iterating over 1/1 shards. node#0 dataloader worker#0, ': Finished iterating over 1/1 shards. `Trainer.fit` stopped: `max_epochs=2` reached. Set __getitem__(key) output type to arrow for no columns (when key is int or slice) and don't output other (un-formatted) columns. Set __getitem__(key) output type to arrow for no columns (when key is int or slice) and don't output other (un-formatted) columns. node#1 dataloader worker#1, ': Finished iterating over 1/1 shards. node#1 dataloader worker#0, ': Finished iterating over 1/1 shards. [Rank 1] Training started. [Rank 1] Training epoch 0 started. [Rank 1] Training epoch 1 started. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. node#1 dataloader worker#1, ': Starting to iterate over 1/2 shards. node#1 dataloader worker#0, ': Starting to iterate over 1/2 shards. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples. Set __getitem__(key) output type to arrow for no columns (when key is int or slice) and don't output other (un-formatted) columns. Set __getitem__(key) output type to arrow for no columns (when key is int or slice) and don't output other (un-formatted) columns. node#1 dataloader worker#0, ': Finished iterating over 1/1 shards. node#1 dataloader worker#1, ': Finished iterating over 1/1 shards. ``` I'm also attaching the relevant state_dict to make sure that the state is being checkpointed as expected. ``` {'_iterator_finished': True, '_snapshot': {'_last_yielded_worker_id': 1, '_main_snapshot': {'_IterableDataset_len_called': None, '_base_seed': 3992758080362545099, '_index_sampler_state': {'samples_yielded': 64}, '_num_workers': 2, '_sampler_iter_state': None, '_sampler_iter_yielded': 32, '_shared_seed': None}, '_snapshot_step': 32, '_worker_snapshots': {'worker_0': {'dataset_state': {'ex_iterable': {'shard_example_idx': 0, 'shard_idx': 1}, 'num_examples_since_previous_state': 0, 'previous_state': {'shard_example_idx': 0, 'shard_idx': 1}, 'previous_state_example_idx': 33}, 'fetcher_state': {'dataset_iter_state': None, 'fetcher_ended': False}, 'worker_id': 0}, 'worker_1': {'dataset_state': {'ex_iterable': {'shard_example_idx': 0, 'shard_idx': 1}, 'num_examples_since_previous_state': 0, 'previous_state': {'shard_example_idx': 0, 'shard_idx': 1}, 'previous_state_example_idx': 33}, 'fetcher_state': {'dataset_iter_state': None, 'fetcher_ended': False}, 'worker_id': 1}}}, '_steps_since_snapshot': 0} ``` ### Expected behavior Since I'm following all the recommended steps, I don't expect to see any warning when resuming. Am I doing something wrong? Also, can someone explain why I'm seeing 20 identical messages in the log in this reproduction setting? I'm trying to understand why I see thousands of these messages with the actual dataset. One more surprising thing I noticed in the logs is the change in a number of shards per worker. In the following messages, the denominator changes from 2 to 1. ``` node#1 dataloader worker#1, ': Starting to iterate over 1/2 shards. ... node#1 dataloader worker#1, ': Finished iterating over 1/1 shards. ``` ### Environment info python: 3.11.10 datasets: 3.3.2 lightning: 2.3.1
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/7444/reactions" }
null
{ "completed": 0, "percent_completed": 0, "total": 0 }
{ "blocked_by": 0, "blocking": 0, "total_blocked_by": 0, "total_blocking": 0 }
false