Datasets:
Dataset Viewer
url
string | repository_url
string | labels_url
string | comments_url
string | events_url
string | html_url
string | id
int64 | node_id
string | number
int64 | title
string | user
dict | labels
list | state
string | locked
bool | assignee
dict | assignees
list | milestone
dict | comments
int64 | created_at
timestamp[ms] | updated_at
timestamp[ms] | closed_at
timestamp[ms] | author_association
string | type
null | sub_issues_summary
dict | active_lock_reason
null | draft
bool | pull_request
dict | body
string | closed_by
dict | reactions
dict | timeline_url
string | performed_via_github_app
null | state_reason
string | is_pull_request
bool |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
https://api.github.com/repos/huggingface/datasets/issues/7523 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7523/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7523/comments | https://api.github.com/repos/huggingface/datasets/issues/7523/events | https://github.com/huggingface/datasets/pull/7523 | 2,999,616,692 | PR_kwDODunzps6S1r8w | 7,523 | mention av in video docs | {
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"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}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | 1 | 2025-04-16T13:11:12 | 2025-04-16T13:13:45 | 2025-04-16T13:11:42 | MEMBER | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | false | {
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7523",
"html_url": "https://github.com/huggingface/datasets/pull/7523",
"diff_url": "https://github.com/huggingface/datasets/pull/7523.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7523.patch",
"merged_at": "2025-04-16T13:11:42"
} | null | {
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"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}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7523/reactions",
"total_count": 1,
"+1": 1,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7523/timeline | null | null | true |
https://api.github.com/repos/huggingface/datasets/issues/7522 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7522/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7522/comments | https://api.github.com/repos/huggingface/datasets/issues/7522/events | https://github.com/huggingface/datasets/pull/7522 | 2,998,169,017 | PR_kwDODunzps6SwwXW | 7,522 | Preserve formatting in concatenated IterableDataset | {
"login": "francescorubbo",
"id": 5140987,
"node_id": "MDQ6VXNlcjUxNDA5ODc=",
"avatar_url": "https://avatars.githubusercontent.com/u/5140987?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/francescorubbo",
"html_url": "https://github.com/francescorubbo",
"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}",
"starred_url": "https://api.github.com/users/francescorubbo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/francescorubbo/subscriptions",
"organizations_url": "https://api.github.com/users/francescorubbo/orgs",
"repos_url": "https://api.github.com/users/francescorubbo/repos",
"events_url": "https://api.github.com/users/francescorubbo/events{/privacy}",
"received_events_url": "https://api.github.com/users/francescorubbo/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2025-04-16T02:37:33 | 2025-04-16T02:37:33 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | false | {
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7522",
"html_url": "https://github.com/huggingface/datasets/pull/7522",
"diff_url": "https://github.com/huggingface/datasets/pull/7522.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7522.patch",
"merged_at": null
} | Fixes #7515 | null | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7522/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7522/timeline | null | null | true |
https://api.github.com/repos/huggingface/datasets/issues/7521 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7521/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7521/comments | https://api.github.com/repos/huggingface/datasets/issues/7521/events | https://github.com/huggingface/datasets/pull/7521 | 2,997,666,366 | PR_kwDODunzps6SvEZp | 7,521 | fix: Image Feature in Datasets Library Fails to Handle bytearray Objects from Spark DataFrames (#7517) | {
"login": "giraffacarp",
"id": 73196164,
"node_id": "MDQ6VXNlcjczMTk2MTY0",
"avatar_url": "https://avatars.githubusercontent.com/u/73196164?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/giraffacarp",
"html_url": "https://github.com/giraffacarp",
"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}",
"starred_url": "https://api.github.com/users/giraffacarp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/giraffacarp/subscriptions",
"organizations_url": "https://api.github.com/users/giraffacarp/orgs",
"repos_url": "https://api.github.com/users/giraffacarp/repos",
"events_url": "https://api.github.com/users/giraffacarp/events{/privacy}",
"received_events_url": "https://api.github.com/users/giraffacarp/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | 1 | 2025-04-15T21:23:58 | 2025-04-16T06:57:22 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | false | {
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7521",
"html_url": "https://github.com/huggingface/datasets/pull/7521",
"diff_url": "https://github.com/huggingface/datasets/pull/7521.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7521.patch",
"merged_at": null
} | ## 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 | null | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7521/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7521/timeline | null | null | true |
https://api.github.com/repos/huggingface/datasets/issues/7520 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7520/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7520/comments | https://api.github.com/repos/huggingface/datasets/issues/7520/events | https://github.com/huggingface/datasets/issues/7520 | 2,997,422,044 | I_kwDODunzps6yqQfc | 7,520 | Update items in the dataset without `map` | {
"login": "mashdragon",
"id": 122402293,
"node_id": "U_kgDOB0u19Q",
"avatar_url": "https://avatars.githubusercontent.com/u/122402293?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/mashdragon",
"html_url": "https://github.com/mashdragon",
"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}",
"starred_url": "https://api.github.com/users/mashdragon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mashdragon/subscriptions",
"organizations_url": "https://api.github.com/users/mashdragon/orgs",
"repos_url": "https://api.github.com/users/mashdragon/repos",
"events_url": "https://api.github.com/users/mashdragon/events{/privacy}",
"received_events_url": "https://api.github.com/users/mashdragon/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 1935892871,
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement",
"name": "enhancement",
"color": "a2eeef",
"default": true,
"description": "New feature or request"
}
] | open | false | null | [] | null | 0 | 2025-04-15T19:39:01 | 2025-04-15T19:39:01 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7520/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7520/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7519 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7519/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7519/comments | https://api.github.com/repos/huggingface/datasets/issues/7519/events | https://github.com/huggingface/datasets/pull/7519 | 2,996,458,961 | PR_kwDODunzps6Sq76Z | 7,519 | pdf docs fixes | {
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"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}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | 1 | 2025-04-15T13:35:56 | 2025-04-15T13:38:31 | 2025-04-15T13:36:03 | MEMBER | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | false | {
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7519",
"html_url": "https://github.com/huggingface/datasets/pull/7519",
"diff_url": "https://github.com/huggingface/datasets/pull/7519.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7519.patch",
"merged_at": "2025-04-15T13:36:03"
} | close https://github.com/huggingface/datasets/issues/7494 | {
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"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}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7519/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7519/timeline | null | null | true |
https://api.github.com/repos/huggingface/datasets/issues/7518 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7518/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7518/comments | https://api.github.com/repos/huggingface/datasets/issues/7518/events | https://github.com/huggingface/datasets/issues/7518 | 2,996,141,825 | I_kwDODunzps6ylX8B | 7,518 | num_proc parallelization works only for first ~10s. | {
"login": "pshishodiaa",
"id": 33901783,
"node_id": "MDQ6VXNlcjMzOTAxNzgz",
"avatar_url": "https://avatars.githubusercontent.com/u/33901783?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pshishodiaa",
"html_url": "https://github.com/pshishodiaa",
"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}",
"starred_url": "https://api.github.com/users/pshishodiaa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pshishodiaa/subscriptions",
"organizations_url": "https://api.github.com/users/pshishodiaa/orgs",
"repos_url": "https://api.github.com/users/pshishodiaa/repos",
"events_url": "https://api.github.com/users/pshishodiaa/events{/privacy}",
"received_events_url": "https://api.github.com/users/pshishodiaa/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | 2 | 2025-04-15T11:44:03 | 2025-04-15T13:12:13 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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
 | null | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7518/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7518/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7517 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7517/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7517/comments | https://api.github.com/repos/huggingface/datasets/issues/7517/events | https://github.com/huggingface/datasets/issues/7517 | 2,996,106,077 | I_kwDODunzps6ylPNd | 7,517 | Image Feature in Datasets Library Fails to Handle bytearray Objects from Spark DataFrames | {
"login": "giraffacarp",
"id": 73196164,
"node_id": "MDQ6VXNlcjczMTk2MTY0",
"avatar_url": "https://avatars.githubusercontent.com/u/73196164?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/giraffacarp",
"html_url": "https://github.com/giraffacarp",
"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}",
"starred_url": "https://api.github.com/users/giraffacarp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/giraffacarp/subscriptions",
"organizations_url": "https://api.github.com/users/giraffacarp/orgs",
"repos_url": "https://api.github.com/users/giraffacarp/repos",
"events_url": "https://api.github.com/users/giraffacarp/events{/privacy}",
"received_events_url": "https://api.github.com/users/giraffacarp/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | {
"login": "giraffacarp",
"id": 73196164,
"node_id": "MDQ6VXNlcjczMTk2MTY0",
"avatar_url": "https://avatars.githubusercontent.com/u/73196164?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/giraffacarp",
"html_url": "https://github.com/giraffacarp",
"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}",
"starred_url": "https://api.github.com/users/giraffacarp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/giraffacarp/subscriptions",
"organizations_url": "https://api.github.com/users/giraffacarp/orgs",
"repos_url": "https://api.github.com/users/giraffacarp/repos",
"events_url": "https://api.github.com/users/giraffacarp/events{/privacy}",
"received_events_url": "https://api.github.com/users/giraffacarp/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"login": "giraffacarp",
"id": 73196164,
"node_id": "MDQ6VXNlcjczMTk2MTY0",
"avatar_url": "https://avatars.githubusercontent.com/u/73196164?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/giraffacarp",
"html_url": "https://github.com/giraffacarp",
"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}",
"starred_url": "https://api.github.com/users/giraffacarp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/giraffacarp/subscriptions",
"organizations_url": "https://api.github.com/users/giraffacarp/orgs",
"repos_url": "https://api.github.com/users/giraffacarp/repos",
"events_url": "https://api.github.com/users/giraffacarp/events{/privacy}",
"received_events_url": "https://api.github.com/users/giraffacarp/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
] | null | 4 | 2025-04-15T11:29:17 | 2025-04-15T15:57:15 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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
| null | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7517/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7517/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7516 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7516/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7516/comments | https://api.github.com/repos/huggingface/datasets/issues/7516/events | https://github.com/huggingface/datasets/issues/7516 | 2,995,780,283 | I_kwDODunzps6yj_q7 | 7,516 | unsloth/DeepSeek-R1-Distill-Qwen-32B server error | {
"login": "Editor-1",
"id": 164353862,
"node_id": "U_kgDOCcvXRg",
"avatar_url": "https://avatars.githubusercontent.com/u/164353862?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Editor-1",
"html_url": "https://github.com/Editor-1",
"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}",
"starred_url": "https://api.github.com/users/Editor-1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Editor-1/subscriptions",
"organizations_url": "https://api.github.com/users/Editor-1/orgs",
"repos_url": "https://api.github.com/users/Editor-1/repos",
"events_url": "https://api.github.com/users/Editor-1/events{/privacy}",
"received_events_url": "https://api.github.com/users/Editor-1/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | 0 | 2025-04-15T09:26:53 | 2025-04-15T09:57:26 | 2025-04-15T09:57:26 | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | {
"login": "Editor-1",
"id": 164353862,
"node_id": "U_kgDOCcvXRg",
"avatar_url": "https://avatars.githubusercontent.com/u/164353862?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Editor-1",
"html_url": "https://github.com/Editor-1",
"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}",
"starred_url": "https://api.github.com/users/Editor-1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Editor-1/subscriptions",
"organizations_url": "https://api.github.com/users/Editor-1/orgs",
"repos_url": "https://api.github.com/users/Editor-1/repos",
"events_url": "https://api.github.com/users/Editor-1/events{/privacy}",
"received_events_url": "https://api.github.com/users/Editor-1/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7516/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7516/timeline | null | completed | false |
https://api.github.com/repos/huggingface/datasets/issues/7515 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7515/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7515/comments | https://api.github.com/repos/huggingface/datasets/issues/7515/events | https://github.com/huggingface/datasets/issues/7515 | 2,995,082,418 | I_kwDODunzps6yhVSy | 7,515 | `concatenate_datasets` does not preserve Pytorch format for IterableDataset | {
"login": "francescorubbo",
"id": 5140987,
"node_id": "MDQ6VXNlcjUxNDA5ODc=",
"avatar_url": "https://avatars.githubusercontent.com/u/5140987?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/francescorubbo",
"html_url": "https://github.com/francescorubbo",
"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}",
"starred_url": "https://api.github.com/users/francescorubbo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/francescorubbo/subscriptions",
"organizations_url": "https://api.github.com/users/francescorubbo/orgs",
"repos_url": "https://api.github.com/users/francescorubbo/repos",
"events_url": "https://api.github.com/users/francescorubbo/events{/privacy}",
"received_events_url": "https://api.github.com/users/francescorubbo/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | 2 | 2025-04-15T04:36:34 | 2025-04-16T02:39:16 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | null | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7515/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7515/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7514 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7514/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7514/comments | https://api.github.com/repos/huggingface/datasets/issues/7514/events | https://github.com/huggingface/datasets/pull/7514 | 2,994,714,923 | PR_kwDODunzps6Sk7Et | 7,514 | Do not hash `generator` in `BuilderConfig.create_config_id` | {
"login": "simonreise",
"id": 43753582,
"node_id": "MDQ6VXNlcjQzNzUzNTgy",
"avatar_url": "https://avatars.githubusercontent.com/u/43753582?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/simonreise",
"html_url": "https://github.com/simonreise",
"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}",
"starred_url": "https://api.github.com/users/simonreise/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/simonreise/subscriptions",
"organizations_url": "https://api.github.com/users/simonreise/orgs",
"repos_url": "https://api.github.com/users/simonreise/repos",
"events_url": "https://api.github.com/users/simonreise/events{/privacy}",
"received_events_url": "https://api.github.com/users/simonreise/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | 0 | 2025-04-15T01:26:43 | 2025-04-15T16:27:51 | 2025-04-15T16:27:51 | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | false | {
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7514",
"html_url": "https://github.com/huggingface/datasets/pull/7514",
"diff_url": "https://github.com/huggingface/datasets/pull/7514.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7514.patch",
"merged_at": null
} | `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 | {
"login": "simonreise",
"id": 43753582,
"node_id": "MDQ6VXNlcjQzNzUzNTgy",
"avatar_url": "https://avatars.githubusercontent.com/u/43753582?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/simonreise",
"html_url": "https://github.com/simonreise",
"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}",
"starred_url": "https://api.github.com/users/simonreise/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/simonreise/subscriptions",
"organizations_url": "https://api.github.com/users/simonreise/orgs",
"repos_url": "https://api.github.com/users/simonreise/repos",
"events_url": "https://api.github.com/users/simonreise/events{/privacy}",
"received_events_url": "https://api.github.com/users/simonreise/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7514/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7514/timeline | null | null | true |
https://api.github.com/repos/huggingface/datasets/issues/7513 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7513/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7513/comments | https://api.github.com/repos/huggingface/datasets/issues/7513/events | https://github.com/huggingface/datasets/issues/7513 | 2,994,678,437 | I_kwDODunzps6yfyql | 7,513 | MemoryError while creating dataset from generator | {
"login": "simonreise",
"id": 43753582,
"node_id": "MDQ6VXNlcjQzNzUzNTgy",
"avatar_url": "https://avatars.githubusercontent.com/u/43753582?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/simonreise",
"html_url": "https://github.com/simonreise",
"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}",
"starred_url": "https://api.github.com/users/simonreise/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/simonreise/subscriptions",
"organizations_url": "https://api.github.com/users/simonreise/orgs",
"repos_url": "https://api.github.com/users/simonreise/repos",
"events_url": "https://api.github.com/users/simonreise/events{/privacy}",
"received_events_url": "https://api.github.com/users/simonreise/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | 3 | 2025-04-15T01:02:02 | 2025-04-15T17:49:39 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | null | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7513/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7513/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7512 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7512/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7512/comments | https://api.github.com/repos/huggingface/datasets/issues/7512/events | https://github.com/huggingface/datasets/issues/7512 | 2,994,043,544 | I_kwDODunzps6ydXqY | 7,512 | .map() fails if function uses pyvista | {
"login": "el-hult",
"id": 11832922,
"node_id": "MDQ6VXNlcjExODMyOTIy",
"avatar_url": "https://avatars.githubusercontent.com/u/11832922?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/el-hult",
"html_url": "https://github.com/el-hult",
"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}",
"starred_url": "https://api.github.com/users/el-hult/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/el-hult/subscriptions",
"organizations_url": "https://api.github.com/users/el-hult/orgs",
"repos_url": "https://api.github.com/users/el-hult/repos",
"events_url": "https://api.github.com/users/el-hult/events{/privacy}",
"received_events_url": "https://api.github.com/users/el-hult/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | 1 | 2025-04-14T19:43:02 | 2025-04-14T20:01:53 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7512/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7512/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7510 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7510/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7510/comments | https://api.github.com/repos/huggingface/datasets/issues/7510/events | https://github.com/huggingface/datasets/issues/7510 | 2,992,131,117 | I_kwDODunzps6yWEwt | 7,510 | Incompatibile dill version (0.3.9) in datasets 2.18.0 - 3.5.0 | {
"login": "JGrel",
"id": 98061329,
"node_id": "U_kgDOBdhMEQ",
"avatar_url": "https://avatars.githubusercontent.com/u/98061329?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/JGrel",
"html_url": "https://github.com/JGrel",
"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}",
"starred_url": "https://api.github.com/users/JGrel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/JGrel/subscriptions",
"organizations_url": "https://api.github.com/users/JGrel/orgs",
"repos_url": "https://api.github.com/users/JGrel/repos",
"events_url": "https://api.github.com/users/JGrel/events{/privacy}",
"received_events_url": "https://api.github.com/users/JGrel/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | 3 | 2025-04-14T07:22:44 | 2025-04-16T09:30:16 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | null | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7510/reactions",
"total_count": 2,
"+1": 2,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7510/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7509 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7509/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7509/comments | https://api.github.com/repos/huggingface/datasets/issues/7509/events | https://github.com/huggingface/datasets/issues/7509 | 2,991,484,542 | I_kwDODunzps6yTm5- | 7,509 | Dataset uses excessive memory when loading files | {
"login": "avishaiElmakies",
"id": 36810152,
"node_id": "MDQ6VXNlcjM2ODEwMTUy",
"avatar_url": "https://avatars.githubusercontent.com/u/36810152?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/avishaiElmakies",
"html_url": "https://github.com/avishaiElmakies",
"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}",
"starred_url": "https://api.github.com/users/avishaiElmakies/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/avishaiElmakies/subscriptions",
"organizations_url": "https://api.github.com/users/avishaiElmakies/orgs",
"repos_url": "https://api.github.com/users/avishaiElmakies/repos",
"events_url": "https://api.github.com/users/avishaiElmakies/events{/privacy}",
"received_events_url": "https://api.github.com/users/avishaiElmakies/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | 9 | 2025-04-13T21:09:49 | 2025-04-16T16:49:10 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7509/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7509/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7508 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7508/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7508/comments | https://api.github.com/repos/huggingface/datasets/issues/7508/events | https://github.com/huggingface/datasets/issues/7508 | 2,986,612,934 | I_kwDODunzps6yBBjG | 7,508 | Iterating over Image feature columns is extremely slow | {
"login": "sohamparikh",
"id": 11831521,
"node_id": "MDQ6VXNlcjExODMxNTIx",
"avatar_url": "https://avatars.githubusercontent.com/u/11831521?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/sohamparikh",
"html_url": "https://github.com/sohamparikh",
"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}",
"starred_url": "https://api.github.com/users/sohamparikh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sohamparikh/subscriptions",
"organizations_url": "https://api.github.com/users/sohamparikh/orgs",
"repos_url": "https://api.github.com/users/sohamparikh/repos",
"events_url": "https://api.github.com/users/sohamparikh/events{/privacy}",
"received_events_url": "https://api.github.com/users/sohamparikh/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | 2 | 2025-04-10T19:00:54 | 2025-04-15T17:57:08 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7508/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7508/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7507 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7507/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7507/comments | https://api.github.com/repos/huggingface/datasets/issues/7507/events | https://github.com/huggingface/datasets/issues/7507 | 2,984,309,806 | I_kwDODunzps6x4PQu | 7,507 | Front-end statistical data quantity deviation | {
"login": "rangehow",
"id": 88258534,
"node_id": "MDQ6VXNlcjg4MjU4NTM0",
"avatar_url": "https://avatars.githubusercontent.com/u/88258534?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rangehow",
"html_url": "https://github.com/rangehow",
"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}",
"starred_url": "https://api.github.com/users/rangehow/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rangehow/subscriptions",
"organizations_url": "https://api.github.com/users/rangehow/orgs",
"repos_url": "https://api.github.com/users/rangehow/repos",
"events_url": "https://api.github.com/users/rangehow/events{/privacy}",
"received_events_url": "https://api.github.com/users/rangehow/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | 1 | 2025-04-10T02:51:38 | 2025-04-15T12:54:51 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7507/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7507/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7506 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7506/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7506/comments | https://api.github.com/repos/huggingface/datasets/issues/7506/events | https://github.com/huggingface/datasets/issues/7506 | 2,981,687,450 | I_kwDODunzps6xuPCa | 7,506 | HfHubHTTPError: 429 Client Error: Too Many Requests for URL when trying to access Fineweb-10BT on 4A100 GPUs using SLURM | {
"login": "calvintanama",
"id": 66202555,
"node_id": "MDQ6VXNlcjY2MjAyNTU1",
"avatar_url": "https://avatars.githubusercontent.com/u/66202555?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/calvintanama",
"html_url": "https://github.com/calvintanama",
"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}",
"starred_url": "https://api.github.com/users/calvintanama/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/calvintanama/subscriptions",
"organizations_url": "https://api.github.com/users/calvintanama/orgs",
"repos_url": "https://api.github.com/users/calvintanama/repos",
"events_url": "https://api.github.com/users/calvintanama/events{/privacy}",
"received_events_url": "https://api.github.com/users/calvintanama/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | 1 | 2025-04-09T06:32:04 | 2025-04-15T13:04:31 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7506/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7506/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7505 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7505/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7505/comments | https://api.github.com/repos/huggingface/datasets/issues/7505/events | https://github.com/huggingface/datasets/issues/7505 | 2,979,926,156 | I_kwDODunzps6xnhCM | 7,505 | HfHubHTTPError: 403 Forbidden: None. Cannot access content at: https://hf.co/api/s3proxy | {
"login": "hissain",
"id": 1412262,
"node_id": "MDQ6VXNlcjE0MTIyNjI=",
"avatar_url": "https://avatars.githubusercontent.com/u/1412262?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/hissain",
"html_url": "https://github.com/hissain",
"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}",
"starred_url": "https://api.github.com/users/hissain/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hissain/subscriptions",
"organizations_url": "https://api.github.com/users/hissain/orgs",
"repos_url": "https://api.github.com/users/hissain/repos",
"events_url": "https://api.github.com/users/hissain/events{/privacy}",
"received_events_url": "https://api.github.com/users/hissain/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2025-04-08T14:08:40 | 2025-04-08T14:08:40 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7505/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7505/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7504 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7504/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7504/comments | https://api.github.com/repos/huggingface/datasets/issues/7504/events | https://github.com/huggingface/datasets/issues/7504 | 2,979,410,641 | I_kwDODunzps6xljLR | 7,504 | BuilderConfig ParquetConfig(...) doesn't have a 'use_auth_token' key. | {
"login": "tteguayco",
"id": 20015750,
"node_id": "MDQ6VXNlcjIwMDE1NzUw",
"avatar_url": "https://avatars.githubusercontent.com/u/20015750?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tteguayco",
"html_url": "https://github.com/tteguayco",
"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}",
"starred_url": "https://api.github.com/users/tteguayco/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tteguayco/subscriptions",
"organizations_url": "https://api.github.com/users/tteguayco/orgs",
"repos_url": "https://api.github.com/users/tteguayco/repos",
"events_url": "https://api.github.com/users/tteguayco/events{/privacy}",
"received_events_url": "https://api.github.com/users/tteguayco/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | 2 | 2025-04-08T10:55:03 | 2025-04-15T12:36:28 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7504/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7504/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7503 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7503/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7503/comments | https://api.github.com/repos/huggingface/datasets/issues/7503/events | https://github.com/huggingface/datasets/issues/7503 | 2,978,512,625 | I_kwDODunzps6xiH7x | 7,503 | Inconsistency between load_dataset and load_from_disk functionality | {
"login": "zzzzzec",
"id": 60975422,
"node_id": "MDQ6VXNlcjYwOTc1NDIy",
"avatar_url": "https://avatars.githubusercontent.com/u/60975422?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/zzzzzec",
"html_url": "https://github.com/zzzzzec",
"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}",
"starred_url": "https://api.github.com/users/zzzzzec/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/zzzzzec/subscriptions",
"organizations_url": "https://api.github.com/users/zzzzzec/orgs",
"repos_url": "https://api.github.com/users/zzzzzec/repos",
"events_url": "https://api.github.com/users/zzzzzec/events{/privacy}",
"received_events_url": "https://api.github.com/users/zzzzzec/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | 1 | 2025-04-08T03:46:22 | 2025-04-15T12:39:53 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7503/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7503/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7502 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7502/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7502/comments | https://api.github.com/repos/huggingface/datasets/issues/7502/events | https://github.com/huggingface/datasets/issues/7502 | 2,977,453,814 | I_kwDODunzps6xeFb2 | 7,502 | `load_dataset` of size 40GB creates a cache of >720GB | {
"login": "pietrolesci",
"id": 61748653,
"node_id": "MDQ6VXNlcjYxNzQ4NjUz",
"avatar_url": "https://avatars.githubusercontent.com/u/61748653?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pietrolesci",
"html_url": "https://github.com/pietrolesci",
"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}",
"starred_url": "https://api.github.com/users/pietrolesci/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pietrolesci/subscriptions",
"organizations_url": "https://api.github.com/users/pietrolesci/orgs",
"repos_url": "https://api.github.com/users/pietrolesci/repos",
"events_url": "https://api.github.com/users/pietrolesci/events{/privacy}",
"received_events_url": "https://api.github.com/users/pietrolesci/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | 2 | 2025-04-07T16:52:34 | 2025-04-15T15:22:12 | 2025-04-15T15:22:11 | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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
| {
"login": "pietrolesci",
"id": 61748653,
"node_id": "MDQ6VXNlcjYxNzQ4NjUz",
"avatar_url": "https://avatars.githubusercontent.com/u/61748653?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/pietrolesci",
"html_url": "https://github.com/pietrolesci",
"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}",
"starred_url": "https://api.github.com/users/pietrolesci/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pietrolesci/subscriptions",
"organizations_url": "https://api.github.com/users/pietrolesci/orgs",
"repos_url": "https://api.github.com/users/pietrolesci/repos",
"events_url": "https://api.github.com/users/pietrolesci/events{/privacy}",
"received_events_url": "https://api.github.com/users/pietrolesci/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7502/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7502/timeline | null | completed | false |
https://api.github.com/repos/huggingface/datasets/issues/7501 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7501/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7501/comments | https://api.github.com/repos/huggingface/datasets/issues/7501/events | https://github.com/huggingface/datasets/issues/7501 | 2,976,721,014 | I_kwDODunzps6xbSh2 | 7,501 | Nested Feature raises ArrowNotImplementedError: Unsupported cast using function cast_struct | {
"login": "yaner-here",
"id": 26623948,
"node_id": "MDQ6VXNlcjI2NjIzOTQ4",
"avatar_url": "https://avatars.githubusercontent.com/u/26623948?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/yaner-here",
"html_url": "https://github.com/yaner-here",
"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}",
"starred_url": "https://api.github.com/users/yaner-here/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yaner-here/subscriptions",
"organizations_url": "https://api.github.com/users/yaner-here/orgs",
"repos_url": "https://api.github.com/users/yaner-here/repos",
"events_url": "https://api.github.com/users/yaner-here/events{/privacy}",
"received_events_url": "https://api.github.com/users/yaner-here/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | 1 | 2025-04-07T12:35:39 | 2025-04-07T12:43:04 | 2025-04-07T12:43:03 | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | {
"login": "yaner-here",
"id": 26623948,
"node_id": "MDQ6VXNlcjI2NjIzOTQ4",
"avatar_url": "https://avatars.githubusercontent.com/u/26623948?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/yaner-here",
"html_url": "https://github.com/yaner-here",
"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}",
"starred_url": "https://api.github.com/users/yaner-here/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yaner-here/subscriptions",
"organizations_url": "https://api.github.com/users/yaner-here/orgs",
"repos_url": "https://api.github.com/users/yaner-here/repos",
"events_url": "https://api.github.com/users/yaner-here/events{/privacy}",
"received_events_url": "https://api.github.com/users/yaner-here/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7501/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7501/timeline | null | completed | false |
https://api.github.com/repos/huggingface/datasets/issues/7500 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7500/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7500/comments | https://api.github.com/repos/huggingface/datasets/issues/7500/events | https://github.com/huggingface/datasets/issues/7500 | 2,974,841,921 | I_kwDODunzps6xUHxB | 7,500 | Make `with_format` correctly indicate that a `Dataset` is compatible with PyTorch's `Dataset` class | {
"login": "benglewis",
"id": 3817460,
"node_id": "MDQ6VXNlcjM4MTc0NjA=",
"avatar_url": "https://avatars.githubusercontent.com/u/3817460?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/benglewis",
"html_url": "https://github.com/benglewis",
"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}",
"starred_url": "https://api.github.com/users/benglewis/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/benglewis/subscriptions",
"organizations_url": "https://api.github.com/users/benglewis/orgs",
"repos_url": "https://api.github.com/users/benglewis/repos",
"events_url": "https://api.github.com/users/benglewis/events{/privacy}",
"received_events_url": "https://api.github.com/users/benglewis/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 1935892871,
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement",
"name": "enhancement",
"color": "a2eeef",
"default": true,
"description": "New feature or request"
}
] | open | false | null | [] | null | 1 | 2025-04-06T09:56:09 | 2025-04-15T12:57:39 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7500/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7500/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7499 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7499/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7499/comments | https://api.github.com/repos/huggingface/datasets/issues/7499/events | https://github.com/huggingface/datasets/pull/7499 | 2,973,489,126 | PR_kwDODunzps6Rd4Zp | 7,499 | Added cache dirs to load and file_utils | {
"login": "gmongaras",
"id": 43501738,
"node_id": "MDQ6VXNlcjQzNTAxNzM4",
"avatar_url": "https://avatars.githubusercontent.com/u/43501738?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/gmongaras",
"html_url": "https://github.com/gmongaras",
"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}",
"starred_url": "https://api.github.com/users/gmongaras/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gmongaras/subscriptions",
"organizations_url": "https://api.github.com/users/gmongaras/orgs",
"repos_url": "https://api.github.com/users/gmongaras/repos",
"events_url": "https://api.github.com/users/gmongaras/events{/privacy}",
"received_events_url": "https://api.github.com/users/gmongaras/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | 4 | 2025-04-04T22:36:04 | 2025-04-15T13:19:15 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | false | {
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7499",
"html_url": "https://github.com/huggingface/datasets/pull/7499",
"diff_url": "https://github.com/huggingface/datasets/pull/7499.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7499.patch",
"merged_at": null
} | 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. | null | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7499/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7499/timeline | null | null | true |
https://api.github.com/repos/huggingface/datasets/issues/7498 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7498/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7498/comments | https://api.github.com/repos/huggingface/datasets/issues/7498/events | https://github.com/huggingface/datasets/issues/7498 | 2,969,218,273 | I_kwDODunzps6w-qzh | 7,498 | Extreme memory bandwidth. | {
"login": "J0SZ",
"id": 185079645,
"node_id": "U_kgDOCwgXXQ",
"avatar_url": "https://avatars.githubusercontent.com/u/185079645?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/J0SZ",
"html_url": "https://github.com/J0SZ",
"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}",
"starred_url": "https://api.github.com/users/J0SZ/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/J0SZ/subscriptions",
"organizations_url": "https://api.github.com/users/J0SZ/orgs",
"repos_url": "https://api.github.com/users/J0SZ/repos",
"events_url": "https://api.github.com/users/J0SZ/events{/privacy}",
"received_events_url": "https://api.github.com/users/J0SZ/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2025-04-03T11:09:08 | 2025-04-03T11:11:22 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7498/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7498/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7497 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7497/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7497/comments | https://api.github.com/repos/huggingface/datasets/issues/7497/events | https://github.com/huggingface/datasets/issues/7497 | 2,968,553,693 | I_kwDODunzps6w8Ijd | 7,497 | How to convert videos to images? | {
"login": "tongvibe",
"id": 171649931,
"node_id": "U_kgDOCjsriw",
"avatar_url": "https://avatars.githubusercontent.com/u/171649931?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tongvibe",
"html_url": "https://github.com/tongvibe",
"followers_url": "https://api.github.com/users/tongvibe/followers",
"following_url": "https://api.github.com/users/tongvibe/following{/other_user}",
"gists_url": "https://api.github.com/users/tongvibe/gists{/gist_id}",
"starred_url": "https://api.github.com/users/tongvibe/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tongvibe/subscriptions",
"organizations_url": "https://api.github.com/users/tongvibe/orgs",
"repos_url": "https://api.github.com/users/tongvibe/repos",
"events_url": "https://api.github.com/users/tongvibe/events{/privacy}",
"received_events_url": "https://api.github.com/users/tongvibe/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 1935892871,
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement",
"name": "enhancement",
"color": "a2eeef",
"default": true,
"description": "New feature or request"
}
] | open | false | null | [] | null | 1 | 2025-04-03T07:08:39 | 2025-04-15T12:35:15 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7497/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7497/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7496 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7496/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7496/comments | https://api.github.com/repos/huggingface/datasets/issues/7496/events | https://github.com/huggingface/datasets/issues/7496 | 2,967,345,522 | I_kwDODunzps6w3hly | 7,496 | Json builder: Allow features to override problematic Arrow types | {
"login": "edmcman",
"id": 1017189,
"node_id": "MDQ6VXNlcjEwMTcxODk=",
"avatar_url": "https://avatars.githubusercontent.com/u/1017189?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/edmcman",
"html_url": "https://github.com/edmcman",
"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}",
"starred_url": "https://api.github.com/users/edmcman/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/edmcman/subscriptions",
"organizations_url": "https://api.github.com/users/edmcman/orgs",
"repos_url": "https://api.github.com/users/edmcman/repos",
"events_url": "https://api.github.com/users/edmcman/events{/privacy}",
"received_events_url": "https://api.github.com/users/edmcman/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [
{
"id": 1935892871,
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement",
"name": "enhancement",
"color": "a2eeef",
"default": true,
"description": "New feature or request"
}
] | open | false | null | [] | null | 1 | 2025-04-02T19:27:16 | 2025-04-15T13:06:09 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7496/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7496/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7495 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7495/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7495/comments | https://api.github.com/repos/huggingface/datasets/issues/7495/events | https://github.com/huggingface/datasets/issues/7495 | 2,967,034,060 | I_kwDODunzps6w2VjM | 7,495 | Columns in the dataset obtained though load_dataset do not correspond to the one in the dataset viewer since 3.4.0 | {
"login": "bruno-hays",
"id": 48770768,
"node_id": "MDQ6VXNlcjQ4NzcwNzY4",
"avatar_url": "https://avatars.githubusercontent.com/u/48770768?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/bruno-hays",
"html_url": "https://github.com/bruno-hays",
"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}",
"starred_url": "https://api.github.com/users/bruno-hays/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bruno-hays/subscriptions",
"organizations_url": "https://api.github.com/users/bruno-hays/orgs",
"repos_url": "https://api.github.com/users/bruno-hays/repos",
"events_url": "https://api.github.com/users/bruno-hays/events{/privacy}",
"received_events_url": "https://api.github.com/users/bruno-hays/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | 0 | 2025-04-02T17:01:11 | 2025-04-03T09:54:22 | null | CONTRIBUTOR | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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
| null | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7495/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7495/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7494 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7494/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7494/comments | https://api.github.com/repos/huggingface/datasets/issues/7494/events | https://github.com/huggingface/datasets/issues/7494 | 2,965,347,685 | I_kwDODunzps6wv51l | 7,494 | Broken links in pdf loading documentation | {
"login": "VyoJ",
"id": 75789232,
"node_id": "MDQ6VXNlcjc1Nzg5MjMy",
"avatar_url": "https://avatars.githubusercontent.com/u/75789232?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/VyoJ",
"html_url": "https://github.com/VyoJ",
"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}",
"starred_url": "https://api.github.com/users/VyoJ/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/VyoJ/subscriptions",
"organizations_url": "https://api.github.com/users/VyoJ/orgs",
"repos_url": "https://api.github.com/users/VyoJ/repos",
"events_url": "https://api.github.com/users/VyoJ/events{/privacy}",
"received_events_url": "https://api.github.com/users/VyoJ/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | 1 | 2025-04-02T06:45:22 | 2025-04-15T13:36:25 | 2025-04-15T13:36:04 | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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) | {
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"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}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7494/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7494/timeline | null | completed | false |
https://api.github.com/repos/huggingface/datasets/issues/7493 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7493/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7493/comments | https://api.github.com/repos/huggingface/datasets/issues/7493/events | https://github.com/huggingface/datasets/issues/7493 | 2,964,025,179 | I_kwDODunzps6wq29b | 7,493 | push_to_hub does not upload videos | {
"login": "DominikVincent",
"id": 9339403,
"node_id": "MDQ6VXNlcjkzMzk0MDM=",
"avatar_url": "https://avatars.githubusercontent.com/u/9339403?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/DominikVincent",
"html_url": "https://github.com/DominikVincent",
"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}",
"starred_url": "https://api.github.com/users/DominikVincent/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/DominikVincent/subscriptions",
"organizations_url": "https://api.github.com/users/DominikVincent/orgs",
"repos_url": "https://api.github.com/users/DominikVincent/repos",
"events_url": "https://api.github.com/users/DominikVincent/events{/privacy}",
"received_events_url": "https://api.github.com/users/DominikVincent/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | open | false | null | [] | null | 1 | 2025-04-01T17:00:20 | 2025-04-15T12:34:23 | null | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | 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 | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7493/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7493/timeline | null | null | false |
https://api.github.com/repos/huggingface/datasets/issues/7492 | https://api.github.com/repos/huggingface/datasets | https://api.github.com/repos/huggingface/datasets/issues/7492/labels{/name} | https://api.github.com/repos/huggingface/datasets/issues/7492/comments | https://api.github.com/repos/huggingface/datasets/issues/7492/events | https://github.com/huggingface/datasets/pull/7492 | 2,959,088,568 | PR_kwDODunzps6QtCQM | 7,492 | Closes #7457 | {
"login": "Harry-Yang0518",
"id": 129883215,
"node_id": "U_kgDOB73cTw",
"avatar_url": "https://avatars.githubusercontent.com/u/129883215?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Harry-Yang0518",
"html_url": "https://github.com/Harry-Yang0518",
"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}",
"starred_url": "https://api.github.com/users/Harry-Yang0518/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Harry-Yang0518/subscriptions",
"organizations_url": "https://api.github.com/users/Harry-Yang0518/orgs",
"repos_url": "https://api.github.com/users/Harry-Yang0518/repos",
"events_url": "https://api.github.com/users/Harry-Yang0518/events{/privacy}",
"received_events_url": "https://api.github.com/users/Harry-Yang0518/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | [] | closed | false | null | [] | null | 1 | 2025-03-30T20:41:20 | 2025-04-13T22:05:07 | 2025-04-13T22:05:07 | NONE | null | {
"total": 0,
"completed": 0,
"percent_completed": 0
} | null | false | {
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7492",
"html_url": "https://github.com/huggingface/datasets/pull/7492",
"diff_url": "https://github.com/huggingface/datasets/pull/7492.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7492.patch",
"merged_at": null
} | 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. | {
"login": "Harry-Yang0518",
"id": 129883215,
"node_id": "U_kgDOB73cTw",
"avatar_url": "https://avatars.githubusercontent.com/u/129883215?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Harry-Yang0518",
"html_url": "https://github.com/Harry-Yang0518",
"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}",
"starred_url": "https://api.github.com/users/Harry-Yang0518/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Harry-Yang0518/subscriptions",
"organizations_url": "https://api.github.com/users/Harry-Yang0518/orgs",
"repos_url": "https://api.github.com/users/Harry-Yang0518/repos",
"events_url": "https://api.github.com/users/Harry-Yang0518/events{/privacy}",
"received_events_url": "https://api.github.com/users/Harry-Yang0518/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
} | {
"url": "https://api.github.com/repos/huggingface/datasets/issues/7492/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} | https://api.github.com/repos/huggingface/datasets/issues/7492/timeline | null | null | true |
End of preview. Expand
in Data Studio
YAML Metadata
Warning:
The task_ids "token-classification-other-acronym-identification" is not in the official list: acceptability-classification, entity-linking-classification, fact-checking, intent-classification, language-identification, multi-class-classification, multi-label-classification, multi-input-text-classification, natural-language-inference, semantic-similarity-classification, sentiment-classification, topic-classification, semantic-similarity-scoring, sentiment-scoring, sentiment-analysis, hate-speech-detection, text-scoring, named-entity-recognition, part-of-speech, parsing, lemmatization, word-sense-disambiguation, coreference-resolution, extractive-qa, open-domain-qa, closed-domain-qa, news-articles-summarization, news-articles-headline-generation, dialogue-modeling, dialogue-generation, conversational, language-modeling, text-simplification, explanation-generation, abstractive-qa, open-domain-abstractive-qa, closed-domain-qa, open-book-qa, closed-book-qa, slot-filling, masked-language-modeling, keyword-spotting, speaker-identification, audio-intent-classification, audio-emotion-recognition, audio-language-identification, multi-label-image-classification, multi-class-image-classification, face-detection, vehicle-detection, instance-segmentation, semantic-segmentation, panoptic-segmentation, image-captioning, image-inpainting, image-colorization, super-resolution, grasping, task-planning, tabular-multi-class-classification, tabular-multi-label-classification, tabular-single-column-regression, rdf-to-text, multiple-choice-qa, multiple-choice-coreference-resolution, document-retrieval, utterance-retrieval, entity-linking-retrieval, fact-checking-retrieval, univariate-time-series-forecasting, multivariate-time-series-forecasting, visual-question-answering, document-question-answering, pose-estimation
Dataset Card for Dataset Name
This dataset card aims to be a base template for new datasets. It has been generated using this raw template.
Dataset Details
Dataset Description
- Curated by: [More Information Needed]
- Funded by [optional]: [More Information Needed]
- Shared by [optional]: [More Information Needed]
- Language(s) (NLP): [More Information Needed]
- License: [More Information Needed]
Dataset Sources [optional]
- Repository: [More Information Needed]
- Paper [optional]: [More Information Needed]
- Demo [optional]: [More Information Needed]
Uses
Direct Use
[More Information Needed]
Out-of-Scope Use
[More Information Needed]
Dataset Structure
[More Information Needed]
Dataset Creation
Curation Rationale
[More Information Needed]
Source Data
Data Collection and Processing
[More Information Needed]
Who are the source data producers?
[More Information Needed]
Annotations [optional]
Annotation process
[More Information Needed]
Who are the annotators?
[More Information Needed]
Personal and Sensitive Information
[More Information Needed]
Bias, Risks, and Limitations
[More Information Needed]
Recommendations
Users should be made aware of the risks, biases and limitations of the dataset. More information needed for further recommendations.
Citation [optional]
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
Glossary [optional]
[More Information Needed]
More Information [optional]
[More Information Needed]
Dataset Card Authors [optional]
[More Information Needed]
Dataset Card Contact
[More Information Needed]
- Downloads last month
- 35