url
stringlengths 58
61
| repository_url
stringclasses 1
value | labels_url
stringlengths 72
75
| comments_url
stringlengths 67
70
| events_url
stringlengths 65
68
| html_url
stringlengths 48
51
| id
int64 600M
3.67B
| node_id
stringlengths 18
24
| number
int64 2
7.88k
| title
stringlengths 1
290
| user
dict | labels
listlengths 0
4
| state
stringclasses 2
values | locked
bool 1
class | assignee
dict | assignees
listlengths 0
4
| comments
listlengths 0
30
| created_at
timestamp[s]date 2020-04-14 18:18:51
2025-11-26 16:16:56
| updated_at
timestamp[s]date 2020-04-29 09:23:05
2025-11-30 03:52:07
| closed_at
timestamp[s]date 2020-04-29 09:23:05
2025-11-21 12:31:19
⌀ | author_association
stringclasses 4
values | type
null | active_lock_reason
null | draft
null | pull_request
null | body
stringlengths 0
228k
⌀ | closed_by
dict | reactions
dict | timeline_url
stringlengths 67
70
| performed_via_github_app
null | state_reason
stringclasses 4
values | sub_issues_summary
dict | issue_dependencies_summary
dict | is_pull_request
bool 1
class | closed_at_time_taken
duration[s] |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
https://api.github.com/repos/huggingface/datasets/issues/6348
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6348/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6348/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6348/events
|
https://github.com/huggingface/datasets/issues/6348
| 1,961,268,504
|
I_kwDODunzps505pUY
| 6,348
|
Parquet stream-conversion fails to embed images/audio files from gated repos
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1676121?v=4",
"events_url": "https://api.github.com/users/severo/events{/privacy}",
"followers_url": "https://api.github.com/users/severo/followers",
"following_url": "https://api.github.com/users/severo/following{/other_user}",
"gists_url": "https://api.github.com/users/severo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/severo",
"id": 1676121,
"login": "severo",
"node_id": "MDQ6VXNlcjE2NzYxMjE=",
"organizations_url": "https://api.github.com/users/severo/orgs",
"received_events_url": "https://api.github.com/users/severo/received_events",
"repos_url": "https://api.github.com/users/severo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/severo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/severo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/severo",
"user_view_type": "public"
}
|
[
{
"color": "d73a4a",
"default": true,
"description": "Something isn't working",
"id": 1935892857,
"name": "bug",
"node_id": "MDU6TGFiZWwxOTM1ODkyODU3",
"url": "https://api.github.com/repos/huggingface/datasets/labels/bug"
}
] |
open
| false
| null |
[] |
[
"I have created a project to stream audio in the datasets viewer on Hugging Face using Parquet.\n\nhttps://github.com/pr0mila/ParquetToHuggingFace"
] | 2023-10-25T12:12:44
| 2025-04-17T12:21:43
| null |
COLLABORATOR
| null | null | null | null |
it seems to be an issue with datasets not passing the token to embed_table_storage when generating a dataset
See https://github.com/huggingface/datasets-server/issues/2010
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6348/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6348/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6347
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6347/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6347/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6347/events
|
https://github.com/huggingface/datasets/issues/6347
| 1,959,004,835
|
I_kwDODunzps50xAqj
| 6,347
|
Incorrect example code in 'Create a dataset' docs
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/72076688?v=4",
"events_url": "https://api.github.com/users/rwood-97/events{/privacy}",
"followers_url": "https://api.github.com/users/rwood-97/followers",
"following_url": "https://api.github.com/users/rwood-97/following{/other_user}",
"gists_url": "https://api.github.com/users/rwood-97/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rwood-97",
"id": 72076688,
"login": "rwood-97",
"node_id": "MDQ6VXNlcjcyMDc2Njg4",
"organizations_url": "https://api.github.com/users/rwood-97/orgs",
"received_events_url": "https://api.github.com/users/rwood-97/received_events",
"repos_url": "https://api.github.com/users/rwood-97/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rwood-97/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rwood-97/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rwood-97",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"This was fixed in https://github.com/huggingface/datasets/pull/6247. You can find the fix in the `main` version of the docs",
"Ah great, thanks :)"
] | 2023-10-24T11:01:21
| 2023-10-25T13:05:21
| 2023-10-25T13:05:21
|
NONE
| null | null | null | null |
### Describe the bug
On [this](https://huggingface.co/docs/datasets/create_dataset) page, the example code for loading in images and audio is incorrect.
Currently, examples are:
``` python
from datasets import ImageFolder
dataset = load_dataset("imagefolder", data_dir="/path/to/pokemon")
```
and
``` python
from datasets import AudioFolder
dataset = load_dataset("audiofolder", data_dir="/path/to/folder")
```
I'm pretty sure the imports are wrong and should be:
``` python
from datasets import load_dataset
dataset = load_dataset("audiofolder", data_dir="/path/to/folder")
```
I am happy to update this if this is right but just wanted to check before making any changes.
### Steps to reproduce the bug
Go to https://huggingface.co/docs/datasets/create_dataset
### Expected behavior
N/A
### Environment info
N/A
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/72076688?v=4",
"events_url": "https://api.github.com/users/rwood-97/events{/privacy}",
"followers_url": "https://api.github.com/users/rwood-97/followers",
"following_url": "https://api.github.com/users/rwood-97/following{/other_user}",
"gists_url": "https://api.github.com/users/rwood-97/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rwood-97",
"id": 72076688,
"login": "rwood-97",
"node_id": "MDQ6VXNlcjcyMDc2Njg4",
"organizations_url": "https://api.github.com/users/rwood-97/orgs",
"received_events_url": "https://api.github.com/users/rwood-97/received_events",
"repos_url": "https://api.github.com/users/rwood-97/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rwood-97/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rwood-97/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rwood-97",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6347/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6347/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 1 day, 2:04:00
|
https://api.github.com/repos/huggingface/datasets/issues/6345
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6345/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6345/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6345/events
|
https://github.com/huggingface/datasets/issues/6345
| 1,957,707,870
|
I_kwDODunzps50sEBe
| 6,345
|
support squad structure datasets using a YAML parameter
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/138524319?v=4",
"events_url": "https://api.github.com/users/MajdTannous1/events{/privacy}",
"followers_url": "https://api.github.com/users/MajdTannous1/followers",
"following_url": "https://api.github.com/users/MajdTannous1/following{/other_user}",
"gists_url": "https://api.github.com/users/MajdTannous1/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/MajdTannous1",
"id": 138524319,
"login": "MajdTannous1",
"node_id": "U_kgDOCEG2nw",
"organizations_url": "https://api.github.com/users/MajdTannous1/orgs",
"received_events_url": "https://api.github.com/users/MajdTannous1/received_events",
"repos_url": "https://api.github.com/users/MajdTannous1/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/MajdTannous1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MajdTannous1/subscriptions",
"type": "User",
"url": "https://api.github.com/users/MajdTannous1",
"user_view_type": "public"
}
|
[
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
open
| false
| null |
[] |
[] | 2023-10-23T17:55:37
| 2023-10-23T17:55:37
| null |
NONE
| null | null | null | null |
### Feature request
Since the squad structure is widely used, I think it could be beneficial to support it using a YAML parameter.
could you implement automatic data loading of squad-like data using squad JSON format, to read it from JSON files and view it in the correct squad structure.
The dataset structure should be like this:
https://huggingface.co/datasets/squad
Columns:id,title,context,question,answers
### Motivation
Dataset repo requires arbitrary Python code execution
### Your contribution
The dataset structure should be like this:
https://huggingface.co/datasets/squad
Columns:id,title,context,question,answers
train and dev sets in squad structure JSON files
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 1,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6345/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6345/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6333
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6333/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6333/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6333/events
|
https://github.com/huggingface/datasets/issues/6333
| 1,956,714,423
|
I_kwDODunzps50oRe3
| 6,333
|
Support fsspec 2023.10.0
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
[] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
] |
[
"Hi @albertvillanova @lhoestq \r\n\r\nI believe the pull request that pins the fsspec version (https://github.com/huggingface/datasets/pull/6331) was merged by mistake. Another fix for the issue was merged on the same day an hour apart. See https://github.com/huggingface/datasets/pull/6334\r\n\r\nI'm now having an issue in my project where I can't use newer versions of fsspec.\r\n\r\nCan we remove the pin?\r\n\r\nHave a nice day! :)",
"Hi @tomscholz,\r\n\r\nThanks for pointing this out. I think you are right.\r\n\r\nI am doing some cross-checks and fixing it. ",
"Hi again, @tomscholz.\r\n\r\nAfter a more cautious investigation, I think the pin is OK because there are other reasons for it. Chronologically:\r\n- #6331 \r\n- #6334\r\n- #6336 \r\n- #6337 \r\n\r\nThe reason is that after version 2023.10.0, they changed again the behavior of their `glob` function. See: https://github.com/huggingface/datasets/pull/6337#issuecomment-1774930135\r\nWe are working on our side to support both previous and new glob behavior.\r\n\r\nNote:\r\n- First pin was < 2023.10.0\r\n- Last pin is <= 2023.10.0",
"Fixed by #6334 and #6336."
] | 2023-10-23T09:14:53
| 2024-02-07T12:39:58
| 2024-02-07T12:39:58
|
MEMBER
| null | null | null | null |
Once root issue is fixed, remove temporary pin of fsspec < 2023.10.0 introduced by:
- #6331
Related to issue:
- #6330
As @ZachNagengast suggested, the issue might be related to:
- https://github.com/fsspec/filesystem_spec/pull/1381
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6333/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6333/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 107 days, 3:25:05
|
https://api.github.com/repos/huggingface/datasets/issues/6330
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6330/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6330/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6330/events
|
https://github.com/huggingface/datasets/issues/6330
| 1,956,053,294
|
I_kwDODunzps50lwEu
| 6,330
|
Latest fsspec==2023.10.0 issue with streaming datasets
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1981179?v=4",
"events_url": "https://api.github.com/users/ZachNagengast/events{/privacy}",
"followers_url": "https://api.github.com/users/ZachNagengast/followers",
"following_url": "https://api.github.com/users/ZachNagengast/following{/other_user}",
"gists_url": "https://api.github.com/users/ZachNagengast/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ZachNagengast",
"id": 1981179,
"login": "ZachNagengast",
"node_id": "MDQ6VXNlcjE5ODExNzk=",
"organizations_url": "https://api.github.com/users/ZachNagengast/orgs",
"received_events_url": "https://api.github.com/users/ZachNagengast/received_events",
"repos_url": "https://api.github.com/users/ZachNagengast/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ZachNagengast/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ZachNagengast/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ZachNagengast",
"user_view_type": "public"
}
|
[] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
] |
[
"I also encountered a similar error below.\r\nAppreciate the team could shed some light on this issue.\r\n\r\n```\r\n---------------------------------------------------------------------------\r\nNotImplementedError Traceback (most recent call last)\r\n[/home/ubuntu/work/EveryDream2trainer/prepare_dataset.ipynb](https://vscode-remote+ssh-002dremote-002braspberry-002dg5-002e4x.vscode-resource.vscode-cdn.net/home/ubuntu/work/EveryDream2trainer/prepare_dataset.ipynb) Cell 1 line 4\r\n [1](vscode-notebook-cell://ssh-remote%2Braspberry-g5.4x/home/ubuntu/work/EveryDream2trainer/prepare_dataset.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=0) from datasets import load_dataset, load_dataset\r\n [3](vscode-notebook-cell://ssh-remote%2Braspberry-g5.4x/home/ubuntu/work/EveryDream2trainer/prepare_dataset.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=2) # ds = load_dataset(\"parquet\", data_dir=\"/home/ubuntu/work/EveryDream2trainer/datasets/monse_v1/data\")\r\n----> [4](vscode-notebook-cell://ssh-remote%2Braspberry-g5.4x/home/ubuntu/work/EveryDream2trainer/prepare_dataset.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=3) ds = load_dataset(\"Raspberry-ai/monse-v1\")\r\n\r\nFile [/opt/conda/envs/everydream/lib/python3.10/site-packages/datasets/load.py:1804](https://vscode-remote+ssh-002dremote-002braspberry-002dg5-002e4x.vscode-resource.vscode-cdn.net/opt/conda/envs/everydream/lib/python3.10/site-packages/datasets/load.py:1804), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)\r\n 1800 # Build dataset for splits\r\n 1801 keep_in_memory = (\r\n 1802 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)\r\n 1803 )\r\n-> 1804 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)\r\n 1805 # Rename and cast features to match task schema\r\n 1806 if task is not None:\r\n\r\nFile [/opt/conda/envs/everydream/lib/python3.10/site-packages/datasets/builder.py:1108](https://vscode-remote+ssh-002dremote-002braspberry-002dg5-002e4x.vscode-resource.vscode-cdn.net/opt/conda/envs/everydream/lib/python3.10/site-packages/datasets/builder.py:1108), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)\r\n 1106 is_local = not is_remote_filesystem(self._fs)\r\n 1107 if not is_local:\r\n-> 1108 raise NotImplementedError(f\"Loading a dataset cached in a {type(self._fs).__name__} is not supported.\")\r\n 1109 if not os.path.exists(self._output_dir):\r\n 1110 raise FileNotFoundError(\r\n 1111 f\"Dataset {self.name}: could not find data in {self._output_dir}. Please make sure to call \"\r\n 1112 \"builder.download_and_prepare(), or use \"\r\n 1113 \"datasets.load_dataset() before trying to access the Dataset object.\"\r\n 1114 )\r\n\r\nNotImplementedError: Loading a dataset cached in a LocalFileSystem is not supported.\r\n```\r\n\r\nCode to reproduce the issue:\r\n\r\n```\r\nfrom datasets import load_dataset\r\n\r\nds = load_dataset(\"Raspberry-ai/monse-v1\")\r\n```\r\n\r\n\r\nDependencies:\r\n```\r\nPackage Version\r\n------------------------- ------------\r\nabsl-py 2.0.0\r\naccelerate 0.23.0\r\naiohttp 3.8.4\r\naiosignal 1.3.1\r\nantlr4-python3-runtime 4.9.3\r\nanyio 4.0.0\r\nappdirs 1.4.4\r\nargon2-cffi 23.1.0\r\nargon2-cffi-bindings 21.2.0\r\narrow 1.3.0\r\nasttokens 2.4.0\r\nasync-lru 2.0.4\r\nasync-timeout 4.0.3\r\nattrs 23.1.0\r\nBabel 2.13.0\r\nbackcall 0.2.0\r\nbeautifulsoup4 4.12.2\r\nbitsandbytes 0.41.1\r\nbleach 6.1.0\r\nbraceexpand 0.1.7\r\ncachetools 5.3.1\r\ncertifi 2023.7.22\r\ncffi 1.16.0\r\ncharset-normalizer 3.3.1\r\nclick 8.1.7\r\ncmake 3.27.7\r\ncolorama 0.4.6\r\ncomm 0.1.4\r\ncompel 1.1.6\r\ndatasets 2.11.0\r\ndebugpy 1.8.0\r\ndecorator 5.1.1\r\ndefusedxml 0.7.1\r\ndiffusers 0.18.0\r\ndill 0.3.6\r\ndocker-pycreds 0.4.0\r\ndowg 0.3.1\r\neinops 0.7.0\r\neinops-exts 0.0.4\r\nexceptiongroup 1.1.3\r\nexecuting 2.0.0\r\nfastjsonschema 2.18.1\r\nfilelock 3.12.4\r\nfqdn 1.5.1\r\nfrozenlist 1.4.0\r\nfsspec 2023.10.0\r\nftfy 6.1.1\r\ngitdb 4.0.11\r\nGitPython 3.1.40\r\ngoogle-auth 2.23.3\r\ngoogle-auth-oauthlib 1.1.0\r\ngrpcio 1.59.0\r\nhuggingface-hub 0.18.0\r\nidna 3.4\r\nimportlib-metadata 6.8.0\r\ninflection 0.5.1\r\nipykernel 6.25.2\r\nipython 8.16.1\r\nisoduration 20.11.0\r\njedi 0.19.1\r\nJinja2 3.1.2\r\njoblib 1.3.2\r\njson5 0.9.14\r\njsonpointer 2.4\r\njsonschema 4.19.1\r\njsonschema-specifications 2023.7.1\r\njupyter_client 8.4.0\r\njupyter_core 5.4.0\r\njupyter-events 0.8.0\r\njupyter-lsp 2.2.0\r\njupyter_server 2.8.0\r\njupyter_server_terminals 0.4.4\r\njupyterlab 4.0.7\r\njupyterlab-pygments 0.2.2\r\njupyterlab_server 2.25.0\r\nlightning-utilities 0.9.0\r\nlion-pytorch 0.1.2\r\nlit 17.0.3\r\nMarkdown 3.5\r\nMarkupSafe 2.1.3\r\nmatplotlib-inline 0.1.6\r\nmistune 3.0.2\r\nmore-itertools 10.1.0\r\nmpmath 1.3.0\r\nmultidict 6.0.4\r\nmultiprocess 0.70.14\r\nmypy-extensions 1.0.0\r\nnbclient 0.8.0\r\nnbconvert 7.9.2\r\nnbformat 5.9.2\r\nnest-asyncio 1.5.8\r\nnetworkx 3.2\r\nnltk 3.8.1\r\nnotebook_shim 0.2.3\r\nnumpy 1.23.5\r\noauthlib 3.2.2\r\nomegaconf 2.2.3\r\nopen-clip-torch 2.22.0\r\nopen-flamingo 2.0.0\r\noverrides 7.4.0\r\npackaging 23.2\r\npandas 2.1.1\r\npandocfilters 1.5.0\r\nparso 0.8.3\r\npathtools 0.1.2\r\npexpect 4.8.0\r\npickleshare 0.7.5\r\nPillow 10.1.0\r\npip 23.3.1\r\nplatformdirs 3.11.0\r\nprometheus-client 0.17.1\r\nprompt-toolkit 3.0.39\r\nprotobuf 3.20.1\r\npsutil 5.9.6\r\nptyprocess 0.7.0\r\npure-eval 0.2.2\r\npyarrow 13.0.0\r\npyasn1 0.5.0\r\npyasn1-modules 0.3.0\r\npycparser 2.21\r\npyDeprecate 0.3.2\r\nPygments 2.16.1\r\npynvml 11.4.1\r\npyparsing 3.1.1\r\npyre-extensions 0.0.29\r\npython-dateutil 2.8.2\r\npython-json-logger 2.0.7\r\npytorch-lightning 1.6.5\r\npytz 2023.3.post1\r\nPyYAML 6.0.1\r\npyzmq 25.1.1\r\nreferencing 0.30.2\r\nregex 2023.10.3\r\nrequests 2.31.0\r\nrequests-oauthlib 1.3.1\r\nresponses 0.18.0\r\nrfc3339-validator 0.1.4\r\nrfc3986-validator 0.1.1\r\nrpds-py 0.10.6\r\nrsa 4.9\r\nsafetensors 0.4.0\r\nscipy 1.11.3\r\nSend2Trash 1.8.2\r\nsentencepiece 0.1.98\r\nsentry-sdk 1.32.0\r\nsetproctitle 1.3.3\r\nsetuptools 68.2.2\r\nsix 1.16.0\r\nsmmap 5.0.1\r\nsniffio 1.3.0\r\nsoupsieve 2.5\r\nstack-data 0.6.3\r\nsympy 1.12\r\ntensorboard 2.15.0\r\ntensorboard-data-server 0.7.1\r\nterminado 0.17.1\r\ntimm 0.9.8\r\ntinycss2 1.2.1\r\ntokenizers 0.13.3\r\ntomli 2.0.1\r\ntorch 2.0.1+cu118\r\ntorchmetrics 1.2.0\r\ntorchvision 0.15.2+cu118\r\ntornado 6.3.3\r\ntqdm 4.66.1\r\ntraitlets 5.11.2\r\ntransformers 4.29.2\r\ntriton 2.0.0\r\ntypes-python-dateutil 2.8.19.14\r\ntyping_extensions 4.8.0\r\ntyping-inspect 0.9.0\r\ntzdata 2023.3\r\nuri-template 1.3.0\r\nurllib3 2.0.7\r\nwandb 0.15.12\r\nwcwidth 0.2.8\r\nwebcolors 1.13\r\nwebdataset 0.2.62\r\nwebencodings 0.5.1\r\nwebsocket-client 1.6.4\r\nWerkzeug 3.0.0\r\nwheel 0.41.2\r\nxformers 0.0.20\r\nxxhash 3.4.1\r\nyarl 1.9.2\r\nzipp 3.17.0\r\n```",
"@humpydonkey FWIW setting fsspec down to 2023.9.2 fixed the issue\r\n\r\n`pip install fsspec==2023.9.2`",
"got it, thanks @ZachNagengast ",
"Thanks for reporting and for the investigation, @ZachNagengast! :hugs: \r\n\r\nWe are investigating the root cause of the issue. In the meantime, we are going to pin fsspec < 2023.10.0. ",
"https://stackoverflow.com/questions/77433096/notimplementederror-loading-a-dataset-cached-in-a-localfilesystem-is-not-suppor/77433141#77433141",
"You can also update `datasets`:\r\n\r\n```\r\npip install -U datasets\r\n```\r\n\r\nIt will also update `fsspec` to use the right version",
"This seems to work fine in 2.19.0. Hopefully it will not break again",
"not working for 2.19.1 !",
"Hi, just wished to follow up on this issue. I am recently using datasets==2.12.0 and fsspec==2023.9.2 and the same error: \"NotImplementedError: Loading a streaming dataset cached in a LocalFileSystem is not supported yet.\" popped up. I tried doing upgrading datasets to the latest version with `pip install -U datasets` and the same issue occurred. "
] | 2023-10-22T20:57:10
| 2025-06-09T22:00:16
| 2023-10-23T09:17:56
|
CONTRIBUTOR
| null | null | null | null |
### Describe the bug
Loading a streaming dataset with this version of fsspec fails with the following error:
`NotImplementedError: Loading a streaming dataset cached in a LocalFileSystem is not supported yet.`
I suspect the issue is with this PR
https://github.com/fsspec/filesystem_spec/pull/1381
### Steps to reproduce the bug
1. Upgrade fsspec to version `2023.10.0`
2. Attempt to load a streaming dataset e.g. `load_dataset("laion/gpt4v-emotion-dataset", split="train", streaming=True)`
3. Observe the following exception:
```
File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/datasets/load.py", line 2146, in load_dataset
return builder_instance.as_streaming_dataset(split=split)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/datasets/builder.py", line 1318, in as_streaming_dataset
raise NotImplementedError(
NotImplementedError: Loading a streaming dataset cached in a LocalFileSystem is not supported yet.
```
### Expected behavior
Should stream the dataset as normal.
### Environment info
datasets@main
fsspec==2023.10.0
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6330/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6330/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 12:20:46
|
https://api.github.com/repos/huggingface/datasets/issues/6329
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6329/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6329/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6329/events
|
https://github.com/huggingface/datasets/issues/6329
| 1,955,858,020
|
I_kwDODunzps50lAZk
| 6,329
|
شبکه های متن به گفتار ابتدا متن داده شده را به بازنمایی میانی
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/147399213?v=4",
"events_url": "https://api.github.com/users/shabnam706/events{/privacy}",
"followers_url": "https://api.github.com/users/shabnam706/followers",
"following_url": "https://api.github.com/users/shabnam706/following{/other_user}",
"gists_url": "https://api.github.com/users/shabnam706/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/shabnam706",
"id": 147399213,
"login": "shabnam706",
"node_id": "U_kgDOCMkiLQ",
"organizations_url": "https://api.github.com/users/shabnam706/orgs",
"received_events_url": "https://api.github.com/users/shabnam706/received_events",
"repos_url": "https://api.github.com/users/shabnam706/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/shabnam706/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/shabnam706/subscriptions",
"type": "User",
"url": "https://api.github.com/users/shabnam706",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[] | 2023-10-22T11:07:46
| 2023-10-23T09:22:58
| 2023-10-23T09:22:58
|
NONE
| null | null | null | null |
شبکه های متن به گفتار ابتدا متن داده شده را به بازنمایی میانی
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lhoestq",
"id": 42851186,
"login": "lhoestq",
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lhoestq",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6329/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6329/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 22:15:12
|
https://api.github.com/repos/huggingface/datasets/issues/6328
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6328/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6328/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6328/events
|
https://github.com/huggingface/datasets/issues/6328
| 1,955,857,904
|
I_kwDODunzps50lAXw
| 6,328
|
شبکه های متن به گفتار ابتدا متن داده شده را به بازنمایی میانی
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/147399213?v=4",
"events_url": "https://api.github.com/users/shabnam706/events{/privacy}",
"followers_url": "https://api.github.com/users/shabnam706/followers",
"following_url": "https://api.github.com/users/shabnam706/following{/other_user}",
"gists_url": "https://api.github.com/users/shabnam706/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/shabnam706",
"id": 147399213,
"login": "shabnam706",
"node_id": "U_kgDOCMkiLQ",
"organizations_url": "https://api.github.com/users/shabnam706/orgs",
"received_events_url": "https://api.github.com/users/shabnam706/received_events",
"repos_url": "https://api.github.com/users/shabnam706/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/shabnam706/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/shabnam706/subscriptions",
"type": "User",
"url": "https://api.github.com/users/shabnam706",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"شبکه های متن به گفتار ابتدا متن داده شده را به بازنمایی میانی"
] | 2023-10-22T11:07:21
| 2023-10-23T09:22:38
| 2023-10-23T09:22:38
|
NONE
| null | null | null | null | null |
{
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lhoestq",
"id": 42851186,
"login": "lhoestq",
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lhoestq",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6328/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6328/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 22:15:17
|
https://api.github.com/repos/huggingface/datasets/issues/6327
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6327/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6327/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6327/events
|
https://github.com/huggingface/datasets/issues/6327
| 1,955,470,755
|
I_kwDODunzps50jh2j
| 6,327
|
FileNotFoundError when trying to load the downloaded dataset with `load_dataset(..., streaming=True)`
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/18402347?v=4",
"events_url": "https://api.github.com/users/yzhangcs/events{/privacy}",
"followers_url": "https://api.github.com/users/yzhangcs/followers",
"following_url": "https://api.github.com/users/yzhangcs/following{/other_user}",
"gists_url": "https://api.github.com/users/yzhangcs/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/yzhangcs",
"id": 18402347,
"login": "yzhangcs",
"node_id": "MDQ6VXNlcjE4NDAyMzQ3",
"organizations_url": "https://api.github.com/users/yzhangcs/orgs",
"received_events_url": "https://api.github.com/users/yzhangcs/received_events",
"repos_url": "https://api.github.com/users/yzhangcs/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/yzhangcs/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yzhangcs/subscriptions",
"type": "User",
"url": "https://api.github.com/users/yzhangcs",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"You can clone the `togethercomputer/RedPajama-Data-1T-Sample` repo and load the dataset with `load_dataset(\"path/to/cloned_repo\")` to use it offline.",
"@mariosasko Thank you for your kind reply! I'll try it as a workaround.\r\nDoes that mean that currently it's not supported to simply load with a short name?",
"It is, but manually downloading repo files to the cache can easily lead to failure (the HF cache is not meant to be modified by a user besides deleting the files 🙂), as in your case. Hence, the clone + `load_dataset(\"path/to/cloned_repo\")` workflow should be used instead."
] | 2023-10-21T12:27:03
| 2023-10-23T18:50:07
| 2023-10-23T18:50:07
|
CONTRIBUTOR
| null | null | null | null |
### Describe the bug
Hi, I'm trying to load the dataset `togethercomputer/RedPajama-Data-1T-Sample` with `load_dataset` in streaming mode, i.e., `streaming=True`, but `FileNotFoundError` occurs.
### Steps to reproduce the bug
I've downloaded the dataset and save it to the cache dir in advance. My hope is loading the files in offline environment and without taking too much hours to prepross the entire data before running into the training process.
So I try the following code to load the files streamingly
```py
dataset = load_dataset('togethercomputer/RedPajama-Data-1T-Sample', streaming=True)
print(next(iter(dataset['train'])))
```
Sadly, it raises the following:
```
FileNotFoundError: [Errno 2] No such file or directory: 'CURRENT_CODE_PATH/arxiv_sample.jsonl'
```
I've noticed that the dataset can be properly found in the begining
```
Using the latest cached version of the module from /root/.cache/huggingface/modules/datasets_modules/datasets/togethercomputer--RedPajama-Data-1T-Sample/6ea3bc8ec2e84ec6d2df1930942e9028ace8c5b9d9143823cf911c50bbd92039 (last modified on Sat Oct 21 20:12:57 2023) since it couldn't be found locally at togethercomputer/RedPajama-Data-1T-Sample., or remotely on the Hugging Face Hub.
```
But it seems that the paths couldn't be properly parsed when loading iteratively.
How should I fix this error. I've tried specifying `data_files` or `data_dir` as `.../arxiv_sample.jsonl` but none of them works.
Thanks.
### Expected behavior
Properly load the dataset.
### Environment info
`datasets==2.14.5`
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/18402347?v=4",
"events_url": "https://api.github.com/users/yzhangcs/events{/privacy}",
"followers_url": "https://api.github.com/users/yzhangcs/followers",
"following_url": "https://api.github.com/users/yzhangcs/following{/other_user}",
"gists_url": "https://api.github.com/users/yzhangcs/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/yzhangcs",
"id": 18402347,
"login": "yzhangcs",
"node_id": "MDQ6VXNlcjE4NDAyMzQ3",
"organizations_url": "https://api.github.com/users/yzhangcs/orgs",
"received_events_url": "https://api.github.com/users/yzhangcs/received_events",
"repos_url": "https://api.github.com/users/yzhangcs/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/yzhangcs/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yzhangcs/subscriptions",
"type": "User",
"url": "https://api.github.com/users/yzhangcs",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6327/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6327/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 2 days, 6:23:04
|
https://api.github.com/repos/huggingface/datasets/issues/6324
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6324/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6324/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6324/events
|
https://github.com/huggingface/datasets/issues/6324
| 1,955,126,687
|
I_kwDODunzps50iN2f
| 6,324
|
Conversion to Arrow fails due to wrong type heuristic
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2862336?v=4",
"events_url": "https://api.github.com/users/jphme/events{/privacy}",
"followers_url": "https://api.github.com/users/jphme/followers",
"following_url": "https://api.github.com/users/jphme/following{/other_user}",
"gists_url": "https://api.github.com/users/jphme/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jphme",
"id": 2862336,
"login": "jphme",
"node_id": "MDQ6VXNlcjI4NjIzMzY=",
"organizations_url": "https://api.github.com/users/jphme/orgs",
"received_events_url": "https://api.github.com/users/jphme/received_events",
"repos_url": "https://api.github.com/users/jphme/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jphme/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jphme/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jphme",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"Unlike Pandas, Arrow is strict with types, so converting the problematic strings to ints (or ints to strings) to ensure all the values have the same type is the only fix. \r\n\r\nJSON support has been requested in Arrow [here](https://github.com/apache/arrow/issues/32538), but I don't expect this to be implemented soon. \r\n\r\nAlso, this type could be represented with the Arrow Union type. However, due to low usage, the Union type has limited support in the Arrow ecosystem (e.g., IIRC Parquet still does not support it). So, we should probably wait a bit more before adding support for it in `datasets`",
"> Unlike Pandas, Arrow is strict with types, so converting the problematic strings to ints (or ints to strings) to ensure all the values have the same type is the only fix.\r\n> \r\n> JSON support has been requested in Arrow [here](https://github.com/apache/arrow/issues/32538), but I don't expect this to be implemented soon.\r\n> \r\n> Also, this type could be represented with the Arrow Union type. However, due to low usage, the Union type has limited support in the Arrow ecosystem (e.g., IIRC Parquet still does not support it). So, we should probably wait a bit more before adding support for it in `datasets`\r\n\r\nOk many thanks, I was able to mitigate the problem by manually checking and converting all problematic fields now."
] | 2023-10-20T23:20:58
| 2023-10-23T20:52:57
| 2023-10-23T20:52:57
|
NONE
| null | null | null | null |
### Describe the bug
I have a list of dictionaries with valid/JSON-serializable values.
One key is the denominator for a paragraph. In 99.9% of cases its a number, but there are some occurences of '1a', '2b' and so on.
If trying to convert this list to a dataset with `Dataset.from_list()`, I always get
`ArrowInvalid: Could not convert '1' with type str: tried to convert to int64`, presumably because pyarrow tries to convert the keys to integers.
Is there any way to circumvent this and fix dtypes? I didn't find anything in the documentation.
### Steps to reproduce the bug
* create a list of dicts with one key being a string of an integer for the first few thousand occurences and try to convert to dataset.
### Expected behavior
There shouldn't be an error (e.g. some flag to turn off automatic str to numeric conversion).
### Environment info
- `datasets` version: 2.14.5
- Platform: Linux-5.15.0-84-generic-x86_64-with-glibc2.35
- Python version: 3.9.18
- Huggingface_hub version: 0.17.3
- PyArrow version: 13.0.0
- Pandas version: 2.1.1
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2862336?v=4",
"events_url": "https://api.github.com/users/jphme/events{/privacy}",
"followers_url": "https://api.github.com/users/jphme/followers",
"following_url": "https://api.github.com/users/jphme/following{/other_user}",
"gists_url": "https://api.github.com/users/jphme/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jphme",
"id": 2862336,
"login": "jphme",
"node_id": "MDQ6VXNlcjI4NjIzMzY=",
"organizations_url": "https://api.github.com/users/jphme/orgs",
"received_events_url": "https://api.github.com/users/jphme/received_events",
"repos_url": "https://api.github.com/users/jphme/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jphme/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jphme/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jphme",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6324/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6324/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 2 days, 21:31:59
|
https://api.github.com/repos/huggingface/datasets/issues/6323
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6323/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6323/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6323/events
|
https://github.com/huggingface/datasets/issues/6323
| 1,954,245,980
|
I_kwDODunzps50e21c
| 6,323
|
Loading dataset from large GCS bucket very slow since 2.14
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/6209990?v=4",
"events_url": "https://api.github.com/users/jbcdnr/events{/privacy}",
"followers_url": "https://api.github.com/users/jbcdnr/followers",
"following_url": "https://api.github.com/users/jbcdnr/following{/other_user}",
"gists_url": "https://api.github.com/users/jbcdnr/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jbcdnr",
"id": 6209990,
"login": "jbcdnr",
"node_id": "MDQ6VXNlcjYyMDk5OTA=",
"organizations_url": "https://api.github.com/users/jbcdnr/orgs",
"received_events_url": "https://api.github.com/users/jbcdnr/received_events",
"repos_url": "https://api.github.com/users/jbcdnr/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jbcdnr/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jbcdnr/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jbcdnr",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"I've also encountered this issue recently and want to ask if this has been seen.\r\n\r\n@albertvillanova for visibility - I'm not sure who the right person is to tag, but I noticed you were active recently so perhaps you can direct this to the right person.\r\n\r\nThanks!"
] | 2023-10-20T12:59:55
| 2024-09-03T18:42:33
| null |
NONE
| null | null | null | null |
### Describe the bug
Since updating to >2.14 we have very slow access to our parquet files on GCS when loading a dataset (>30 min vs 3s). Our GCS bucket has many objects and resolving globs is very slow. I could track down the problem to this change:
https://github.com/huggingface/datasets/blame/bade7af74437347a760830466eb74f7a8ce0d799/src/datasets/data_files.py#L348
The underlying implementation with gcsfs is really slow. Could you go back to the old way if we are simply giving the parquet files and no glob pattern?
Thank you.
### Steps to reproduce the bug
Load a dataset from a GCS bucket that has many files.
### Expected behavior
Used to be fast (3s) in 2.13
### Environment info
datasets==2.14.5
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6323/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6323/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6320
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6320/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6320/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6320/events
|
https://github.com/huggingface/datasets/issues/6320
| 1,952,618,316
|
I_kwDODunzps50YpdM
| 6,320
|
Dataset slice splits can't load training and validation at the same time
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/32488097?v=4",
"events_url": "https://api.github.com/users/timlac/events{/privacy}",
"followers_url": "https://api.github.com/users/timlac/followers",
"following_url": "https://api.github.com/users/timlac/following{/other_user}",
"gists_url": "https://api.github.com/users/timlac/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/timlac",
"id": 32488097,
"login": "timlac",
"node_id": "MDQ6VXNlcjMyNDg4MDk3",
"organizations_url": "https://api.github.com/users/timlac/orgs",
"received_events_url": "https://api.github.com/users/timlac/received_events",
"repos_url": "https://api.github.com/users/timlac/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/timlac/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/timlac/subscriptions",
"type": "User",
"url": "https://api.github.com/users/timlac",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"The expression \"train+test\" concatenates the splits.\r\n\r\nThe individual splits as separate datasets can be obtained as follows:\r\n```python\r\ntrain_ds, test_ds = load_dataset(\"<dataset_name>\", split=[\"train\", \"test\"])\r\ntrain_10pct_ds, test_10pct_ds = load_dataset(\"<dataset_name>\", split=[\"train[:10%]\", \"test[:%10]\"])\r\n```"
] | 2023-10-19T16:09:22
| 2023-11-30T16:21:15
| 2023-11-30T16:21:15
|
NONE
| null | null | null | null |
### Describe the bug
According to the [documentation](https://huggingface.co/docs/datasets/v2.14.5/loading#slice-splits) is should be possible to run the following command:
`train_test_ds = datasets.load_dataset("bookcorpus", split="train+test")`
to load the train and test sets from the dataset.
However executing the equivalent code:
`speech_commands_v1 = load_dataset("superb", "ks", split="train+test")`
only yields the following output:
> Dataset({
> features: ['file', 'audio', 'label'],
> num_rows: 54175
> })
Where loading the dataset without the split argument yields:
> DatasetDict({
> train: Dataset({
> features: ['file', 'audio', 'label'],
> num_rows: 51094
> })
> validation: Dataset({
> features: ['file', 'audio', 'label'],
> num_rows: 6798
> })
> test: Dataset({
> features: ['file', 'audio', 'label'],
> num_rows: 3081
> })
> })
Thus, the API seems to be broken in this regard.
This is a bit annoying since I want to be able to use the split argument with `split="train[:10%]+test[:10%]"` to have smaller dataset to work with when validating my model is working correctly.
### Steps to reproduce the bug
`speech_commands_v1 = load_dataset("superb", "ks", split="train+test")`
### Expected behavior
> DatasetDict({
> train: Dataset({
> features: ['file', 'audio', 'label'],
> num_rows: 51094
> })
> test: Dataset({
> features: ['file', 'audio', 'label'],
> num_rows: 3081
> })
> })
### Environment info
```
import datasets
print(datasets.__version__)
```
> 2.14.5
```
import sys
print(sys.version)
```
> 3.9.17 (main, Jul 5 2023, 20:41:20)
> [GCC 11.2.0]
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6320/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6320/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 42 days, 0:11:53
|
https://api.github.com/repos/huggingface/datasets/issues/6319
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6319/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6319/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6319/events
|
https://github.com/huggingface/datasets/issues/6319
| 1,952,101,717
|
I_kwDODunzps50WrVV
| 6,319
|
Datasets.map is severely broken
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4603365?v=4",
"events_url": "https://api.github.com/users/phalexo/events{/privacy}",
"followers_url": "https://api.github.com/users/phalexo/followers",
"following_url": "https://api.github.com/users/phalexo/following{/other_user}",
"gists_url": "https://api.github.com/users/phalexo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/phalexo",
"id": 4603365,
"login": "phalexo",
"node_id": "MDQ6VXNlcjQ2MDMzNjU=",
"organizations_url": "https://api.github.com/users/phalexo/orgs",
"received_events_url": "https://api.github.com/users/phalexo/received_events",
"repos_url": "https://api.github.com/users/phalexo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/phalexo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/phalexo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/phalexo",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"Hi! Instead of processing a single example at a time, you should use the batched `map` for the best performance (with `num_proc=1`) - the fast tokenizers can process a batch's samples in parallel in that scenario.\r\n\r\nE.g., the following code in Colab takes an hour to complete:\r\n```python\r\n# !pip install datasets transformers\r\nfrom datasets import load_dataset\r\nfrom transformers import AutoTokenizer\r\ntokenizer = AutoTokenizer.from_pretrained(\"bert-base-cased\")\r\ndataset = dataset.map(lambda ex: tokenizer(ex[\"text\"]), batched=True, remove_columns=[\"text\", \"meta\"])\r\n```",
"Batched is far worse. A single batch of 1000 took hours and that was only 1%\r\n\r\n\r\nOn Thu, Oct 19, 2023, 2:26 PM Mario Šaško ***@***.***> wrote:\r\n\r\n> Hi! You should use the batched map for the best performance (with\r\n> num_proc=1) - the fast tokenizers can process a batch's samples in\r\n> parallel.\r\n>\r\n> E.g., the following code in Colab takes an hour to complete:\r\n>\r\n> # !pip install datasets transformersfrom datasets import load_datasetfrom transformers import AutoTokenizertokenizer = AutoTokenizer.from_pretrained(\"bert-base-cased\")dataset = dataset.map(lambda ex: tokenizer(ex[\"text\"]), batched=True, remove_columns=[\"text\", \"meta\"])\r\n>\r\n> —\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/huggingface/datasets/issues/6319#issuecomment-1771503757>,\r\n> or unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/ABDD3ZJHPSRVDEXFNMXR2N3YAFWFZAVCNFSM6AAAAAA6HDKPSCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZRGUYDGNZVG4>\r\n> .\r\n> You are receiving this because you authored the thread.Message ID:\r\n> ***@***.***>\r\n>\r\n",
"Can you please provide a self-contained reproducer?",
"Which specific version of datasets are you using?\r\n\r\nWhat is the architecture of your colab setup? Ram? Cores? OS?\r\n\r\n\r\nOn Thu, Oct 19, 2023, 2:27 PM pensive introvert ***@***.***>\r\nwrote:\r\n\r\n> Batched is far worse. A single batch of 1000 took hours and that was only\r\n> 1%\r\n>\r\n>\r\n> On Thu, Oct 19, 2023, 2:26 PM Mario Šaško ***@***.***>\r\n> wrote:\r\n>\r\n>> Hi! You should use the batched map for the best performance (with\r\n>> num_proc=1) - the fast tokenizers can process a batch's samples in\r\n>> parallel.\r\n>>\r\n>> E.g., the following code in Colab takes an hour to complete:\r\n>>\r\n>> # !pip install datasets transformersfrom datasets import load_datasetfrom transformers import AutoTokenizertokenizer = AutoTokenizer.from_pretrained(\"bert-base-cased\")dataset = dataset.map(lambda ex: tokenizer(ex[\"text\"]), batched=True, remove_columns=[\"text\", \"meta\"])\r\n>>\r\n>> —\r\n>> Reply to this email directly, view it on GitHub\r\n>> <https://github.com/huggingface/datasets/issues/6319#issuecomment-1771503757>,\r\n>> or unsubscribe\r\n>> <https://github.com/notifications/unsubscribe-auth/ABDD3ZJHPSRVDEXFNMXR2N3YAFWFZAVCNFSM6AAAAAA6HDKPSCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZRGUYDGNZVG4>\r\n>> .\r\n>> You are receiving this because you authored the thread.Message ID:\r\n>> ***@***.***>\r\n>>\r\n>\r\n",
"from functools import partial\r\nimport transformers\r\nfrom datasets import load_dataset, concatenate_datasets, load_from_disk\r\n\r\nmodel_name_or_path=\"/opt/data/data/daryl149/llama-2-7b-chat-hf\"\r\noutput_dir=\"/opt/data/data/LongLoRA/checkpoints\"\r\ncache_dir=\"/opt/data/data/LongLoRA/cache\"\r\nmodel_max_length=16384\r\n\r\nIGNORE_INDEX = -100\r\nDEFAULT_PAD_TOKEN = \"[PAD]\"\r\nDEFAULT_EOS_TOKEN = \"</s>\"\r\nDEFAULT_BOS_TOKEN = \"<s>\"\r\nDEFAULT_UNK_TOKEN = \"<unk>\"\r\n\r\n\r\ntokenizer = transformers.LlamaTokenizerFast.from_pretrained(\r\n model_name_or_path,\r\n cache_dir=cache_dir,\r\n model_max_length=model_max_length,\r\n padding_side=\"right\",\r\n use_fast=True,\r\n #use_fast=False\r\n)\r\n\r\nspecial_tokens_dict = dict()\r\nif tokenizer.pad_token is None:\r\n special_tokens_dict[\"pad_token\"] = DEFAULT_PAD_TOKEN\r\nif tokenizer.eos_token is None:\r\n special_tokens_dict[\"eos_token\"] = DEFAULT_EOS_TOKEN\r\nif tokenizer.bos_token is None:\r\n special_tokens_dict[\"bos_token\"] = DEFAULT_BOS_TOKEN\r\nif tokenizer.unk_token is None:\r\n special_tokens_dict[\"unk_token\"] = DEFAULT_UNK_TOKEN\r\n\r\ntokenizer.add_special_tokens(special_tokens_dict)\r\n\r\ndef tokenize_fn(tokenizer, example):\r\n context_length = tokenizer.model_max_length\r\n outputs = tokenizer(\r\n tokenizer.eos_token.join(example[\"text\"]),\r\n #truncation=False,\r\n truncation=True,\r\n return_tensors=\"pt\",\r\n #return_tensors=\"np\",\r\n pad_to_multiple_of=context_length,\r\n padding=True,\r\n )\r\n return {\"input_ids\": outputs[\"input_ids\"].view(-1, context_length)}\r\n\r\nfor idx in range(100):\r\n dataset = load_dataset(\"togethercomputer/RedPajama-Data-1T-Sample\",\r\ncache_dir=cache_dir, split=f'train[{idx}%:{idx+1}%]')\r\n dataset = dataset.map(partial(tokenize_fn, tokenizer), batched=False,\r\nnum_proc=16, remove_columns=[\"text\", \"meta\"])\r\n dataset.save_to_disk(training_args.cache_dir + f\"/training_data_{idx}\")\r\n\r\n\r\nOn Thu, Oct 19, 2023 at 2:30 PM Mario Šaško ***@***.***>\r\nwrote:\r\n\r\n> Can you please provide a self-contained reproducer?\r\n>\r\n> —\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/huggingface/datasets/issues/6319#issuecomment-1771509229>,\r\n> or unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/ABDD3ZNBZ3BE7Q4EQZZK6MLYAFWURAVCNFSM6AAAAAA6HDKPSCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZRGUYDSMRSHE>\r\n> .\r\n> You are receiving this because you authored the thread.Message ID:\r\n> ***@***.***>\r\n>\r\n",
"I changed the tokenizer to one without \"Fast suffix, and something changed.\r\nThe fraction, although still slowed a lot at 80% was able to get over the\r\nfinish line of 100%\r\n\r\nI have to do more testng, see if the whole set can be processed\r\n\r\n\r\n\r\nOn Thu, Oct 19, 2023 at 3:03 PM pensive introvert <\r\n***@***.***> wrote:\r\n\r\n> from functools import partial\r\n> import transformers\r\n> from datasets import load_dataset, concatenate_datasets, load_from_disk\r\n>\r\n> model_name_or_path=\"/opt/data/data/daryl149/llama-2-7b-chat-hf\"\r\n> output_dir=\"/opt/data/data/LongLoRA/checkpoints\"\r\n> cache_dir=\"/opt/data/data/LongLoRA/cache\"\r\n> model_max_length=16384\r\n>\r\n> IGNORE_INDEX = -100\r\n> DEFAULT_PAD_TOKEN = \"[PAD]\"\r\n> DEFAULT_EOS_TOKEN = \"</s>\"\r\n> DEFAULT_BOS_TOKEN = \"<s>\"\r\n> DEFAULT_UNK_TOKEN = \"<unk>\"\r\n>\r\n>\r\n> tokenizer = transformers.LlamaTokenizerFast.from_pretrained(\r\n> model_name_or_path,\r\n> cache_dir=cache_dir,\r\n> model_max_length=model_max_length,\r\n> padding_side=\"right\",\r\n> use_fast=True,\r\n> #use_fast=False\r\n> )\r\n>\r\n> special_tokens_dict = dict()\r\n> if tokenizer.pad_token is None:\r\n> special_tokens_dict[\"pad_token\"] = DEFAULT_PAD_TOKEN\r\n> if tokenizer.eos_token is None:\r\n> special_tokens_dict[\"eos_token\"] = DEFAULT_EOS_TOKEN\r\n> if tokenizer.bos_token is None:\r\n> special_tokens_dict[\"bos_token\"] = DEFAULT_BOS_TOKEN\r\n> if tokenizer.unk_token is None:\r\n> special_tokens_dict[\"unk_token\"] = DEFAULT_UNK_TOKEN\r\n>\r\n> tokenizer.add_special_tokens(special_tokens_dict)\r\n>\r\n> def tokenize_fn(tokenizer, example):\r\n> context_length = tokenizer.model_max_length\r\n> outputs = tokenizer(\r\n> tokenizer.eos_token.join(example[\"text\"]),\r\n> #truncation=False,\r\n> truncation=True,\r\n> return_tensors=\"pt\",\r\n> #return_tensors=\"np\",\r\n> pad_to_multiple_of=context_length,\r\n> padding=True,\r\n> )\r\n> return {\"input_ids\": outputs[\"input_ids\"].view(-1, context_length)}\r\n>\r\n> for idx in range(100):\r\n> dataset = load_dataset(\"togethercomputer/RedPajama-Data-1T-Sample\",\r\n> cache_dir=cache_dir, split=f'train[{idx}%:{idx+1}%]')\r\n> dataset = dataset.map(partial(tokenize_fn, tokenizer), batched=False,\r\n> num_proc=16, remove_columns=[\"text\", \"meta\"])\r\n> dataset.save_to_disk(training_args.cache_dir + f\"/training_data_{idx}\")\r\n>\r\n>\r\n> On Thu, Oct 19, 2023 at 2:30 PM Mario Šaško ***@***.***>\r\n> wrote:\r\n>\r\n>> Can you please provide a self-contained reproducer?\r\n>>\r\n>> —\r\n>> Reply to this email directly, view it on GitHub\r\n>> <https://github.com/huggingface/datasets/issues/6319#issuecomment-1771509229>,\r\n>> or unsubscribe\r\n>> <https://github.com/notifications/unsubscribe-auth/ABDD3ZNBZ3BE7Q4EQZZK6MLYAFWURAVCNFSM6AAAAAA6HDKPSCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZRGUYDSMRSHE>\r\n>> .\r\n>> You are receiving this because you authored the thread.Message ID:\r\n>> ***@***.***>\r\n>>\r\n>\r\n",
"So, using LlamaTokenizerFast was the problem. Changing it to LlamaTokenizer\r\nfixed things,\r\n\r\nOn Thu, Oct 19, 2023 at 4:04 PM pensive introvert <\r\n***@***.***> wrote:\r\n\r\n> I changed the tokenizer to one without \"Fast suffix, and something\r\n> changed. The fraction, although still slowed a lot at 80% was able to get\r\n> over the finish line of 100%\r\n>\r\n> I have to do more testng, see if the whole set can be processed\r\n>\r\n>\r\n>\r\n> On Thu, Oct 19, 2023 at 3:03 PM pensive introvert <\r\n> ***@***.***> wrote:\r\n>\r\n>> from functools import partial\r\n>> import transformers\r\n>> from datasets import load_dataset, concatenate_datasets, load_from_disk\r\n>>\r\n>> model_name_or_path=\"/opt/data/data/daryl149/llama-2-7b-chat-hf\"\r\n>> output_dir=\"/opt/data/data/LongLoRA/checkpoints\"\r\n>> cache_dir=\"/opt/data/data/LongLoRA/cache\"\r\n>> model_max_length=16384\r\n>>\r\n>> IGNORE_INDEX = -100\r\n>> DEFAULT_PAD_TOKEN = \"[PAD]\"\r\n>> DEFAULT_EOS_TOKEN = \"</s>\"\r\n>> DEFAULT_BOS_TOKEN = \"<s>\"\r\n>> DEFAULT_UNK_TOKEN = \"<unk>\"\r\n>>\r\n>>\r\n>> tokenizer = transformers.LlamaTokenizerFast.from_pretrained(\r\n>> model_name_or_path,\r\n>> cache_dir=cache_dir,\r\n>> model_max_length=model_max_length,\r\n>> padding_side=\"right\",\r\n>> use_fast=True,\r\n>> #use_fast=False\r\n>> )\r\n>>\r\n>> special_tokens_dict = dict()\r\n>> if tokenizer.pad_token is None:\r\n>> special_tokens_dict[\"pad_token\"] = DEFAULT_PAD_TOKEN\r\n>> if tokenizer.eos_token is None:\r\n>> special_tokens_dict[\"eos_token\"] = DEFAULT_EOS_TOKEN\r\n>> if tokenizer.bos_token is None:\r\n>> special_tokens_dict[\"bos_token\"] = DEFAULT_BOS_TOKEN\r\n>> if tokenizer.unk_token is None:\r\n>> special_tokens_dict[\"unk_token\"] = DEFAULT_UNK_TOKEN\r\n>>\r\n>> tokenizer.add_special_tokens(special_tokens_dict)\r\n>>\r\n>> def tokenize_fn(tokenizer, example):\r\n>> context_length = tokenizer.model_max_length\r\n>> outputs = tokenizer(\r\n>> tokenizer.eos_token.join(example[\"text\"]),\r\n>> #truncation=False,\r\n>> truncation=True,\r\n>> return_tensors=\"pt\",\r\n>> #return_tensors=\"np\",\r\n>> pad_to_multiple_of=context_length,\r\n>> padding=True,\r\n>> )\r\n>> return {\"input_ids\": outputs[\"input_ids\"].view(-1, context_length)}\r\n>>\r\n>> for idx in range(100):\r\n>> dataset = load_dataset(\"togethercomputer/RedPajama-Data-1T-Sample\",\r\n>> cache_dir=cache_dir, split=f'train[{idx}%:{idx+1}%]')\r\n>> dataset = dataset.map(partial(tokenize_fn, tokenizer), batched=False,\r\n>> num_proc=16, remove_columns=[\"text\", \"meta\"])\r\n>> dataset.save_to_disk(training_args.cache_dir +\r\n>> f\"/training_data_{idx}\")\r\n>>\r\n>>\r\n>> On Thu, Oct 19, 2023 at 2:30 PM Mario Šaško ***@***.***>\r\n>> wrote:\r\n>>\r\n>>> Can you please provide a self-contained reproducer?\r\n>>>\r\n>>> —\r\n>>> Reply to this email directly, view it on GitHub\r\n>>> <https://github.com/huggingface/datasets/issues/6319#issuecomment-1771509229>,\r\n>>> or unsubscribe\r\n>>> <https://github.com/notifications/unsubscribe-auth/ABDD3ZNBZ3BE7Q4EQZZK6MLYAFWURAVCNFSM6AAAAAA6HDKPSCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZRGUYDSMRSHE>\r\n>>> .\r\n>>> You are receiving this because you authored the thread.Message ID:\r\n>>> ***@***.***>\r\n>>>\r\n>>\r\n",
"Indeed, the tokenizer is super slow. Perhaps @ArthurZucker knows the reason why.\r\n\r\n([This](https://colab.research.google.com/drive/1VgeurX-4Fl2X6aBQTwh_X4kuQKZ6K9L1?usp=sharing) simplified Colab can be used to reproduce the behavior)",
"same issue here\r\nsample to reproduce: https://github.com/philschmid/document-ai-transformers/blob/main/training/donut_sroie.ipynb\r\nwith following map line\r\nhttps://github.com/philschmid/document-ai-transformers/blob/main/training/donut_sroie.ipynb\r\n\r\nIf I directly iterate over the dataset and call the mapping method, it is very fast\r\n```py\r\nfor sample in dataset:\r\n def preprocess_documents_for_donut(sample):\r\n```\r\n\r\nif i removed `.convert('RGB')` It can run to completion without getting stuck. I suspect it has something to do with the Image.\r\n\r\nIf I use batch, it's even slower.",
"@ewfian \r\n\r\n> If I directly iterate over the dataset and call the mapping method, it is very fast\r\n\r\n`Dataset.map` must also convert the images into bytes to write them to an Arrow file (the write itself takes some time, too). \r\n\r\nYou can make the `map` faster by manually converting the images into an \"arrow-compatible\" representation. Otherwise, the Pillow defaults are used when saving an image, which seems particularly slow for the notebook's case.\r\n\r\n```python\r\ndef preprocess_documents_for_donut(sample):\r\n text = json.loads(sample[\"text\"])\r\n d_doc = task_start_token + json2token(text) + eos_token\r\n image = sample[\"image\"].convert('RGB')\r\n # convert image to bytes\r\n buffer = io.BytesIO()\r\n image.save(buffer, format=\"PNG\", compress_level=1)\r\n return {\"image\": {\"bytes\": buffer.getvalue()}, \"text\": d_doc}\r\n\r\nproc_dataset = dataset.map(preprocess_documents_for_donut, writer_batch_size=50)\r\n```",
"The problem I had was to do with map using fork and copying locks from the\r\nparent process in acquired state. I ended up changing the context to use\r\nforkserver instead.\r\n\r\n\r\nOn Wed, Nov 29, 2023, 10:04 PM Mario Šaško ***@***.***> wrote:\r\n\r\n> @ewfian <https://github.com/ewfian>\r\n>\r\n> If I directly iterate over the dataset and call the mapping method, it is\r\n> very fast\r\n>\r\n> Dataset.map must also convert the images into bytes to write them to an\r\n> Arrow file (the write itself takes some time, too).\r\n>\r\n> You can make the map faster by manually converting the images into an\r\n> \"arrow-compatible\" representation. Otherwise, the Pillow defaults are used\r\n> when saving an image, which seems particularly slow for the notebook's case.\r\n>\r\n> def preprocess_documents_for_donut(sample):\r\n> text = json.loads(sample[\"text\"])\r\n> d_doc = task_start_token + json2token(text) + eos_token\r\n> image = sample[\"image\"].convert('RGB')\r\n> # convert image to bytes\r\n> buffer = io.BytesIO()\r\n> image.save(buffer, format=\"PNG\", compress_level=1)\r\n> return {\"image\": {\"bytes\": buffer.getvalue()}, \"text\": d_doc}\r\n> proc_dataset = dataset.map(preprocess_documents_for_donut, writer_batch_size=50)\r\n>\r\n> —\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/huggingface/datasets/issues/6319#issuecomment-1833033973>,\r\n> or unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/ABDD3ZKKEKJVWBFH7QHLRJ3YG7ZUJAVCNFSM6AAAAAA6HDKPSCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZTGAZTGOJXGM>\r\n> .\r\n> You are receiving this because you authored the thread.Message ID:\r\n> ***@***.***>\r\n>\r\n",
"I face the same issue many times.\r\n\r\nNot only when using the transformers' tokenizer, but also when applying nltk's [pos_tag](https://www.nltk.org/api/nltk.tag.pos_tag.html) to the entire English Wikipedia. So I suspect the cause is not in the tokenizer but in the Dataset.map\r\n\r\nMy case:\r\nAt the beginning of the run, the speed was 600 samples/s, but it slowed down to 20 samples/s at around 90% (after 3 hours). I am concerned that the CPU usage was only about 5% at the end of the run, even though there was still lots of data left.",
"It is the interaction of fork() inside the map and tokenizer mutexes/locks.\r\n\r\nYou have to set up your own process pool and use fork server instead of\r\nfork.\r\n\r\n\r\nOn Tue, Aug 6, 2024, 11:44 AM yuji96 ***@***.***> wrote:\r\n\r\n> I face the same issue many times.\r\n>\r\n> Not only when using the transformers' tokenizer, but also when applying\r\n> nltk's pos_tag <https://www.nltk.org/api/nltk.tag.pos_tag.html> to the\r\n> entire English Wikipedia. So I suspect the cause is not in the tokenizer\r\n> but in the Dataset.map\r\n>\r\n> My case:\r\n> At the beginning of the run, the speed was 600 samples/s, but it slowed\r\n> down to 20 samples/s at around 90% (after 3 hours). I am concerned that the\r\n> CPU usage was only about 5% at the end of the run, even though there was\r\n> still lots of data left.\r\n>\r\n> #6319 (comment)\r\n> <https://github.com/huggingface/datasets/issues/6319#issuecomment-1771629160>\r\n> It's very nice to hear that the run is complete, but the original issue\r\n> has not been solved, which is that it gets slower and slower. As it is now,\r\n> Dataset.map will not be able to handle the large datasets that are getting\r\n> larger day by day.\r\n>\r\n> —\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/huggingface/datasets/issues/6319#issuecomment-2271603976>,\r\n> or unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/ABDD3ZLFHSIGNNXAEJJIXWLZQDVPTAVCNFSM6AAAAABMCTVK2SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZRGYYDGOJXGY>\r\n> .\r\n> You are receiving this because you authored the thread.Message ID:\r\n> ***@***.***>\r\n>\r\n",
"Thank you for your advice!\r\n\r\nI added `multiprocess.set_start_method(\"forkserver\")` but the result seemed to be the same. In my case, it may be due to the very simple fact that about 10% of the process, which includes long text, never ends. I'll try shard by data size.\r\n\r\n",
"Would recommend using `LlamaTokenizerFast` not `LlamaTokenizer` ! "
] | 2023-10-19T12:19:33
| 2024-08-08T17:05:08
| null |
NONE
| null | null | null | null |
### Describe the bug
Regardless of how many cores I used, I have 16 or 32 threads, map slows down to a crawl at around 80% done, lingers maybe until 97% extremely slowly and NEVER finishes the job. It just hangs.
After watching this for 27 hours I control-C out of it. Until the end one process appears to be doing something, but it never ends.
I saw some comments about fast tokenizers using Rust and all and tried different variations. NOTHING works.
### Steps to reproduce the bug
Running it without breaking the dataset into parts results in the same behavior. The loop was an attempt to see if this was a RAM issue.
for idx in range(100):
dataset = load_dataset("togethercomputer/RedPajama-Data-1T-Sample", cache_dir=cache_dir, split=f'train[{idx}%:{idx+1}%]')
dataset = dataset.map(partial(tokenize_fn, tokenizer), batched=False, num_proc=1, remove_columns=["text", "meta"])
dataset.save_to_disk(training_args.cache_dir + f"/training_data_{idx}")
### Expected behavior
I expect map to run at more or less the same speed it starts with and FINISH its processing.
### Environment info
Python 3.8, same with 3.10 makes no difference.
Ubuntu 20.04,
| null |
{
"+1": 8,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 8,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6319/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6319/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6317
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6317/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6317/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6317/events
|
https://github.com/huggingface/datasets/issues/6317
| 1,951,965,668
|
I_kwDODunzps50WKHk
| 6,317
|
sentiment140 dataset unavailable
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/52670382?v=4",
"events_url": "https://api.github.com/users/AndreasKarasenko/events{/privacy}",
"followers_url": "https://api.github.com/users/AndreasKarasenko/followers",
"following_url": "https://api.github.com/users/AndreasKarasenko/following{/other_user}",
"gists_url": "https://api.github.com/users/AndreasKarasenko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/AndreasKarasenko",
"id": 52670382,
"login": "AndreasKarasenko",
"node_id": "MDQ6VXNlcjUyNjcwMzgy",
"organizations_url": "https://api.github.com/users/AndreasKarasenko/orgs",
"received_events_url": "https://api.github.com/users/AndreasKarasenko/received_events",
"repos_url": "https://api.github.com/users/AndreasKarasenko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/AndreasKarasenko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AndreasKarasenko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/AndreasKarasenko",
"user_view_type": "public"
}
|
[] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
] |
[
"Thanks for reporting. We are investigating the issue.",
"We have opened an issue in the corresponding Hub dataset: https://huggingface.co/datasets/sentiment140/discussions/3\r\n\r\nLet's continue the discussion there."
] | 2023-10-19T11:25:21
| 2023-10-19T13:04:56
| 2023-10-19T13:04:56
|
NONE
| null | null | null | null |
### Describe the bug
loading the dataset using load_dataset("sentiment140") returns the following error
ConnectionError: Couldn't reach http://cs.stanford.edu/people/alecmgo/trainingandtestdata.zip (error 403)
### Steps to reproduce the bug
Run the following code (version should not matter).
```
from datasets import load_dataset
data = load_dataset("sentiment140")
```
### Expected behavior
The dataset should be loaded just like any other.
The main issue is that it is no longer hosted by stanford. It is still available from a [Google Drive Link](https://docs.google.com/file/d/0B04GJPshIjmPRnZManQwWEdTZjg/edit).
### Environment info
- `datasets` version: 2.14.5
- Platform: Windows-10-10.0.19045-SP0
- Python version: 3.10.8
- Huggingface_hub version: 0.17.3
- PyArrow version: 13.0.0
- Pandas version: 2.1.1
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6317/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6317/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 1:39:35
|
https://api.github.com/repos/huggingface/datasets/issues/6315
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6315/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6315/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6315/events
|
https://github.com/huggingface/datasets/issues/6315
| 1,951,800,819
|
I_kwDODunzps50Vh3z
| 6,315
|
Hub datasets with CSV metadata raise ArrowInvalid: JSON parse error: Invalid value. in row 0
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
[
{
"color": "d73a4a",
"default": true,
"description": "Something isn't working",
"id": 1935892857,
"name": "bug",
"node_id": "MDU6TGFiZWwxOTM1ODkyODU3",
"url": "https://api.github.com/repos/huggingface/datasets/labels/bug"
}
] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
] |
[] | 2023-10-19T10:11:29
| 2023-10-20T06:14:10
| 2023-10-20T06:14:10
|
MEMBER
| null | null | null | null |
When trying to load a Hub dataset that contains a CSV metadata file, it raises an `ArrowInvalid` error:
```
E pyarrow.lib.ArrowInvalid: JSON parse error: Invalid value. in row 0
pyarrow/error.pxi:100: ArrowInvalid
```
See: https://huggingface.co/datasets/lukarape/public_small_papers/discussions/1
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6315/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6315/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 20:02:41
|
https://api.github.com/repos/huggingface/datasets/issues/6311
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6311/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6311/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6311/events
|
https://github.com/huggingface/datasets/issues/6311
| 1,949,304,993
|
I_kwDODunzps50MAih
| 6,311
|
cast_column to Sequence with length=4 occur exception raise in datasets/table.py:2146
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/16574677?v=4",
"events_url": "https://api.github.com/users/neiblegy/events{/privacy}",
"followers_url": "https://api.github.com/users/neiblegy/followers",
"following_url": "https://api.github.com/users/neiblegy/following{/other_user}",
"gists_url": "https://api.github.com/users/neiblegy/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/neiblegy",
"id": 16574677,
"login": "neiblegy",
"node_id": "MDQ6VXNlcjE2NTc0Njc3",
"organizations_url": "https://api.github.com/users/neiblegy/orgs",
"received_events_url": "https://api.github.com/users/neiblegy/received_events",
"repos_url": "https://api.github.com/users/neiblegy/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/neiblegy/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/neiblegy/subscriptions",
"type": "User",
"url": "https://api.github.com/users/neiblegy",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"Thanks for reporting! We've spotted the bugs with the `array.values` handling and are fixing them in https://github.com/huggingface/datasets/pull/6283 (should be part of the next release).",
"> Thanks for reporting! We've spotted the bugs with the `array.values` handling and are fixing them in #6283 (should be part of the next release).\r\n\r\ni encounter another exception while cast_column to type `Sequence(feature={\"points\": Array2D(shape=(-1, 2), dtype=\"int64\"), \"label\": ClassLabel(num_classes=num_classes, names=names)})`\r\n\r\nwhile my data like this: '{\"points\": [[0.6,0.6], [0.7,0.7], [0.8,0.8]], \"label\": \"A1\"}'\r\n\r\nhere is the backtrace info:\r\n\r\n```\r\n out = func(dataset, *args, **kwargs)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py\", line 2110, in cast_column\r\n return self.cast(features)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py\", line 2055, in cast\r\n dataset = dataset.map(\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py\", line 592, in wrapper\r\n out: Union[\"Dataset\", \"DatasetDict\"] = func(self, *args, **kwargs)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py\", line 557, in wrapper\r\n out: Union[\"Dataset\", \"DatasetDict\"] = func(self, *args, **kwargs)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py\", line 3097, in map\r\n for rank, done, content in Dataset._map_single(**dataset_kwargs):\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py\", line 3474, in _map_single\r\n batch = apply_function_on_filtered_inputs(\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py\", line 3353, in apply_function_on_filtered_inputs\r\n processed_inputs = function(*fn_args, *additional_args, **fn_kwargs)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 2329, in table_cast\r\n return cast_table_to_schema(table, schema)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 2288, in cast_table_to_schema\r\n arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 2288, in <listcomp>\r\n arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 1831, in wrapper\r\n return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 1831, in <listcomp>\r\n return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 2073, in cast_array_to_feature\r\n arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()]\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 2073, in <listcomp>\r\n arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()]\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 1833, in wrapper\r\n return func(array, *args, **kwargs)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 2095, in cast_array_to_feature\r\n casted_values = _c(array.values, feature.feature)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 1833, in wrapper\r\n return func(array, *args, **kwargs)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 2144, in cast_array_to_feature\r\n return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 1833, in wrapper\r\n return func(array, *args, **kwargs)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 1967, in array_cast\r\n return pa_type.wrap_array(array)\r\n File \"pyarrow/types.pxi\", line 1369, in pyarrow.lib.BaseExtensionType.wrap_array\r\nTypeError: Incompatible storage type for extension<arrow.py_extension_type<Array2DExtensionType>>: expected list<item: list<item: double>>, got list<item: double>\r\n```\r\nand i print(array) in datasets/table.py:1967 indeed get 2D list. is that same issue in #6283 ?\r\n\r\nbesides this, hugging face datasets seems don't naturally support multi-labels which means `Sequence(ClassLabel)` illegal if data is [\"label1\", \"label2\"]. so i have to define a class derived from `ClassLabel`, like this:\r\n\r\n```\r\nclass AisClassLabels(ClassLabel):\r\n def encode_example(self, example_data):\r\n if self.num_classes is None:\r\n raise ValueError(\r\n \"Trying to use ClassLabel feature with undefined number of class. \"\r\n \"Please set ClassLabel.names or num_classes.\"\r\n )\r\n if not isinstance(example_data, list):\r\n example_data = [example_data]\r\n\r\n for i in range(len(example_data)):\r\n if isinstance(example_data[i], str):\r\n example_data[i] = self.str2int(example_data[i])\r\n if not -1 <= example_data[i] < self.num_classes:\r\n raise ValueError(f\"Class label {example_data:d} greater than configured num_classes {self.num_classes}\")\r\n return example_data\r\n```\r\nand it works well in my case. but is there any recommend way to implement multi-labels?",
"`Incompatible storage type for extension<arrow.py_extension_type<Array2DExtensionType>>: expected list<item: list<item: double>>, got list<item: double>`\r\nif i change `Array2D(shape=(-1, 2), dtype=\"int64\")` to `Sequence(Value(\"int64\"))` , every thing goes well. but my data is 2D int list",
"i test Sequence(ClassLabel) is ok if one column is label list. but it is not ok in nested column such as `Sequence(feature= {\"points\": Sequence(Value(\"int32\")), \"label\": Sequence(ClassLabel(num_classes....)))`. in this case i need override ClassLabels. encode_example as i given above."
] | 2023-10-18T09:38:05
| 2024-02-06T19:24:20
| 2024-02-06T19:24:20
|
NONE
| null | null | null | null |
### Describe the bug
i load a dataset from local csv file which has 187383612 examples, then use `map` to generate new columns for test.
here is my code :
```
import os
from datasets import load_dataset
from datasets.features import Sequence, Value
def add_new_path(example):
example["ais_bbox"] = [100,100,200,200]
example["ais_image_path"] = os.path.join("images", example["image_path"]) if example["image_path"] else ""
return example
ais_dataset = load_dataset("/data/ryan.gao/ais_dataset_cache/raw/1749/")
hf_ds = ais_dataset.map(add_new_path, batched=False, num_proc=32)
ds = hf_ds.cast_column("ais_bbox", Sequence(Value("int32"), length=4))
```
and the `cast_column` raise an exception
```
Casting the dataset: 3%|███▉
...
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2110, in cast_column
return self.cast(features)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2055, in cast
dataset = dataset.map(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 592, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 557, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3097, in map
for rank, done, content in Dataset._map_single(**dataset_kwargs):
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3474, in _map_single
batch = apply_function_on_filtered_inputs(
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3353, in apply_function_on_filtered_inputs
processed_inputs = function(*fn_args, *additional_args, **fn_kwargs)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2329, in table_cast
return cast_table_to_schema(table, schema)
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2145, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}")
TypeError: Couldn't cast array of type
list<item: int64>
to
Sequence(feature=Value(dtype='int32', id=None), length=4, id=None)
```
i check the source code and make debug info:
in datasets/table.py:2092
```
2091 if feature.length > -1:
2092 if feature.length * len(array) == len(array.values):
2093 return pa.FixedSizeListArray.from_arrays(_c(array.values, feature.feature), feature.length)
2094 print(len(array))
2095 print(len(array.values))
```
my feature.length is 4. but feature.length * len(array) == len(array.values) is false.
print(len(array)) is 262
print(len(array.values)) is 4000
then I use "for item in array" to print each item then get 262 * [100,100,200,200]
and use "for item in array.values" to print each item and get 4000 int32 which are 1000 * [100,100,200,200]
i'm wondering the `chunk` in each `array.chunks`, the "chunk.values" may get all the chunks's value rather than single chunk? but i check the pyarrow's doc seems chunk.values is chunk's value not all.
### Steps to reproduce the bug
code provided above.
### Expected behavior
feature.length * len(array) == len(array.values) should be true. and there should not has Exception.
### Environment info
python3.9
x86_64
datasets: 2.14.4
pyarrow: 13.0.0 or 10.0.0
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6311/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6311/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 111 days, 9:46:15
|
https://api.github.com/repos/huggingface/datasets/issues/6308
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6308/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6308/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6308/events
|
https://github.com/huggingface/datasets/issues/6308
| 1,946,810,625
|
I_kwDODunzps50CfkB
| 6,308
|
module 'resource' has no attribute 'error'
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/48009681?v=4",
"events_url": "https://api.github.com/users/NeoWang9999/events{/privacy}",
"followers_url": "https://api.github.com/users/NeoWang9999/followers",
"following_url": "https://api.github.com/users/NeoWang9999/following{/other_user}",
"gists_url": "https://api.github.com/users/NeoWang9999/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/NeoWang9999",
"id": 48009681,
"login": "NeoWang9999",
"node_id": "MDQ6VXNlcjQ4MDA5Njgx",
"organizations_url": "https://api.github.com/users/NeoWang9999/orgs",
"received_events_url": "https://api.github.com/users/NeoWang9999/received_events",
"repos_url": "https://api.github.com/users/NeoWang9999/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/NeoWang9999/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/NeoWang9999/subscriptions",
"type": "User",
"url": "https://api.github.com/users/NeoWang9999",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"This (Windows) issue was fixed in `fsspec` in https://github.com/fsspec/filesystem_spec/pull/1275. So, to avoid the error, update the `fsspec` installation with `pip install -U fsspec`.",
"> This (Windows) issue was fixed in `fsspec` in [fsspec/filesystem_spec#1275](https://github.com/fsspec/filesystem_spec/pull/1275). So, to avoid the error, update the `fsspec` installation with `pip install -U fsspec`.\r\n\r\nafter I run `pip install -U fsspec`\r\n\r\nit occurs a new error:\r\n```\r\nERROR: 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 conflict\r\ns.\r\ndatasets 2.14.5 requires fsspec[http]<2023.9.0,>=2023.1.0, but you have fsspec 2023.9.2 which is incompatible.\r\n\r\n```",
"The `fsspec<2023.9.0` upper bound will be removed in the next release. The `ResourceError` fix is also present in version 2023.6.0, so use that version in the meantime (`pip install fsspec==2023.6.0`).",
"> The `fsspec<2023.9.0` upper bound will be removed in the next release. The `ResourceError` fix is also present in version 2023.6.0, so use that version in the meantime (`pip install fsspec==2023.6.0`).\r\n\r\nthanks for reply!"
] | 2023-10-17T08:08:54
| 2023-10-25T17:09:22
| 2023-10-25T17:09:22
|
NONE
| null | null | null | null |
### Describe the bug
just run import:
`from datasets import load_dataset`
and then:
```
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\__init__.py", line 22, in <module>
from .arrow_dataset import Dataset
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_dataset.py", line 66, in <module>
from .arrow_reader import ArrowReader
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_reader.py", line 30, in <module>
from .download.download_config import DownloadConfig
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\__init__.py", line 10, in <module>
from .streaming_download_manager import StreamingDownloadManager
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\streaming_download_manager.py", line 21, in <module>
from ..filesystems import COMPRESSION_FILESYSTEMS
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\filesystems\__init__.py", line 8, in <module>
import fsspec.asyn
File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\fsspec\asyn.py", line 157, in <module>
ResourceEror = resource.error
AttributeError: module 'resource' has no attribute 'error'
Process finished with exit code 1
```
and the error codes are:
```
try:
import resource
except ImportError:
resource = None
ResourceError = OSError
else:
ResourceEror = resource.error
```
1. miss spelling : "ResourceEror " should be "ResourceErorr"
2. module 'resource' has no attribute 'error'
### Steps to reproduce the bug
only one step:
`from datasets import load_dataset`
### Expected behavior
slove error: module 'resource' has no attribute 'error'
### Environment info
python=3.10
datasets==2.14.5
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6308/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6308/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 8 days, 9:00:28
|
https://api.github.com/repos/huggingface/datasets/issues/6306
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6306/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6306/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6306/events
|
https://github.com/huggingface/datasets/issues/6306
| 1,946,363,452
|
I_kwDODunzps50AyY8
| 6,306
|
pyinstaller : OSError: could not get source code
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/57702070?v=4",
"events_url": "https://api.github.com/users/dusk877647949/events{/privacy}",
"followers_url": "https://api.github.com/users/dusk877647949/followers",
"following_url": "https://api.github.com/users/dusk877647949/following{/other_user}",
"gists_url": "https://api.github.com/users/dusk877647949/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dusk877647949",
"id": 57702070,
"login": "dusk877647949",
"node_id": "MDQ6VXNlcjU3NzAyMDcw",
"organizations_url": "https://api.github.com/users/dusk877647949/orgs",
"received_events_url": "https://api.github.com/users/dusk877647949/received_events",
"repos_url": "https://api.github.com/users/dusk877647949/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dusk877647949/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dusk877647949/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dusk877647949",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"more information:\r\n``` \r\nFile \"text2vec\\__init__.py\", line 8, in <module>\r\nFile \"<frozen importlib._bootstrap>\", line 1027, in _find_and_load\r\nFile \"<frozen importlib._bootstrap>\", line 1006, in _find_and_load_unlocked\r\nFile \"<frozen importlib._bootstrap>\", line 688, in _load_unlocked\r\nFile \"PyInstaller\\loader\\pyimod02_importers.py\", line 499, in exec_module\r\nFile \"text2vec\\bertmatching_model.py\", line 19, in <module>\r\nFile \"<frozen importlib._bootstrap>\", line 1027, in _find_and_load\r\nFile \"<frozen importlib._bootstrap>\", line 1006, in _find_and_load_unlocked\r\nFile \"<frozen importlib._bootstrap>\", line 688, in _load_unlocked\r\nFile \"PyInstaller\\loader\\pyimod02_importers.py\", line 499, in exec_module\r\nFile \"text2vec\\bertmatching_dataset.py\", line 7, in <module>\r\nFile \"<frozen importlib._bootstrap>\", line 1027, in _find_and_load\r\nFile \"<frozen importlib._bootstrap>\", line 1006, in _find_and_load_unlocked\r\nFile \"<frozen importlib._bootstrap>\", line 688, in _load_unlocked\r\nFile \"PyInstaller\\loader\\pyimod02_importers.py\", line 499, in exec_module\r\nFile \"datasets\\__init__.py\", line 52, in <module>\r\nFile \"<frozen importlib._bootstrap>\", line 1027, in _find_and_load\r\nFile \"<frozen importlib._bootstrap>\", line 1006, in _find_and_load_unlocked\r\nFile \"<frozen importlib._bootstrap>\", line 688, in _load_unlocked\r\nFile \"PyInstaller\\loader\\pyimod02_importers.py\", line 499, in exec_module\r\nFile \"datasets\\inspect.py\", line 30, in <module>\r\nFile \"<frozen importlib._bootstrap>\", line 1027, in _find_and_load\r\nFile \"<frozen importlib._bootstrap>\", line 1006, in _find_and_load_unlocked\r\nFile \"<frozen importlib._bootstrap>\", line 688, in _load_unlocked\r\nFile \"PyInstaller\\loader\\pyimod02_importers.py\", line 499, in exec_module\r\nFile \"datasets\\load.py\", line 58, in <module>\r\nFile \"<frozen importlib._bootstrap>\", line 1027, in _find_and_load\r\nFile \"<frozen importlib._bootstrap>\", line 1006, in _find_and_load_unlocked\r\nFile \"<frozen importlib._bootstrap>\", line 688, in _load_unlocked\r\nFile \"PyInstaller\\loader\\pyimod02_importers.py\", line 499, in exec_module\r\nFile \"datasets\\packaged_modules\\__init__.py\", line 31, in <module>\r\nFile \"inspect.py\", line 1147, in getsource\r\nFile \"inspect.py\", line 1129, in getsourcelines\r\nFile \"inspect.py\", line 958, in findsource\r\nOSError: could not get source code\r\n```\r\n",
"Can you share a reproducer? I haven't been able to reproduce the error myself.",
"> '\r\n\r\nthanks,I solve it.it's about pyinstaller.",
"1",
"> > '\r\n> \r\n> thanks,I solve it.it's about pyinstaller.\r\n\r\nI encountered the same error, how to solve it?"
] | 2023-10-17T01:41:51
| 2023-11-02T07:24:51
| 2023-10-18T14:03:42
|
NONE
| null | null | null | null |
### Describe the bug
I ran a package with pyinstaller and got the following error:
### Steps to reproduce the bug
```
...
File "datasets\__init__.py", line 52, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\inspect.py", line 30, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\load.py", line 58, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "datasets\packaged_modules\__init__.py", line 31, in <module>
File "inspect.py", line 1147, in getsource
File "inspect.py", line 1129, in getsourcelines
File "inspect.py", line 958, in findsource
OSError: could not get source code
```
### Expected behavior
I have looked up the relevant information, but I can't find a suitable reason
### Environment info
```python
python 3.10
datasets 2.14.4
pyinstaller 5.6.2
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/57702070?v=4",
"events_url": "https://api.github.com/users/dusk877647949/events{/privacy}",
"followers_url": "https://api.github.com/users/dusk877647949/followers",
"following_url": "https://api.github.com/users/dusk877647949/following{/other_user}",
"gists_url": "https://api.github.com/users/dusk877647949/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dusk877647949",
"id": 57702070,
"login": "dusk877647949",
"node_id": "MDQ6VXNlcjU3NzAyMDcw",
"organizations_url": "https://api.github.com/users/dusk877647949/orgs",
"received_events_url": "https://api.github.com/users/dusk877647949/received_events",
"repos_url": "https://api.github.com/users/dusk877647949/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dusk877647949/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dusk877647949/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dusk877647949",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6306/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6306/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 1 day, 12:21:51
|
https://api.github.com/repos/huggingface/datasets/issues/6305
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6305/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6305/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6305/events
|
https://github.com/huggingface/datasets/issues/6305
| 1,946,010,912
|
I_kwDODunzps5z_cUg
| 6,305
|
Cannot load dataset with `2.14.5`: `FileNotFound` error
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/167943?v=4",
"events_url": "https://api.github.com/users/finiteautomata/events{/privacy}",
"followers_url": "https://api.github.com/users/finiteautomata/followers",
"following_url": "https://api.github.com/users/finiteautomata/following{/other_user}",
"gists_url": "https://api.github.com/users/finiteautomata/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/finiteautomata",
"id": 167943,
"login": "finiteautomata",
"node_id": "MDQ6VXNlcjE2Nzk0Mw==",
"organizations_url": "https://api.github.com/users/finiteautomata/orgs",
"received_events_url": "https://api.github.com/users/finiteautomata/received_events",
"repos_url": "https://api.github.com/users/finiteautomata/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/finiteautomata/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/finiteautomata/subscriptions",
"type": "User",
"url": "https://api.github.com/users/finiteautomata",
"user_view_type": "public"
}
|
[] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
] |
[
"Thanks for reporting, @finiteautomata.\r\n\r\nWe are investigating it. ",
"There is a bug in `datasets`. You can see our proposed fix:\r\n- #6309 "
] | 2023-10-16T20:11:27
| 2023-10-18T13:50:36
| 2023-10-18T13:50:36
|
NONE
| null | null | null | null |
### Describe the bug
I'm trying to load [piuba-bigdata/articles_and_comments] and I'm stumbling with this error on `2.14.5`. However, this works on `2.10.0`.
### Steps to reproduce the bug
[Colab link](https://colab.research.google.com/drive/1SAftFMQnFE708ikRnJJHIXZV7R5IBOCE#scrollTo=r2R2ipCCDmsg)
```python
Downloading readme: 100%
1.19k/1.19k [00:00<00:00, 30.9kB/s]
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
[<ipython-input-2-807c3583d297>](https://localhost:8080/#) in <cell line: 3>()
1 from datasets import load_dataset
2
----> 3 load_dataset("piuba-bigdata/articles_and_comments", split="train")
2 frames
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2127
2128 # Create a dataset builder
-> 2129 builder_instance = load_dataset_builder(
2130 path=path,
2131 name=name,
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, token, use_auth_token, storage_options, **config_kwargs)
1813 download_config = download_config.copy() if download_config else DownloadConfig()
1814 download_config.storage_options.update(storage_options)
-> 1815 dataset_module = dataset_module_factory(
1816 path,
1817 revision=revision,
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1506 raise e1 from None
1507 if isinstance(e1, FileNotFoundError):
-> 1508 raise FileNotFoundError(
1509 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. "
1510 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}"
FileNotFoundError: Couldn't find a dataset script at /content/piuba-bigdata/articles_and_comments/articles_and_comments.py or any data file in the same directory. Couldn't find 'piuba-bigdata/articles_and_comments' on the Hugging Face Hub either: FileNotFoundError: No (supported) data files or dataset script found in piuba-bigdata/articles_and_comments.
```
### Expected behavior
It should load normally.
### Environment info
```
- `datasets` version: 2.14.5
- Platform: Linux-5.15.120+-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.18.0
- PyArrow version: 9.0.0
- Pandas version: 1.5.3
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6305/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6305/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 1 day, 17:39:09
|
https://api.github.com/repos/huggingface/datasets/issues/6303
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6303/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6303/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6303/events
|
https://github.com/huggingface/datasets/issues/6303
| 1,943,466,532
|
I_kwDODunzps5z1vIk
| 6,303
|
Parquet uploads off-by-one naming scheme
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1981179?v=4",
"events_url": "https://api.github.com/users/ZachNagengast/events{/privacy}",
"followers_url": "https://api.github.com/users/ZachNagengast/followers",
"following_url": "https://api.github.com/users/ZachNagengast/following{/other_user}",
"gists_url": "https://api.github.com/users/ZachNagengast/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ZachNagengast",
"id": 1981179,
"login": "ZachNagengast",
"node_id": "MDQ6VXNlcjE5ODExNzk=",
"organizations_url": "https://api.github.com/users/ZachNagengast/orgs",
"received_events_url": "https://api.github.com/users/ZachNagengast/received_events",
"repos_url": "https://api.github.com/users/ZachNagengast/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ZachNagengast/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ZachNagengast/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ZachNagengast",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"You can find the reasoning behind this naming scheme [here](https://github.com/huggingface/transformers/pull/16343#discussion_r931182168).\r\n\r\nThis point has been raised several times, so I'd be okay with starting with `00001-` (also to be consistent with the `transformers` sharding), but I'm not sure @lhoestq agrees.",
"We start at 0 in `datasets` for consistency with Apache Spark, Apache Beam, Dask and others.\r\n\r\nAlso note `transformers` isn't a good reference on this topic. I talked with the maintainers when they added shards but it was already released this way. Though we found that there is a backward-compatible way in `transformers` to start at 0, but no request from `transformers` users to changes this AFAIK.",
"not sure it would be a good idea to break the consistency now, IMO",
"Makes sense to start at 0 for plenty of good reasons so I'm on board.\r\n\r\nWhat about the second part `-of-0000X`? With single commit PR #6269 just getting merged, there was a note about issues with 100+ file edits https://github.com/huggingface/datasets/pull/6269#issuecomment-1755428581.\r\n\r\nThat would be my last remaining concern in the context of the `push_to_hub(..., append=True)` work to be done, where appending a single file to the full dataset will require renaming every other existing file in the dataset. If it doesn't seem like a big issue for this work then all the better 👍"
] | 2023-10-14T18:31:03
| 2023-10-16T16:33:21
| null |
CONTRIBUTOR
| null | null | null | null |
### Describe the bug
I noticed this numbering scheme not matching up in a different project and wanted to raise it as an issue for discussion, what is the actual proper way to have these stored?
<img width="425" alt="image" src="https://github.com/huggingface/datasets/assets/1981179/3ffa2144-7c9a-446f-b521-a5e9db71e7ce">
The `-SSSSS-of-NNNNN` seems to be used widely across the codebase. The section that creates the part in my screenshot is here https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_dataset.py#L5287
There are also some edits to this section in the single commit branch.
### Steps to reproduce the bug
1. Upload a dataset that requires at least two parquet files in it
2. Observe the naming scheme
### Expected behavior
The couple options here are of course **1. keeping it as is**
**2. Starting the index at 1:**
train-00001-of-00002-{hash}.parquet
train-00002-of-00002-{hash}.parquet
**3. My preferred option** (which would solve my specific issue), dropping the total entirely:
train-00000-{hash}.parquet
train-00001-{hash}.parquet
This also solves an issue that will occur with an `append` variable for `push_to_hub` (see https://github.com/huggingface/datasets/issues/6290) where as you add a new parquet file, you need to rename everything in the repo as well.
However, I know there are parts of the repo that use 0 as the starting file or may require the total, so raising the question for discussion.
### Environment info
- `datasets` version: 2.14.6.dev0
- Platform: macOS-14.0-arm64-arm-64bit
- Python version: 3.10.12
- Huggingface_hub version: 0.18.0
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6303/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6303/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6302
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6302/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6302/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6302/events
|
https://github.com/huggingface/datasets/issues/6302
| 1,942,096,078
|
I_kwDODunzps5zwgjO
| 6,302
|
ArrowWriter/ParquetWriter `write` method does not increase `_num_bytes` and hence datasets not sharding at `max_shard_size`
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2855550?v=4",
"events_url": "https://api.github.com/users/Rassibassi/events{/privacy}",
"followers_url": "https://api.github.com/users/Rassibassi/followers",
"following_url": "https://api.github.com/users/Rassibassi/following{/other_user}",
"gists_url": "https://api.github.com/users/Rassibassi/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Rassibassi",
"id": 2855550,
"login": "Rassibassi",
"node_id": "MDQ6VXNlcjI4NTU1NTA=",
"organizations_url": "https://api.github.com/users/Rassibassi/orgs",
"received_events_url": "https://api.github.com/users/Rassibassi/received_events",
"repos_url": "https://api.github.com/users/Rassibassi/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Rassibassi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Rassibassi/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Rassibassi",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"`writer._num_bytes` is updated every `writer_batch_size`-th call to the `write` method (default `writer_batch_size` is 1000 (examples)). You should be able to see the update by passing a smaller `writer_batch_size` to the `load_dataset_builder`.\r\n\r\nWe could improve this by supporting the string `writer_batch_size` version as we do with `max_shard_size`, and capping `writer_batch_size` to `max_shard_size` in scenarios where the default `writer_batch_size` > `max_shard_size`. ",
"Thanks, reducing `writer_batch_size` solved my problem :)"
] | 2023-10-13T14:43:36
| 2023-10-17T06:52:12
| 2023-10-17T06:52:11
|
NONE
| null | null | null | null |
### Describe the bug
An example from [1], does not work when limiting shards with `max_shard_size`.
Try the following example with low `max_shard_size`, such as:
```python
builder.download_and_prepare(output_dir, storage_options=storage_options, file_format="parquet", max_shard_size="10MB")
```
The reason for this is that, in line [2] `writer._num_bytes > max_shard_size` is never true, because the `write` method of `ArrowWriter` [3] does not increase `self._num_bytes`.
Such that respective Arrow/Parquet shards are only written to file based on the `writer_batch_size` or `config.DEFAULT_MAX_BATCH_SIZE`, but not based on `max_shard_size`.
[1] https://huggingface.co/docs/datasets/filesystems#download-and-prepare-a-dataset-into-a-cloud-storage
[2] https://github.com/huggingface/datasets/blob/3e8d420808718c9a1453a2e7ee3484ca12c9c70d/src/datasets/builder.py#L1677
[3] https://github.com/huggingface/datasets/blob/3e8d420808718c9a1453a2e7ee3484ca12c9c70d/src/datasets/arrow_writer.py#L459
### Steps to reproduce the bug
Get example from: https://huggingface.co/docs/datasets/filesystems#download-and-prepare-a-dataset-into-a-cloud-storage
Call `builder.download_and_prepare` with low `max_shard_size` such as `10MB`, e.g.:
```python
builder.download_and_prepare(output_dir, storage_options=storage_options, file_format="parquet", max_shard_size="10MB")
```
### Expected behavior
Shards should be written based on `max_shard_size` instead of batch size.
### Environment info
```
>>> import datasets
>>> datasets.__version__
'2.14.6.dev0
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2855550?v=4",
"events_url": "https://api.github.com/users/Rassibassi/events{/privacy}",
"followers_url": "https://api.github.com/users/Rassibassi/followers",
"following_url": "https://api.github.com/users/Rassibassi/following{/other_user}",
"gists_url": "https://api.github.com/users/Rassibassi/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Rassibassi",
"id": 2855550,
"login": "Rassibassi",
"node_id": "MDQ6VXNlcjI4NTU1NTA=",
"organizations_url": "https://api.github.com/users/Rassibassi/orgs",
"received_events_url": "https://api.github.com/users/Rassibassi/received_events",
"repos_url": "https://api.github.com/users/Rassibassi/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Rassibassi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Rassibassi/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Rassibassi",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6302/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6302/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 3 days, 16:08:35
|
https://api.github.com/repos/huggingface/datasets/issues/6299
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6299/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6299/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6299/events
|
https://github.com/huggingface/datasets/issues/6299
| 1,939,649,238
|
I_kwDODunzps5znLLW
| 6,299
|
Support for newer versions of JAX
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/25456859?v=4",
"events_url": "https://api.github.com/users/ddrous/events{/privacy}",
"followers_url": "https://api.github.com/users/ddrous/followers",
"following_url": "https://api.github.com/users/ddrous/following{/other_user}",
"gists_url": "https://api.github.com/users/ddrous/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ddrous",
"id": 25456859,
"login": "ddrous",
"node_id": "MDQ6VXNlcjI1NDU2ODU5",
"organizations_url": "https://api.github.com/users/ddrous/orgs",
"received_events_url": "https://api.github.com/users/ddrous/received_events",
"repos_url": "https://api.github.com/users/ddrous/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ddrous/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ddrous/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ddrous",
"user_view_type": "public"
}
|
[
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
closed
| false
| null |
[] |
[] | 2023-10-12T10:03:46
| 2023-10-12T16:28:59
| 2023-10-12T16:28:59
|
NONE
| null | null | null | null |
### Feature request
Hi,
I like your idea of adapting the datasets library to be usable with JAX. Thank you for that.
However, in your [setup.py](https://github.com/huggingface/datasets/blob/main/setup.py), you enforce old versions of JAX <= 0.3... It is very cumbersome !
What is the rationale for such a limitation ? Can you remove it please ?
Thanks,
### Motivation
This library is unusable with new versions of JAX ?
### Your contribution
Yes.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6299/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6299/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 6:25:13
|
https://api.github.com/repos/huggingface/datasets/issues/6294
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6294/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6294/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6294/events
|
https://github.com/huggingface/datasets/issues/6294
| 1,937,359,605
|
I_kwDODunzps5zecL1
| 6,294
|
IndexError: Invalid key is out of bounds for size 0 despite having a populated dataset
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/61892155?v=4",
"events_url": "https://api.github.com/users/ZYM66/events{/privacy}",
"followers_url": "https://api.github.com/users/ZYM66/followers",
"following_url": "https://api.github.com/users/ZYM66/following{/other_user}",
"gists_url": "https://api.github.com/users/ZYM66/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ZYM66",
"id": 61892155,
"login": "ZYM66",
"node_id": "MDQ6VXNlcjYxODkyMTU1",
"organizations_url": "https://api.github.com/users/ZYM66/orgs",
"received_events_url": "https://api.github.com/users/ZYM66/received_events",
"repos_url": "https://api.github.com/users/ZYM66/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ZYM66/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ZYM66/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ZYM66",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"It looks to be the same issue as the one reported in https://discuss.huggingface.co/t/indexerror-invalid-key-16-is-out-of-bounds-for-size-0.\r\n\r\nCan you check the length of `train_dataset` before the `train_sampler = self._get_train_sampler()` (and after `_remove_unused_columns`) line?"
] | 2023-10-11T09:59:38
| 2023-10-17T11:24:06
| 2023-10-17T11:24:06
|
NONE
| null | null | null | null |
### Describe the bug
I am encountering an `IndexError` when trying to access data from a DataLoader which wraps around a dataset I've loaded using the `datasets` library. The error suggests that the dataset size is `0`, but when I check the length and print the dataset, it's clear that it has `1166` entries.
### Steps to reproduce the bug
1. Load a dataset with `1166` entries.
2. Create a DataLoader using this dataset.
3. Try iterating over the DataLoader.
code:
```python
def get_train_dataloader(self) -> DataLoader:
if self.train_dataset is None:
raise ValueError("Trainer: training requires a train_dataset.")
train_dataset = self.train_dataset
data_collator = self.data_collator
print(len(train_dataset))
print(train_dataset)
if is_datasets_available() and isinstance(train_dataset, datasets.Dataset):
train_dataset = self._remove_unused_columns(train_dataset, description="training")
else:
data_collator = self._get_collator_with_removed_columns(data_collator, description="training")
train_sampler = self._get_train_sampler()
dl = DataLoader(
train_dataset,
batch_size=self._train_batch_size,
sampler=train_sampler,
collate_fn=data_collator,
drop_last=self.args.dataloader_drop_last,
num_workers=self.args.dataloader_num_workers,
pin_memory=self.args.dataloader_pin_memory,
worker_init_fn=seed_worker,
)
print(dl)
print(len(dl))
for i in dl:
print(i)
break
return dl
```
output :
```
1166
Dataset({
features: ['input_ids', 'special_tokens_mask'],
num_rows: 1166
})
<torch.utils.data.dataloader.DataLoader object ...>
146
```
Error:
```
Traceback (most recent call last):
File "/home/dl/zym/llamaJP/TestUseContinuePretrainLlama.py", line 266, in <module>
train()
File "/home/dl/zym/llamaJP/TestUseContinuePretrainLlama.py", line 260, in train
trainer.train()
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/transformers/trainer.py", line 1506, in train
return inner_training_loop(
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/transformers/trainer.py", line 1520, in _inner_training_loop
train_dataloader = self.get_train_dataloader()
File "/home/dl/zym/llamaJP/TestUseContinuePretrainLlama.py", line 80, in get_train_dataloader
for i in dl:
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 630, in __next__
data = self._next_data()
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 674, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = self.dataset.__getitems__(possibly_batched_index)
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2807, in __getitems__
batch = self.__getitem__(keys)
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2803, in __getitem__
return self._getitem(key)
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2787, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 583, in query_table
_check_valid_index_key(key, size)
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 536, in _check_valid_index_key
_check_valid_index_key(int(max(key)), size=size)
File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 526, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 1116 is out of bounds for size 0
```
### Expected behavior
I expect to be able to iterate over the DataLoader without encountering an IndexError since the dataset is populated.
### Environment info
- `datasets` library version: [2.14.5]
- Platform: [Linux]
- Python version: 3.10
- Other libraries involved: HuggingFace Transformers
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/61892155?v=4",
"events_url": "https://api.github.com/users/ZYM66/events{/privacy}",
"followers_url": "https://api.github.com/users/ZYM66/followers",
"following_url": "https://api.github.com/users/ZYM66/following{/other_user}",
"gists_url": "https://api.github.com/users/ZYM66/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ZYM66",
"id": 61892155,
"login": "ZYM66",
"node_id": "MDQ6VXNlcjYxODkyMTU1",
"organizations_url": "https://api.github.com/users/ZYM66/orgs",
"received_events_url": "https://api.github.com/users/ZYM66/received_events",
"repos_url": "https://api.github.com/users/ZYM66/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ZYM66/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ZYM66/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ZYM66",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6294/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6294/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 6 days, 1:24:28
|
https://api.github.com/repos/huggingface/datasets/issues/6293
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6293/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6293/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6293/events
|
https://github.com/huggingface/datasets/issues/6293
| 1,937,238,047
|
I_kwDODunzps5zd-gf
| 6,293
|
Choose columns to stream parquet data in streaming mode
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lhoestq",
"id": 42851186,
"login": "lhoestq",
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lhoestq",
"user_view_type": "public"
}
|
[
{
"color": "d73a4a",
"default": true,
"description": "Something isn't working",
"id": 1935892857,
"name": "bug",
"node_id": "MDU6TGFiZWwxOTM1ODkyODU3",
"url": "https://api.github.com/repos/huggingface/datasets/labels/bug"
}
] |
closed
| false
| null |
[] |
[] | 2023-10-11T08:59:36
| 2023-10-11T16:21:38
| 2023-10-11T16:21:38
|
MEMBER
| null | null | null | null |
Currently passing columns= to load_dataset in streaming mode fails
```
Tried to load parquet data with columns '['link']' with mismatching features '{'caption': Value(dtype='string', id=None), 'image': {'bytes': Value(dtype='binary', id=None), 'path': Value(dtype='null', id=None)}, 'link': Value(dtype='string', id=None), 'message_id': Value(dtype='string', id=None), 'timestamp': Value(dtype='string', id=None)}'
```
similar to https://github.com/huggingface/datasets/issues/6039
reported at https://huggingface.co/datasets/laion/dalle-3-dataset/discussions/3#65259a09617407d4520f4ad9
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lhoestq",
"id": 42851186,
"login": "lhoestq",
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lhoestq",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6293/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6293/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 7:22:02
|
https://api.github.com/repos/huggingface/datasets/issues/6292
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6292/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6292/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6292/events
|
https://github.com/huggingface/datasets/issues/6292
| 1,937,050,470
|
I_kwDODunzps5zdQtm
| 6,292
|
how to load the image of dtype float32 or float64
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/26437644?v=4",
"events_url": "https://api.github.com/users/wanglaofei/events{/privacy}",
"followers_url": "https://api.github.com/users/wanglaofei/followers",
"following_url": "https://api.github.com/users/wanglaofei/following{/other_user}",
"gists_url": "https://api.github.com/users/wanglaofei/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/wanglaofei",
"id": 26437644,
"login": "wanglaofei",
"node_id": "MDQ6VXNlcjI2NDM3NjQ0",
"organizations_url": "https://api.github.com/users/wanglaofei/orgs",
"received_events_url": "https://api.github.com/users/wanglaofei/received_events",
"repos_url": "https://api.github.com/users/wanglaofei/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/wanglaofei/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wanglaofei/subscriptions",
"type": "User",
"url": "https://api.github.com/users/wanglaofei",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"Hi! Can you provide a code that reproduces the issue?\r\n\r\nAlso, which version of `datasets` are you using? You can check this by running `python -c \"import datasets; print(datasets.__version__)\"` inside the env. We added support for \"float images\" in `datasets 2.9`."
] | 2023-10-11T07:27:16
| 2023-10-11T13:19:11
| null |
NONE
| null | null | null | null |
_FEATURES = datasets.Features(
{
"image": datasets.Image(),
"text": datasets.Value("string"),
},
)
The datasets builder seems only support the unit8 data. How to load the float dtype data?
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6292/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6292/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6291
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6291/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6291/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6291/events
|
https://github.com/huggingface/datasets/issues/6291
| 1,936,129,871
|
I_kwDODunzps5zZv9P
| 6,291
|
Casting type from Array2D int to Array2D float crashes
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/22567306?v=4",
"events_url": "https://api.github.com/users/AlanBlanchet/events{/privacy}",
"followers_url": "https://api.github.com/users/AlanBlanchet/followers",
"following_url": "https://api.github.com/users/AlanBlanchet/following{/other_user}",
"gists_url": "https://api.github.com/users/AlanBlanchet/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/AlanBlanchet",
"id": 22567306,
"login": "AlanBlanchet",
"node_id": "MDQ6VXNlcjIyNTY3MzA2",
"organizations_url": "https://api.github.com/users/AlanBlanchet/orgs",
"received_events_url": "https://api.github.com/users/AlanBlanchet/received_events",
"repos_url": "https://api.github.com/users/AlanBlanchet/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/AlanBlanchet/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AlanBlanchet/subscriptions",
"type": "User",
"url": "https://api.github.com/users/AlanBlanchet",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"Thanks for reporting! I've opened a PR with a fix"
] | 2023-10-10T20:10:10
| 2023-10-13T13:45:31
| 2023-10-13T13:45:31
|
NONE
| null | null | null | null |
### Describe the bug
I am on a school project and the initial type for feature annotations are `Array2D(shape=(None, 4))`. I am trying to cast this type to a `float64` and pyarrow gives me this error :
```
Traceback (most recent call last):
File "/home/alan/dev/ClassezDesImagesAvecDesAlgorithmesDeDeeplearning/src/sdd/data/dataset.py", line 141, in <module>
dataset = StanfordDogsDataset(size, 5).original(True).demo()
File "<attrs generated init __main__.StanfordDogsDataset>", line 4, in __init__
File "/home/alan/dev/ClassezDesImagesAvecDesAlgorithmesDeDeeplearning/src/sdd/data/dataset.py", line 33, in __attrs_post_init__
self.dataset = self.dataset.cast_column(
File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/fingerprint.py", line 511, in wrapper
out = func(dataset, *args, **kwargs)
File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2110, in cast_column
return self.cast(features)
File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2055, in cast
dataset = dataset.map(
File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 592, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 557, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3097, in map
for rank, done, content in Dataset._map_single(**dataset_kwargs):
File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3474, in _map_single
batch = apply_function_on_filtered_inputs(
File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3353, in apply_function_on_filtered_inputs
processed_inputs = function(*fn_args, *additional_args, **fn_kwargs)
File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/table.py", line 2328, in table_cast
return cast_table_to_schema(table, schema)
File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/table.py", line 2287, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/table.py", line 2287, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1831, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1831, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/table.py", line 2143, in cast_array_to_feature
return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)
File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper
return func(array, *args, **kwargs)
File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1967, in array_cast
return pa_type.wrap_array(array)
File "pyarrow/types.pxi", line 1369, in pyarrow.lib.BaseExtensionType.wrap_array
TypeError: Incompatible storage type for extension<arrow.py_extension_type<Array2DExtensionType>>: expected list<item: list<item: double>>, got list<item: list<item: int32>>
```
### Steps to reproduce the bug
```python
dataset = datasets.load_dataset("Alanox/stanford-dogs", split="full")
dataset = dataset.cast_column("annotations", Array2D((None, 4), "float64"))
```
### Expected behavior
It should simply cast the column feature type to a `float64` without error
### Environment info
datasets == 2.14.5
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6291/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6291/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 2 days, 17:35:21
|
https://api.github.com/repos/huggingface/datasets/issues/6290
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6290/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6290/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6290/events
|
https://github.com/huggingface/datasets/issues/6290
| 1,935,629,679
|
I_kwDODunzps5zX11v
| 6,290
|
Incremental dataset (e.g. `.push_to_hub(..., append=True)`)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/11801849?v=4",
"events_url": "https://api.github.com/users/Wauplin/events{/privacy}",
"followers_url": "https://api.github.com/users/Wauplin/followers",
"following_url": "https://api.github.com/users/Wauplin/following{/other_user}",
"gists_url": "https://api.github.com/users/Wauplin/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Wauplin",
"id": 11801849,
"login": "Wauplin",
"node_id": "MDQ6VXNlcjExODAxODQ5",
"organizations_url": "https://api.github.com/users/Wauplin/orgs",
"received_events_url": "https://api.github.com/users/Wauplin/received_events",
"repos_url": "https://api.github.com/users/Wauplin/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Wauplin/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Wauplin/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Wauplin",
"user_view_type": "public"
}
|
[
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
open
| false
| null |
[] |
[
"Yea I think waiting for #6269 would be best, or branching from it. For reference, this [PR](https://github.com/LAION-AI/Discord-Scrapers/pull/2) is progressing pretty well which will do similar using the hf hub for our LAION dataset bot https://github.com/LAION-AI/Discord-Scrapers/pull/2. ",
"Is there any update on this?",
"Is there any update on this?",
"No update so far on this feature request but for broader context, this announce will help with incremental datasets https://huggingface.co/blog/xethub-joins-hf :)",
"Still no update? Whats the current recommended way to upload large datasets to the hub? I can't load it all to memory after some limit right",
"> Still no update? Whats the current recommended way to upload large datasets to the hub? I can't load it all to memory after some limit right\n\n@tolgadur bro, you may set 'data_dir' as a temporary solution like that:\n\n`Dataset.push_to_hub('your_repo_aame', data_dir='data_{index}')`\n",
"Related to this feature request: `pyarrow` 21 is out and added content defined chunking for parquet, which enables deduped uploads to Xet.\n\nTherefore we can have a logic in append=True that modifies an existing Parquet file to add more rows without having to reupload the full file."
] | 2023-10-10T15:18:03
| 2025-08-13T12:55:28
| null |
CONTRIBUTOR
| null | null | null | null |
### Feature request
Have the possibility to do `ds.push_to_hub(..., append=True)`.
### Motivation
Requested in this [comment](https://huggingface.co/datasets/laion/dalle-3-dataset/discussions/3#65252597c4edc168202a5eaa) and
this [comment](https://huggingface.co/datasets/laion/dalle-3-dataset/discussions/4#6524f675c9607bdffb208d8f). Discussed internally on [slack](https://huggingface.slack.com/archives/C02EMARJ65P/p1696950642610639?thread_ts=1690554266.830949&cid=C02EMARJ65P).
### Your contribution
What I suggest to do for parquet datasets is to use `CommitOperationCopy` + `CommitOperationDelete` from `huggingface_hub`:
1. list files
2. copy files from parquet-0001-of-0004 to parquet-0001-of-0005
3. delete files like parquet-0001-of-0004
4. generate + add last parquet file parquet-0005-of-0005
=> make a single commit with all commit operations at once
I think it should be quite straightforward to implement. Happy to review a PR (maybe conflicting with the ongoing "1 commit push_to_hub" PR https://github.com/huggingface/datasets/pull/6269)
| null |
{
"+1": 11,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 11,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6290/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6290/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6288
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6288/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6288/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6288/events
|
https://github.com/huggingface/datasets/issues/6288
| 1,935,005,457
|
I_kwDODunzps5zVdcR
| 6,288
|
Dataset.from_pandas with a DataFrame of PIL.Images
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lhoestq",
"id": 42851186,
"login": "lhoestq",
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lhoestq",
"user_view_type": "public"
}
|
[
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
open
| false
| null |
[] |
[
"A duplicate of https://github.com/huggingface/datasets/issues/4796.\r\n\r\nWe could get this for free by implementing the `Image` feature as an extension type, as shown in [this](https://colab.research.google.com/drive/1Uzm_tXVpGTwbzleDConWcNjacwO1yxE4?usp=sharing) Colab (example with UUIDs).\r\n",
"+1 to this\r\nCalling this line with a df that contains a PIL image (as they are returned from load_dataset)\r\n`ds = Dataset.from_pandas(df)`\r\nResults in this error:\r\n`ArrowInvalid: ('Could not convert <PIL.PngImagePlugin.PngImageFile image mode=RGB size=1024x1024 at 0x2B41F2D70> with type PngImageFile: did not recognize Python value type when inferring an Arrow data type', 'Conversion failed for column image with type object')`",
"I found something that can be used as solution.\r\n\r\nI have the same problem when I've try to load the images from a pamdas dataset\r\n\r\nIf you have all on a pandas dataset try \r\nDataset.from_dict( your_df.reset_index(drop=True).to_dict(orient='list'), split=set_your_split)\r\n\r\nAnd this avoid the error"
] | 2023-10-10T10:29:16
| 2024-11-29T16:35:30
| null |
MEMBER
| null | null | null | null |
Currently type inference doesn't know what to do with a Pandas Series of PIL.Image objects, though it would be nice to get a Dataset with the Image type this way
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6288/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6288/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6287
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6287/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6287/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6287/events
|
https://github.com/huggingface/datasets/issues/6287
| 1,932,758,192
|
I_kwDODunzps5zM4yw
| 6,287
|
map() not recognizing "text"
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5688359?v=4",
"events_url": "https://api.github.com/users/EngineerKhan/events{/privacy}",
"followers_url": "https://api.github.com/users/EngineerKhan/followers",
"following_url": "https://api.github.com/users/EngineerKhan/following{/other_user}",
"gists_url": "https://api.github.com/users/EngineerKhan/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/EngineerKhan",
"id": 5688359,
"login": "EngineerKhan",
"node_id": "MDQ6VXNlcjU2ODgzNTk=",
"organizations_url": "https://api.github.com/users/EngineerKhan/orgs",
"received_events_url": "https://api.github.com/users/EngineerKhan/received_events",
"repos_url": "https://api.github.com/users/EngineerKhan/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/EngineerKhan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/EngineerKhan/subscriptions",
"type": "User",
"url": "https://api.github.com/users/EngineerKhan",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"There is no \"text\" column in the `amazon_reviews_multi`, hence the `KeyError`. You can get the column names by running `dataset.column_names`."
] | 2023-10-09T10:27:30
| 2023-10-11T20:28:45
| 2023-10-11T20:28:45
|
NONE
| null | null | null | null |
### Describe the bug
The [map() documentation](https://huggingface.co/docs/datasets/v2.14.5/en/package_reference/main_classes#datasets.Dataset.map) reads:
`
ds = ds.map(lambda x: tokenizer(x['text'], truncation=True, padding=True), batched=True)`
I have been trying to reproduce it in my code as:
`tokenizedDataset = dataset.map(lambda x: tokenizer(x['text']), batched=True)`
But it doesn't work as it throws the error:
> KeyError: 'text'
Can you please guide me on how to fix it?
### Steps to reproduce the bug
1. `from datasets import load_dataset
dataset = load_dataset("amazon_reviews_multi")`
2. Then this code: `from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")`
3. The line I quoted above (which I have been trying)
### Expected behavior
As mentioned in the documentation, it should run without any error and map the tokenization on the whole dataset.
### Environment info
Python 3.10.2
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6287/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6287/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 2 days, 10:01:15
|
https://api.github.com/repos/huggingface/datasets/issues/6285
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6285/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6285/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6285/events
|
https://github.com/huggingface/datasets/issues/6285
| 1,932,306,325
|
I_kwDODunzps5zLKeV
| 6,285
|
TypeError: expected str, bytes or os.PathLike object, not dict
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/20493493?v=4",
"events_url": "https://api.github.com/users/andysingal/events{/privacy}",
"followers_url": "https://api.github.com/users/andysingal/followers",
"following_url": "https://api.github.com/users/andysingal/following{/other_user}",
"gists_url": "https://api.github.com/users/andysingal/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/andysingal",
"id": 20493493,
"login": "andysingal",
"node_id": "MDQ6VXNlcjIwNDkzNDkz",
"organizations_url": "https://api.github.com/users/andysingal/orgs",
"received_events_url": "https://api.github.com/users/andysingal/received_events",
"repos_url": "https://api.github.com/users/andysingal/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/andysingal/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andysingal/subscriptions",
"type": "User",
"url": "https://api.github.com/users/andysingal",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"You should be able to load the images by modifying the `load_dataset` call like this:\r\n```python\r\ndataset = load_dataset(\"imagefolder\", data_dir=\"/content/datasets/PotholeDetectionYOLOv8-1\")\r\n```\r\n\r\nThe `imagefolder` builder expects the image files to be in `path/label/image_file` (e.g. .`.../train/dog/image_1.jpg`), so the solution for the labels in your case is to create metadata files (one for each split; as explained [here](https://huggingface.co/docs/datasets/image_dataset#imagefolder)) that map the images to their labels.",
"> You should be able to load the images by modifying the `load_dataset` call like this:\r\n> \r\n> ```python\r\n> dataset = load_dataset(\"imagefolder\", data_dir=\"/content/datasets/PotholeDetectionYOLOv8-1\")\r\n> ```\r\n> \r\n> The `imagefolder` builder expects the image files to be in `path/label/image_file` (e.g. .`.../train/dog/image_1.jpg`), so the solution for the labels in your case is to create metadata files (one for each split; as explained [here](https://huggingface.co/docs/datasets/image_dataset#imagefolder)) that map the images to their labels.\r\n\r\nI tried like this but only uploads images and not labels, Andyrasika/potholes-dataset",
"As explained in my previous comment, you need to define metadata files to load the labels or update the paths to be in the format `train/label/image` (`train- image /n -labels` is not supported by the loader).",
"I downloaded my file after annotating using roboflow . It gives train-\r\nimages, labels , test- images, labels , valid- images, labels . I hope it\r\ngives you an idea of the dataset . Please advise on this dataset\r\n\r\nOn Tue, Oct 10, 2023 at 18:12 Mario Šaško ***@***.***> wrote:\r\n\r\n> As explained in my previous comment, you need to define metadata files to\r\n> load the labels or update the paths to be in the format train/label/image\r\n> (train- image /n -labels is not supported by the loader).\r\n>\r\n> —\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/huggingface/datasets/issues/6285#issuecomment-1755335215>,\r\n> or unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/AE4LJNN56FWWTSBYTSTUWHLX6U7CVAVCNFSM6AAAAAA5YHCSTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJVGMZTKMRRGU>\r\n> .\r\n> You are receiving this because you authored the thread.Message ID:\r\n> ***@***.***>\r\n>\r\n"
] | 2023-10-09T04:56:26
| 2023-10-10T13:17:33
| null |
NONE
| null | null | null | null |
### Describe the bug
my dataset is in form : train- image /n -labels
and tried the code:
```
from datasets import load_dataset
data_files = {
"train": "/content/datasets/PotholeDetectionYOLOv8-1/train/",
"validation": "/content/datasets/PotholeDetectionYOLOv8-1/valid/",
"test": "/content/datasets/PotholeDetectionYOLOv8-1/test/"
}
dataset = load_dataset("imagefolder", data_dir=data_files)
dataset
```
got error:
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
[<ipython-input-29-2ef1926f73d9>](https://localhost:8080/#) in <cell line: 8>()
6 "test": "/content/datasets/PotholeDetectionYOLOv8-1/test/"
7 }
----> 8 dataset = load_dataset("imagefolder", data_dir=data_files)
9 dataset
6 frames
[/usr/lib/python3.10/pathlib.py](https://localhost:8080/#) in _parse_args(cls, args)
576 parts += a._parts
577 else:
--> 578 a = os.fspath(a)
579 if isinstance(a, str):
580 # Force-cast str subclasses to str (issue #21127)
TypeError: expected str, bytes or os.PathLike object, not dict
```
### Steps to reproduce the bug
as share above
### Expected behavior
load images and labels , but my dataset only uploads images
- https://huggingface.co/datasets/Andyrasika/potholes-dataset
### Environment info
colab pro
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6285/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6285/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6284
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6284/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6284/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6284/events
|
https://github.com/huggingface/datasets/issues/6284
| 1,929,551,712
|
I_kwDODunzps5zAp9g
| 6,284
|
Add Belebele multiple-choice machine reading comprehension (MRC) dataset
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/64583161?v=4",
"events_url": "https://api.github.com/users/rajveer43/events{/privacy}",
"followers_url": "https://api.github.com/users/rajveer43/followers",
"following_url": "https://api.github.com/users/rajveer43/following{/other_user}",
"gists_url": "https://api.github.com/users/rajveer43/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rajveer43",
"id": 64583161,
"login": "rajveer43",
"node_id": "MDQ6VXNlcjY0NTgzMTYx",
"organizations_url": "https://api.github.com/users/rajveer43/orgs",
"received_events_url": "https://api.github.com/users/rajveer43/received_events",
"repos_url": "https://api.github.com/users/rajveer43/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rajveer43/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rajveer43/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rajveer43",
"user_view_type": "public"
}
|
[
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
closed
| false
| null |
[] |
[
"This dataset is already available on the Hub: https://huggingface.co/datasets/facebook/belebele.\r\n"
] | 2023-10-06T06:58:03
| 2023-10-06T13:26:51
| 2023-10-06T13:26:51
|
NONE
| null | null | null | null |
### Feature request
Belebele is a multiple-choice machine reading comprehension (MRC) dataset spanning 122 language variants. This dataset enables the evaluation of mono- and multi-lingual models in high-, medium-, and low-resource languages. Each question has four multiple-choice answers and is linked to a short passage from the [FLORES-200](https://github.com/facebookresearch/flores/tree/main/flores200) dataset. The human annotation procedure was carefully curated to create questions that discriminate between different levels of generalizable language comprehension and is reinforced by extensive quality checks. While all questions directly relate to the passage, the English dataset on its own proves difficult enough to challenge state-of-the-art language models. Being fully parallel, this dataset enables direct comparison of model performance across all languages. Belebele opens up new avenues for evaluating and analyzing the multilingual abilities of language models and NLP systems.
Please refer to paper for more details, [The Belebele Benchmark: a Parallel Reading Comprehension Dataset in 122 Language Variants](https://arxiv.org/abs/2308.16884).
## Composition
- 900 questions per language variant
- 488 distinct passages, there are 1-2 associated questions for each.
- For each question, there is 4 multiple-choice answers, exactly 1 of which is correct.
- 122 language/language variants (including English).
- 900 x 122 = 109,800 total questions.
### Motivation
official repo https://github.com/facebookresearch/belebele
### Your contribution
-
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 1,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6284/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6284/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 6:28:48
|
https://api.github.com/repos/huggingface/datasets/issues/6280
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6280/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6280/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6280/events
|
https://github.com/huggingface/datasets/issues/6280
| 1,928,215,278
|
I_kwDODunzps5y7jru
| 6,280
|
Couldn't cast array of type fixed_size_list to Sequence(Value(float64))
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1000442?v=4",
"events_url": "https://api.github.com/users/jmif/events{/privacy}",
"followers_url": "https://api.github.com/users/jmif/followers",
"following_url": "https://api.github.com/users/jmif/following{/other_user}",
"gists_url": "https://api.github.com/users/jmif/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jmif",
"id": 1000442,
"login": "jmif",
"node_id": "MDQ6VXNlcjEwMDA0NDI=",
"organizations_url": "https://api.github.com/users/jmif/orgs",
"received_events_url": "https://api.github.com/users/jmif/received_events",
"repos_url": "https://api.github.com/users/jmif/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jmif/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jmif/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jmif",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"Thanks for reporting! I've opened a PR with a fix.",
"Thanks for the quick response @mariosasko! I just installed your branch via `poetry add 'git+https://github.com/huggingface/datasets#fix-array_values'` and I can confirm it works on the example provided.\r\n\r\nFollow up question for you, should `None`s be supported in these types of features as they are in others?\r\n\r\nFor example, the following script:\r\n\r\n```\r\nfrom datasets import Features, Value, Sequence, ClassLabel, Dataset\r\n\r\ndataset_features = Features({\r\n 'text': Value('string'),\r\n 'embedding': Sequence(Value('double'), length=2),\r\n 'categories': Sequence(ClassLabel(names=sorted([\r\n 'one',\r\n 'two',\r\n 'three'\r\n ]))),\r\n})\r\n\r\ndataset = Dataset.from_dict(\r\n {\r\n 'text': ['A'] * 10000,\r\n \"embedding\": [None] * 10000, # THIS LINE CHANGED\r\n 'categories': [[0]] * 10000,\r\n },\r\n features=dataset_features\r\n)\r\n\r\ndef test_mapper(r):\r\n r['text'] = list(map(lambda t: t + ' b', r['text']))\r\n return r\r\n\r\n\r\ndataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2)\r\n```\r\n\r\nfails with\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py\", line 125, in worker\r\n result = (True, func(*args, **kwds))\r\n File \"/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py\", line 1354, in _write_generator_to_queue\r\n for i, result in enumerate(func(**kwargs)):\r\n File \"/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py\", line 3493, in _map_single\r\n writer.write_batch(batch)\r\n File \"/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_writer.py\", line 549, in write_batch\r\n array = cast_array_to_feature(col_values, col_type) if col_type is not None else col_values\r\n File \"/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py\", line 1831, in wrapper\r\n return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])\r\n File \"/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py\", line 1831, in <listcomp>\r\n return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])\r\n File \"/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py\", line 2160, in cast_array_to_feature\r\n raise TypeError(f\"Couldn't cast array of type\\n{array.type}\\nto\\n{feature}\")\r\nTypeError: Couldn't cast array of type\r\nfixed_size_list<item: double>[2]\r\nto\r\nSequence(feature=Value(dtype='float64', id=None), length=2, id=None)\r\n```\r\n\r\nIdeally we can have empty embedding columns as well!",
"This part of PyArrow is buggy and inconsistent regarding features implemented across the types, so the only option is to operate on the Arrow buffer level to fix issues such as the above one.",
"Ok - can you take the POC I did [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e)? Happy to turn this into an actual PR but would appreciate feedback on the implementation before I take another pass!"
] | 2023-10-05T12:48:31
| 2024-02-06T19:24:20
| 2024-02-06T19:24:20
|
NONE
| null | null | null | null |
### Describe the bug
I have a dataset with an embedding column, when I try to map that dataset I get the following exception:
```
Traceback (most recent call last):
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3189, in map
for rank, done, content in iflatmap_unordered(
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered
[async_result.get(timeout=0.05) for async_result in async_results]
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in <listcomp>
[async_result.get(timeout=0.05) for async_result in async_results]
File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 774, in get
raise self._value
TypeError: Couldn't cast array of type
fixed_size_list<item: float>[2]
to
Sequence(feature=Value(dtype='float32', id=None), length=2, id=None)
```
### Steps to reproduce the bug
Here's a simple repro script:
```
from datasets import Features, Value, Sequence, ClassLabel, Dataset
dataset_features = Features({
'text': Value('string'),
'embedding': Sequence(Value('double'), length=2),
'categories': Sequence(ClassLabel(names=sorted([
'one',
'two',
'three'
]))),
})
dataset = Dataset.from_dict(
{
'text': ['A'] * 10000,
'embedding': [[0.0, 0.1]] * 10000,
'categories': [[0]] * 10000,
},
features=dataset_features
)
def test_mapper(r):
r['text'] = list(map(lambda t: t + ' b', r['text']))
return r
dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2)
```
Removing the embedding column fixes the issue!
### Expected behavior
The mapping completes successfully.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-14.0-arm64-arm-64bit
- Python version: 3.10.12
- Huggingface_hub version: 0.17.1
- PyArrow version: 13.0.0
- Pandas version: 2.0.3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6280/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6280/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 124 days, 6:35:49
|
https://api.github.com/repos/huggingface/datasets/issues/6279
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6279/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6279/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6279/events
|
https://github.com/huggingface/datasets/issues/6279
| 1,928,028,226
|
I_kwDODunzps5y62BC
| 6,279
|
Batched IterableDataset
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7010688?v=4",
"events_url": "https://api.github.com/users/lneukom/events{/privacy}",
"followers_url": "https://api.github.com/users/lneukom/followers",
"following_url": "https://api.github.com/users/lneukom/following{/other_user}",
"gists_url": "https://api.github.com/users/lneukom/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lneukom",
"id": 7010688,
"login": "lneukom",
"node_id": "MDQ6VXNlcjcwMTA2ODg=",
"organizations_url": "https://api.github.com/users/lneukom/orgs",
"received_events_url": "https://api.github.com/users/lneukom/received_events",
"repos_url": "https://api.github.com/users/lneukom/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lneukom/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lneukom/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lneukom",
"user_view_type": "public"
}
|
[
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
open
| false
| null |
[] |
[
"This is exactly what I was looking for. It would also be very useful for me :-)",
"This issue is really smashing the selling point of HF datasets... The only workaround I've found so far is to create a customized IterableDataloader which improves the loading speed to some extent.\r\n\r\nFor example I've a HF dataset `dt_train` with `len(dt_train) == 1M`. Using plain DataLoader is extremely slow:\r\n```\r\n%%time\r\ndl_train = DataLoader(dt_train, batch_size=128, shuffle = True)\r\nfor batch in dl_train:\r\n pass\r\n``` \r\n\r\n```\r\nCPU times: user 24min 35s, sys: 704 ms, total: 24min 36s\r\nWall time: 24min 37s\r\n```\r\nAnd DataLoader works even worse with HF's iterable_dataset:\r\n```\r\n%%time\r\ndt_train_ = dt_train.with_format(None).to_iterable_dataset(num_shards=64).shuffle(buffer_size=10_000)\r\ndl_train = DataLoader(dt_train_, batch_size=128)\r\nfor batch in dl_train:\r\n pass\r\n```\r\n```\r\nCPU times: user 1h 6min 2s, sys: 4.28 s, total: 1h 6min 6s\r\nWall time: 1h 7min 53s\r\n```\r\nWorkaround by running a customized wrapper:\r\n```\r\n%%time\r\nfrom torch.utils.data import DataLoader, IterableDataset\r\n\r\nclass Dataset2Iterable(IterableDataset):\r\n \"\"\"\r\n Wrapper to use a HF dataset as pytorch IterableDataset to speed up data loading.\r\n \"\"\"\r\n def __init__(self, dataset, batch_size=1, shuffle=True):\r\n super(Dataset2Iterable).__init__()\r\n self.dataset = dataset\r\n self.batch_size = batch_size\r\n self.shuffle = shuffle\r\n\r\n def __iter__(self):\r\n if self.shuffle: self.dataset.shuffle()\r\n return self.dataset.iter(batch_size=self.batch_size)\r\n\r\ndl_train = DataLoader(Dataset2Iterable(dt_train, batch_size = 128), batch_size=1, num_workers=0)\r\nfor n in range(2):\r\n for batch in dl_train:\r\n pass\r\n```\r\nThe speed still is slower than using tensorflow's loader but improved a lot than previous code:\r\n```\r\nCPU times: user 4min 18s, sys: 0 ns, total: 4min 18s\r\nWall time: 4min 20s\r\n```\r\nNote that the way I implemented `Dataset2Iterable` will only work with `num_workers=0`.",
"I can confirm that @zhh210's solution works with `num_workers=0`. However, for my use case, this was still slower than tokenizing on the fly through a collator and leveraging multiple workers in the dataloder.\r\n\r\n@lhoestq I think this is an important use case (e.g., streaming from a large dataset, online or stored on disk). What do you think might be the best solution to move forward?",
"I guess it can be implemented using a batched`.map()` under the hood that returns a single item containing the input batch.\r\n\r\nIn the meantime you can use this:\r\n\r\n```python\r\ndef batch(unbatched: dict[str, list]) -> dict[str, list]:\r\n return {k: [v] for k, v in unbatched}\r\n\r\nbatched_dataset = dataset.map(batch, batched=True, batch_size=batch_size)\r\n```\r\n\r\nThough it would be great to have a `.batch()` method indeed, I'd be happy to help with anyone wants to open a PR",
"If no one else is planning to work on this, I can take it on. I'll wait until next week, and if no one has started a PR by then, I'll go ahead and open one.",
"It looks like the implementation of IterableDataset is still using a hardcoded batch size of 1. For example in line 2063 in [`/datsets/src/datasets/iterable_dataset.py`](https://github.com/huggingface/datasets/blob/3.0.2/src/datasets/iterable_dataset.py#L2063). Iterating over IterableDataset with large batch sizes therefore remains slow, even when using `batch()`. I guess then the data are not being read from one contiguous chunk of memory. Instead every example is retrieved one by one, leading to long dataloading times. As a minimal example: Load c4 dataset and iterate over it with a large batch size.\r\n```python\r\nimport datasets\r\nfrom timeit import default_timer as timer\r\nc4 = datasets.load_dataset(\"allenai/c4\", \"en\", streaming=True, split=\"train\")\r\nc4_batched = c4.batch(512**2) # use large batch size\r\niterator = iter(c4_batched)\r\nfor i in range(5):\r\n start_time=timer()\r\n next(iterator) # get next batch\r\n end_time = timer()\r\n print(f\"time for one batch: {end_time-start_time}\")\r\n```\r\nThis results in the following output for me:\r\ntime for one batch: 12.615376660600305\r\ntime for one batch: 13.011422813870013\r\ntime for one batch: 14.157325950451195\r\ntime for one batch: 14.225894245319068\r\ntime for one batch: 13.898222777992487\r\n\r\nBecause I want to use my IterableDataset with the pytorch dataloader I rewrote the `__iter_pytorch__` and the `__iter__` functions like so and am getting much faster dataloading times. I marked the lines I changed with \"# changed here\":\r\n\r\n```python\r\nfrom datasets.iterable_dataset import _convert_to_arrow\r\nfrom datasets.formatting import TensorFormatter, get_formatter\r\nfrom datasets.features.features import cast_to_python_objects\r\nimport sys\r\nimport fsspec.asyn\r\nfrom itertools import islice\r\nfrom datasets.utils.logging import get_logger\r\nfrom datasets.iterable_dataset import _examples_to_batch, _apply_feature_types_on_batch, _apply_feature_types_on_example\r\n\r\nlogger = get_logger(__name__)\r\n\r\ndef __iter__(self):\r\n if \"torch\" in sys.modules:\r\n import torch.utils.data\r\n\r\n worker_info = torch.utils.data.get_worker_info()\r\n if isinstance(self, torch.utils.data.IterableDataset) and worker_info is not None:\r\n # We're a torch.utils.data.IterableDataset in a PyTorch worker process\r\n yield from self._iter_pytorch()\r\n return\r\n\r\n ex_iterable = self._prepare_ex_iterable_for_iteration(batch_size=self.batch_size, drop_last_batch=self.drop_last_batch) # changed here\r\n if self._formatting:\r\n formatter = get_formatter(self._formatting.format_type, features=self.features)\r\n format_dict = (\r\n formatter.recursive_tensorize if isinstance(formatter, TensorFormatter) else cast_to_python_objects\r\n )\r\n else:\r\n format_dict = None\r\n\r\n if self._formatting and (ex_iterable.iter_arrow or self._formatting.format_type == \"arrow\"):\r\n if ex_iterable.iter_arrow:\r\n iterator = ex_iterable.iter_arrow()\r\n else:\r\n iterator = _convert_to_arrow(ex_iterable, batch_size=self.batch_size) # changed here\r\n for key, pa_table in iterator:\r\n yield formatter.format_row(pa_table)\r\n return\r\n\r\n for key, example in ex_iterable:\r\n if self.features and not ex_iterable.is_typed:\r\n # `IterableDataset` automatically fills missing columns with None.\r\n # This is done with `_apply_feature_types_on_example`.\r\n example = _apply_feature_types_on_example(\r\n example, self.features, token_per_repo_id=self._token_per_repo_id\r\n )\r\n yield format_dict(example) if format_dict else example\r\n\r\n\r\n\r\ndef _iter_pytorch(self):\r\n ex_iterable = self._prepare_ex_iterable_for_iteration(batch_size=self.batch_size, drop_last_batch=self.drop_last_batch) # changed here\r\n # Fix for fsspec when using multiprocess to avoid hanging in the ML training loop. (only required for fsspec >= 0.9.0)\r\n # See https://github.com/fsspec/gcsfs/issues/379\r\n fsspec.asyn.reset_lock()\r\n # check if there aren't too many workers\r\n import torch.utils.data\r\n\r\n worker_info = torch.utils.data.get_worker_info()\r\n if self._is_main_process() and ex_iterable.n_shards < worker_info.num_workers:\r\n logger.warning(\r\n f\"Too many dataloader workers: {worker_info.num_workers} (max is dataset.n_shards={ex_iterable.n_shards}). \"\r\n f\"Stopping {worker_info.num_workers - ex_iterable.n_shards} dataloader workers.\"\r\n )\r\n logger.info(\r\n f\"To parallelize data loading, we give each process some shards (or data sources) to process. \"\r\n f\"Therefore it's unnecessary to have a number of workers greater than dataset.n_shards={ex_iterable.n_shards}. \"\r\n f\"To enable more parallelism, please split the dataset in more files than {ex_iterable.n_shards}.\"\r\n )\r\n # split workload\r\n _log_prefix = f\"node#{self._distributed.rank} \" if self._distributed else \"\"\r\n shards_indices = ex_iterable.split_shard_indices_by_worker(worker_info.id, worker_info.num_workers)\r\n if shards_indices:\r\n logger.debug(\r\n f\"{_log_prefix}dataloader worker#{worker_info.id}, ': Starting to iterate over {len(shards_indices)}/{ex_iterable.n_shards} shards.\"\r\n )\r\n ex_iterable = ex_iterable.shard_data_sources(worker_id=worker_info.id, num_workers=worker_info.num_workers)\r\n self._state_dict = ex_iterable._init_state_dict()\r\n if self._starting_state_dict:\r\n ex_iterable.load_state_dict(self._starting_state_dict)\r\n\r\n if self._formatting:\r\n formatter = get_formatter(self._formatting.format_type, features=self.features)\r\n format_dict = (\r\n formatter.recursive_tensorize if isinstance(formatter, TensorFormatter) else cast_to_python_objects\r\n )\r\n else:\r\n format_dict = None\r\n\r\n if self._formatting and (ex_iterable.iter_arrow or self._formatting == \"arrow\"):\r\n if ex_iterable.iter_arrow:\r\n iterator = ex_iterable.iter_arrow()\r\n else:\r\n iterator = _convert_to_arrow(ex_iterable, batch_size=self.batch_size) # changed here\r\n if self.batch_size > 1: # changed here until end of file\r\n for key, pa_table in iterator:\r\n yield formatter.format_batch(pa_table)\r\n return\r\n else:\r\n for key, pa_table in iterator:\r\n yield formatter.format_row(pa_table)\r\n return\r\n\r\n iterator = iter(ex_iterable)\r\n if self.batch_size > 1:\r\n for key, example in iterator:\r\n # If batched, first build the batch\r\n examples = [example] + [example for key, example in islice(iterator, self.batch_size - 1)]\r\n if self.drop_last_batch and len(examples) < self.batch_size: # ignore last batch\r\n return\r\n batch = _examples_to_batch(examples)\r\n if self.features and not ex_iterable.is_typed:\r\n # `IterableDataset` automatically fills missing columns with None.\r\n # This is done with `_apply_feature_types_on_batch`.\r\n batch = _apply_feature_types_on_batch(batch, self.features, token_per_repo_id=self._token_per_repo_id)\r\n yield format_dict(batch) if format_dict else batch\r\n else:\r\n for key, example in ex_iterable:\r\n if self.features and not ex_iterable.is_typed:\r\n # `IterableDataset` automatically fills missing columns with None.\r\n # This is done with `_apply_feature_types_on_example`.\r\n example = _apply_feature_types_on_example(\r\n example, self.features, token_per_repo_id=self._token_per_repo_id\r\n )\r\n yield format_dict(example) if format_dict else example\r\n logger.debug(\r\n f\"{_log_prefix}dataloader worker#{worker_info.id}, ': Finished iterating over {len(shards_indices)}/{ex_iterable.n_shards} shards.\"\r\n )\r\n else:\r\n logger.debug(\r\n f\"{_log_prefix}dataloader worker#{worker_info.id}, ': Stopping... Number of dataset shards < num_workers ({ex_iterable.n_shards}<{worker_info.num_workers}).\"\r\n )\r\n```\r\n\r\nFor anyone wanting to try it you can patch it into datasets by overwriting the function via `setattr(datasets.IterableDataset, '_iter_pytorch', _iter_pytorch)`\r\n\r\nI don't really know what most of the rest of the code is doing so no idea if this is a valid fix or not, but it seems to work for me.\r\nExample of running the fix:\r\n```python\r\nfrom torch.utils.data.dataloader import DataLoader\r\nc4.batch_size = 512**2 # set batch size here\r\ndataloader = Dataloader(c4, batch_size=None) # use custom batching from IterableDataset\r\niterator = iter(dataloader)\r\nfor i in range(5):\r\n start_time=timer()\r\n next(iterator) #get the batch\r\n end_time = timer()\r\n print(f\"time for one batch: {end_time-start_time}\")\r\n```\r\nI now get \r\ntime for one batch: 0.6047679269686341\r\ntime for one batch: 0.000248616561293602\r\ntime for one batch: 0.00017435848712921143\r\ntime for one batch: 0.00015910807996988297\r\ntime for one batch: 0.00015317369252443314\r\n\r\nI love the datasets library and it would be great if iterating with large batch sizes would be supported directly, either with a similar fix to mine or in some other way :)",
"Hi @taczin , thanks for reporting !\r\n\r\nIndeed the `IterableDataset.batch()` implementation is quite naive is manipulates python objects:\r\n\r\nhttps://github.com/huggingface/datasets/blob/d37ed46ebf45981131bd3678173dbb4b7e2b2f1a/src/datasets/iterable_dataset.py#L3026-L3029\r\n\r\nHowever it can be much faster if it can be applied on the Arrow data, maybe using something like this (untested)\r\n\r\n```python\r\ndef batch_fn(unbatched): \r\n return {k: [v] for k, v in unbatched.items()} \r\n\r\ndef batch_fn_arrow(unbatched_pa_table): \r\n offsets = pa.array([0, len(unbatched_pa_table)])\r\n return pa.Table.from_arrays([\r\n pa.ListArray.from_arrays(offsets, unbatched_pa_table[k])\r\n for k in unbatched_pa_table.column_names\r\n ], unbatched_pa_table.column_names)\r\n\r\nif self._ex_iterabe.iter_arrow:\r\n return self.with_format(\"arrow\").map(\r\n batch_fn_arrow, batched=True, batch_size=batch_size, drop_last_batch=drop_last_batch\r\n ).with_format(self._formatting.format_type if self._formatting else None)\r\nelse:\r\n return self.map(batch_fn, batched=True, batch_size=batch_size, drop_last_batch=drop_last_batch)\r\n```",
"Hi @lhoestq , thanks for your answer. I was wondering: is there a reason why the internal call to `ex_iterable = self._prepare_ex_iterable_for_iteration()` in the IterableDataset code does not pass the batch size even though it could? If not passed the default of 1 is used, leading to the observed slow loading.",
"After calling `.batch()`, `_prepare_ex_iterable_for_iteration` should use batch_size=1 since now each row in the dataset is actually a batch of the original dataset."
] | 2023-10-05T11:12:49
| 2024-11-07T10:01:22
| null |
NONE
| null | null | null | null |
### Feature request
Hi,
could you add an implementation of a batched `IterableDataset`. It already support an option to do batch iteration via `.iter(batch_size=...)` but this cannot be used in combination with a torch `DataLoader` since it just returns an iterator.
### Motivation
The current implementation loads each element of a batch individually which can be very slow in cases of a big batch_size. I did some experiments [here](https://discuss.huggingface.co/t/slow-dataloader-with-big-batch-size/57224) and using a batched iteration would speed up data loading significantly.
### Your contribution
N/A
| null |
{
"+1": 6,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 6,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6279/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6279/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6277
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6277/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6277/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6277/events
|
https://github.com/huggingface/datasets/issues/6277
| 1,927,044,546
|
I_kwDODunzps5y3F3C
| 6,277
|
FileNotFoundError: Couldn't find a module script at /content/paws-x/paws-x.py. Module 'paws-x' doesn't exist on the Hugging Face Hub either.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/66733346?v=4",
"events_url": "https://api.github.com/users/diegogonzalezc/events{/privacy}",
"followers_url": "https://api.github.com/users/diegogonzalezc/followers",
"following_url": "https://api.github.com/users/diegogonzalezc/following{/other_user}",
"gists_url": "https://api.github.com/users/diegogonzalezc/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/diegogonzalezc",
"id": 66733346,
"login": "diegogonzalezc",
"node_id": "MDQ6VXNlcjY2NzMzMzQ2",
"organizations_url": "https://api.github.com/users/diegogonzalezc/orgs",
"received_events_url": "https://api.github.com/users/diegogonzalezc/received_events",
"repos_url": "https://api.github.com/users/diegogonzalezc/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/diegogonzalezc/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/diegogonzalezc/subscriptions",
"type": "User",
"url": "https://api.github.com/users/diegogonzalezc",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"`evaluate.load(\"paws-x\", \"es\")` throws the error because there is no such metric in the `evaluate` lib.\r\n\r\nSo, this is unrelated to our lib."
] | 2023-10-04T22:01:25
| 2023-10-08T17:05:46
| 2023-10-08T17:05:46
|
NONE
| null | null | null | null |
### Describe the bug
I'm encountering a "FileNotFoundError" while attempting to use the "paws-x" dataset to retrain the DistilRoBERTa-base model. The error message is as follows:
FileNotFoundError: Couldn't find a module script at /content/paws-x/paws-x.py. Module 'paws-x' doesn't exist on the Hugging Face Hub either.
### Steps to reproduce the bug
https://colab.research.google.com/drive/11xUUFxloClpmqLvDy_Xxfmo3oUzjY5nx#scrollTo=kUn74FigzhHm
### Expected behavior
The the trained model
### Environment info
colab, "paws-x" dataset , DistilRoBERTa-base model
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6277/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6277/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 3 days, 19:04:21
|
https://api.github.com/repos/huggingface/datasets/issues/6276
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6276/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6276/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6276/events
|
https://github.com/huggingface/datasets/issues/6276
| 1,925,961,878
|
I_kwDODunzps5yy9iW
| 6,276
|
I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/50768065?v=4",
"events_url": "https://api.github.com/users/valaofficial/events{/privacy}",
"followers_url": "https://api.github.com/users/valaofficial/followers",
"following_url": "https://api.github.com/users/valaofficial/following{/other_user}",
"gists_url": "https://api.github.com/users/valaofficial/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/valaofficial",
"id": 50768065,
"login": "valaofficial",
"node_id": "MDQ6VXNlcjUwNzY4MDY1",
"organizations_url": "https://api.github.com/users/valaofficial/orgs",
"received_events_url": "https://api.github.com/users/valaofficial/received_events",
"repos_url": "https://api.github.com/users/valaofficial/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/valaofficial/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/valaofficial/subscriptions",
"type": "User",
"url": "https://api.github.com/users/valaofficial",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"Since you are using Windows, maybe moving the `map` call inside `if __name__ == \"__main__\"` can fix the issue:\r\n```python\r\nif __name__ == \"__main__\":\r\n common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names[\"train\"], num_proc=4)\r\n```\r\n\r\nOtherwise, the only solution is to set `num_proc=1`.",
"> Since you are using Windows, maybe moving the `map` call inside `if __name__ == \"__main__\"` can fix the issue:\r\n> \r\n> ```python\r\n> if __name__ == \"__main__\":\r\n> common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names[\"train\"], num_proc=4)\r\n> ```\r\n> \r\n> Otherwise, the only solution is to set `num_proc=1`.\r\n\r\nThank you very much for the response, i eventually tried setting `num_proc=1` and now the jupyter notebook kernel keers dying after running the command, what do you think the issue could be, could it be that my system is not capable of running the command \"i'm using a Lenovo Thinkpad T440 with no GPU\"",
"Firstly, you didn't define feature_extractor variable. Secondly, it is large nlp model. Hence you should use proper gpu, otherwise your machine's cpu will be overclock and you can do nothing."
] | 2023-10-04T11:03:41
| 2023-11-27T10:39:16
| null |
NONE
| null | null | null | null |
### Describe the bug
I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error, i'm following the steps in this blog post
https://huggingface.co/blog/fine-tune-whisper
I tried google collab and it works but because I'm on the free version the training doesn't complete
the error comes in jupyter notebook when i run this line
`common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)`
here is the error message
```
Map (num_proc=4): 0% 0/2506 [00:52<?, ? examples/s]
The above exception was the direct cause of the following exception:
NameError Traceback (most recent call last) Cell In[19], line 1 ----> 1 common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)
File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:853, in DatasetDict.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( --> 853 { 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 )
File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:854, in <dictcomp>(.0) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( 853 { --> 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 )
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:592, in transmit_tasks.<locals>.wrapper(*args, **kwargs) 590 self: "Dataset" = kwargs.pop("self") 591 # apply actual function --> 592 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 593 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 594 for dataset in datasets: 595 # Remove task templates if a column mapping of the template is no longer valid
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:557, in transmit_format.<locals>.wrapper(*args, **kwargs) 550 self_format = { 551 "type": self._format_type, 552 "format_kwargs": self._format_kwargs, 553 "columns": self._format_columns, 554 "output_all_columns": self._output_all_columns, 555 } 556 # apply actual function --> 557 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 558 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 559 # re-apply format to the output
File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:3189, in Dataset.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 3182 logger.info(f"Spawning {num_proc} processes") 3183 with logging.tqdm( 3184 disable=not logging.is_progress_bar_enabled(), 3185 unit=" examples", 3186 total=pbar_total, 3187 desc=(desc or "Map") + f" (num_proc={num_proc})", 3188 ) as pbar: -> 3189 for rank, done, content in iflatmap_unordered( 3190 pool, Dataset._map_single, kwargs_iterable=kwargs_per_job 3191 ): 3192 if done: 3193 shards_done += 1
File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in iflatmap_unordered(pool, func, kwargs_iterable) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results]
File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in <listcomp>(.0) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results]
File ~\anaconda\Lib\site-packages\multiprocess\pool.py:774, in ApplyResult.get(self, timeout) 772 return self._value 773 else: --> 774 raise self._value
NameError: name 'feature_extractor' is not defined
```
### Steps to reproduce the bug
1. follow the steps in this blog post
https://huggingface.co/blog/fine-tune-whisper
2. run this line of code
`common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)`
3. I'm using jupyter notebook from anaconda
### Expected behavior
No error message
### Environment info
datasets version: 2.8.0
Python version: 3.11
Windows 10
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6276/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6276/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6275
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6275/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6275/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6275/events
|
https://github.com/huggingface/datasets/issues/6275
| 1,921,354,680
|
I_kwDODunzps5yhYu4
| 6,275
|
Would like to Contribute a dataset
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/97907750?v=4",
"events_url": "https://api.github.com/users/vikas70607/events{/privacy}",
"followers_url": "https://api.github.com/users/vikas70607/followers",
"following_url": "https://api.github.com/users/vikas70607/following{/other_user}",
"gists_url": "https://api.github.com/users/vikas70607/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/vikas70607",
"id": 97907750,
"login": "vikas70607",
"node_id": "U_kgDOBdX0Jg",
"organizations_url": "https://api.github.com/users/vikas70607/orgs",
"received_events_url": "https://api.github.com/users/vikas70607/received_events",
"repos_url": "https://api.github.com/users/vikas70607/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/vikas70607/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/vikas70607/subscriptions",
"type": "User",
"url": "https://api.github.com/users/vikas70607",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"Hi! The process of contributing a dataset is explained here: https://huggingface.co/docs/datasets/upload_dataset. Also, check https://huggingface.co/docs/datasets/image_dataset for a more detailed explanation of how to share an image dataset."
] | 2023-10-02T07:00:21
| 2023-10-10T16:27:54
| 2023-10-10T16:27:54
|
NONE
| null | null | null | null |
I have a dataset of 2500 images that can be used for color-blind machine-learning algorithms. Since , there was no dataset available online , I made this dataset myself and would like to contribute this now to community
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6275/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6275/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 8 days, 9:27:33
|
https://api.github.com/repos/huggingface/datasets/issues/6274
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6274/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6274/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6274/events
|
https://github.com/huggingface/datasets/issues/6274
| 1,921,036,328
|
I_kwDODunzps5ygLAo
| 6,274
|
FileNotFoundError for dataset with multiple builder config
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/97120485?v=4",
"events_url": "https://api.github.com/users/LouisChen15/events{/privacy}",
"followers_url": "https://api.github.com/users/LouisChen15/followers",
"following_url": "https://api.github.com/users/LouisChen15/following{/other_user}",
"gists_url": "https://api.github.com/users/LouisChen15/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/LouisChen15",
"id": 97120485,
"login": "LouisChen15",
"node_id": "U_kgDOBcnw5Q",
"organizations_url": "https://api.github.com/users/LouisChen15/orgs",
"received_events_url": "https://api.github.com/users/LouisChen15/received_events",
"repos_url": "https://api.github.com/users/LouisChen15/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/LouisChen15/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/LouisChen15/subscriptions",
"type": "User",
"url": "https://api.github.com/users/LouisChen15",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"Please tell me if the above info is not enough for solving the problem. I will then make my dataset public temporarily so that you can really reproduce the bug. ",
"Hi! \r\nCould you share how to solve this problem? \r\nI faced this same error. "
] | 2023-10-01T23:45:56
| 2024-08-14T04:42:02
| 2023-10-02T20:09:38
|
NONE
| null | null | null | null |
### Describe the bug
When there is only one config and only the dataset name is entered when using datasets.load_dataset(), it works fine. But if I create a second builder_config for my dataset and enter the config name when using datasets.load_dataset(), the following error will happen.
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/chenx/.cache/huggingface/datasets/my_dataset/0_shot_multiple_choice/1.0.0/97c3854a012cfd6b045e3be4c864739902af2d818bb9235b047baa94c302e9a2.incomplete/my_dataset-test-00000-00000-of-NNNNN.arrow'
The "XXX.incomplete folder" in the cache folder of my dataset will disappear before "generating test split", which does not happen when config name is not entered and the config name is "default"
C:\Users\chenx\.cache\huggingface\datasets\my_dataset\0_shot_multiple_choice\1.0.0
The folder that is supposed to remain under the above directory will disappear, and the data generator will not have a place to generate data into.
### Steps to reproduce the bug
test = load_dataset('my_dataset', '0_shot_multiple_choice')
### Expected behavior
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/chenx/.cache/huggingface/datasets/my_dataset/0_shot_multiple_choice/1.0.0/97c3854a012cfd6b045e3be4c864739902af2d818bb9235b047baa94c302e9a2.incomplete/my_dataset-test-00000-00000-of-NNNNN.arrow'
### Environment info
datasets 2.14.5
python 3.8.18
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/97120485?v=4",
"events_url": "https://api.github.com/users/LouisChen15/events{/privacy}",
"followers_url": "https://api.github.com/users/LouisChen15/followers",
"following_url": "https://api.github.com/users/LouisChen15/following{/other_user}",
"gists_url": "https://api.github.com/users/LouisChen15/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/LouisChen15",
"id": 97120485,
"login": "LouisChen15",
"node_id": "U_kgDOBcnw5Q",
"organizations_url": "https://api.github.com/users/LouisChen15/orgs",
"received_events_url": "https://api.github.com/users/LouisChen15/received_events",
"repos_url": "https://api.github.com/users/LouisChen15/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/LouisChen15/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/LouisChen15/subscriptions",
"type": "User",
"url": "https://api.github.com/users/LouisChen15",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6274/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6274/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 20:23:42
|
https://api.github.com/repos/huggingface/datasets/issues/6273
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6273/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6273/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6273/events
|
https://github.com/huggingface/datasets/issues/6273
| 1,920,922,260
|
I_kwDODunzps5yfvKU
| 6,273
|
Broken Link to PubMed Abstracts dataset .
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/100606327?v=4",
"events_url": "https://api.github.com/users/sameemqureshi/events{/privacy}",
"followers_url": "https://api.github.com/users/sameemqureshi/followers",
"following_url": "https://api.github.com/users/sameemqureshi/following{/other_user}",
"gists_url": "https://api.github.com/users/sameemqureshi/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sameemqureshi",
"id": 100606327,
"login": "sameemqureshi",
"node_id": "U_kgDOBf8hdw",
"organizations_url": "https://api.github.com/users/sameemqureshi/orgs",
"received_events_url": "https://api.github.com/users/sameemqureshi/received_events",
"repos_url": "https://api.github.com/users/sameemqureshi/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sameemqureshi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sameemqureshi/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sameemqureshi",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"This has already been reported in the HF Course repo (https://github.com/huggingface/course/issues/623).",
"@lhoestq @albertvillanova @lewtun I don't think we are allowed to host these data files on the Hub (due to DMCA), which means the only option is to use a different dataset in the course (and to re-record the video 🙂), no?",
"Keeping the video is maybe fine, we can add a note on youtube to suggest to load a dataset with a different name. Maybe C4 ? And update the code snippets on the website ?",
"Maybe you want to try it with the PUBMED dataset that I reproduced based on the The [PubMed Abstract GitHub Site](http://github.com/thoppe/The-Pile-PubMed) and uploaded on the HuggingFace:\r\n\r\n```\r\nfrom datasets import load_dataset\r\npubmed_dataset = load_dataset(\"hwang2006/PUBMED_title_abstracts_2020_baseline\")\r\npubmed_dataset\r\n\r\n#Downloading data: 100%\r\n#7.98G/7.98G [11:47<00:00, 9.68MB/s]\r\n#Generating train split: 17722096/0 [00:36<00:00, 505376.37 examples/s]\r\n\r\n#DatasetDict({\r\n# train: Dataset({\r\n# features: ['meta', 'text'],\r\n# num_rows: 17722096\r\n# })\r\n#})\r\n```",
"孔令涛说感谢感谢"
] | 2023-10-01T19:08:48
| 2024-04-28T02:30:42
| null |
NONE
| null | null | null | null |
### Describe the bug
The link provided for the dataset is broken,
data_files =
[https://the-eye.eu/public/AI/pile_preliminary_components/PUBMED_title_abstracts_2019_baseline.jsonl.zst](url)
The
### Steps to reproduce the bug
Steps to reproduce:
1) Head over to [https://huggingface.co/learn/nlp-course/chapter5/4?fw=pt#big-data-datasets-to-the-rescue](url)
2) In the Section "What is the Pile?", you can see a code snippet that contains the broken link.
### Expected behavior
The link should Redirect to the "PubMed Abstracts dataset" as expected .
### Environment info
.
| null |
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6273/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6273/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6272
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6272/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6272/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6272/events
|
https://github.com/huggingface/datasets/issues/6272
| 1,920,831,487
|
I_kwDODunzps5yfY__
| 6,272
|
Duplicate `data_files` when named `<split>/<split>.parquet`
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lhoestq",
"id": 42851186,
"login": "lhoestq",
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lhoestq",
"user_view_type": "public"
}
|
[
{
"color": "d73a4a",
"default": true,
"description": "Something isn't working",
"id": 1935892857,
"name": "bug",
"node_id": "MDU6TGFiZWwxOTM1ODkyODU3",
"url": "https://api.github.com/repos/huggingface/datasets/labels/bug"
}
] |
closed
| false
| null |
[] |
[
"Also reported in https://github.com/huggingface/datasets/issues/6259",
"I think it's best to drop duplicates with a `set` (as a temporary fix) and improve the patterns when/if https://github.com/fsspec/filesystem_spec/pull/1382 gets merged. @lhoestq Do you have some other ideas?",
"Alternatively we could just use this no ?\r\n\r\n```python\r\nif config.FSSPEC_VERSION < version.parse(\"2023.9.0\"):\r\n KEYWORDS_IN_PATH_NAME_BASE_PATTERNS = [\r\n \"{keyword}[{sep}/]**\",\r\n \"**[{sep}]{keyword}[{sep}/]**\",\r\n \"**/{keyword}[{sep}/]**\",\r\n ]\r\nelse:\r\n KEYWORDS_IN_PATH_NAME_BASE_PATTERNS = [\r\n \"{keyword}[{sep}/]**\",\r\n \"**/*[{sep}]{keyword}[{sep}/]**\",\r\n \"**/*/{keyword}[{sep}/]**\",\r\n ]\r\n```\r\n\r\nThis way no need to implement sets, which would require a bit of work since we've always considered a list of pattern to be resolved as the concatenated list of resolved files for each pattern (including duplicates)\r\n",
"Arf `\"**/*/{keyword}[{sep}/]**\"` does return `data/keyword.txt` in latest `fsspec` but not in `glob.glob`\r\n\r\nEDIT: actually forgot to set `recursive=True`",
"Actually `glob.glob` does return it with `recursive=True` ! my bad",
"Pff just tested and my idea sucks, pattern 1 and 3 obviously give duplicates ",
"> I think it's best to drop duplicates with a set (as a temporary fix)\r\n\r\nI started https://github.com/huggingface/datasets/pull/6278 to use DataFilesSet objects instead of DataFilesList"
] | 2023-10-01T15:43:56
| 2024-03-15T15:22:05
| 2024-03-15T15:22:05
|
MEMBER
| null | null | null | null |
e.g. with `u23429/stock_1_minute_ticker`
```ipython
In [1]: from datasets import *
In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker")
Downloading readme: 100%|██████████████████████████| 627/627 [00:00<00:00, 246kB/s]
In [3]: b.config.data_files
Out[3]:
{NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'],
NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'],
NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet',
'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']}
```
This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6272/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6272/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 165 days, 23:38:09
|
https://api.github.com/repos/huggingface/datasets/issues/6271
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6271/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6271/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6271/events
|
https://github.com/huggingface/datasets/issues/6271
| 1,920,420,295
|
I_kwDODunzps5yd0nH
| 6,271
|
Overwriting Split overwrites data but not metadata, corrupting dataset
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/13859249?v=4",
"events_url": "https://api.github.com/users/govindrai/events{/privacy}",
"followers_url": "https://api.github.com/users/govindrai/followers",
"following_url": "https://api.github.com/users/govindrai/following{/other_user}",
"gists_url": "https://api.github.com/users/govindrai/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/govindrai",
"id": 13859249,
"login": "govindrai",
"node_id": "MDQ6VXNlcjEzODU5MjQ5",
"organizations_url": "https://api.github.com/users/govindrai/orgs",
"received_events_url": "https://api.github.com/users/govindrai/received_events",
"repos_url": "https://api.github.com/users/govindrai/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/govindrai/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/govindrai/subscriptions",
"type": "User",
"url": "https://api.github.com/users/govindrai",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[] | 2023-09-30T22:37:31
| 2023-10-16T13:30:50
| 2023-10-16T13:30:50
|
NONE
| null | null | null | null |
### Describe the bug
I want to be able to overwrite/update/delete splits in my dataset. Currently the only way to do is to manually go into the dataset and delete the split. If I try to overwrite programmatically I end up in an error state and (somewhat) corrupting the dataset. Read below.
**Current Behavior**
When I push to an existing split I get this error:
`ValueError: Split complexRoofLocation_01Apr2023_to_31May2023test already present`
This seems to suggest that the library doesn't support overwriting splits.
**Potential Bug**
What’s strange is that datasets, despite the operation erroring out with the ValueError above, does, in fact, overwrite the split:
`Pushing dataset shards to the dataset hub: 100% [.....................] 1/1 [00:00<00:00, 55.04it/s]`
Even though you got an error message and your code fails, your dataset is now changed. That seems like a bug. Either don't change the dataset, or don't throw the error and allow the script to proceed.
Additional Bug
While it overwrites the split, it doesn’t overwrite the split’s information. Because of this when you pull down the dataset you may end up getting a `NonMatchingSplitsSizesError` if the size of the dataset during the overwrite is different. For example, my original split had 5 rows, but on my overwrite, I only had 4. Then when I try to download the dataset, I get a `NonMatchingSplitsSizesError` because the dataset's data.json states there’s 5 but only 4 exist in the split.
Expected Behavior
This corrupts the dataset rendering it unusable (until you take manual intervention). Either the library should let the overwrite happen (which it does but should also update the metadata) or it shouldn’t do anything.
### Steps to reproduce the bug
[Colab Notebook](https://colab.research.google.com/drive/1bqVkD06Ngs9MQNdSk_ygCG6y1UqXA4pC?usp=sharing)
### Expected behavior
The split should be overwritten and I should be able to use the new version of the dataset without issue.
### Environment info
- `datasets` version: 2.14.5
- Platform: Linux-5.15.120+-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.17.3
- PyArrow version: 9.0.0
- Pandas version: 1.5.3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6271/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6271/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 15 days, 14:53:19
|
https://api.github.com/repos/huggingface/datasets/issues/6270
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6270/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6270/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6270/events
|
https://github.com/huggingface/datasets/issues/6270
| 1,920,329,373
|
I_kwDODunzps5ydead
| 6,270
|
Dataset.from_generator raises with sharded gen_args
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/53510?v=4",
"events_url": "https://api.github.com/users/hartmans/events{/privacy}",
"followers_url": "https://api.github.com/users/hartmans/followers",
"following_url": "https://api.github.com/users/hartmans/following{/other_user}",
"gists_url": "https://api.github.com/users/hartmans/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hartmans",
"id": 53510,
"login": "hartmans",
"node_id": "MDQ6VXNlcjUzNTEw",
"organizations_url": "https://api.github.com/users/hartmans/orgs",
"received_events_url": "https://api.github.com/users/hartmans/received_events",
"repos_url": "https://api.github.com/users/hartmans/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hartmans/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hartmans/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hartmans",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"`gen_kwargs` should be a `dict`, as stated in the docstring, but you are passing a `list`.\r\n\r\nSo, to fix the error, replace the list of dicts with a dict of lists (and slightly modify the generator function):\r\n```python\r\nfrom pathlib import Path\r\nimport datasets\r\n\r\ndef process_yaml(files):\r\n for f in files:\r\n # process\r\n yield dict(...)\r\n\r\n\r\nif __name__ == '__main__':\r\n import sys\r\n dir = Path(sys.argv[0]).parent\r\n ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs={'files': [f for f in dir.glob('*.yml')]})\r\n ds.to_json('training.jsonl')\r\n```",
"That runs, and because my dataset is small, it's what I did to get past the problem.\r\nHowever, it does not produce a sharded dataset. From the doc string I expect there ought to be a way to call from_generator such that num_shards in the resulting data set is equal to the number of items in the list.\r\nThe part of the doc string that your suggestion is not responsive to is:\r\n` You can define a sharded dataset by passing the list of shards in *g\r\nen_kwargs*.\r\n`\r\n\r\nWhat your suggestion does is calls the generator once, with the list argument, and produces a single shard dataset.\r\n",
"The sharding mentioned here refers to using this function with `num_proc` (multiprocessing splits the `kwargs` into shards and passes them to the generator function)\r\n\r\n> That runs, and because my dataset is small, it's what I did to get past the problem.\r\n\r\n`from_generator` generates a memory-mapped dataset (can be larger than RAM), so the dataset size should not be an issue unless the generator function's implementation does not properly free the memory.\r\n",
"It sounds like you are saying that num_proc affects the form of gen_kwargs.\r\nAre you saying that for non-zero num_proc gen_kwargs should be a list whose length is the same as num_proc?\r\nOr are you saying that for non-zero num_proc, gen_kwargs should be a dict whose elements are lists the length of num_proc?\r\n",
"I ran some tests. So, it looks like with num_proc greater than 1, gen_kwargs is expected to be a dict of lists. It calls the generator also with a dict of lists, but the lists are split.\r\nI.E. if my original has `gen_kwargs=dict(a=[0,1,2])`, then my generator might get called with `gen_kwalrgs=dict([0])`.\r\nThat all makes sense, but I definitely think there is room for improvement in the doc string here.\r\nIn order to suggest improvements to the doc string, I need to look at how the gen_kwargs are split, and figure out if:\r\n* num_proc needs to exactly equal the length of the lists\r\n* num_proc needs to evenly divide the length of the lists\r\n* Or there's no required relationship.\r\nI'll look into that and then propose an improved doc string if no one else gets to it first.",
"Okay, that was fun; I took a dive through the dataset code and feel like I have a much better understanding.\r\nHere is my understanding of the behavior:\r\n* max_proc is an upper limit on the number of shards that `from_generator` produces\r\n* If `max_proc` is greater than 1, then all lists in *gen_kwargs* must be the same length\r\n* If the lists in *gen_kwargs* are shorter than *num_proc* elements, *num_proc* will be reduced and a warning produced. Put another way, `min(list_length, num_shards)` shards will be produced\r\n* The members of the lists in *gen_kwargs* will be partitioned among the created jobs.\r\nTo validate the above, take a look at\r\n`_number_of_shards_in_gen_kwargs` and `_distribute_shards` and `_split_gen_kwargs` in utils/sharding.py.\r\nI've also chased down starting at *from_generator* all the way through to GeneratorBuilder and the calls to the functions in sharding.py.\r\nTomorrow I'll take a look at the contributing guidelines and see what's involved in putting together a PR to improve the doc string."
] | 2023-09-30T16:50:06
| 2023-10-11T20:29:12
| 2023-10-11T20:29:11
|
CONTRIBUTOR
| null | null | null | null |
### Describe the bug
According to the docs of Datasets.from_generator:
```
gen_kwargs(`dict`, *optional*):
Keyword arguments to be passed to the `generator` callable.
You can define a sharded dataset by passing the list of shards in `gen_kwargs`.
```
So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element.
It doesn't work that way though.
### Steps to reproduce the bug
```python
#!/usr/bin/python
from pathlib import Path
import datasets
def process_yaml(file):
yield dict(example=42)
if __name__ == '__main__':
import sys
dir = Path(sys.argv[0]).parent
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
)
ds.to_json('training.jsonl')
```
```
Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
File "/tmp/dataset_bug.py", line 13, in <module>
ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator
).read()
^^^^^^
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read
self.builder.download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare
self._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare
super()._download_and_prepare(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single
generator = self._generate_examples(**gen_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ```
mapping, not list
### Expected behavior
I would expect that process_yaml would be called once for each yaml file in the directory where the script is run.
I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list.
### Environment info
- `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0)
- Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36
- Python version: 3.11.2
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6270/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6270/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 11 days, 3:39:05
|
https://api.github.com/repos/huggingface/datasets/issues/6267
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6267/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6267/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6267/events
|
https://github.com/huggingface/datasets/issues/6267
| 1,916,443,262
|
I_kwDODunzps5yOpp-
| 6,267
|
Multi label class encoding
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1000442?v=4",
"events_url": "https://api.github.com/users/jmif/events{/privacy}",
"followers_url": "https://api.github.com/users/jmif/followers",
"following_url": "https://api.github.com/users/jmif/following{/other_user}",
"gists_url": "https://api.github.com/users/jmif/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jmif",
"id": 1000442,
"login": "jmif",
"node_id": "MDQ6VXNlcjEwMDA0NDI=",
"organizations_url": "https://api.github.com/users/jmif/orgs",
"received_events_url": "https://api.github.com/users/jmif/received_events",
"repos_url": "https://api.github.com/users/jmif/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jmif/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jmif/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jmif",
"user_view_type": "public"
}
|
[
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
open
| false
| null |
[] |
[
"You can use a `Sequence(ClassLabel(...))` feature type to represent a list of labels, and `cast_column`/`cast` to perform the \"string to label\" conversion (`class_encode_column` does support nested fields), e.g., in your case:\r\n```python\r\nfrom datasets import Dataset, Sequence, ClassLabel\r\ndata = {\r\n 'text': ['one', 'two', 'three', 'four'],\r\n 'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']]\r\n}\r\n\r\ndataset = Dataset.from_dict(data)\r\ndataset = dataset.cast_column('labels', Sequence(ClassLabel(names=[\"a\", \"b\", \"c\", \"d\"])))\r\n```",
"Great! Can you elaborate on \"class_encode_column does support nested fields\"? Do you mean that there is a way to `class_encode_column` on a Sequence?",
"Yes, exactly! This would be a nice contribution, though.",
"Sorry, I'm still not following. Are you saying that there currently exists a way to call `class_encode_column` on a `Sequence(ClassLabel)` type? Or that the underlying data structures support it and a contribution of a method to do that would be welcome?",
"`class_encode_column ` currently does not support `Sequence(ClassLabel)`. Implementing support for this would be a nice contribution.\r\n\r\nIn the meantime, this limitation can be circumvented by fetching (unique) labels and calling `.cast_column(col, Sequence(ClassLabel(names=labels)))`.",
"Ok makes sense, can you take a look at the POC implementation I did [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e)? Happy to take another pass / submit as a PR but would be helpful if I got a thumbs up that this was directionally correct with respect to implementation / architecture. ",
"There is no need to introduce a new type (`MultiLabel`) for this feature. Also, I think we can keep the logic inside a single method instead of separating the two cases.\r\n\r\nMaybe https://github.com/huggingface/datasets/pull/4277 can help with the implementation. We extended `align_labels_with_mapping` to support `Sequence(ClassLabel(...))` in that PR (initially, it only worked with `ClassLabel(...)`)"
] | 2023-09-27T22:48:08
| 2023-10-26T18:46:08
| null |
NONE
| null | null | null | null |
### Feature request
I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels.
Here's an example of what I'd like to encode:
```
data = {
'text': ['one', 'two', 'three', 'four'],
'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']]
}
dataset = Dataset.from_dict(data)
dataset = dataset.class_encode_column('labels')
```
I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow.
I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected.
After digging more I did notice a few issues
- After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this.
- I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior.
### Motivation
See above - would like to support multi label class encodings.
### Your contribution
This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests.
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6267/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6267/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6263
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6263/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6263/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6263/events
|
https://github.com/huggingface/datasets/issues/6263
| 1,914,951,043
|
I_kwDODunzps5yI9WD
| 6,263
|
CI is broken: ImportError: cannot import name 'context' from 'tensorflow.python'
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
[
{
"color": "d73a4a",
"default": true,
"description": "Something isn't working",
"id": 1935892857,
"name": "bug",
"node_id": "MDU6TGFiZWwxOTM1ODkyODU3",
"url": "https://api.github.com/repos/huggingface/datasets/labels/bug"
}
] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
] |
[] | 2023-09-27T08:12:05
| 2023-09-27T08:36:40
| 2023-09-27T08:36:40
|
MEMBER
| null | null | null | null |
Python 3.10 CI is broken for `test_py310`.
See: https://github.com/huggingface/datasets/actions/runs/6322990957/job/17169678812?pr=6262
```
FAILED tests/test_py_utils.py::TempSeedTest::test_tensorflow - ImportError: cannot import name 'context' from 'tensorflow.python' (/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/tensorflow/python/__init__.py)
```
```
_________________________ TempSeedTest.test_tensorflow _________________________
[gw1] linux -- Python 3.10.13 /opt/hostedtoolcache/Python/3.10.13/x64/bin/python
self = <tests.test_py_utils.TempSeedTest testMethod=test_tensorflow>
@require_tf
def test_tensorflow(self):
import tensorflow as tf
from tensorflow.keras import layers
model = layers.Dense(2)
def gen_random_output():
x = tf.random.uniform((1, 3))
return model(x).numpy()
> with temp_seed(42, set_tensorflow=True):
tests/test_py_utils.py:155:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/contextlib.py:135: in __enter__
return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
seed = 42, set_pytorch = False, set_tensorflow = True
@contextmanager
def temp_seed(seed: int, set_pytorch=False, set_tensorflow=False):
"""Temporarily set the random seed. This works for python numpy, pytorch and tensorflow."""
np_state = np.random.get_state()
np.random.seed(seed)
if set_pytorch and config.TORCH_AVAILABLE:
import torch
torch_state = torch.random.get_rng_state()
torch.random.manual_seed(seed)
if torch.cuda.is_available():
torch_cuda_states = torch.cuda.get_rng_state_all()
torch.cuda.manual_seed_all(seed)
if set_tensorflow and config.TF_AVAILABLE:
import tensorflow as tf
> from tensorflow.python import context as tfpycontext
E ImportError: cannot import name 'context' from 'tensorflow.python' (/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/tensorflow/python/__init__.py)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/datasets/utils/py_utils.py:257: ImportError
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6263/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6263/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 0:24:35
|
https://api.github.com/repos/huggingface/datasets/issues/6261
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6261/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6261/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6261/events
|
https://github.com/huggingface/datasets/issues/6261
| 1,913,813,178
|
I_kwDODunzps5yEni6
| 6,261
|
Can't load a dataset
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/37955817?v=4",
"events_url": "https://api.github.com/users/joaopedrosdmm/events{/privacy}",
"followers_url": "https://api.github.com/users/joaopedrosdmm/followers",
"following_url": "https://api.github.com/users/joaopedrosdmm/following{/other_user}",
"gists_url": "https://api.github.com/users/joaopedrosdmm/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/joaopedrosdmm",
"id": 37955817,
"login": "joaopedrosdmm",
"node_id": "MDQ6VXNlcjM3OTU1ODE3",
"organizations_url": "https://api.github.com/users/joaopedrosdmm/orgs",
"received_events_url": "https://api.github.com/users/joaopedrosdmm/received_events",
"repos_url": "https://api.github.com/users/joaopedrosdmm/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/joaopedrosdmm/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/joaopedrosdmm/subscriptions",
"type": "User",
"url": "https://api.github.com/users/joaopedrosdmm",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"I believe is due to the fact that doesn't work with .tgz files.",
"`JourneyDB/JourneyDB` is a gated dataset, so this error means you are not authenticated to access it, either by using an invalid token or by not agreeing to the terms in the dialog on the dataset page.\r\n\r\n> I believe is due to the fact that doesn't work with .tgz files.\r\n\r\nIndeed, the dataset's data files structure is not supported natively by `datasets`. To load it, one option is to clone the repo (or download it with `huggingface_hub.snapshot_download`) and use `Dataset.from_generator` to process the files.",
"> JourneyDB/JourneyDB is a gated dataset, so this error means you are not authenticated to access it, either by using an invalid token or by not agreeing to the terms in the dialog on the dataset page.´\r\n\r\nI did authentication with:\r\n\r\n```\r\nfrom huggingface_hub import notebook_login\r\nnotebook_login()\r\n```\r\n\r\nIsn't that the correct way to do it?\r\n\r\n> Indeed, the dataset's data files structure is not supported natively by datasets. To load it, one option is to clone the repo (or download it with huggingface_hub.snapshot_download) and use Dataset.from_generator to process the files.\r\n\r\nGreat suggestion I will give it a try.",
"Have you accepted the terms in the dialog [here](https://huggingface.co/datasets/JourneyDB/JourneyDB)?\r\n\r\nIIRC Kaggle preinstalls an outdated `datasets` version, so it's also a good idea to update it before importing `datasets` (and do the same for `huggingface_hub`)",
"Sorry for the late reply. Yes, I did. Thanks for the tip!"
] | 2023-09-26T15:46:25
| 2023-10-05T10:23:23
| 2023-10-05T10:23:22
|
NONE
| null | null | null | null |
### Describe the bug
Can't seem to load the JourneyDB dataset.
It throws the following error:
```
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
Cell In[15], line 2
1 # If the dataset is gated/private, make sure you have run huggingface-cli login
----> 2 dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1664, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1661 ignore_verifications = ignore_verifications or save_infos
1663 # Create a dataset builder
-> 1664 builder_instance = load_dataset_builder(
1665 path=path,
1666 name=name,
1667 data_dir=data_dir,
1668 data_files=data_files,
1669 cache_dir=cache_dir,
1670 features=features,
1671 download_config=download_config,
1672 download_mode=download_mode,
1673 revision=revision,
1674 use_auth_token=use_auth_token,
1675 **config_kwargs,
1676 )
1678 # Return iterable dataset in case of streaming
1679 if streaming:
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1490, in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, use_auth_token, **config_kwargs)
1488 download_config = download_config.copy() if download_config else DownloadConfig()
1489 download_config.use_auth_token = use_auth_token
-> 1490 dataset_module = dataset_module_factory(
1491 path,
1492 revision=revision,
1493 download_config=download_config,
1494 download_mode=download_mode,
1495 data_dir=data_dir,
1496 data_files=data_files,
1497 )
1499 # Get dataset builder class from the processing script
1500 builder_cls = import_main_class(dataset_module.module_path)
File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1238, in dataset_module_factory(path, revision, download_config, download_mode, force_local_path, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1236 raise ConnectionError(f"Couln't reach the Hugging Face Hub for dataset '{path}': {e1}") from None
1237 if isinstance(e1, FileNotFoundError):
-> 1238 raise FileNotFoundError(
1239 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. "
1240 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}"
1241 ) from None
1242 raise e1 from None
1243 else:
FileNotFoundError: Couldn't find a dataset script at /kaggle/working/JourneyDB/JourneyDB/JourneyDB.py or any data file in the same directory. Couldn't find 'JourneyDB/JourneyDB' on the Hugging Face Hub either: FileNotFoundError: Unable to find data in dataset repository JourneyDB/JourneyDB with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip']
```
### Steps to reproduce the bug
1)
```
from huggingface_hub import notebook_login
notebook_login()
```
2)
```
!pip install -q datasets
from datasets import load_dataset
```
3)
`dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)`
### Expected behavior
Load the dataset
### Environment info
Notebook
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/37955817?v=4",
"events_url": "https://api.github.com/users/joaopedrosdmm/events{/privacy}",
"followers_url": "https://api.github.com/users/joaopedrosdmm/followers",
"following_url": "https://api.github.com/users/joaopedrosdmm/following{/other_user}",
"gists_url": "https://api.github.com/users/joaopedrosdmm/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/joaopedrosdmm",
"id": 37955817,
"login": "joaopedrosdmm",
"node_id": "MDQ6VXNlcjM3OTU1ODE3",
"organizations_url": "https://api.github.com/users/joaopedrosdmm/orgs",
"received_events_url": "https://api.github.com/users/joaopedrosdmm/received_events",
"repos_url": "https://api.github.com/users/joaopedrosdmm/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/joaopedrosdmm/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/joaopedrosdmm/subscriptions",
"type": "User",
"url": "https://api.github.com/users/joaopedrosdmm",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6261/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6261/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 8 days, 18:36:57
|
https://api.github.com/repos/huggingface/datasets/issues/6260
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6260/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6260/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6260/events
|
https://github.com/huggingface/datasets/issues/6260
| 1,912,593,466
|
I_kwDODunzps5x_9w6
| 6,260
|
REUSE_DATASET_IF_EXISTS don't work
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/88258534?v=4",
"events_url": "https://api.github.com/users/rangehow/events{/privacy}",
"followers_url": "https://api.github.com/users/rangehow/followers",
"following_url": "https://api.github.com/users/rangehow/following{/other_user}",
"gists_url": "https://api.github.com/users/rangehow/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rangehow",
"id": 88258534,
"login": "rangehow",
"node_id": "MDQ6VXNlcjg4MjU4NTM0",
"organizations_url": "https://api.github.com/users/rangehow/orgs",
"received_events_url": "https://api.github.com/users/rangehow/received_events",
"repos_url": "https://api.github.com/users/rangehow/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rangehow/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rangehow/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rangehow",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"Hi! Unfortunately, the current behavior is to delete the downloaded data when this error happens. So, I've opened a PR that removes the problematic import to avoid losing data due to `apache_beam` not being installed (we host the preprocessed version of `natual_questions` on the HF GCS, so requiring `apache_beam` in that case doesn't make sense)",
"Thanks for your reply. I met another question that I set `export HF_DATASETS_CACHE=/data/lxy/.cache` , but each time I run load_datasets, the datasets module still looking for NQ in the wrong default cache dir '/home/lxy/.cache' 。How to avoid this incorrect behavior. I am sure HF_DATASETS_CACHE was set correctly since I use echo & to check it.\r\n\r\nby the way I delete the file in '/home/lxy/.cache' since I found there has some kb size file seems useless.",
"You need to set this variable before the `datasets` import. Then, you can use `import datasets; datasets.config.HF_DATASETS_CACHE` to verify the cache location."
] | 2023-09-26T03:02:16
| 2023-09-28T18:23:36
| 2023-09-28T18:23:36
|
NONE
| null | null | null | null |
### Describe the bug
I use the following code to download natural_question dataset. Even though I have completely download it, the next time I run this code, the new download procedure will start and cover the original /data/lxy/NQ
config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ')
data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS)
---
Since I don't have apache_beam installed, it throw a exception. After I pip install apache_beam ,the download restart..

### Steps to reproduce the bug
run this two line code
config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ')
data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS)
### Expected behavior
Download behavior can be correctly follow DownloadMode
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-3.10.0-1160.88.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 11.0.0
- Pandas version: 2.0.3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6260/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6260/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 2 days, 15:21:20
|
https://api.github.com/repos/huggingface/datasets/issues/6259
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6259/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6259/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6259/events
|
https://github.com/huggingface/datasets/issues/6259
| 1,911,965,758
|
I_kwDODunzps5x9kg-
| 6,259
|
Duplicated Rows When Loading Parquet Files from Root Directory with Subdirectories
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/141304309?v=4",
"events_url": "https://api.github.com/users/MF-FOOM/events{/privacy}",
"followers_url": "https://api.github.com/users/MF-FOOM/followers",
"following_url": "https://api.github.com/users/MF-FOOM/following{/other_user}",
"gists_url": "https://api.github.com/users/MF-FOOM/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/MF-FOOM",
"id": 141304309,
"login": "MF-FOOM",
"node_id": "U_kgDOCGwh9Q",
"organizations_url": "https://api.github.com/users/MF-FOOM/orgs",
"received_events_url": "https://api.github.com/users/MF-FOOM/received_events",
"repos_url": "https://api.github.com/users/MF-FOOM/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/MF-FOOM/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MF-FOOM/subscriptions",
"type": "User",
"url": "https://api.github.com/users/MF-FOOM",
"user_view_type": "public"
}
|
[] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
] |
[
"Thanks for reporting this issue! We should be able to avoid this by making our `glob` patterns more precise. In the meantime, you can load the dataset by directly assigning splits to the data files: \r\n```python\r\nfrom datasets import load_dataset\r\nds = load_dataset(\"parquet\", data_files={\"train\": \"testing123/train/output_train.parquet\", \"validation\": \"testing123/val/output_val.parquet\"})\r\n```"
] | 2023-09-25T17:20:54
| 2024-03-15T15:22:04
| 2024-03-15T15:22:04
|
NONE
| null | null | null | null |
### Describe the bug
When parquet files are saved in "train" and "val" subdirectories under a root directory, and datasets are then loaded using `load_dataset("parquet", data_dir="root_directory")`, the resulting dataset has duplicated rows for both the training and validation sets.
### Steps to reproduce the bug
1. Create a root directory, e.g., "testing123".
2. Under "testing123", create two subdirectories: "train" and "val".
3. Create and save a parquet file with 3 unique rows in the "train" subdirectory.
4. Create and save a parquet file with 4 unique rows in the "val" subdirectory.
5. Load the datasets from the root directory using `load_dataset("parquet", data_dir="testing123")`
6. Iterate through the datasets and print the rows
Here's a collab reproducing these steps:
https://colab.research.google.com/drive/11NEdImnQ3OqJlwKSHRMhr7jCBesNdLY4?usp=sharing
### Expected behavior
- Training set should contain 3 unique rows.
- Validation set should contain 4 unique rows.
### Environment info
- `datasets` version: 2.14.5
- Platform: Linux-5.15.120+-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.17.2
- PyArrow version: 9.0.0
- Pandas version: 1.5.3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6259/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6259/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 171 days, 22:01:10
|
https://api.github.com/repos/huggingface/datasets/issues/6257
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6257/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6257/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6257/events
|
https://github.com/huggingface/datasets/issues/6257
| 1,910,741,044
|
I_kwDODunzps5x45g0
| 6,257
|
HfHubHTTPError - exceeded our hourly quotas for action: commit
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/57996478?v=4",
"events_url": "https://api.github.com/users/yuvalkirstain/events{/privacy}",
"followers_url": "https://api.github.com/users/yuvalkirstain/followers",
"following_url": "https://api.github.com/users/yuvalkirstain/following{/other_user}",
"gists_url": "https://api.github.com/users/yuvalkirstain/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/yuvalkirstain",
"id": 57996478,
"login": "yuvalkirstain",
"node_id": "MDQ6VXNlcjU3OTk2NDc4",
"organizations_url": "https://api.github.com/users/yuvalkirstain/orgs",
"received_events_url": "https://api.github.com/users/yuvalkirstain/received_events",
"repos_url": "https://api.github.com/users/yuvalkirstain/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/yuvalkirstain/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yuvalkirstain/subscriptions",
"type": "User",
"url": "https://api.github.com/users/yuvalkirstain",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"how is your dataset structured? (file types, how many commits and files are you trying to push, etc)",
"I succeeded in uploading it after several attempts with an hour gap between each attempt (inconvenient but worked). The final dataset is [here](https://huggingface.co/datasets/yuvalkirstain/pickapic_v2), code and context to the dataset can be found [here](https://github.com/yuvalkirstain/PickScore/).\r\nI can close the issue if this behavior is intended, as most users probably do not need to upload large-scale datasets.",
"We could fix this by creating a single commit for all the (Parquet) shards in `push_to_hub` instead of one commit per shard, as we currently do. \r\n\r\n@Wauplin Any updates on the 2-step commit process suggested by you that we need to implement this?",
"> Any updates on the 2-step commit process suggested by you that we need to implement this?\r\n\r\nRe-prioritizing this, sorry. Will let you know but probably can be done this week."
] | 2023-09-25T06:11:43
| 2023-10-16T13:30:49
| 2023-10-16T13:30:48
|
NONE
| null | null | null | null |
### Describe the bug
I try to upload a very large dataset of images, and get the following error:
```
File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/hf_api.py:2712, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit, run_as_future)
2710 try:
2711 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params)
-> 2712 hf_raise_for_status(commit_resp, endpoint_name="commit")
2713 except RepositoryNotFoundError as e:
2714 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE)
File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name)
297 raise BadRequestError(message, response=response) from e
299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information
300 # as well (request id and/or server error message)
--> 301 raise HfHubHTTPError(str(e), response=response) from e
HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/yuvalkirstain/pickapic_v2/commit/main (Request ID: Root=1-65112399-12d63f7d7f28bfa40a36a0fd)
You have exceeded our hourly quotas for action: commit. We invite you to retry later.
```
this makes it much less convenient to host large datasets on HF hub.
### Steps to reproduce the bug
Upload a very large dataset of images
### Expected behavior
the upload to work well
### Environment info
- `datasets` version: 2.13.1
- Platform: Linux-5.15.0-1033-aws-x86_64-with-glibc2.31
- Python version: 3.10.11
- Huggingface_hub version: 0.15.1
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6257/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6257/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 21 days, 7:19:05
|
https://api.github.com/repos/huggingface/datasets/issues/6256
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6256/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6256/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6256/events
|
https://github.com/huggingface/datasets/issues/6256
| 1,910,275,199
|
I_kwDODunzps5x3Hx_
| 6,256
|
load_dataset() function's cache_dir does not seems to work
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/171831?v=4",
"events_url": "https://api.github.com/users/andyzhu/events{/privacy}",
"followers_url": "https://api.github.com/users/andyzhu/followers",
"following_url": "https://api.github.com/users/andyzhu/following{/other_user}",
"gists_url": "https://api.github.com/users/andyzhu/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/andyzhu",
"id": 171831,
"login": "andyzhu",
"node_id": "MDQ6VXNlcjE3MTgzMQ==",
"organizations_url": "https://api.github.com/users/andyzhu/orgs",
"received_events_url": "https://api.github.com/users/andyzhu/received_events",
"repos_url": "https://api.github.com/users/andyzhu/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/andyzhu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andyzhu/subscriptions",
"type": "User",
"url": "https://api.github.com/users/andyzhu",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"Can you share the error message?\r\n\r\nAlso, it would help if you could check whether `huggingface_hub`'s download behaves the same:\r\n```python\r\nfrom huggingface_hub import snapshot_download\r\nsnapshot_download(\"trec\", repo_type=\"dataset\", cache_dir='/path/to/my/dir)\r\n```\r\n\r\nIn the next major release, we aim to switch to `huggingface_hub` for file download/caching, but we could align the `cache_dir`'s `umask` behavior earlier than this if their solution works for your use case.",
"@mariosasko, Hey , is there any update on this? ",
"Yes, I am still facing the same issue.\r\n\r\n```python\r\nfrom huggingface_hub import snapshot_download\r\nsnapshot_download(\"trec\", repo_type=\"dataset\", cache_dir='/path/to/my/dir)\r\n```\r\n\r\nBut this is working for me.\r\n\r\nThanks.",
"Could you clarify a bit? What if I wanted only 100 samples from train split, how would i change the above? Thanks",
"I have exactly same issue",
"@lhoestq Can this be open again? Reading #7200 this doesn't even address not being able to specify `cache_dir`, it just updates the documentation? Their own comment states this:\n\n> In my testing, I could not specify the cache directory even by load_dataset(\"dataset_name\" cache_dir=\"...\"). It might be another issue. I also welcome any advice to solve this issue.\n\nNothing else in the PR seems to indicate that this is actually resolved.",
"I've noticed the same issue. Looks like #7499 was fixing it, but from what I see in the comments this setting is for different caches?",
"Hi ! you can find the information about the `datasets` and `huggingface_hub` cache directories here: https://huggingface.co/docs/datasets/v3.6.0/en/cache#cache-directory"
] | 2023-09-24T15:34:06
| 2025-05-14T10:08:53
| 2024-10-08T15:45:18
|
NONE
| null | null | null | null |
### Describe the bug
datasets version: 2.14.5
when trying to run the following command
trec = load_dataset('trec', split='train[:1000]', cache_dir='/path/to/my/dir')
I keep getting error saying the command does not have permission to the default cache directory on my macbook pro machine.
It seems the cache_dir parameter cannot change the dataset saving directory from the default
what ever explained in the https://huggingface.co/docs/datasets/cache does not seem to work
### Steps to reproduce the bug
datasets version: 2.14.5
when trying to run the following command
trec = load_dataset('trec', split='train[:1000]', cache_dir='/path/to/my/dir')
I keep getting error saying the command does not have permission to the default cache directory on my macbook pro machine.
It seems the cache_dir parameter cannot change the dataset saving directory from the default
what ever explained in the https://huggingface.co/docs/datasets/cache does not seem to work
### Expected behavior
the dataset should be saved to the cache_dir points to
### Environment info
datasets version: 2.14.5
macos X: Ventura 13.4.1 (c)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lhoestq",
"id": 42851186,
"login": "lhoestq",
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lhoestq",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 1,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6256/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6256/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 380 days, 0:11:12
|
https://api.github.com/repos/huggingface/datasets/issues/6254
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6254/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6254/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6254/events
|
https://github.com/huggingface/datasets/issues/6254
| 1,909,672,104
|
I_kwDODunzps5x00io
| 6,254
|
Dataset.from_generator() cost much more time in vscode debugging mode then running mode
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/56437469?v=4",
"events_url": "https://api.github.com/users/dontnet-wuenze/events{/privacy}",
"followers_url": "https://api.github.com/users/dontnet-wuenze/followers",
"following_url": "https://api.github.com/users/dontnet-wuenze/following{/other_user}",
"gists_url": "https://api.github.com/users/dontnet-wuenze/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dontnet-wuenze",
"id": 56437469,
"login": "dontnet-wuenze",
"node_id": "MDQ6VXNlcjU2NDM3NDY5",
"organizations_url": "https://api.github.com/users/dontnet-wuenze/orgs",
"received_events_url": "https://api.github.com/users/dontnet-wuenze/received_events",
"repos_url": "https://api.github.com/users/dontnet-wuenze/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dontnet-wuenze/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dontnet-wuenze/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dontnet-wuenze",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"Answered on the forum: https://discuss.huggingface.co/t/dataset-from-generator-cost-much-more-time-in-vscode-debugging-mode-then-running-mode/56005/2"
] | 2023-09-23T02:07:26
| 2023-10-03T14:42:53
| 2023-10-03T14:42:53
|
NONE
| null | null | null | null |
### Describe the bug
Hey there,
I’m using Dataset.from_generator() to convert a torch_dataset to the Huggingface Dataset.
However, when I debug my code on vscode, I find that it runs really slow on Dataset.from_generator() which may even 20 times longer then run the script on terminal.
### Steps to reproduce the bug
I write a simple test code :
```python
import os
from functools import partial
from typing import Callable
import torch
import time
from torch.utils.data import Dataset as TorchDataset
from datasets import load_from_disk, Dataset as HFDataset
import torch
from torch.utils.data import Dataset
class SimpleDataset(Dataset):
def __init__(self, data):
self.data = data
self.keys = list(data[0].keys())
def __len__(self):
return len(self.data)
def __getitem__(self, index):
sample = self.data[index]
return {key: sample[key] for key in self.keys}
def TorchDataset2HuggingfaceDataset(torch_dataset: TorchDataset, cache_dir: str = None
) -> HFDataset:
"""
convert torch dataset to huggingface dataset
"""
generator : Callable[[], TorchDataset] = lambda: (sample for sample in torch_dataset)
return HFDataset.from_generator(generator, cache_dir=cache_dir)
if __name__ == '__main__':
data = [
{'id': 1, 'name': 'Alice'},
{'id': 2, 'name': 'Bob'},
{'id': 3, 'name': 'Charlie'}
]
torch_dataset = SimpleDataset(data)
start_time = time.time()
huggingface_dataset = TorchDataset2HuggingfaceDataset(torch_dataset)
end_time = time.time()
print("time: ", end_time - start_time)
print(huggingface_dataset)
```
### Expected behavior
this test on my machine report that the running time on terminal is 0.086,
however the running time in debugging mode on vscode is 0.25, which I think is much longer than expected.
I’d like to know is the anything wrong in the code or just because of debugging?
I have traced the code and I find is this func which I get stuck.
```python
def create_config_id(
self,
config_kwargs: dict,
custom_features: Optional[Features] = None,
) -> str:
...
# stuck in this line
suffix = Hasher.hash(config_kwargs_to_add_to_suffix)
```
### Environment info
- `datasets` version: 2.12.0
- Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31
- Python version: 3.11.3
- Huggingface_hub version: 0.17.2
- PyArrow version: 11.0.0
- Pandas version: 2.0.1
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6254/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6254/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 10 days, 12:35:27
|
https://api.github.com/repos/huggingface/datasets/issues/6252
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6252/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6252/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6252/events
|
https://github.com/huggingface/datasets/issues/6252
| 1,906,375,378
|
I_kwDODunzps5xoPrS
| 6,252
|
exif_transpose not done to Image (PIL problem)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/108274349?v=4",
"events_url": "https://api.github.com/users/rhajou/events{/privacy}",
"followers_url": "https://api.github.com/users/rhajou/followers",
"following_url": "https://api.github.com/users/rhajou/following{/other_user}",
"gists_url": "https://api.github.com/users/rhajou/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rhajou",
"id": 108274349,
"login": "rhajou",
"node_id": "U_kgDOBnQirQ",
"organizations_url": "https://api.github.com/users/rhajou/orgs",
"received_events_url": "https://api.github.com/users/rhajou/received_events",
"repos_url": "https://api.github.com/users/rhajou/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rhajou/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rhajou/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rhajou",
"user_view_type": "public"
}
|
[
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
closed
| false
| null |
[] |
[
"Indeed, it makes sense to do this by default. \r\n\r\nIn the meantime, you can use `.with_transform` to transpose the images when accessing them:\r\n\r\n```python\r\nimport PIL.ImageOps\r\n\r\ndef exif_transpose_transform(batch):\r\n batch[\"image\"] = [PIL.ImageOps.exif_transpose(image) for image in batch[\"image\"]]\r\n return batch\r\n\r\ndataset = dataset.with_transform(exif_transpose_transform)\r\n```",
"This operation sets some `Image` attributes to `None` (`.format`, `.filename`, etc.), causing our tests to fail, so I think we should wait for Datasets 3.0 to make this change. In version 3.0, storing image paths will be replaced by embedding image bytes, so there will be fewer instances where we use the `.filename` attribute."
] | 2023-09-21T08:11:46
| 2024-03-19T15:29:43
| 2024-03-19T15:29:43
|
NONE
| null | null | null | null |
### Feature request
I noticed that some of my images loaded using PIL have some metadata related to exif that can rotate them when loading.
Since the dataset.features.Image uses PIL for loading, the loaded image may be rotated (width and height will be inverted) thus for tasks as object detection and layoutLM this can create some inconsistencies (between input bboxes and input images).
For now there is no option in datasets.features.Image to specify that. We need to do the following when preparing examples (when preparing images for training, test or inference):
```
from PIL import Image, ImageOps
pil = ImageOps.exif_transpose(pil)
```
reference: https://stackoverflow.com/a/63950647/5720150
Is it possible to add this by default to the datasets.feature.Image ? or to add the option to do the ImageOps.exif_transpose?
Thank you
### Motivation
Prevent having inverted data related to exif metadata that may affect object detection tasks
### Your contribution
Changing in datasets.featrues.Image I can help with that.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6252/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6252/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 180 days, 7:17:57
|
https://api.github.com/repos/huggingface/datasets/issues/6246
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6246/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6246/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6246/events
|
https://github.com/huggingface/datasets/issues/6246
| 1,899,848,414
|
I_kwDODunzps5xPWLe
| 6,246
|
Add new column to dataset
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/20493493?v=4",
"events_url": "https://api.github.com/users/andysingal/events{/privacy}",
"followers_url": "https://api.github.com/users/andysingal/followers",
"following_url": "https://api.github.com/users/andysingal/following{/other_user}",
"gists_url": "https://api.github.com/users/andysingal/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/andysingal",
"id": 20493493,
"login": "andysingal",
"node_id": "MDQ6VXNlcjIwNDkzNDkz",
"organizations_url": "https://api.github.com/users/andysingal/orgs",
"received_events_url": "https://api.github.com/users/andysingal/received_events",
"repos_url": "https://api.github.com/users/andysingal/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/andysingal/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andysingal/subscriptions",
"type": "User",
"url": "https://api.github.com/users/andysingal",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"I think it's an issue with the code.\r\n\r\nSpecifically:\r\n```python\r\ndataset = dataset['train'].add_column(\"/workspace/data\", new_column)\r\n```\r\n\r\nNow `dataset` is the train set with a new column. \r\nTo fix this, you can do:\r\n\r\n```python\r\ndataset['train'] = dataset['train'].add_column(\"/workspace/data\", new_column)\r\n```",
"> I think it's an issue with the code.\r\n> \r\n> Specifically:\r\n> \r\n> ```python\r\n> dataset = dataset['train'].add_column(\"/workspace/data\", new_column)\r\n> ```\r\n> \r\n> Now `dataset` is the train set with a new column. To fix this, you can do:\r\n> \r\n> ```python\r\n> dataset['train'] = dataset['train'].add_column(\"/workspace/data\", new_column)\r\n> ```\r\n\r\nThanks for your response, but i can not access mask images, please let me know why the problem still persists. Here is the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing ",
"I think there is a slight misunderstanding.\r\n```python\r\nnew_column = [\"mask\"] * len(dataset[\"train\"])\r\ndataset['train'] = dataset['train'].add_column(\"/workspace/data\", new_column)\r\n```\r\n\r\nadds a column with the string `mask` to your dataset.\r\nIf you're trying to load the images `\"mask_{idx}.png\"` in your dataset, you could try:\r\n\r\n```\r\nfrom datasets import Image\r\n\r\ndataset['train'] = dataset['train'].map(lambda u, idx: {'mask': f\"/workspace/data/mask_{idx}.png\", with_indices=True).cast_column(\"mask\", Image())\r\n```\r\n\r\nWhat this does is that it adds a column to your dataset name `mask` with the path to the mask, then it cast the column as an `Image` feature.\r\n\r\nThis [link](https://huggingface.co/docs/datasets/v2.5.1/en/image_load) explains how to load images.\r\n\r\nHope this helps!",
"> I think there is a slight misunderstanding.\r\n> \r\n> ```python\r\n> new_column = [\"mask\"] * len(dataset[\"train\"])\r\n> dataset['train'] = dataset['train'].add_column(\"/workspace/data\", new_column)\r\n> ```\r\n> \r\n> adds a column with the string `mask` to your dataset. If you're trying to load the images `\"mask_{idx}.png\"` in your dataset, you could try:\r\n> \r\n> ```\r\n> from datasets import Image\r\n> \r\n> dataset['train'] = dataset['train'].map(lambda u, idx: {'mask': f\"/workspace/data/mask_{idx}.png\", with_indices=True).cast_column(\"mask\", Image())\r\n> ```\r\n> \r\n> What this does is that it adds a column to your dataset name `mask` with the path to the mask, then it cast the column as an `Image` feature.\r\n> \r\n> This [link](https://huggingface.co/docs/datasets/v2.5.1/en/image_load) explains how to load images.\r\n> \r\n> Hope this helps!\r\n\r\nThank you very much, this is really helpful...\r\ni made some changes for it to work:\r\n```\r\ndataset['train'] = dataset['train'].map(lambda u, idx: {'mask': f\"/content/data/mask_{idx}.png\"}, with_indices=True).cast_column(\"mask\", Image())\r\n```\r\nThanks Again @Dref360 "
] | 2023-09-17T16:59:48
| 2023-09-18T16:20:09
| 2023-09-18T16:20:09
|
NONE
| null | null | null | null |
### Describe the bug
```
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
[<ipython-input-9-bd197b36b6a0>](https://localhost:8080/#) in <cell line: 1>()
----> 1 dataset['train']['/workspace/data']
3 frames
[/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_column_key(key, columns)
518 def _check_valid_column_key(key: str, columns: List[str]) -> None:
519 if key not in columns:
--> 520 raise KeyError(f"Column {key} not in the dataset. Current columns in the dataset: {columns}")
521
522
KeyError: "Column train not in the dataset. Current columns in the dataset: ['image', '/workspace/data']"
```
### Steps to reproduce the bug
please find the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing
### Expected behavior
add column to the dataset
### Environment info
colab pro
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/20493493?v=4",
"events_url": "https://api.github.com/users/andysingal/events{/privacy}",
"followers_url": "https://api.github.com/users/andysingal/followers",
"following_url": "https://api.github.com/users/andysingal/following{/other_user}",
"gists_url": "https://api.github.com/users/andysingal/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/andysingal",
"id": 20493493,
"login": "andysingal",
"node_id": "MDQ6VXNlcjIwNDkzNDkz",
"organizations_url": "https://api.github.com/users/andysingal/orgs",
"received_events_url": "https://api.github.com/users/andysingal/received_events",
"repos_url": "https://api.github.com/users/andysingal/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/andysingal/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andysingal/subscriptions",
"type": "User",
"url": "https://api.github.com/users/andysingal",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6246/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6246/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 23:20:21
|
https://api.github.com/repos/huggingface/datasets/issues/6242
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6242/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6242/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6242/events
|
https://github.com/huggingface/datasets/issues/6242
| 1,896,899,123
|
I_kwDODunzps5xEGIz
| 6,242
|
Data alteration when loading dataset with unspecified inner sequence length
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/45557362?v=4",
"events_url": "https://api.github.com/users/qgallouedec/events{/privacy}",
"followers_url": "https://api.github.com/users/qgallouedec/followers",
"following_url": "https://api.github.com/users/qgallouedec/following{/other_user}",
"gists_url": "https://api.github.com/users/qgallouedec/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/qgallouedec",
"id": 45557362,
"login": "qgallouedec",
"node_id": "MDQ6VXNlcjQ1NTU3MzYy",
"organizations_url": "https://api.github.com/users/qgallouedec/orgs",
"received_events_url": "https://api.github.com/users/qgallouedec/received_events",
"repos_url": "https://api.github.com/users/qgallouedec/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/qgallouedec/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/qgallouedec/subscriptions",
"type": "User",
"url": "https://api.github.com/users/qgallouedec",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"While this issue may seem specific, it led to a silent problem in my workflow that took days to diagnose. If this feature is not intended to be supported, an error should be raised when encountering this configuration to prevent such issues.",
"Thanks for reporting! This is a MRE:\r\n\r\n```python\r\nimport pyarrow as pa\r\nfrom datasets.table import cast_array_to_feature\r\nfrom datasets import Sequence, Value\r\ndata = [\r\n [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]],\r\n [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]],\r\n]\r\narr = pa.array(data, pa.list_(pa.list_(pa.float32(), 3)))\r\ncast_array_to_feature(arr, Sequence(Sequence(Value(\"float32\"))))\r\n```\r\n\r\nI've opened a PR with a fix."
] | 2023-09-14T16:12:45
| 2023-09-19T17:53:18
| 2023-09-19T17:53:18
|
MEMBER
| null | null | null | null |
### Describe the bug
When a dataset saved with a specified inner sequence length is loaded without specifying that length, the original data is altered and becomes inconsistent.
### Steps to reproduce the bug
```python
from datasets import Dataset, Features, Value, Sequence, load_dataset
# Repository ID
repo_id = "my_repo_id"
# Define features with a specific length of 3 for each inner sequence
specified_features = Features({"key": Sequence(Sequence(Value("float32"), length=3))})
# Create a dataset with the specified features
data = [
[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]],
[[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]],
]
dataset = Dataset.from_dict({"key": data}, features=specified_features)
# Push the dataset to the hub
dataset.push_to_hub(repo_id)
# Define features without specifying the length
unspecified_features = Features({"key": Sequence(Sequence(Value("float32")))})
# Load the dataset from the hub with this new feature definition
dataset = load_dataset(f"qgallouedec/{repo_id}", split="train", features=unspecified_features)
# The obtained data is altered
print(dataset.to_dict()) # {'key': [[[1.0], [2.0]], [[3.0], [4.0]]]}
```
### Expected behavior
```python
print(dataset.to_dict()) # {'key': [[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]]]}
```
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-6.2.0-32-generic-x86_64-with-glibc2.35
- Python version: 3.9.12
- Huggingface_hub version: 0.15.1
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6242/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6242/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 5 days, 1:40:33
|
https://api.github.com/repos/huggingface/datasets/issues/6240
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6240/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6240/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6240/events
|
https://github.com/huggingface/datasets/issues/6240
| 1,895,723,888
|
I_kwDODunzps5w_nNw
| 6,240
|
Dataloader stuck on multiple GPUs
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/40049003?v=4",
"events_url": "https://api.github.com/users/kuri54/events{/privacy}",
"followers_url": "https://api.github.com/users/kuri54/followers",
"following_url": "https://api.github.com/users/kuri54/following{/other_user}",
"gists_url": "https://api.github.com/users/kuri54/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kuri54",
"id": 40049003,
"login": "kuri54",
"node_id": "MDQ6VXNlcjQwMDQ5MDAz",
"organizations_url": "https://api.github.com/users/kuri54/orgs",
"received_events_url": "https://api.github.com/users/kuri54/received_events",
"repos_url": "https://api.github.com/users/kuri54/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kuri54/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kuri54/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kuri54",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"What type of dataset are you using in this script? `torch.utils.data.Dataset` or `datasets.Dataset`? Please share the `datasets` package version if it's the latter. Otherwise, it's better to move this issue to the `accelerate` repo.",
"Very sorry, I thought I had a repo in `accelerate!`\r\nI will close this issue and repo the issue in the appropriate place."
] | 2023-09-14T05:30:30
| 2023-09-14T23:54:42
| 2023-09-14T23:54:42
|
NONE
| null | null | null | null |
### Describe the bug
I am trying to get CLIP to fine-tuning with my code.
When I tried to run it on multiple GPUs using accelerate, I encountered the following phenomenon.
- Validation dataloader stuck in 2nd epoch only on multi-GPU
Specifically, when the "for inputs in valid_loader:" process is finished, it does not proceed to the next step. train_loader process is completed. Also, both train and valid are working correctly in the first epoch.
The accelerate command at that time is as follows.
`accelerate launch --multi_gpu --num_processes=2 {script_name.py} {--arg1} {--arg2} ...`
- This will not happen when single GPU is used.
`CUDA_VISIBLE_DEVICES="0" accelerate launch {script_name.py} --arg1 --arg2 ...`
- Setting num_workers=0 in dataloader did not change the result.
### Steps to reproduce the bug
1. The codes for fine-tuning the regular CLIP were updated for accelerate.
2. Run the code with the accelerate command as `accelerate launch --multi_gpu --num_processes=2 {script_name.py} {--arg1} {--arg2} ...` and the above problem will occur.
3. CUDA_VISIBLE_DEVICES="0" accelerate launch {script_name.py} --arg1 --arg2 ...` , it works fine.
### Expected behavior
It Should end normally as if it was run on a single GPU.
### Environment info
Since `datasets-cli env` did not work, the environment is described below.
- OS: Ubuntu 22.04 with Docker
- Docker: 24.0.5, build ced0996
- Python: 3.10.12
- torch==2.0.1
- accelerate==0.21.0
- transformers==4.33.1
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/40049003?v=4",
"events_url": "https://api.github.com/users/kuri54/events{/privacy}",
"followers_url": "https://api.github.com/users/kuri54/followers",
"following_url": "https://api.github.com/users/kuri54/following{/other_user}",
"gists_url": "https://api.github.com/users/kuri54/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kuri54",
"id": 40049003,
"login": "kuri54",
"node_id": "MDQ6VXNlcjQwMDQ5MDAz",
"organizations_url": "https://api.github.com/users/kuri54/orgs",
"received_events_url": "https://api.github.com/users/kuri54/received_events",
"repos_url": "https://api.github.com/users/kuri54/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kuri54/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kuri54/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kuri54",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6240/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6240/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 18:24:12
|
https://api.github.com/repos/huggingface/datasets/issues/6239
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6239/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6239/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6239/events
|
https://github.com/huggingface/datasets/issues/6239
| 1,895,349,382
|
I_kwDODunzps5w-LyG
| 6,239
|
Load local audio data doesn't work
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/554032?v=4",
"events_url": "https://api.github.com/users/abodacs/events{/privacy}",
"followers_url": "https://api.github.com/users/abodacs/followers",
"following_url": "https://api.github.com/users/abodacs/following{/other_user}",
"gists_url": "https://api.github.com/users/abodacs/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/abodacs",
"id": 554032,
"login": "abodacs",
"node_id": "MDQ6VXNlcjU1NDAzMg==",
"organizations_url": "https://api.github.com/users/abodacs/orgs",
"received_events_url": "https://api.github.com/users/abodacs/received_events",
"repos_url": "https://api.github.com/users/abodacs/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/abodacs/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/abodacs/subscriptions",
"type": "User",
"url": "https://api.github.com/users/abodacs",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"I think this is the same issue as https://github.com/huggingface/datasets/issues/4776. Maybe installing `ffmpeg` can fix it:\r\n```python\r\nadd-apt-repository -y ppa:savoury1/ffmpeg4\r\napt-get -qq install -y ffmpeg\r\n```\r\n\r\nHowever, the best solution is to use a newer version of `datasets`. In the recent releases, we've replaced `torchaudio` with `soundfile`, which is easier to install and faster.",
"@mariosasko \r\nThanks for your help"
] | 2023-09-13T22:30:01
| 2023-09-15T14:32:10
| 2023-09-15T14:32:10
|
NONE
| null | null | null | null |
### Describe the bug
I get a RuntimeError from the following code:
```python
audio_dataset = Dataset.from_dict({"audio": ["/kaggle/input/bengaliai-speech/train_mp3s/000005f3362c.mp3"]}).cast_column("audio", Audio())
audio_dataset[0]
```
### Traceback
<details>
```python
RuntimeError Traceback (most recent call last)
Cell In[33], line 1
----> 1 train_dataset[0]
File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:1764, in Dataset.__getitem__(self, key)
1762 def __getitem__(self, key): # noqa: F811
1763 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools)."""
-> 1764 return self._getitem(
1765 key,
1766 )
File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:1749, in Dataset._getitem(self, key, decoded, **kwargs)
1747 formatter = get_formatter(format_type, features=self.features, decoded=decoded, **format_kwargs)
1748 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
-> 1749 formatted_output = format_table(
1750 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns
1751 )
1752 return formatted_output
File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:532, in format_table(table, key, formatter, format_columns, output_all_columns)
530 python_formatter = PythonFormatter(features=None)
531 if format_columns is None:
--> 532 return formatter(pa_table, query_type=query_type)
533 elif query_type == "column":
534 if key in format_columns:
File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:281, in Formatter.__call__(self, pa_table, query_type)
279 def __call__(self, pa_table: pa.Table, query_type: str) -> Union[RowFormat, ColumnFormat, BatchFormat]:
280 if query_type == "row":
--> 281 return self.format_row(pa_table)
282 elif query_type == "column":
283 return self.format_column(pa_table)
File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:312, in PythonFormatter.format_row(self, pa_table)
310 row = self.python_arrow_extractor().extract_row(pa_table)
311 if self.decoded:
--> 312 row = self.python_features_decoder.decode_row(row)
313 return row
File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:221, in PythonFeaturesDecoder.decode_row(self, row)
220 def decode_row(self, row: dict) -> dict:
--> 221 return self.features.decode_example(row) if self.features else row
File /opt/conda/lib/python3.10/site-packages/datasets/features/features.py:1386, in Features.decode_example(self, example)
1376 def decode_example(self, example: dict):
1377 """Decode example with custom feature decoding.
1378
1379 Args:
(...)
1383 :obj:`dict[str, Any]`
1384 """
-> 1386 return {
1387 column_name: decode_nested_example(feature, value)
1388 if self._column_requires_decoding[column_name]
1389 else value
1390 for column_name, (feature, value) in zip_dict(
1391 {key: value for key, value in self.items() if key in example}, example
1392 )
1393 }
File /opt/conda/lib/python3.10/site-packages/datasets/features/features.py:1387, in <dictcomp>(.0)
1376 def decode_example(self, example: dict):
1377 """Decode example with custom feature decoding.
1378
1379 Args:
(...)
1383 :obj:`dict[str, Any]`
1384 """
1386 return {
-> 1387 column_name: decode_nested_example(feature, value)
1388 if self._column_requires_decoding[column_name]
1389 else value
1390 for column_name, (feature, value) in zip_dict(
1391 {key: value for key, value in self.items() if key in example}, example
1392 )
1393 }
File /opt/conda/lib/python3.10/site-packages/datasets/features/features.py:1087, in decode_nested_example(schema, obj)
1085 # Object with special decoding:
1086 elif isinstance(schema, (Audio, Image)):
-> 1087 return schema.decode_example(obj) if obj is not None else None
1088 return obj
File /opt/conda/lib/python3.10/site-packages/datasets/features/audio.py:103, in Audio.decode_example(self, value)
101 raise ValueError(f"An audio sample should have one of 'path' or 'bytes' but both are None in {value}.")
102 elif path is not None and path.endswith("mp3"):
--> 103 array, sampling_rate = self._decode_mp3(file if file else path)
104 elif path is not None and path.endswith("opus"):
105 if file:
File /opt/conda/lib/python3.10/site-packages/datasets/features/audio.py:241, in Audio._decode_mp3(self, path_or_file)
238 except RuntimeError as err:
239 raise ImportError("To support decoding 'mp3' audio files, please install 'sox'.") from err
--> 241 array, sampling_rate = torchaudio.load(path_or_file, format="mp3")
242 if self.sampling_rate and self.sampling_rate != sampling_rate:
243 if not hasattr(self, "_resampler") or self._resampler.orig_freq != sampling_rate:
File /opt/conda/lib/python3.10/site-packages/torchaudio/backend/sox_io_backend.py:256, in load(filepath, frame_offset, num_frames, normalize, channels_first, format)
254 if ret is not None:
255 return ret
--> 256 return _fallback_load(filepath, frame_offset, num_frames, normalize, channels_first, format)
File /opt/conda/lib/python3.10/site-packages/torchaudio/backend/sox_io_backend.py:30, in _fail_load(filepath, frame_offset, num_frames, normalize, channels_first, format)
22 def _fail_load(
23 filepath: str,
24 frame_offset: int = 0,
(...)
28 format: Optional[str] = None,
29 ) -> Tuple[torch.Tensor, int]:
---> 30 raise RuntimeError("Failed to load audio from {}".format(filepath))
RuntimeError: Failed to load audio from /kaggle/input/bengaliai-speech/train_mp3s/000005f3362c.mp3
```
</details>
### Steps to reproduce the bug
1. - Create a custom dataset using Local files of type mp3.
3. - Try to read the first audio item.
### Expected behavior
Expected output
```python
audio_dataset[0]["audio"]
{'array': array([ 0. , 0.00024414, -0.00024414, ..., -0.00024414,
0. , 0. ], dtype=float32),
'path': 'path/to/audio_1',
'sampling_rate': 16000}
```
### Environment info
N/A
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/554032?v=4",
"events_url": "https://api.github.com/users/abodacs/events{/privacy}",
"followers_url": "https://api.github.com/users/abodacs/followers",
"following_url": "https://api.github.com/users/abodacs/following{/other_user}",
"gists_url": "https://api.github.com/users/abodacs/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/abodacs",
"id": 554032,
"login": "abodacs",
"node_id": "MDQ6VXNlcjU1NDAzMg==",
"organizations_url": "https://api.github.com/users/abodacs/orgs",
"received_events_url": "https://api.github.com/users/abodacs/received_events",
"repos_url": "https://api.github.com/users/abodacs/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/abodacs/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/abodacs/subscriptions",
"type": "User",
"url": "https://api.github.com/users/abodacs",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6239/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6239/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 1 day, 16:02:09
|
https://api.github.com/repos/huggingface/datasets/issues/6238
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6238/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6238/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6238/events
|
https://github.com/huggingface/datasets/issues/6238
| 1,895,207,828
|
I_kwDODunzps5w9pOU
| 6,238
|
`dataset.filter` ALWAYS removes the first item from the dataset when using batched=True
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1330693?v=4",
"events_url": "https://api.github.com/users/Taytay/events{/privacy}",
"followers_url": "https://api.github.com/users/Taytay/followers",
"following_url": "https://api.github.com/users/Taytay/following{/other_user}",
"gists_url": "https://api.github.com/users/Taytay/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Taytay",
"id": 1330693,
"login": "Taytay",
"node_id": "MDQ6VXNlcjEzMzA2OTM=",
"organizations_url": "https://api.github.com/users/Taytay/orgs",
"received_events_url": "https://api.github.com/users/Taytay/received_events",
"repos_url": "https://api.github.com/users/Taytay/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Taytay/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Taytay/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Taytay",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"`filter` treats the function's output as a (selection) mask - `True` keeps the sample, and `False` drops it. In your case, `bool(0)` evaluates to `False`, so dropping the first sample is the correct behavior.",
"Oh gosh! 🤦 I totally misunderstood the API! My apologies!"
] | 2023-09-13T20:20:37
| 2023-09-17T07:05:07
| 2023-09-17T07:05:07
|
NONE
| null | null | null | null |
### Describe the bug
If you call batched=True when calling `filter`, the first item is _always_ filtered out, regardless of the filter condition.
### Steps to reproduce the bug
Here's a minimal example:
```python
def filter_batch_always_true(batch, indices):
print("First index being passed into this filter function: ", indices[0])
return indices # Keep all indices
data = {"value": list(range(10))}
dataset = Dataset.from_dict(data)
filtered_dataset = dataset.filter(filter_batch_always_true, with_indices=True, batched=True)
print("Length of original dataset: ", len(dataset))
print("Length of filtered_dataset: ", len(filtered_dataset))
print("Is equal to original? ", len(filtered_dataset) == len(dataset))
print("First item of filtered dataset: ", filtered_dataset[0])
print("Last item of filtered dataset: ", filtered_dataset[-1])
```
prints:
```
First index being passed into this filter function: 0
Length of original dataset: 10
Length of filtered_dataset: 9
Is equal to original? False
First item of filtered dataset: {'value': 1}
Last item of filtered dataset: {'value': 9}
```
### Expected behavior
Filter should respect the filter condition.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.5-arm64-arm-64bit
- Python version: 3.9.18
- Huggingface_hub version: 0.17.1
- PyArrow version: 10.0.1
- Pandas version: 2.0.2
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1330693?v=4",
"events_url": "https://api.github.com/users/Taytay/events{/privacy}",
"followers_url": "https://api.github.com/users/Taytay/followers",
"following_url": "https://api.github.com/users/Taytay/following{/other_user}",
"gists_url": "https://api.github.com/users/Taytay/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Taytay",
"id": 1330693,
"login": "Taytay",
"node_id": "MDQ6VXNlcjEzMzA2OTM=",
"organizations_url": "https://api.github.com/users/Taytay/orgs",
"received_events_url": "https://api.github.com/users/Taytay/received_events",
"repos_url": "https://api.github.com/users/Taytay/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Taytay/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Taytay/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Taytay",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6238/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6238/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 3 days, 10:44:30
|
https://api.github.com/repos/huggingface/datasets/issues/6237
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6237/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6237/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6237/events
|
https://github.com/huggingface/datasets/issues/6237
| 1,893,822,321
|
I_kwDODunzps5w4W9x
| 6,237
|
Tokenization with multiple workers is too slow
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/25720695?v=4",
"events_url": "https://api.github.com/users/macabdul9/events{/privacy}",
"followers_url": "https://api.github.com/users/macabdul9/followers",
"following_url": "https://api.github.com/users/macabdul9/following{/other_user}",
"gists_url": "https://api.github.com/users/macabdul9/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/macabdul9",
"id": 25720695,
"login": "macabdul9",
"node_id": "MDQ6VXNlcjI1NzIwNjk1",
"organizations_url": "https://api.github.com/users/macabdul9/orgs",
"received_events_url": "https://api.github.com/users/macabdul9/received_events",
"repos_url": "https://api.github.com/users/macabdul9/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/macabdul9/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/macabdul9/subscriptions",
"type": "User",
"url": "https://api.github.com/users/macabdul9",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"[This](https://huggingface.co/docs/datasets/nlp_process#map) is the most performant way to tokenize a dataset (`batched=True, num_proc=None, return_tensors=\"np\"`) \r\n\r\nIf`tokenizer.is_fast` returns `True`, `num_proc` must be `None/1` to benefit from the fast tokenizers' parallelism (the fast tokenizers are implemented in Rust, and Rust multi-threading doesn't work well with Python multi-processing)"
] | 2023-09-13T06:18:34
| 2023-09-19T21:54:58
| 2023-09-19T21:54:58
|
NONE
| null | null | null | null |
I am trying to tokenize a few million documents with multiple workers but the tokenization process is taking forever.
Code snippet:
```
raw_datasets.map(
encode_function,
batched=False,
num_proc=args.preprocessing_num_workers,
load_from_cache_file=not args.overwrite_cache,
remove_columns=[name for name in raw_datasets["train"].column_names if name not in ["input_ids", "labels", "attention_mask"]],
desc="Tokenizing data",
)
```
Details:
```
transformers==4.28.0.dev0
datasets==4.28.0.dev0
preprocessing_num_workers==48
```
tokenizer == decapoda-research/llama-7b-hf
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6237/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6237/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 6 days, 15:36:24
|
https://api.github.com/repos/huggingface/datasets/issues/6236
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6236/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6236/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6236/events
|
https://github.com/huggingface/datasets/issues/6236
| 1,893,648,480
|
I_kwDODunzps5w3shg
| 6,236
|
Support buffer shuffle for to_tf_dataset
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7635551?v=4",
"events_url": "https://api.github.com/users/EthanRock/events{/privacy}",
"followers_url": "https://api.github.com/users/EthanRock/followers",
"following_url": "https://api.github.com/users/EthanRock/following{/other_user}",
"gists_url": "https://api.github.com/users/EthanRock/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/EthanRock",
"id": 7635551,
"login": "EthanRock",
"node_id": "MDQ6VXNlcjc2MzU1NTE=",
"organizations_url": "https://api.github.com/users/EthanRock/orgs",
"received_events_url": "https://api.github.com/users/EthanRock/received_events",
"repos_url": "https://api.github.com/users/EthanRock/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/EthanRock/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/EthanRock/subscriptions",
"type": "User",
"url": "https://api.github.com/users/EthanRock",
"user_view_type": "public"
}
|
[
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
open
| false
| null |
[] |
[
"cc @Rocketknight1 ",
"Hey! You can implement this yourself, just:\r\n\r\n1) Create the dataset with `to_tf_dataset()` with `shuffle=False`\r\n2) Add an `unbatch()` at the end (or use batch_size=1)\r\n3) Add a `shuffle()` to the resulting dataset with your desired buffer size\r\n4) Add a `batch()` at the end again to re-batch your dataset.\r\n\r\nNote that the way we construct datasets in `to_tf_dataset()`, we don't actually shuffle the entire dataset in-memory, using `tf.data.Dataset.shuffle()`! Instead, we shuffle an index array and then load from the dataset with that. This means that shuffling with `tf.data.Dataset.shuffle()` will probably be slower and use more memory than our approach - I don't think adding the option for smaller shuffle buffers will actually save you memory on this!",
"Thanks for your reply! @Rocketknight1 \r\n\"We don't actually shuffle the entire dataset in-memory, using tf.data.Dataset.shuffle()! Instead, we shuffle an index array and then load from the dataset with that.\"\r\nIn such case, there will be random access to dataset data during shuffling. When the dataset is large, the performance can be X10 times slow. I have tried many ways with to_tf_dataset() trying to achieve comparable performance with tf.data.Dataset().shuffle(buffer_size).batch(). But the performance with to_tf_dataset() is still slow. \r\n"
] | 2023-09-13T03:19:44
| 2023-09-18T01:11:21
| null |
NONE
| null | null | null | null |
### Feature request
I'm using to_tf_dataset to convert a large dataset to tf.data.Dataset and use Keras fit to train model.
Currently, to_tf_dataset only supports full size shuffle, which can be very slow on large dataset.
tf.data.Dataset support buffer shuffle by default.
shuffle(
buffer_size, seed=None, reshuffle_each_iteration=None, name=None
)
### Motivation
I'm very frustrated to find the loading with shuffling large dataset is very slow. It seems impossible to shuffle before training Keras with big dataset.
### Your contribution
NA
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6236/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6236/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6235
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6235/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6235/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6235/events
|
https://github.com/huggingface/datasets/issues/6235
| 1,893,337,083
|
I_kwDODunzps5w2gf7
| 6,235
|
Support multiprocessing for download/extract nestedly
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/22725729?v=4",
"events_url": "https://api.github.com/users/hgt312/events{/privacy}",
"followers_url": "https://api.github.com/users/hgt312/followers",
"following_url": "https://api.github.com/users/hgt312/following{/other_user}",
"gists_url": "https://api.github.com/users/hgt312/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hgt312",
"id": 22725729,
"login": "hgt312",
"node_id": "MDQ6VXNlcjIyNzI1NzI5",
"organizations_url": "https://api.github.com/users/hgt312/orgs",
"received_events_url": "https://api.github.com/users/hgt312/received_events",
"repos_url": "https://api.github.com/users/hgt312/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hgt312/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hgt312/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hgt312",
"user_view_type": "public"
}
|
[
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
open
| false
| null |
[] |
[] | 2023-09-12T21:51:08
| 2023-09-12T21:51:08
| null |
NONE
| null | null | null | null |
### Feature request
Current multiprocessing for download/extract is not done nestedly. For example, when processing SlimPajama, there is only 3 processes (for train/test/val), while there are many files inside these 3 folders
```
Downloading data files #0: 0%| | 0/1 [00:00<?, ?obj/s]
Downloading data files #1: 0%| | 0/1 [00:00<?, ?obj/s]
Downloading data files #2: 0%| | 0/1 [00:00<?, ?obj/s]
Extracting data files #0: 0%| | 0/1 [00:00<?, ?obj/s]
Extracting data files #1: 0%| | 0/1 [00:00<?, ?obj/s][A
Extracting data files #2: 0%| | 0/1 [00:00<?, ?obj/s][A[A
```
### Motivation
speedup dataset loading
### Your contribution
I can help test the feature
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6235/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6235/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6229
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6229/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6229/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6229/events
|
https://github.com/huggingface/datasets/issues/6229
| 1,889,050,954
|
I_kwDODunzps5wmKFK
| 6,229
|
Apply inference on all images in the dataset
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/20493493?v=4",
"events_url": "https://api.github.com/users/andysingal/events{/privacy}",
"followers_url": "https://api.github.com/users/andysingal/followers",
"following_url": "https://api.github.com/users/andysingal/following{/other_user}",
"gists_url": "https://api.github.com/users/andysingal/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/andysingal",
"id": 20493493,
"login": "andysingal",
"node_id": "MDQ6VXNlcjIwNDkzNDkz",
"organizations_url": "https://api.github.com/users/andysingal/orgs",
"received_events_url": "https://api.github.com/users/andysingal/received_events",
"repos_url": "https://api.github.com/users/andysingal/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/andysingal/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andysingal/subscriptions",
"type": "User",
"url": "https://api.github.com/users/andysingal",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"From what I see, `MMSegInferencer` supports NumPy arrays, so replace the line `image_path = example['image']` with `image_path = np.array(example['image'])` to fix the issue (`example[\"image\"]` is a `PIL.Image` object). ",
"> From what I see, `MMSegInferencer` supports NumPy arrays, so replace the line `image_path = example['image']` with `image_path = np.array(example['image'])` to fix the issue (`example[\"image\"]` is a `PIL.Image` object).\r\n\r\nThanks @mariosasko for your reply...\r\ni tried :\r\n```\r\n# Define a function to apply the code to each image in the dataset\r\ndef process_image(image_path):\r\n print(\"Processing image:\", image_path)\r\n result = inferencer(image_path)['predictions']\r\n mask = np.where(result == 12, 255, 0).astype('uint8')\r\n return Image.fromarray(mask)\r\n\r\n# Process and save masks for each image in the dataset\r\nfor idx, example in enumerate(dataset['train']):\r\n image_path = np.array(example['image'])\r\n mask_image = process_image(image_path)\r\n mask_image.save(f\"mask_{idx}.png\")\r\n```\r\nand got\r\n```\r\nProcessing image: [[[202 165 87]\r\n [203 166 88]\r\n [207 168 91]\r\n ...\r\n [243 205 122]\r\n [244 202 120]\r\n [242 200 118]]\r\n\r\n [[202 165 87]\r\n [203 166 88]\r\n [207 168 91]\r\n ...\r\n [244 206 123]\r\n [245 203 121]\r\n [243 201 119]]\r\n\r\n [[203 164 87]\r\n [204 165 88]\r\n [207 168 91]\r\n ...\r\n [245 207 126]\r\n [246 204 122]\r\n [245 203 121]]\r\n\r\n ...\r\n\r\n [[154 123 56]\r\n [155 124 57]\r\n [158 125 56]\r\n ...\r\n [ 3 3 1]\r\n [ 3 3 1]\r\n [ 3 3 1]]\r\n\r\n [[154 123 56]\r\n [154 123 56]\r\n [155 124 57]\r\n ...\r\n [ 2 2 0]\r\n [ 2 2 0]\r\n [ 2 2 0]]\r\n\r\n [[152 121 54]\r\n [152 121 54]\r\n [153 122 55]\r\n ...\r\n [ 2 2 0]\r\n [ 2 2 0]\r\n [ 2 2 0]]]\r\nInference ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \r\nProcessing image: [[[ 39 44 40]\r\n [ 39 44 40]\r\n [ 39 43 44]\r\n ...\r\n [187 185 164]\r\n [208 204 175]\r\n [203 198 166]]\r\n\r\n [[ 42 47 43]\r\n [ 40 45 41]\r\n [ 40 44 45]\r\n ...\r\n [188 186 165]\r\n [202 198 169]\r\n [201 196 164]]\r\n\r\n [[ 41 46 42]\r\n [ 39 44 40]\r\n [ 40 44 45]\r\n ...\r\n [187 184 165]\r\n [197 193 166]\r\n [201 196 166]]\r\n\r\n ...\r\n\r\n [[ 29 27 30]\r\n [ 28 26 29]\r\n [ 25 23 26]\r\n ...\r\n [ 48 33 28]\r\n [ 44 31 25]\r\n [ 39 26 20]]\r\n\r\n [[ 34 29 33]\r\n [ 32 27 31]\r\n [ 29 24 28]\r\n ...\r\n [ 30 17 11]\r\n [ 36 23 15]\r\n [ 41 28 20]]\r\n\r\n [[ 35 30 34]\r\n [ 33 28 32]\r\n [ 28 23 27]\r\n ...\r\n [ 28 15 9]\r\n [ 41 28 20]\r\n [ 46 33 25]]]\r\nInference ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \r\nProcessing image: [[[ 65 53 55]\r\n [ 65 53 55]\r\n [ 51 39 41]\r\n ...\r\n [133 127 111]\r\n [150 141 124]\r\n [133 124 107]]\r\n\r\n [[ 58 45 52]\r\n [ 61 48 55]\r\n [ 51 38 45]\r\n ...\r\n [148 141 123]\r\n [178 169 152]\r\n [144 135 118]]\r\n\r\n [[ 79 66 83]\r\n [ 73 60 77]\r\n [ 65 51 66]\r\n ...\r\n [140 131 114]\r\n [142 133 116]\r\n [147 136 118]]\r\n\r\n ...\r\n\r\n [[132 122 133]\r\n [ 95 85 94]\r\n [ 61 51 60]\r\n ...\r\n [ 39 28 42]\r\n [ 46 36 45]\r\n [ 25 16 21]]\r\n\r\n [[150 143 151]\r\n [114 107 115]\r\n [ 64 54 63]\r\n ...\r\n [ 47 35 47]\r\n [ 38 27 35]\r\n [140 129 133]]\r\n\r\n [[145 138 146]\r\n [115 108 116]\r\n [ 69 59 67]\r\n ...\r\n [ 31 19 31]\r\n [128 117 123]\r\n [196 185 189]]]\r\nInference ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \r\nProcessing image: [[[159 151 140]\r\n [171 163 152]\r\n [161 148 142]\r\n ...\r\n [198 184 171]\r\n [189 175 162]\r\n [183 169 156]]\r\n\r\n [[128 118 106]\r\n [138 128 116]\r\n [138 125 116]\r\n ...\r\n [200 186 173]\r\n [190 176 163]\r\n [187 173 160]]\r\n\r\n [[165 153 137]\r\n [170 158 142]\r\n [174 162 148]\r\n ...\r\n [200 187 171]\r\n [188 175 159]\r\n [182 169 153]]\r\n```\r\nHowever , when trying to add to:\r\n```\r\nfrom datasets import load_dataset\r\ndataset = load_dataset('Andyrasika/cat_kingdom')\r\ndataset\r\n```\r\ni did \r\n```\r\nnew_column = [\"mask\"] * len(dataset[\"train\"])\r\nnew_column\r\ndataset = dataset.add_column(\"/workspace/data\", new_column)\r\n\r\nprint(dataset)\r\n```\r\ngot error:\r\n```\r\n---------------------------------------------------------------------------\r\nAttributeError Traceback (most recent call last)\r\nCell In[11], line 3\r\n 1 new_column = [\"mask\"] * len(dataset[\"train\"])\r\n 2 new_column\r\n----> 3 dataset = dataset.add_column(\"/workspace/data\", new_column)\r\n 5 print(dataset)\r\n\r\nAttributeError: 'DatasetDict' object has no attribute 'add_column'\r\n```",
"https://github.com/huggingface/datasets/issues/6246 resolved the `add_column` error, so I'm closing this issue :) "
] | 2023-09-10T08:36:12
| 2023-09-20T16:11:53
| 2023-09-20T16:11:52
|
NONE
| null | null | null | null |
### Describe the bug
```
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
Cell In[14], line 11
9 for idx, example in enumerate(dataset['train']):
10 image_path = example['image']
---> 11 mask_image = process_image(image_path)
12 mask_image.save(f"mask_{idx}.png")
Cell In[14], line 4, in process_image(image_path)
2 def process_image(image_path):
3 print("Processing image:", image_path)
----> 4 result = inferencer(image_path)['predictions']
5 mask = np.where(result == 12, 255, 0).astype('uint8')
6 return Image.fromarray(mask)
File /usr/local/lib/python3.10/dist-packages/mmseg/apis/mmseg_inferencer.py:183, in MMSegInferencer.__call__(self, inputs, return_datasamples, batch_size, show, wait_time, out_dir, img_out_dir, pred_out_dir, **kwargs)
180 pred_out_dir = ''
181 img_out_dir = ''
--> 183 return super().__call__(
184 inputs=inputs,
185 return_datasamples=return_datasamples,
186 batch_size=batch_size,
187 show=show,
188 wait_time=wait_time,
189 img_out_dir=img_out_dir,
190 pred_out_dir=pred_out_dir,
191 **kwargs)
File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:221, in BaseInferencer.__call__(self, inputs, return_datasamples, batch_size, **kwargs)
218 inputs = self.preprocess(
219 ori_inputs, batch_size=batch_size, **preprocess_kwargs)
220 preds = []
--> 221 for data in (track(inputs, description='Inference')
222 if self.show_progress else inputs):
223 preds.extend(self.forward(data, **forward_kwargs))
224 visualization = self.visualize(
225 ori_inputs, preds,
226 **visualize_kwargs) # type: ignore # noqa: E501
File /usr/local/lib/python3.10/dist-packages/rich/progress.py:168, in track(sequence, description, total, auto_refresh, console, transient, get_time, refresh_per_second, style, complete_style, finished_style, pulse_style, update_period, disable, show_speed)
157 progress = Progress(
158 *columns,
159 auto_refresh=auto_refresh,
(...)
164 disable=disable,
165 )
167 with progress:
--> 168 yield from progress.track(
169 sequence, total=total, description=description, update_period=update_period
170 )
File /usr/local/lib/python3.10/dist-packages/rich/progress.py:1210, in Progress.track(self, sequence, total, task_id, description, update_period)
1208 if self.live.auto_refresh:
1209 with _TrackThread(self, task_id, update_period) as track_thread:
-> 1210 for value in sequence:
1211 yield value
1212 track_thread.completed += 1
File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:291, in BaseInferencer.preprocess(self, inputs, batch_size, **kwargs)
266 """Process the inputs into a model-feedable format.
267
268 Customize your preprocess by overriding this method. Preprocess should
(...)
287 Any: Data processed by the ``pipeline`` and ``collate_fn``.
288 """
289 chunked_data = self._get_chunk_data(
290 map(self.pipeline, inputs), batch_size)
--> 291 yield from map(self.collate_fn, chunked_data)
File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:588, in BaseInferencer._get_chunk_data(self, inputs, chunk_size)
586 chunk_data = []
587 for _ in range(chunk_size):
--> 588 processed_data = next(inputs_iter)
589 chunk_data.append(processed_data)
590 yield chunk_data
File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/base.py:12, in BaseTransform.__call__(self, results)
9 def __call__(self,
10 results: Dict) -> Optional[Union[Dict, Tuple[List, List]]]:
---> 12 return self.transform(results)
File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/wrappers.py:88, in Compose.transform(self, results)
79 """Call function to apply transforms sequentially.
80
81 Args:
(...)
85 dict or None: Transformed results.
86 """
87 for t in self.transforms:
---> 88 results = t(results) # type: ignore
89 if results is None:
90 return None
File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/base.py:12, in BaseTransform.__call__(self, results)
9 def __call__(self,
10 results: Dict) -> Optional[Union[Dict, Tuple[List, List]]]:
---> 12 return self.transform(results)
File /usr/local/lib/python3.10/dist-packages/mmseg/datasets/transforms/loading.py:496, in InferencerLoader.transform(self, single_input)
494 inputs = single_input
495 else:
--> 496 raise NotImplementedError
498 if 'img' in inputs:
499 return self.from_ndarray(inputs)
NotImplementedError:
````
### Steps to reproduce the bug
```
from datasets import load_dataset
dataset = load_dataset('Andyrasika/cat_kingdom')
dataset
from mmseg.apis import MMSegInferencer
checkpoint_name = 'segformer_mit-b5_8xb2-160k_ade20k-640x640'
inferencer = MMSegInferencer(model=checkpoint_name)
# Define a function to apply the code to each image in the dataset
def process_image(image_path):
print("Processing image:", image_path)
result = inferencer(image_path)['predictions']
mask = np.where(result == 12, 255, 0).astype('uint8')
return Image.fromarray(mask)
# Process and save masks for each image in the dataset
for idx, example in enumerate(dataset['train']):
image_path = example['image']
mask_image = process_image(image_path)
mask_image.save(f"mask_{idx}.png")
```
### Expected behavior
create a separate column with masks in the dataset and further shows as a separate column in hub
### Environment info
jupyter notebook RTX 3090
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6229/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6229/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 10 days, 7:35:40
|
https://api.github.com/repos/huggingface/datasets/issues/6225
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6225/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6225/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6225/events
|
https://github.com/huggingface/datasets/issues/6225
| 1,887,054,320
|
I_kwDODunzps5weinw
| 6,225
|
Conversion from RGB to BGR in Object Detection tutorial
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/33297401?v=4",
"events_url": "https://api.github.com/users/samokhinv/events{/privacy}",
"followers_url": "https://api.github.com/users/samokhinv/followers",
"following_url": "https://api.github.com/users/samokhinv/following{/other_user}",
"gists_url": "https://api.github.com/users/samokhinv/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/samokhinv",
"id": 33297401,
"login": "samokhinv",
"node_id": "MDQ6VXNlcjMzMjk3NDAx",
"organizations_url": "https://api.github.com/users/samokhinv/orgs",
"received_events_url": "https://api.github.com/users/samokhinv/received_events",
"repos_url": "https://api.github.com/users/samokhinv/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/samokhinv/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/samokhinv/subscriptions",
"type": "User",
"url": "https://api.github.com/users/samokhinv",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"Good catch!"
] | 2023-09-08T06:49:19
| 2023-09-08T17:52:18
| 2023-09-08T17:52:17
|
NONE
| null | null | null | null |
The [tutorial](https://huggingface.co/docs/datasets/main/en/object_detection) mentions the necessity of conversion the input image from BGR to RGB
> albumentations expects the image to be in BGR format, not RGB, so you’ll have to convert the image before applying the transform.
[Link to tutorial](https://github.com/huggingface/datasets/blob/0a068dbf3b446417ffd89d32857608394ec699e6/docs/source/object_detection.mdx#L77)
However, relevant albumentations' tutorials [on channels conversion](https://albumentations.ai/docs/examples/example/#read-the-image-from-the-disk-and-convert-it-from-the-bgr-color-space-to-the-rgb-color-space) and [on boxes](https://albumentations.ai/docs/examples/example_bboxes/) imply that it's not really true no more.
I suggest removing this outdated conversion from the tutorial.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6225/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6225/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 11:02:58
|
https://api.github.com/repos/huggingface/datasets/issues/6221
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6221/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6221/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6221/events
|
https://github.com/huggingface/datasets/issues/6221
| 1,884,324,631
|
I_kwDODunzps5wUIMX
| 6,221
|
Support saving datasets with custom formatting
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"Not a fan of pickling this sort of stuff either.\r\nNote that users can also share the code in their dataset documentation."
] | 2023-09-06T16:03:32
| 2023-09-06T18:32:07
| null |
COLLABORATOR
| null | null | null | null |
Requested in https://discuss.huggingface.co/t/using-set-transform-on-a-dataset-leads-to-an-exception/53036.
I am not sure if supporting this is the best idea for the following reasons:
>For this to work, we would have to pickle a custom transform, which means the transform and the objects it references need to be serializable. Also, deserializing these bytes would make `load_from_disk` unsafe, so I'm not sure this is a good idea.
@lhoestq WDYT?
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6221/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6221/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6217
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6217/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6217/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6217/events
|
https://github.com/huggingface/datasets/issues/6217
| 1,883,614,607
|
I_kwDODunzps5wRa2P
| 6,217
|
`Dataset.to_dict()` ignore `decode=True` with Image feature
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/45557362?v=4",
"events_url": "https://api.github.com/users/qgallouedec/events{/privacy}",
"followers_url": "https://api.github.com/users/qgallouedec/followers",
"following_url": "https://api.github.com/users/qgallouedec/following{/other_user}",
"gists_url": "https://api.github.com/users/qgallouedec/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/qgallouedec",
"id": 45557362,
"login": "qgallouedec",
"node_id": "MDQ6VXNlcjQ1NTU3MzYy",
"organizations_url": "https://api.github.com/users/qgallouedec/orgs",
"received_events_url": "https://api.github.com/users/qgallouedec/received_events",
"repos_url": "https://api.github.com/users/qgallouedec/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/qgallouedec/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/qgallouedec/subscriptions",
"type": "User",
"url": "https://api.github.com/users/qgallouedec",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"We need to implement the `Image` type as a PyArrow extension type (to allow us to override the Python conversion) for this to work as expected. For now, it's best to use your approach indeed."
] | 2023-09-06T09:26:16
| 2023-09-08T17:08:52
| null |
MEMBER
| null | null | null | null |
### Describe the bug
`Dataset.to_dict` seems to ignore the decoding instruction passed in features.
### Steps to reproduce the bug
```python
import datasets
import numpy as np
from PIL import Image
img = np.random.randint(0, 256, (5, 5, 3), dtype=np.uint8)
img = Image.fromarray(img)
features = datasets.Features({"image": datasets.Image(decode=True)})
dataset = datasets.Dataset.from_dict({"image": [img]}, features=features)
print({key: dataset[key] for key in dataset.column_names})
# {'image': [<PIL.PngImagePlugin.PngImageFile image mode=RGB size=5x5 at 0x7EFBC80E15B0>]}
print(dataset.to_dict())
# {'image': [{'bytes': b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x05\x00\x00\x00\x05\x08\x02\x00\x00\x00\x02\r\xb1\xb2\x00\x00\x00[IDATx\x9c\x01P\x00\xaf\xff\x01\x13\x1b<7\xe7\xe0\xdc^6\xed\x04\xc7M\xd2\x9f\x00X\x1b\xb0?\x1ba\x15\xc5 o\xd0\x80\xbe\x19/\x01\xec\x95\x1f\x9f\xffj\xfa1\xa7\xc4X\xea\xbe\xa4g\x00\xc4\x15\xdeC\xc7 \xbbaqe\xc8\xb9\xa9q\xe7\x00,?M\xc0)\xdaD`}\xb1\xdci\x1e\xafC\xa9]%.@\xa6\xf0\xb3\x00\x00\x00\x00IEND\xaeB`\x82', 'path': None}]}
```
### Expected behavior
I would expect `{key: dataset[key] for key in dataset.column_names}` and `dataset.to_dict()` to be equivalent. If the previous behavior is expected, then it should be stated [in the doc](https://huggingface.co/docs/datasets/v2.14.4/en/package_reference/main_classes#datasets.Dataset.to_dict).
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-6.2.0-31-generic-x86_64-with-glibc2.35
- Python version: 3.9.12
- Huggingface_hub version: 0.15.1
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
- Pillow 9.5.0
- numpy 1.25.2
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6217/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6217/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6214
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6214/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6214/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6214/events
|
https://github.com/huggingface/datasets/issues/6214
| 1,881,736,469
|
I_kwDODunzps5wKQUV
| 6,214
|
Unpin fsspec < 2023.9.0
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
[
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
] |
[] | 2023-09-05T11:02:58
| 2023-09-26T15:32:52
| 2023-09-26T15:32:52
|
MEMBER
| null | null | null | null |
Once root issue is fixed, remove temporary pin of fsspec < 2023.9.0 introduced by:
- #6210
Related to issue:
- #6209
After investigation, I think the root issue is related to the new glob behavior with double asterisk `**` they have introduced in:
- https://github.com/fsspec/filesystem_spec/pull/1329
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6214/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6214/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 21 days, 4:29:54
|
https://api.github.com/repos/huggingface/datasets/issues/6212
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6212/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6212/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6212/events
|
https://github.com/huggingface/datasets/issues/6212
| 1,880,399,516
|
I_kwDODunzps5wFJ6c
| 6,212
|
Tilde (~) is not supported for data_files
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/128361578?v=4",
"events_url": "https://api.github.com/users/exs-avianello/events{/privacy}",
"followers_url": "https://api.github.com/users/exs-avianello/followers",
"following_url": "https://api.github.com/users/exs-avianello/following{/other_user}",
"gists_url": "https://api.github.com/users/exs-avianello/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/exs-avianello",
"id": 128361578,
"login": "exs-avianello",
"node_id": "U_kgDOB6akag",
"organizations_url": "https://api.github.com/users/exs-avianello/orgs",
"received_events_url": "https://api.github.com/users/exs-avianello/received_events",
"repos_url": "https://api.github.com/users/exs-avianello/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/exs-avianello/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/exs-avianello/subscriptions",
"type": "User",
"url": "https://api.github.com/users/exs-avianello",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"Hi @exs-avianello, is it really needed? Note you can alternatively use `pathlib.Path` among others as it follows:\r\n\r\n```python\r\nimport datasets\r\nfrom pathlib import Path\r\n\r\n# save a parquet file at ~/path/to/data.parquet\r\n\r\ndata_files = Path.home() / \"path/to/data.parquet\"\r\ndataset = datasets.load_dataset(\"parquet\", data_files=data_files)\r\n```",
"Hi @alvarobartt ! \r\n\r\nThis is definitely just a \"nice to have\" and I am personally more than happy to just use absolute paths client-side. I just wanted to flag it up in case it can help improve the package even more 🙌 It might not be immediately obvious from the stack trace that the error is triggered by the `~` in the path"
] | 2023-09-04T14:23:49
| 2023-09-05T08:28:39
| null |
NONE
| null | null | null | null |
### Describe the bug
Attempting to `load_dataset` from a path starting with `~` (as a shorthand for the user's home directory) seems not to be fully working - at least as far as the `parquet` dataset builder is concerned.
(the same file can be loaded correctly if providing its absolute path instead)
I think that this is very similar to https://github.com/huggingface/datasets/issues/5757, but for `data_files` rather than `data_dir`
### Steps to reproduce the bug
```python
import datasets
# save a parquet file at ~/path/to/data.parquet
data_files = "~/path/to/data.parquet"
dataset = datasets.load_dataset("parquet", data_files=data_files)
```
```
Downloading data files: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 12671.61it/s]
Extracting data files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 22671.91it/s]
Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1949, in _prepare_split_single
num_examples, num_bytes = writer.finalize()
^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/datasets/arrow_writer.py", line 598, in finalize
raise SchemaInferenceError("Please pass `features` or at least one example when writing data")
datasets.arrow_writer.SchemaInferenceError: Please pass `features` or at least one example when writing data
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File ".venv/lib/python3.11/site-packages/datasets/load.py", line 2133, in load_dataset
builder_instance.download_and_prepare(
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare
self._download_and_prepare(
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1813, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1958, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Expected behavior
Can use `~` shorthand in paths when loading local (parquet) datasets.
### Environment info
`datasets 2.14.3`
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6212/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6212/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6209
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6209/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6209/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6209/events
|
https://github.com/huggingface/datasets/issues/6209
| 1,879,622,000
|
I_kwDODunzps5wCMFw
| 6,209
|
CI is broken with AssertionError: 3 failed, 12 errors
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
[
{
"color": "d73a4a",
"default": true,
"description": "Something isn't working",
"id": 1935892857,
"name": "bug",
"node_id": "MDU6TGFiZWwxOTM1ODkyODU3",
"url": "https://api.github.com/repos/huggingface/datasets/labels/bug"
}
] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
] |
[] | 2023-09-04T06:47:05
| 2023-09-04T07:30:01
| 2023-09-04T07:30:01
|
MEMBER
| null | null | null | null |
Our CI is broken: 3 failed, 12 errors
See: https://github.com/huggingface/datasets/actions/runs/6069947111/job/16465138041
```
=========================== short test summary info ============================
FAILED tests/test_load.py::ModuleFactoryTest::test_LocalDatasetModuleFactoryWithoutScript_with_data_dir - AssertionError: assert ({NamedSplit('train'): ['/tmp/pytest-of-runner/pytest-0/popen-gw1/test_LocalDatasetModuleFactory2/data_dir2/subdir1/train.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_LocalDatasetModuleFactory2/data_dir2/subdir1/train.txt'], NamedSplit('test'): ['/tmp/pytest-of-runner/pytest-0/popen-gw1/test_LocalDatasetModuleFactory2/data_dir2/subdir1/test.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_LocalDatasetModuleFactory2/data_dir2/subdir1/test.txt']} is not None and 2 == 1)
+ where 2 = len(['/tmp/pytest-of-runner/pytest-0/popen-gw1/test_LocalDatasetModuleFactory2/data_dir2/subdir1/train.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_LocalDatasetModuleFactory2/data_dir2/subdir1/train.txt'])
FAILED tests/test_load.py::test_load_dataset_arrow[False] - AssertionError: assert 20 == 10
+ where 20 = Dataset({\n features: ['col_1'],\n num_rows: 20\n}).num_rows
FAILED tests/test_load.py::test_load_dataset_arrow[True] - assert 20 == 10
ERROR tests/packaged_modules/test_audiofolder.py::test_data_files_with_metadata_and_multiple_splits[jsonl-False] - AssertionError: assert 6 == 3
+ where 6 = len(['/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_2/audiofolder_data_dir_with_metadata/train/audio_file.wav', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_2/audiofolder_data_dir_with_metadata/train/audio_file2.wav', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_2/audiofolder_data_dir_with_metadata/train/metadata.jsonl', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_2/audiofolder_data_dir_with_metadata/train/audio_file.wav', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_2/audiofolder_data_dir_with_metadata/train/audio_file2.wav', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_2/audiofolder_data_dir_with_metadata/train/metadata.jsonl'])
ERROR tests/packaged_modules/test_audiofolder.py::test_data_files_with_metadata_and_multiple_splits[jsonl-True] - AssertionError: assert 6 == 3
+ where 6 = len(['/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_3/audiofolder_data_dir_with_metadata/train/audio_file.wav', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_3/audiofolder_data_dir_with_metadata/train/audio_file2.wav', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_3/audiofolder_data_dir_with_metadata/train/metadata.jsonl', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_3/audiofolder_data_dir_with_metadata/train/audio_file.wav', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_3/audiofolder_data_dir_with_metadata/train/audio_file2.wav', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_3/audiofolder_data_dir_with_metadata/train/metadata.jsonl'])
ERROR tests/packaged_modules/test_audiofolder.py::test_data_files_with_metadata_and_multiple_splits[csv-False] - AssertionError: assert 6 == 3
+ where 6 = len(['/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_4/audiofolder_data_dir_with_metadata/train/audio_file.wav', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_4/audiofolder_data_dir_with_metadata/train/audio_file2.wav', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_4/audiofolder_data_dir_with_metadata/train/metadata.csv', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_4/audiofolder_data_dir_with_metadata/train/audio_file.wav', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_4/audiofolder_data_dir_with_metadata/train/audio_file2.wav', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_4/audiofolder_data_dir_with_metadata/train/metadata.csv'])
ERROR tests/packaged_modules/test_audiofolder.py::test_data_files_with_metadata_and_multiple_splits[csv-True] - AssertionError: assert 6 == 3
+ where 6 = len(['/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_5/audiofolder_data_dir_with_metadata/train/audio_file.wav', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_5/audiofolder_data_dir_with_metadata/train/audio_file2.wav', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_5/audiofolder_data_dir_with_metadata/train/metadata.csv', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_5/audiofolder_data_dir_with_metadata/train/audio_file.wav', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_5/audiofolder_data_dir_with_metadata/train/audio_file2.wav', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_5/audiofolder_data_dir_with_metadata/train/metadata.csv'])
ERROR tests/packaged_modules/test_folder_based_builder.py::test_data_files_with_metadata_and_splits[1-False] - AssertionError: assert 6 == 3
+ where 6 = len(['/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_3/autofolder_data_dir_with_metadata_two_splits/train/file.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_3/autofolder_data_dir_with_metadata_two_splits/train/file2.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_3/autofolder_data_dir_with_metadata_two_splits/train/metadata.jsonl', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_3/autofolder_data_dir_with_metadata_two_splits/train/file.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_3/autofolder_data_dir_with_metadata_two_splits/train/file2.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_3/autofolder_data_dir_with_metadata_two_splits/train/metadata.jsonl'])
ERROR tests/packaged_modules/test_folder_based_builder.py::test_data_files_with_metadata_and_splits[1-True] - AssertionError: assert 6 == 3
+ where 6 = len(['/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_4/autofolder_data_dir_with_metadata_two_splits/train/file.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_4/autofolder_data_dir_with_metadata_two_splits/train/file2.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_4/autofolder_data_dir_with_metadata_two_splits/train/metadata.jsonl', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_4/autofolder_data_dir_with_metadata_two_splits/train/file.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_4/autofolder_data_dir_with_metadata_two_splits/train/file2.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_4/autofolder_data_dir_with_metadata_two_splits/train/metadata.jsonl'])
ERROR tests/packaged_modules/test_folder_based_builder.py::test_data_files_with_metadata_and_splits[2-False] - AssertionError: assert 6 == 3
+ where 6 = len(['/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_5/autofolder_data_dir_with_metadata_two_splits/train/file.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_5/autofolder_data_dir_with_metadata_two_splits/train/file2.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_5/autofolder_data_dir_with_metadata_two_splits/train/metadata.jsonl', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_5/autofolder_data_dir_with_metadata_two_splits/train/file.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_5/autofolder_data_dir_with_metadata_two_splits/train/file2.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_5/autofolder_data_dir_with_metadata_two_splits/train/metadata.jsonl'])
ERROR tests/packaged_modules/test_imagefolder.py::test_data_files_with_metadata_and_multiple_splits[jsonl-False] - AssertionError: assert 6 == 3
+ where 6 = len(['/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_12/imagefolder_data_dir_with_metadata_two_splits/train/image_rgb.jpg', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_12/imagefolder_data_dir_with_metadata_two_splits/train/image_rgb2.jpg', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_12/imagefolder_data_dir_with_metadata_two_splits/train/metadata.jsonl', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_12/imagefolder_data_dir_with_metadata_two_splits/train/image_rgb.jpg', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_12/imagefolder_data_dir_with_metadata_two_splits/train/image_rgb2.jpg', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_12/imagefolder_data_dir_with_metadata_two_splits/train/metadata.jsonl'])
ERROR tests/packaged_modules/test_imagefolder.py::test_data_files_with_metadata_and_multiple_splits[jsonl-True] - AssertionError: assert 6 == 3
+ where 6 = len(['/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_13/imagefolder_data_dir_with_metadata_two_splits/train/image_rgb.jpg', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_13/imagefolder_data_dir_with_metadata_two_splits/train/image_rgb2.jpg', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_13/imagefolder_data_dir_with_metadata_two_splits/train/metadata.jsonl', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_13/imagefolder_data_dir_with_metadata_two_splits/train/image_rgb.jpg', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_13/imagefolder_data_dir_with_metadata_two_splits/train/image_rgb2.jpg', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_13/imagefolder_data_dir_with_metadata_two_splits/train/metadata.jsonl'])
ERROR tests/packaged_modules/test_folder_based_builder.py::test_data_files_with_metadata_and_splits[2-True] - AssertionError: assert 6 == 3
+ where 6 = len(['/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_6/autofolder_data_dir_with_metadata_two_splits/train/file.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_6/autofolder_data_dir_with_metadata_two_splits/train/file2.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_6/autofolder_data_dir_with_metadata_two_splits/train/metadata.jsonl', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_6/autofolder_data_dir_with_metadata_two_splits/train/file.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_6/autofolder_data_dir_with_metadata_two_splits/train/file2.txt', '/tmp/pytest-of-runner/pytest-0/popen-gw0/test_data_files_with_metadata_6/autofolder_data_dir_with_metadata_two_splits/train/metadata.jsonl'])
ERROR tests/packaged_modules/test_imagefolder.py::test_data_files_with_metadata_and_multiple_splits[csv-False] - AssertionError: assert 6 == 3
+ where 6 = len(['/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_14/imagefolder_data_dir_with_metadata_two_splits/train/image_rgb.jpg', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_14/imagefolder_data_dir_with_metadata_two_splits/train/image_rgb2.jpg', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_14/imagefolder_data_dir_with_metadata_two_splits/train/metadata.csv', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_14/imagefolder_data_dir_with_metadata_two_splits/train/image_rgb.jpg', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_14/imagefolder_data_dir_with_metadata_two_splits/train/image_rgb2.jpg', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_14/imagefolder_data_dir_with_metadata_two_splits/train/metadata.csv'])
ERROR tests/packaged_modules/test_imagefolder.py::test_data_files_with_metadata_and_multiple_splits[csv-True] - AssertionError: assert 6 == 3
+ where 6 = len(['/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_15/imagefolder_data_dir_with_metadata_two_splits/train/image_rgb.jpg', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_15/imagefolder_data_dir_with_metadata_two_splits/train/image_rgb2.jpg', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_15/imagefolder_data_dir_with_metadata_two_splits/train/metadata.csv', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_15/imagefolder_data_dir_with_metadata_two_splits/train/image_rgb.jpg', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_15/imagefolder_data_dir_with_metadata_two_splits/train/image_rgb2.jpg', '/tmp/pytest-of-runner/pytest-0/popen-gw1/test_data_files_with_metadata_15/imagefolder_data_dir_with_metadata_two_splits/train/metadata.csv'])
= 3 failed, 2383 passed, 26 skipped, 9 warnings, 12 errors in 280.79s (0:04:40) =
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6209/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6209/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 0:42:56
|
https://api.github.com/repos/huggingface/datasets/issues/6207
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6207/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6207/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6207/events
|
https://github.com/huggingface/datasets/issues/6207
| 1,879,555,234
|
I_kwDODunzps5wB7yi
| 6,207
|
No-script datasets with ZIP files do not load
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
[
{
"color": "d73a4a",
"default": true,
"description": "Something isn't working",
"id": 1935892857,
"name": "bug",
"node_id": "MDU6TGFiZWwxOTM1ODkyODU3",
"url": "https://api.github.com/repos/huggingface/datasets/labels/bug"
}
] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
] |
[] | 2023-09-04T05:50:27
| 2023-09-04T09:13:33
| 2023-09-04T09:13:33
|
MEMBER
| null | null | null | null |
While investigating an issue on a Hub dataset, I have discovered the no-script datasets containing ZIP files do not load.
For example, that no-script dataset containing ZIP files, raises NonMatchingSplitsSizesError:
```python
In [2]: ds = load_dataset("sidovic/LearningQ-qg")
NonMatchingSplitsSizesError: [
{
'expected': SplitInfo(name='train', num_bytes=0, num_examples=188660, shard_lengths=None, dataset_name=None),
'recorded': SplitInfo(name='train', num_bytes=0, num_examples=0, shard_lengths=None, dataset_name='learning_q-qg')
}, {
'expected': SplitInfo(name='validation', num_bytes=0, num_examples=20630, shard_lengths=None, dataset_name=None),
'recorded': SplitInfo(name='validation', num_bytes=0, num_examples=0, shard_lengths=None, dataset_name='learning_q-qg')
}, {
'expected': SplitInfo(name='test', num_bytes=0, num_examples=18227, shard_lengths=None, dataset_name=None),
'recorded': SplitInfo(name='test', num_bytes=0, num_examples=0, shard_lengths=None, dataset_name='learning_q-qg')
}
]
```
As another example, a no-script dataset containing just a (CSV)-ZIP file, raises a DatasetGenerationError:
```
> num_examples, num_bytes = writer.finalize()
src/datasets/builder.py:1949:
> raise SchemaInferenceError("Please pass `features` or at least one example when writing data")
E datasets.arrow_writer.SchemaInferenceError: Please pass `features` or at least one example when writing data
src/datasets/arrow_writer.py:598: SchemaInferenceError
The above exception was the direct cause of the following exception:
src/datasets/load.py:2143: in load_dataset
builder_instance.download_and_prepare(
src/datasets/builder.py:954: in download_and_prepare
self._download_and_prepare(
src/datasets/builder.py:1049: in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
src/datasets/builder.py:1813: in _prepare_split
for job_id, done, content in self._prepare_split_single(
> raise DatasetGenerationError("An error occurred while generating the dataset") from e
E datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
src/datasets/builder.py:1958: DatasetGenerationError
```
After investigating, I think this bug was introduced in this PR:
- #5972
Related to:
- https://huggingface.co/datasets/sidovic/LearningQ-qg/discussions/1
CC: @lhoestq
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6207/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6207/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 3:23:06
|
https://api.github.com/repos/huggingface/datasets/issues/6206
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6206/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6206/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6206/events
|
https://github.com/huggingface/datasets/issues/6206
| 1,879,473,745
|
I_kwDODunzps5wBn5R
| 6,206
|
When calling load_dataset, raise error: pyarrow.lib.ArrowInvalid: offset overflow while concatenating arrays
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/51043929?v=4",
"events_url": "https://api.github.com/users/aihao2000/events{/privacy}",
"followers_url": "https://api.github.com/users/aihao2000/followers",
"following_url": "https://api.github.com/users/aihao2000/following{/other_user}",
"gists_url": "https://api.github.com/users/aihao2000/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/aihao2000",
"id": 51043929,
"login": "aihao2000",
"node_id": "MDQ6VXNlcjUxMDQzOTI5",
"organizations_url": "https://api.github.com/users/aihao2000/orgs",
"received_events_url": "https://api.github.com/users/aihao2000/received_events",
"repos_url": "https://api.github.com/users/aihao2000/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/aihao2000/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/aihao2000/subscriptions",
"type": "User",
"url": "https://api.github.com/users/aihao2000",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"I solved the problem by modifying the \"self DEFAULT_WRITER_BATCH_SIZE\" in \"class MyDataset (datasets. GeneratorBasedBuilder) : __init__\"",
"same problem, and this solution worked me also - you can set this var by setting the keyword argument `writer_batch_size=...` in `load_dataset(...,writer_batch_size=...)`"
] | 2023-09-04T04:14:00
| 2024-04-17T15:53:29
| 2023-09-04T06:05:49
|
NONE
| null | null | null | null |
### Describe the bug
When calling load_dataset, raise error
```
Traceback (most recent call last):
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1694, in _pre
pare_split_single
writer.write(example, key)
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 490, in
write
self.write_examples_on_file()
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 448, in
write_examples_on_file
self.write_batch(batch_examples=batch_examples)
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 559, in
write_batch
self.write_table(pa_table, writer_batch_size)
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 571, in
write_table
pa_table = pa_table.combine_chunks()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "pyarrow/table.pxi", line 3439, in pyarrow.lib.Table.combine_chunks
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: offset overflow while concatenating arrays
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
dataset = load_dataset(
^^^^^^^^^^^^^
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py", line 2133, in load_da
taset
builder_instance.download_and_prepare(
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 954, in downl
oad_and_prepare
self._download_and_prepare(
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _dow
nload_and_prepare
super()._download_and_prepare(
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _dow
nload_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _pre
pare_split
for job_id, done, content in self._prepare_split_single(
File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1712, in _pre
pare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
Setting num_proc from 8 back to 1 for the train split to disable multiprocessing as it only contains one shard.
09/04/2023 12:02:04 - WARNING - datasets.builder - Setting num_proc from 8 back to 1 for the train split to dis
able multiprocessing as it only contains one shard.
```
### Steps to reproduce the bug
Call load_dataset with the large image as feature
### Expected behavior
no error
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-31-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/51043929?v=4",
"events_url": "https://api.github.com/users/aihao2000/events{/privacy}",
"followers_url": "https://api.github.com/users/aihao2000/followers",
"following_url": "https://api.github.com/users/aihao2000/following{/other_user}",
"gists_url": "https://api.github.com/users/aihao2000/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/aihao2000",
"id": 51043929,
"login": "aihao2000",
"node_id": "MDQ6VXNlcjUxMDQzOTI5",
"organizations_url": "https://api.github.com/users/aihao2000/orgs",
"received_events_url": "https://api.github.com/users/aihao2000/received_events",
"repos_url": "https://api.github.com/users/aihao2000/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/aihao2000/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/aihao2000/subscriptions",
"type": "User",
"url": "https://api.github.com/users/aihao2000",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 1,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6206/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6206/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 1:51:49
|
https://api.github.com/repos/huggingface/datasets/issues/6203
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6203/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6203/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6203/events
|
https://github.com/huggingface/datasets/issues/6203
| 1,877,491,602
|
I_kwDODunzps5v6D-S
| 6,203
|
Support loading from a DVC remote repository
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/16692099?v=4",
"events_url": "https://api.github.com/users/bilelomrani1/events{/privacy}",
"followers_url": "https://api.github.com/users/bilelomrani1/followers",
"following_url": "https://api.github.com/users/bilelomrani1/following{/other_user}",
"gists_url": "https://api.github.com/users/bilelomrani1/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bilelomrani1",
"id": 16692099,
"login": "bilelomrani1",
"node_id": "MDQ6VXNlcjE2NjkyMDk5",
"organizations_url": "https://api.github.com/users/bilelomrani1/orgs",
"received_events_url": "https://api.github.com/users/bilelomrani1/received_events",
"repos_url": "https://api.github.com/users/bilelomrani1/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bilelomrani1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bilelomrani1/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bilelomrani1",
"user_view_type": "public"
}
|
[
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
closed
| false
| null |
[] |
[
"(cross-posting from the linked DVC issue)\r\n\r\nI think this should already work out of the box with the current `datasets` and `dvc.api` releases by passing the correct `storage_options` into the datasets calls. `storage_options` is essentially just the kwargs dict that gets passed to the fsspec fs constructor.\r\n\r\nThe main thing to note here is that the fsspec DVCFileSystem URL should be `dvc://folder/file.json` (i.e. this should be the DVCFileSystem path that is relative to the DVC repo root). You cannot use a URL like `https://gitlab.com/user/repo/folder/file.json`.\r\n\r\nI think something like this should work for you (in a venv where both DVC and datasets are installed):\r\n```python\r\nimport datasets\r\n\r\n# load a dataset from Git/DVC repository where Git repo is located at https://gitlab.com/user/repo.git\r\n# and path to dataset (relative to git/dvc repo root) is 'folder/file.json'\r\ndatasets.load_from_disk(\r\n \"dvc://folder/file.json\",\r\n storage_options={\"url\": \"https://gitlab.com/user/repo.git\"},\r\n)\r\n```\r\n\r\nbasically the `dvc://` is what tells fsspec to create a `DVCFileSystem` and it will construct it like\r\n```python\r\nfs = DVCFileSystem(**storage_options)\r\n```\r\n\r\nThen the subsequent calls use the rest of the `dvc://...` URL like \r\n```python\r\nfs.exists(\"folder/file.json\")\r\n```",
"Hi @pmrowla Thank you for your help, that's very helpful, I was indeed using `fsspec` incorrectly here. There is still an issue with `datasets`:\r\n\r\n```python\r\nimport datasets\r\ndataset = datasets.load_dataset(\"json\", data_files=\"dvc://folder/file.jsonl\", storage_options={\"url\": \"https://gitlab.com/repo/folder/\"})\r\n```\r\n\r\nresults in the following exception:\r\n\r\n```\r\nTraceback (most recent call last): \r\n File \"/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/scmrepo/fs.py\", line 217, in info\r\n ret = self.trie.info(key)\r\n ^^^^^^^^^^^^^^^^^^^\r\n File \"/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/scmrepo/git/objects.py\", line 141, in info\r\n obj = self.trie[key]\r\n ~~~~~~~~~^^^^^\r\n File \"/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/pygtrie.py\", line 937, in __getitem__\r\n node, _ = self._get_node(key_or_slice)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/pygtrie.py\", line 630, in _get_node\r\n raise KeyError(key)\r\nKeyError: ('dvc:', 'datasets', 'spider', 'train.jsonl')\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py\", line 2129, in load_dataset\r\n builder_instance = load_dataset_builder(\r\n ^^^^^^^^^^^^^^^^^^^^^\r\n File \"/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py\", line 1815, in load_dataset_builder\r\n dataset_module = dataset_module_factory(\r\n ^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py\", line 1430, in dataset_module_factory\r\n ).get_module()\r\n ^^^^^^^^^^^^\r\n File \"/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py\", line 958, in get_module\r\n data_files = DataFilesDict.from_patterns(\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py\", line 674, in from_patterns\r\n DataFilesList.from_patterns(\r\n File \"/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py\", line 589, in from_patterns\r\n origin_metadata = _get_origin_metadata(data_files, download_config=download_config)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py\", line 504, in _get_origin_metadata\r\n return thread_map(\r\n ^^^^^^^^^^^\r\n File \"/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/tqdm/contrib/concurrent.py\", line 69, in thread_map\r\n return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/tqdm/contrib/concurrent.py\", line 51, in _executor_map\r\n return list(tqdm_class(ex.map(fn, *iterables, chunksize=chunksize), **kwargs))\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py\", line 619, in result_iterator\r\n yield _result_or_cancel(fs.pop())\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py\", line 317, in _result_or_cancel\r\n return fut.result(timeout)\r\n ^^^^^^^^^^^^^^^^^^^\r\n File \"/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py\", line 456, in result\r\n return self.__get_result()\r\n ^^^^^^^^^^^^^^^^^^^\r\n File \"/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py\", line 401, in __get_result\r\n raise self._exception\r\n File \"/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/thread.py\", line 58, in run\r\n result = self.fn(*self.args, **self.kwargs)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py\", line 491, in _get_single_origin_metadata\r\n info = fs.info(data_file)\r\n ^^^^^^^^^^^^^^^^^^\r\n File \"/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/dvc/fs/dvc.py\", line 357, in info\r\n return self._info(key, path, ignore_subrepos=ignore_subrepos)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/dvc/fs/dvc.py\", line 377, in _info\r\n fs_info = fs.info(fs_path)\r\n ^^^^^^^^^^^^^^^^\r\n File \"/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/dvc_objects/fs/base.py\", line 501, in info\r\n return self.fs.info(path, **kwargs)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/scmrepo/fs.py\", line 221, in info\r\n raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), path)\r\nFileNotFoundError: [Errno 2] No such file or directory: '/dvc:/folder/file.jsonl'\r\n```\r\n\r\nSomehow the URL gets turned into `/dvc:/folder/file.jsonl` inside `datasets`. Otherwise I can confirm that using `fsspec` properly with DVC works as expected.\r\n",
"For the record, there was a `dvc.api.DVCFileSystem` bug which is fixed in DVC `main` and will be available in the next DVC release.\r\n\r\nTo use DVC with `datasets` you just need to pass the Git/DVC repo `url` in `storage_options` as discussed above.\r\n\r\n(note that this requires having both `datasets` and `dvc` installed in your python environment)\r\n```python\r\n>>> from datasets import load_dataset\r\n>>> load_dataset(\r\n... \"json\",\r\n... data_files=\"dvc://eval/metrics.json\",\r\n... storage_options={\"url\": \"https://github.com/iterative/example-get-started.git\"},\r\n... )\r\nDatasetDict({\r\n train: Dataset({\r\n features: ['avg_prec', 'roc_auc'],\r\n num_rows: 1\r\n })\r\n})\r\n```\r\n\r\nAny additional `DVCFileSystem` args can be passed in the same way, so to get a specific branch/tag/commit from the DVC repo you just need to specify the `rev` in `storage_options` like\r\n```\r\nstorage_options={\"url\": \"https://github.com/iterative/example-get-started.git\", \"rev\": \"main\"}\r\n```\r\n\r\nI think this issue can probably be closed now.",
"Thank you for your help, closing."
] | 2023-09-01T14:04:52
| 2023-09-15T15:11:27
| 2023-09-15T15:11:27
|
NONE
| null | null | null | null |
### Feature request
Adding support for loading a file from a DVC repository, tracked remotely on a SCM.
### Motivation
DVC is a popular version control system to version and manage datasets. The files are stored on a remote object storage platform, but they are tracked using Git. Integration with DVC is possible through the `DVCFileSystem`.
I have a Gitlab repository where multiple files are tracked using DVC and stored in a GCP bucket. I would like to be able to load these files using `datasets` directly using an URL. My goal is to write a generic code that abstracts the storage layer, such that my users will only have to pass in an `fsspec`-compliant URL and the corresponding files will be loaded.
### Your contribution
I managed to instantiate a `DVCFileSystem` pointing to a Gitlab repo from a `fsspec` chained URL in [this pull request](https://github.com/iterative/dvc/pull/9903) to DVC.
```python
from fsspec.core import url_to_fs
fs, _ = url_to_fs("dvc::https://gitlab.com/repository/group/my-repo")
```
From now I'm not sure how to continue, it seems that `datasets` expects the URL to be fully qualified like so: `dvc::https://gitlab.com/repository/group/my-repo/my-folder/my-file.json` but this fails because `DVCFileSystem` expects the URL to point to the root of an SCM repo. Is there a way to make this work with `datasets`?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/16692099?v=4",
"events_url": "https://api.github.com/users/bilelomrani1/events{/privacy}",
"followers_url": "https://api.github.com/users/bilelomrani1/followers",
"following_url": "https://api.github.com/users/bilelomrani1/following{/other_user}",
"gists_url": "https://api.github.com/users/bilelomrani1/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bilelomrani1",
"id": 16692099,
"login": "bilelomrani1",
"node_id": "MDQ6VXNlcjE2NjkyMDk5",
"organizations_url": "https://api.github.com/users/bilelomrani1/orgs",
"received_events_url": "https://api.github.com/users/bilelomrani1/received_events",
"repos_url": "https://api.github.com/users/bilelomrani1/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bilelomrani1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bilelomrani1/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bilelomrani1",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6203/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6203/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 14 days, 1:06:35
|
https://api.github.com/repos/huggingface/datasets/issues/6202
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6202/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6202/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6202/events
|
https://github.com/huggingface/datasets/issues/6202
| 1,876,630,351
|
I_kwDODunzps5v2xtP
| 6,202
|
avoid downgrading jax version
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1332458?v=4",
"events_url": "https://api.github.com/users/chrisflesher/events{/privacy}",
"followers_url": "https://api.github.com/users/chrisflesher/followers",
"following_url": "https://api.github.com/users/chrisflesher/following{/other_user}",
"gists_url": "https://api.github.com/users/chrisflesher/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/chrisflesher",
"id": 1332458,
"login": "chrisflesher",
"node_id": "MDQ6VXNlcjEzMzI0NTg=",
"organizations_url": "https://api.github.com/users/chrisflesher/orgs",
"received_events_url": "https://api.github.com/users/chrisflesher/received_events",
"repos_url": "https://api.github.com/users/chrisflesher/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/chrisflesher/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chrisflesher/subscriptions",
"type": "User",
"url": "https://api.github.com/users/chrisflesher",
"user_view_type": "public"
}
|
[
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
closed
| false
| null |
[] |
[
"https://github.com/huggingface/datasets/blob/main/setup.py#L236\r\nCurrently has the highest version at 0.3.25; Not sure if there is any reason for this, other than that was the tested version?"
] | 2023-09-01T02:57:57
| 2023-10-12T16:28:59
| 2023-10-12T16:28:59
|
NONE
| null | null | null | null |
### Feature request
Whenever I `pip install datasets[jax]` it downgrades jax to version 0.3.25. I seem to be able to install this library first then upgrade jax back to version 0.4.13.
### Motivation
It would be nice to not overwrite currently installed version of jax if possible.
### Your contribution
I would be willing to beta test. Or maybe write some code if I could get pointed in the right direction, I'm not super familiar with this codebase.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 2,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 2,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6202/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6202/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 41 days, 13:31:02
|
https://api.github.com/repos/huggingface/datasets/issues/6199
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6199/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6199/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6199/events
|
https://github.com/huggingface/datasets/issues/6199
| 1,875,165,185
|
I_kwDODunzps5vxMAB
| 6,199
|
Use load_dataset for local json files, but it not works
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/50519434?v=4",
"events_url": "https://api.github.com/users/Garen-in-bush/events{/privacy}",
"followers_url": "https://api.github.com/users/Garen-in-bush/followers",
"following_url": "https://api.github.com/users/Garen-in-bush/following{/other_user}",
"gists_url": "https://api.github.com/users/Garen-in-bush/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Garen-in-bush",
"id": 50519434,
"login": "Garen-in-bush",
"node_id": "MDQ6VXNlcjUwNTE5NDM0",
"organizations_url": "https://api.github.com/users/Garen-in-bush/orgs",
"received_events_url": "https://api.github.com/users/Garen-in-bush/received_events",
"repos_url": "https://api.github.com/users/Garen-in-bush/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Garen-in-bush/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Garen-in-bush/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Garen-in-bush",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"Hugging Face's datasets library may prioritize remote configurations. Make sure there are no conflicting configurations causing the library to prefer downloading data\r\nMay be try debugging\r\nraw_datasets = load_dataset('json', data_files=data_files)\r\nprint(raw_datasets)\r\n",
"It doesn't download them but writes them to the local HF cache. The logging could indeed be better. Does loading the dataset succeed? If it doesn't, can you share the error stack trace?"
] | 2023-08-31T09:42:34
| 2023-08-31T19:05:07
| null |
NONE
| null | null | null | null |
### Describe the bug
when I use load_dataset to load my local datasets,it always goes to Hugging Face to download the data instead of loading the local dataset.
### Steps to reproduce the bug
`raw_datasets = load_dataset(
‘json’,
data_files=data_files)`
### Expected behavior

### Environment info
python version 3.8.5
datasets version 2.12
os version unbuntu 18.04
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6199/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6199/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6197
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6197/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6197/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6197/events
|
https://github.com/huggingface/datasets/issues/6197
| 1,875,078,155
|
I_kwDODunzps5vw2wL
| 6,197
|
ValueError: 'index=True' is only valid when 'orient' is 'split', 'table', 'index', or 'columns'
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/128361578?v=4",
"events_url": "https://api.github.com/users/exs-avianello/events{/privacy}",
"followers_url": "https://api.github.com/users/exs-avianello/followers",
"following_url": "https://api.github.com/users/exs-avianello/following{/other_user}",
"gists_url": "https://api.github.com/users/exs-avianello/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/exs-avianello",
"id": 128361578,
"login": "exs-avianello",
"node_id": "U_kgDOB6akag",
"organizations_url": "https://api.github.com/users/exs-avianello/orgs",
"received_events_url": "https://api.github.com/users/exs-avianello/received_events",
"repos_url": "https://api.github.com/users/exs-avianello/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/exs-avianello/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/exs-avianello/subscriptions",
"type": "User",
"url": "https://api.github.com/users/exs-avianello",
"user_view_type": "public"
}
|
[] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
] |
[
"Thanks for reporting. We are investigating it.",
"This issue is caused by latest `pandas` release 2.1.0 (released yesterday Aug 30).\r\n\r\nSee: https://github.com/huggingface/datasets/actions/runs/6035484010/job/16375932085?pr=6198\r\n",
"People using previous releases of `datasets` should pin `pandas` in their local environment:\r\n```\r\npython -m pip install 'pandas<2.1.0'\r\n```"
] | 2023-08-31T08:51:50
| 2023-09-01T10:35:10
| 2023-08-31T10:24:40
|
NONE
| null | null | null | null |
### Describe the bug
Saving a dataset `.to_json()` fails with a `ValueError` since the latest `pandas` [release](https://pandas.pydata.org/docs/dev/whatsnew/v2.1.0.html) (`2.1.0`)
In their latest release we have:
> Improved error handling when using [DataFrame.to_json()](https://pandas.pydata.org/docs/dev/reference/api/pandas.DataFrame.to_json.html#pandas.DataFrame.to_json) with incompatible index and orient arguments ([GH 52143](https://github.com/pandas-dev/pandas/issues/52143))
i.e. an error is now raised for invalid combinations of `index` and `orient`.
This means that unfortunately the custom logic at this line might sometimes lead to contradictions:
https://github.com/huggingface/datasets/blob/029227a116c14720afca71b9b22e78eb2a1c09a6/src/datasets/io/json.py#L96
e.g. for the default case `orient=records` leads to `index=True`, which now raises a `ValueError`
### Steps to reproduce the bug
```python
import datasets
if __name__ == '__main__':
dataset = datasets.Dataset.from_dict({"A": [1, 2, 3], "B": [4, 5, 6]})
dataset.to_json("dataset.json")
```
```shell
>>>
ValueError: 'index=True' is only valid when 'orient' is 'split', 'table', 'index', or 'columns'.
```
### Expected behavior
The dataset is successfully saved as `.json`
### Environment info
`python >= 3.9`
`pandas >= 2.1.0`
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6197/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6197/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 1:32:50
|
https://api.github.com/repos/huggingface/datasets/issues/6196
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6196/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6196/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6196/events
|
https://github.com/huggingface/datasets/issues/6196
| 1,875,070,972
|
I_kwDODunzps5vw0_8
| 6,196
|
Split order is not preserved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
[
{
"color": "d73a4a",
"default": true,
"description": "Something isn't working",
"id": 1935892857,
"name": "bug",
"node_id": "MDU6TGFiZWwxOTM1ODkyODU3",
"url": "https://api.github.com/repos/huggingface/datasets/labels/bug"
}
] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
] |
[] | 2023-08-31T08:47:16
| 2023-08-31T13:48:43
| 2023-08-31T13:48:43
|
MEMBER
| null | null | null | null |
I have noticed that in some cases the split order is not preserved.
For example, consider a no-script dataset with configs:
```yaml
configs:
- config_name: default
data_files:
- split: train
path: train.csv
- split: test
path: test.csv
```
- Note the defined split order is [train, test]
Once the dataset is loaded, the split order is not preserved:
```python
In [16]: ds
Out[16]:
DatasetDict({
test: Dataset({
features: ['text', 'label'],
num_rows: 1
})
train: Dataset({
features: ['text', 'label'],
num_rows: 2
})
})
```
- Note the obtained split order is [test, train]
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4",
"events_url": "https://api.github.com/users/albertvillanova/events{/privacy}",
"followers_url": "https://api.github.com/users/albertvillanova/followers",
"following_url": "https://api.github.com/users/albertvillanova/following{/other_user}",
"gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/albertvillanova",
"id": 8515462,
"login": "albertvillanova",
"node_id": "MDQ6VXNlcjg1MTU0NjI=",
"organizations_url": "https://api.github.com/users/albertvillanova/orgs",
"received_events_url": "https://api.github.com/users/albertvillanova/received_events",
"repos_url": "https://api.github.com/users/albertvillanova/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions",
"type": "User",
"url": "https://api.github.com/users/albertvillanova",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6196/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6196/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 5:01:27
|
https://api.github.com/repos/huggingface/datasets/issues/6195
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6195/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6195/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6195/events
|
https://github.com/huggingface/datasets/issues/6195
| 1,874,195,585
|
I_kwDODunzps5vtfSB
| 6,195
|
Force to reuse cache at given path
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/43507393?v=4",
"events_url": "https://api.github.com/users/Luosuu/events{/privacy}",
"followers_url": "https://api.github.com/users/Luosuu/followers",
"following_url": "https://api.github.com/users/Luosuu/following{/other_user}",
"gists_url": "https://api.github.com/users/Luosuu/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Luosuu",
"id": 43507393,
"login": "Luosuu",
"node_id": "MDQ6VXNlcjQzNTA3Mzkz",
"organizations_url": "https://api.github.com/users/Luosuu/orgs",
"received_events_url": "https://api.github.com/users/Luosuu/received_events",
"repos_url": "https://api.github.com/users/Luosuu/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Luosuu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Luosuu/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Luosuu",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"realized that need to pass the path at `cache_file_name` like\r\n\r\n```python\r\ntokenized_datasets = raw_datasets[\"train\"].map(\r\n tokenize_function,\r\n batched=True,\r\n num_proc=data_args.preprocessing_num_workers,\r\n remove_columns=[text_column_name],\r\n load_from_cache_file=True,\r\n desc=\"Running tokenizer on dataset line_by_line\",\r\n # cache_file_names= {\"train\": \"cache-1982fea76aa54a13.arrow\"}\r\n cache_file_name=\"/project/huggingface_cache/datasets/..../cache-1982fea76aa54a13.arrow\",\r\n new_fingerprint=\"1982fea76aa54a13\"\r\n )\r\n```",
"Thank you so much! I went through a lot of issues before finding similar experiences here. I have to say that the [docs](https://huggingface.co/docs/datasets/v2.11.0/en/package_reference/main_classes#datasets.Dataset.map) of `.map()` is really misleading, probably making people think that just assigning the file name to cache_file_name is enough."
] | 2023-08-30T18:44:54
| 2023-11-03T10:14:21
| 2023-08-30T19:00:45
|
NONE
| null | null | null | null |
### Describe the bug
I have run the official example of MLM like:
```bash
python run_mlm.py \
--model_name_or_path roberta-base \
--dataset_name togethercomputer/RedPajama-Data-1T \
--dataset_config_name arxiv \
--per_device_train_batch_size 10 \
--preprocessing_num_workers 20 \
--validation_split_percentage 0 \
--cache_dir /project/huggingface_cache/datasets \
--line_by_line \
--do_train \
--pad_to_max_length \
--output_dir /project/huggingface_cache/test-mlm
```
it successfully runs and at my cache folder has `cache-1982fea76aa54a13_00001_of_00020.arrow`..... `cache-1982fea76aa54a13_00020_of_00020.arrow ` as tokenization cache of `map` method. And the cache works fine every time I run the command above.
However, when I switched to jupyter notebook (since I do not want to load datasets every time when I changed other parameters not related to the dataloading). It is not recognizing the cache files and starts to re-run the entire tokenization process.
I changed my code to
```python
tokenized_datasets = raw_datasets["train"].map(
tokenize_function,
batched=True,
num_proc=data_args.preprocessing_num_workers,
remove_columns=[text_column_name],
load_from_cache_file=True,
desc="Running tokenizer on dataset line_by_line",
# cache_file_names= {"train": "cache-1982fea76aa54a13.arrow"}
cache_file_name="cache-1982fea76aa54a13.arrow",
new_fingerprint="1982fea76aa54a13"
)
```
it still does not recognize the previously cached files and trying to re-run the tokenization process.
### Steps to reproduce the bug
use jupyter notebook for dataset map function.
### Expected behavior
the map function accepts the given cache_file_name and new_fingerprint then load the previously cached files.
### Environment info
- `datasets` version: 2.14.4.dev0
- Platform: Linux-3.10.0-1160.59.1.el7.x86_64-x86_64-with-glibc2.10
- Python version: 3.8.8
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/43507393?v=4",
"events_url": "https://api.github.com/users/Luosuu/events{/privacy}",
"followers_url": "https://api.github.com/users/Luosuu/followers",
"following_url": "https://api.github.com/users/Luosuu/following{/other_user}",
"gists_url": "https://api.github.com/users/Luosuu/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Luosuu",
"id": 43507393,
"login": "Luosuu",
"node_id": "MDQ6VXNlcjQzNTA3Mzkz",
"organizations_url": "https://api.github.com/users/Luosuu/orgs",
"received_events_url": "https://api.github.com/users/Luosuu/received_events",
"repos_url": "https://api.github.com/users/Luosuu/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Luosuu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Luosuu/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Luosuu",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6195/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6195/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 0:15:51
|
https://api.github.com/repos/huggingface/datasets/issues/6194
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6194/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6194/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6194/events
|
https://github.com/huggingface/datasets/issues/6194
| 1,872,598,223
|
I_kwDODunzps5vnZTP
| 6,194
|
Support custom fingerprinting with `Dataset.from_generator`
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/16692099?v=4",
"events_url": "https://api.github.com/users/bilelomrani1/events{/privacy}",
"followers_url": "https://api.github.com/users/bilelomrani1/followers",
"following_url": "https://api.github.com/users/bilelomrani1/following{/other_user}",
"gists_url": "https://api.github.com/users/bilelomrani1/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bilelomrani1",
"id": 16692099,
"login": "bilelomrani1",
"node_id": "MDQ6VXNlcjE2NjkyMDk5",
"organizations_url": "https://api.github.com/users/bilelomrani1/orgs",
"received_events_url": "https://api.github.com/users/bilelomrani1/received_events",
"repos_url": "https://api.github.com/users/bilelomrani1/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bilelomrani1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bilelomrani1/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bilelomrani1",
"user_view_type": "public"
}
|
[
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
open
| false
| null |
[] |
[
"The `fingerprint` parameter serves a slightly different purpose - we use it to inject a new fingerprint after transforming a `Dataset` (computed from the previous fingerprint + transform + transform args), e.g., to be able to compute the cache file for a transform. There is no concept of `fingerprint` before a `Dataset` is fully initialized, but we still need to hash the args (e.g., generator func) of the \"dataset creation methods\" (`from_generator`, `from_csv`, etc.) to compute the cache directory (to store the initial version and transformed dataset versions)\r\n\r\nI agree it should be easier to bypass the hashing mechanism in this instance, too. However, we should probably first address https://github.com/huggingface/datasets/issues/5080 before solving this (e.g., maybe exposing `hash` in `load_dataset`/`load_dataset_builder`.",
"Adding +1 here:\r\n\r\nIf the generator needs to access some external resources or state, then it's not always straightforward to make it pickle-able. So I'd like to be able to override how the default cache key derivation needs to pickle the generator (and of course, I'd accept responsibility for that part of cache consistency).\r\n\r\nAppears to be a recurrent roadbump: #6118 #5963 #5819 #5750 #4983 ",
"Silly hack incoming:\r\n\r\n```python\r\nimport uuid\r\n\r\nclass _DatasetGeneratorPickleHack:\r\n def __init__(self, generator, generator_id=None):\r\n self.generator = generator\r\n self.generator_id = (\r\n generator_id if generator_id is not None else str(uuid.uuid4())\r\n )\r\n\r\n def __call__(self, *args, **kwargs):\r\n return self.generator(*kwargs, **kwargs)\r\n\r\n def __reduce__(self):\r\n return (_DatasetGeneratorPickleHack_raise, (self.generator_id,))\r\n\r\n\r\ndef _DatasetGeneratorPickleHack_raise(*args, **kwargs):\r\n raise AssertionError(\"cannot actually unpickle _DatasetGeneratorPickleHack!\")\r\n```\r\n\r\nNow `Dataset.from_generator(_DatasetGeneratorPickleHack(gen))` works even if `gen` is unpicklable, because Dataset just pickles the shim object that avoids actually traversing `gen`. Then, one can work out how to set `generator_id` meaningfully to allow cache reuse.",
"I'd like some way to do this too. I find that sometimes the hash doesn't cover enough, and that the dataset is not regenerated even when underlying data has changed, and by supplying a custom fingerprint I could do a better job of controlling when my dataset is regenerated.",
"This is what I did and it works: \r\n\r\nhttps://github.com/stevemadere/s3-datasets/blob/e475a566a16d3051656a66f8ff4d3baa4c55a66c/src/tokengenerators/text_ds_2_tokens_generator.py#L200\r\n",
"I ran into the same thing - my actual generator reads from a disk source that might have new data (images) available at some point and it ends up ignoring calling the generator. Thanks for the hack @mlin 👋 ",
"just wanted to pitch my support for an easy control over the generator id. requiring that generators are pickleable just to get a unique id is limiting: plenty of classes (maybe even hf.datasets own) are written with no pickle support in mind. also as mentioned above the state of a generator might extend beyond its pickle."
] | 2023-08-29T22:43:13
| 2024-12-22T01:14:39
| null |
NONE
| null | null | null | null |
### Feature request
When using `Dataset.from_generator`, the generator is hashed when building the fingerprint. Similar to `.map`, it would be interesting to let the user bypass this hashing by accepting a `fingerprint` argument to `.from_generator`.
### Motivation
Using the `.from_generator` constructor with a non-picklable generator fails. By accepting a `fingerprint` argument to `.from_generator`, the user would have the opportunity to manually fingerprint the dataset and thus bypass the crash.
### Your contribution
If validated, I can try to submit a PR for this.
| null |
{
"+1": 3,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 3,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6194/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6194/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6193
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6193/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6193/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6193/events
|
https://github.com/huggingface/datasets/issues/6193
| 1,872,285,153
|
I_kwDODunzps5vmM3h
| 6,193
|
Dataset loading script method does not work with .pyc file
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/43389071?v=4",
"events_url": "https://api.github.com/users/riteshkumarumassedu/events{/privacy}",
"followers_url": "https://api.github.com/users/riteshkumarumassedu/followers",
"following_url": "https://api.github.com/users/riteshkumarumassedu/following{/other_user}",
"gists_url": "https://api.github.com/users/riteshkumarumassedu/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/riteshkumarumassedu",
"id": 43389071,
"login": "riteshkumarumassedu",
"node_id": "MDQ6VXNlcjQzMzg5MDcx",
"organizations_url": "https://api.github.com/users/riteshkumarumassedu/orgs",
"received_events_url": "https://api.github.com/users/riteshkumarumassedu/received_events",
"repos_url": "https://api.github.com/users/riteshkumarumassedu/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/riteshkumarumassedu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/riteshkumarumassedu/subscriptions",
"type": "User",
"url": "https://api.github.com/users/riteshkumarumassedu",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"Before dynamically loading `.py` scripts with `importlib.import_module`, we also parse their contents to check imports, which is tricky to implement for binary `.pyc` files (requires parsing bytecode), so I don't think this is something we want to support (unless more users request it ofc) as this use case is a bit too specific.\r\n\r\n@lhoestq What's your opinion on this?",
"> Before dynamically loading .py scripts with importlib.import_module, we also parse their contents to check imports, which is tricky to implement for binary .pyc files (requires parsing bytecode), so I don't think this is something we want to support (unless more users request it ofc) as this use case is a bit too specific.\r\n\r\nYes indeed. Though you can use a .py that imports a package that contains your .pyc code and that you previously installed",
"Hi @lhoestq ,\r\nCould you share some example code related to the approach that you are suggesting? "
] | 2023-08-29T19:35:06
| 2023-08-31T19:47:29
| null |
NONE
| null | null | null | null |
### Describe the bug
The huggingface dataset library specifically looks for ‘.py’ file while loading the dataset using loading script approach and it does not work with ‘.pyc’ file.
While deploying in production, it becomes an issue when we are restricted to use only .pyc files. Is there any work around for this ?
### Steps to reproduce the bug
1. Create a dataset loading script to read the custom data.
2. compile the code to make sure that .pyc file is created
3. Delete the loading script and re-run the code. Usually, python should make use of complied .pyc files. However, in this case, the dataset library errors out with the message that it's unable to find the data loader loading script.
### Expected behavior
The code should make use of .pyc file and run without any error.
### Environment info
NA
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6193/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6193/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6190
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6190/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6190/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6190/events
|
https://github.com/huggingface/datasets/issues/6190
| 1,871,582,175
|
I_kwDODunzps5vjhPf
| 6,190
|
`Invalid user token` even when correct user token is passed!
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/18682411?v=4",
"events_url": "https://api.github.com/users/Vaibhavs10/events{/privacy}",
"followers_url": "https://api.github.com/users/Vaibhavs10/followers",
"following_url": "https://api.github.com/users/Vaibhavs10/following{/other_user}",
"gists_url": "https://api.github.com/users/Vaibhavs10/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Vaibhavs10",
"id": 18682411,
"login": "Vaibhavs10",
"node_id": "MDQ6VXNlcjE4NjgyNDEx",
"organizations_url": "https://api.github.com/users/Vaibhavs10/orgs",
"received_events_url": "https://api.github.com/users/Vaibhavs10/received_events",
"repos_url": "https://api.github.com/users/Vaibhavs10/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Vaibhavs10/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Vaibhavs10/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Vaibhavs10",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"This is because `download_config.use_auth_token` is deprecated - you should use `download_config.token` instead",
"Works! Thanks for the quick fix! <3"
] | 2023-08-29T12:37:03
| 2023-08-29T13:01:10
| 2023-08-29T13:01:09
|
NONE
| null | null | null | null |
### Describe the bug
I'm working on a dataset which comprises other datasets on the hub.
URL: https://huggingface.co/datasets/open-asr-leaderboard/datasets-test-only
Note: Some of the sub-datasets in this metadataset require explicit access.
All the other datasets work fine, except, `common_voice`.
### Steps to reproduce the bug
https://github.com/Vaibhavs10/scratchpad/blob/main/cv_datasets_bug_repro.ipynb
### Expected behavior
It should work if the provided access token is valid (as it does for all the other datasets)
### Environment info
datasets version -> 2.14.4
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/18682411?v=4",
"events_url": "https://api.github.com/users/Vaibhavs10/events{/privacy}",
"followers_url": "https://api.github.com/users/Vaibhavs10/followers",
"following_url": "https://api.github.com/users/Vaibhavs10/following{/other_user}",
"gists_url": "https://api.github.com/users/Vaibhavs10/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Vaibhavs10",
"id": 18682411,
"login": "Vaibhavs10",
"node_id": "MDQ6VXNlcjE4NjgyNDEx",
"organizations_url": "https://api.github.com/users/Vaibhavs10/orgs",
"received_events_url": "https://api.github.com/users/Vaibhavs10/received_events",
"repos_url": "https://api.github.com/users/Vaibhavs10/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Vaibhavs10/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Vaibhavs10/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Vaibhavs10",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6190/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6190/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 0:24:06
|
https://api.github.com/repos/huggingface/datasets/issues/6188
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6188/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6188/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6188/events
|
https://github.com/huggingface/datasets/issues/6188
| 1,870,987,640
|
I_kwDODunzps5vhQF4
| 6,188
|
[Feature Request] Check the length of batch before writing so that empty batch is allowed
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/61188463?v=4",
"events_url": "https://api.github.com/users/namespace-Pt/events{/privacy}",
"followers_url": "https://api.github.com/users/namespace-Pt/followers",
"following_url": "https://api.github.com/users/namespace-Pt/following{/other_user}",
"gists_url": "https://api.github.com/users/namespace-Pt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/namespace-Pt",
"id": 61188463,
"login": "namespace-Pt",
"node_id": "MDQ6VXNlcjYxMTg4NDYz",
"organizations_url": "https://api.github.com/users/namespace-Pt/orgs",
"received_events_url": "https://api.github.com/users/namespace-Pt/received_events",
"repos_url": "https://api.github.com/users/namespace-Pt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/namespace-Pt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/namespace-Pt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/namespace-Pt",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"I think this error means you filter all examples within an (input) batch by deleting its columns. In that case, to avoid the error, you can set the column value to an empty list (`input_batch[\"col\"] = []`) instead."
] | 2023-08-29T06:37:34
| 2023-09-19T21:55:38
| 2023-09-19T21:55:37
|
NONE
| null | null | null | null |
### Use Case
I use `dataset.map(process_fn, batched=True)` to process the dataset, with data **augmentations or filtering**. However, when all examples within a batch is filtered out, i.e. **an empty batch is returned**, the following error will be thrown:
```
ValueError: Schema and number of arrays unequal
```
This is because the empty batch does not comply with the schema of other batches. I think an empty batch should be allowed to facilitate coding (one does not need to assign an empty list manually for all keys.)
A simple fix is to check the length of `batch` before writing:
```
if len(batch):
writer.write_batch(batch)
```
instead of
https://github.com/huggingface/datasets/blob/74d60213dcbd7c99484c62ce1d3dfd90a1df0770/src/datasets/arrow_dataset.py#L3493
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6188/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6188/timeline
| null |
not_planned
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 21 days, 15:18:03
|
https://api.github.com/repos/huggingface/datasets/issues/6187
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6187/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6187/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6187/events
|
https://github.com/huggingface/datasets/issues/6187
| 1,870,936,143
|
I_kwDODunzps5vhDhP
| 6,187
|
Couldn't find a dataset script at /content/tsv/tsv.py or any data file in the same directory
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/20493493?v=4",
"events_url": "https://api.github.com/users/andysingal/events{/privacy}",
"followers_url": "https://api.github.com/users/andysingal/followers",
"following_url": "https://api.github.com/users/andysingal/following{/other_user}",
"gists_url": "https://api.github.com/users/andysingal/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/andysingal",
"id": 20493493,
"login": "andysingal",
"node_id": "MDQ6VXNlcjIwNDkzNDkz",
"organizations_url": "https://api.github.com/users/andysingal/orgs",
"received_events_url": "https://api.github.com/users/andysingal/received_events",
"repos_url": "https://api.github.com/users/andysingal/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/andysingal/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andysingal/subscriptions",
"type": "User",
"url": "https://api.github.com/users/andysingal",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"Hi! You can load this dataset with:\r\n```python\r\ndata_files = {\r\n \"train\": \"/content/PUBHEALTH/train.tsv\",\r\n \"validation\": \"/content/PUBHEALTH/dev.tsv\",\r\n \"test\": \"/content/PUBHEALTH/test.tsv\",\r\n}\r\n\r\ntsv_datasets_reloaded = load_dataset(\"csv\", data_files=data_files, sep=\"\\t\")\r\n```\r\n\r\nTo support your `load_dataset` call, defining aliases for the packaged builders, as suggested in https://github.com/huggingface/datasets/issues/5625, must be implemented. We can consider adding this feature if more people request it.\r\n \r\n(Also answered on the Discord [here](https://discord.com/channels/879548962464493619/1145956791134470224/1146071491260186744))"
] | 2023-08-29T05:49:56
| 2023-08-29T16:21:45
| null |
NONE
| null | null | null | null |
### Describe the bug
```
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
[<ipython-input-48-6a7b3e847019>](https://localhost:8080/#) in <cell line: 7>()
5 }
6
----> 7 csv_datasets_reloaded = load_dataset("tsv", data_files=data_files)
8 csv_datasets_reloaded
2 frames
[/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1489 raise e1 from None
1490 if isinstance(e1, FileNotFoundError):
-> 1491 raise FileNotFoundError(
1492 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. "
1493 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}"
FileNotFoundError: Couldn't find a dataset script at /content/tsv/tsv.py or any data file in the same directory. Couldn't find 'tsv' on the Hugging Face Hub either: FileNotFoundError: Dataset 'tsv' doesn't exist on the Hub
```
### Steps to reproduce the bug
```
data_files = {
"train": "/content/PUBHEALTH/train.tsv",
"validation": "/content/PUBHEALTH/dev.tsv",
"test": "/content/PUBHEALTH/test.tsv",
}
tsv_datasets_reloaded = load_dataset("tsv", data_files=data_files)
tsv_datasets_reloaded
```
```
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-48-6a7b3e847019> in <cell line: 7>()
5 }
6
----> 7 csv_datasets_reloaded = load_dataset("tsv", data_files=data_files)
8 csv_datasets_reloaded
2 frames
/usr/local/lib/python3.10/dist-packages/datasets/load.py in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1489 raise e1 from None
1490 if isinstance(e1, FileNotFoundError):
-> 1491 raise FileNotFoundError(
1492 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. "
1493 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}"
FileNotFoundError: Couldn't find a dataset script at /content/tsv/tsv.py or any data file in the same directory. Couldn't find 'tsv' on the Hugging Face Hub either: FileNotFoundError: Dataset 'tsv' doesn't exist on the Hub
```
### Expected behavior
load the data, push to hub
### Environment info
jupyter notebook RTX 3090
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6187/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6187/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6186
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6186/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6186/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6186/events
|
https://github.com/huggingface/datasets/issues/6186
| 1,869,431,457
|
I_kwDODunzps5vbUKh
| 6,186
|
Feature request: add code example of multi-GPU processing
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/48327001?v=4",
"events_url": "https://api.github.com/users/NielsRogge/events{/privacy}",
"followers_url": "https://api.github.com/users/NielsRogge/followers",
"following_url": "https://api.github.com/users/NielsRogge/following{/other_user}",
"gists_url": "https://api.github.com/users/NielsRogge/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/NielsRogge",
"id": 48327001,
"login": "NielsRogge",
"node_id": "MDQ6VXNlcjQ4MzI3MDAx",
"organizations_url": "https://api.github.com/users/NielsRogge/orgs",
"received_events_url": "https://api.github.com/users/NielsRogge/received_events",
"repos_url": "https://api.github.com/users/NielsRogge/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/NielsRogge/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/NielsRogge/subscriptions",
"type": "User",
"url": "https://api.github.com/users/NielsRogge",
"user_view_type": "public"
}
|
[
{
"color": "0075ca",
"default": true,
"description": "Improvements or additions to documentation",
"id": 1935892861,
"name": "documentation",
"node_id": "MDU6TGFiZWwxOTM1ODkyODYx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/documentation"
},
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
closed
| false
| null |
[] |
[
"That'd be a great idea! @mariosasko or @lhoestq, would it be possible to fix the code snippet or do you have another suggested way for doing this?",
"Indeed `if __name__ == \"__main__\"` is important in this case.\r\n\r\nNot sure about the imbalanced GPU usage though, but maybe you can try using the `torch.cuda.device` context manager ?\r\n\r\n> also, should I do it like this or use nn.DataParallel?\r\n\r\nIn this case you wouldn't need a multiprocessed map no ? Since nn.DataParallel would take care of parallelism",
"Adding this Tweet for reference: https://twitter.com/jxmnop/status/1716834517909119019.",
"I think the issue is that we set `CUDA_VISIBLE_DEVICES` after pytorch is imported ?\r\n\r\nWe should use `torch.cuda.set_device(...)` instead",
"@lhoestq \r\n> In this case you wouldn't need a multiprocessed map no ?\r\n\r\nYes. But how to load a model to 2 GPU simultaneously without something like accelerate?",
"> @lhoestq\r\n> \r\n> > In this case you wouldn't need a multiprocessed map no ?\r\n> \r\n> Yes. But how to load a model to 2 GPU simultaneously without something like accelerate?\r\n\r\nTake a look at this fix #6550 . Basically, you move the model to each GPU inside of the function to be mapped. \r\n\r\n",
"In case someone also runs into this issue, I wrote a [blog post](https://forrestbao.github.io/2024/01/30/datasets_map_with_rank_multiple_GPUs.html) with a complete working example by compiling information from several PRs and issues here. Hope it can help. This issue cost me a few hours. I hope my blog post can save you time before the official document gets fixed. ",
"Thanks ! I updated the docs in https://github.com/huggingface/datasets/pull/6550",
"hey @forrestbao , i was too struggling with the same issue for weeks hence i checked out your blog. great work on the blog. \r\nhowever i wanted to ask you could we scale up the process by reinitializing the same model on the same GPU multiple times for even more speedups ? \r\n\r\ni mean to say given that on a multi GPU setup where GPU vram is above 40GB each, after intializing the translation model which is barely 1-2GB in VRAM size, the rest of VRAM sits idle, how could i keep creating multiple instances of the same model on the same GPU for all GPUs to maxmize flops ? ",
"You can use one single instance on your GPU and increase the batch size until you fill the VRAM",
"@lhoestq i tried that, but i noticed that after a certain number of batch_size, using a larger batch_size makes the overall process really slow than using a lower batch_size.",
"Hi @lhoestq , could you help with my two questions: \r\n1. You mentioned `if __name__ == \"__main__\"`, why is that? I tried with a toy dataset and didn't put this line, my two GPU usage looks balanced. \r\n2. Is there any difference between \r\n`from multiprocess import set_start_method` and `from multiprocessing import set_start_method`? The latter is Python's built-in library. In [the official doc](https://huggingface.co/docs/datasets/en/process), it uses `from multiprocess import set_start_method`, but it gives me error like \r\n```\r\n[jobuser@f6e2419a0a63d45638da-n0-0 ~]$ python test.py\r\nTraceback (most recent call last):\r\n File \"/home/jobuser/test.py\", line 33, in <module>\r\n updated_dataset = dataset.map(\r\n File \"/home/jobuser/.local/lib/python3.10/site-packages/datasets/arrow_dataset.py\", line 593, in wrapper\r\n out: Union[\"Dataset\", \"DatasetDict\"] = func(self, *args, **kwargs)\r\n File \"/home/jobuser/.local/lib/python3.10/site-packages/datasets/arrow_dataset.py\", line 558, in wrapper\r\n out: Union[\"Dataset\", \"DatasetDict\"] = func(self, *args, **kwargs)\r\n File \"/home/jobuser/.local/lib/python3.10/site-packages/datasets/arrow_dataset.py\", line 3189, in map\r\n with Pool(len(kwargs_per_job)) as pool:\r\n File \"/home/jobuser/.local/lib/python3.10/site-packages/multiprocess/context.py\", line 119, in Pool\r\n return Pool(processes, initializer, initargs, maxtasksperchild,\r\n File \"/home/jobuser/.local/lib/python3.10/site-packages/multiprocess/pool.py\", line 191, in __init__\r\n self._setup_queues()\r\n File \"/home/jobuser/.local/lib/python3.10/site-packages/multiprocess/pool.py\", line 343, in _setup_queues\r\n self._inqueue = self._ctx.SimpleQueue()\r\n File \"/home/jobuser/.local/lib/python3.10/site-packages/multiprocess/context.py\", line 113, in SimpleQueue\r\n return SimpleQueue(ctx=self.get_context())\r\n File \"/home/jobuser/.local/lib/python3.10/site-packages/multiprocess/queues.py\", line 339, in __init__\r\n self._rlock = ctx.Lock()\r\n File \"/home/jobuser/.local/lib/python3.10/site-packages/multiprocess/context.py\", line 68, in Lock\r\n return Lock(ctx=self.get_context())\r\n File \"/home/jobuser/.local/lib/python3.10/site-packages/multiprocess/synchronize.py\", line 168, in __init__\r\n SemLock.__init__(self, SEMAPHORE, 1, 1, ctx=ctx)\r\n File \"/home/jobuser/.local/lib/python3.10/site-packages/multiprocess/synchronize.py\", line 86, in __init__\r\n register(self._semlock.name, \"semaphore\")\r\n File \"/home/jobuser/.local/lib/python3.10/site-packages/multiprocess/resource_tracker.py\", line 150, in register\r\n self._send('REGISTER', name, rtype)\r\n File \"/home/jobuser/.local/lib/python3.10/site-packages/multiprocess/resource_tracker.py\", line 157, in _send\r\n self.ensure_running()\r\n File \"/home/jobuser/.local/lib/python3.10/site-packages/multiprocess/resource_tracker.py\", line 124, in ensure_running\r\n pid = util.spawnv_passfds(exe, args, fds_to_pass)\r\n File \"/home/jobuser/.local/lib/python3.10/site-packages/multiprocess/util.py\", line 452, in spawnv_passfds\r\n return _posixsubprocess.fork_exec(\r\nTypeError: fork_exec() takes exactly 21 arguments (17 given)\r\n```\r\nwhich seems caused by python version. I am using Python 3.10.2. ",
"Hi ! \r\n\r\n> You mentioned if __name__ == \"__main__\", why is that? I tried with a toy dataset and didn't put this line, my two GPU usage looks balanced.\r\n\r\nIt's a good practice when doing multiprocessing in python. Depending on the multiprocessing method and your python version, python could re-run the code in your main.py in subprocesses that you don't want to re-run (e.g. recursively spawning processes and failing). Though some multiprocessing methods don't re-run main.py and it appears to be your case ;)\r\n\r\n> Is there any difference between\r\nfrom multiprocess import set_start_method and from multiprocessing import set_start_method? The latter is Python's built-in library. In [the official doc](https://huggingface.co/docs/datasets/en/process), it uses from multiprocess import set_start_method, but it gives me error like\r\n\r\nYes, `datasets` uses `multiprocess` which is a separate library from the built-in `multiprocessing`.\r\n\r\n`multiprocess` is an extended version of `multiprocessing` which allows e.g. to pass `lambda` functions to subprocesses",
"Thanks @lhoestq for explanation. Is it okay we use `multiprocessing` for set_start_method given the above-mentioned issue for multiprocess? From my run with toy example, it's fine. Just want to check if you foresee any problems. ",
"Not sure whether `multiprocessing.set_start_method` has any effect actually since we use `dill` for multiprocessed `map()`",
"I'm running the [code example of multi-GPU processing](https://huggingface.co/docs/datasets/en/process#multiprocessing) on a Linux 8x A100 instance. The entire python code run time is 30 seconds faster if I add one line to set torch number of threads immediately after the `import torch` statement. It loads faster to the eight GPUs (however the map() progress bars take similar amount of time without/with this additional line).\r\n```\r\nimport torch\r\ntorch.set_num_threads(1) # I added this line.\r\n\r\nfrom multiprocess import set_start_method\r\n```\r\nFWIW: my instance has these versions.\r\n```\r\nCUDA 12.2 driver 535.161.08\r\nPython 3.10.12\r\ntorch '2.2.2'\r\nmultiprocess '0.70.16'\r\ntransformers '4.39.2'\r\ndatasets '2.18.0'\r\n```",
"@lhoestq Thanks for the updated GPU multiprocessing documentation! When I tried to add `updated_dataset.save_to_disk()` after the map function with multiple GPUs, I get an error during saving: \r\n```\r\nSaving the dataset (0/20 shards): 0%| | 78000/84761821 [01:07<20:22:25, 1154.59 examples/s]Exception ignored in: <generator object Dataset._save_to_disk_single at 0x7f2498f15070>\r\nTraceback (most recent call last):\r\n File \"/home/ubuntu/lib/python3.10/site-packages/datasets/utils/py_utils.py\", line 679, in _write_generator_to_queue\r\n queue.put(result)\r\nRuntimeError: generator ignored GeneratorExit\r\n```\r\nDo you have any thoughts?",
"Hmm first time I see this, and it's even more surprising given there is no generator in `_write_generator_to_queue`. Could you open a new issue ?"
] | 2023-08-28T10:00:59
| 2024-10-07T09:39:51
| 2023-11-22T15:42:20
|
CONTRIBUTOR
| null | null | null | null |
### Feature request
Would be great to add a code example of how to do multi-GPU processing with 🤗 Datasets in the documentation. cc @stevhliu
Currently the docs has a small [section](https://huggingface.co/docs/datasets/v2.3.2/en/process#map) on this saying "your big GPU call goes here", however it didn't work for me out-of-the-box.
Let's say you have a PyTorch model that can do translation, and you have multiple GPUs. In that case, you'd like to duplicate the model on each GPU, each processing (translating) a chunk of the data in parallel.
Here's how I tried to do that:
```
from datasets import load_dataset
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from multiprocess import set_start_method
import torch
import os
dataset = load_dataset("mlfoundations/datacomp_small")
tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M")
# put model on each available GPU
# also, should I do it like this or use nn.DataParallel?
model.to("cuda:0")
model.to("cuda:1")
set_start_method("spawn")
def translate_captions(batch, rank):
os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())
texts = batch["text"]
inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt").to(model.device)
translated_tokens = model.generate(
**inputs, forced_bos_token_id=tokenizer.lang_code_to_id["eng_Latn"], max_length=30
)
translated_texts = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)
batch["translated_text"] = translated_texts
return batch
updated_dataset = dataset.map(translate_captions, with_rank=True, num_proc=2, batched=True, batch_size=256)
```
I've personally tried running this script on a machine with 2 A100 GPUs.
## Error 1
Running the code snippet above from the terminal (python script.py) resulted in the following error:
```
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 125, in _main
prepare(preparation_data)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 289, in run_path
return _run_module_code(code, init_globals, run_name,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/niels/python_projects/datacomp/datasets_multi_gpu.py", line 16, in <module>
set_start_method("spawn")
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 247, in set_start_method
raise RuntimeError('context has already been set')
RuntimeError: context has already been set
```
## Error 2
Then, based on [this Stackoverflow answer](https://stackoverflow.com/a/71616344/7762882), I put the `set_start_method("spawn")` section in a try: catch block. This resulted in the following error:
```
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/dataset_dict.py", line 817, in <dictcomp>
k: dataset.map(
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2926, in map
with Pool(nb_of_missing_shards, initargs=initargs, initializer=initializer) as pool:
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 215, in __init__
self._repopulate_pool()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 306, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 329, in _repopulate_pool_static
w.start()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/process.py", line 121, in start
self._popen = self._Popen(self)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 288, in _Popen
return Popen(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
```
So then I put the last line under a `if __name__ == '__main__':` block. Then the code snippet seemed to work, but it seemed that it's only leveraging a single GPU (based on monitoring `nvidia-smi`):
```
Mon Aug 28 12:19:24 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA A100-SXM... On | 00000000:01:00.0 Off | 0 |
| N/A 55C P0 76W / 275W | 8747MiB / 81920MiB | 0% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
| 1 NVIDIA A100-SXM... On | 00000000:47:00.0 Off | 0 |
| N/A 67C P0 274W / 275W | 59835MiB / 81920MiB | 100% Default |
| | | Disabled |
```
Both GPUs should have equal GPU usage, but I've always noticed that the last GPU has way more usage than the other ones. This made me think that `os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())` might not work inside a Python script, especially if done after importing PyTorch?
### Motivation
Would be great to clarify how to do multi-GPU data processing.
### Your contribution
If my code snippet can be fixed, I can contribute it to the docs :)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lhoestq",
"id": 42851186,
"login": "lhoestq",
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lhoestq",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6186/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6186/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 86 days, 5:41:21
|
https://api.github.com/repos/huggingface/datasets/issues/6185
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6185/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6185/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6185/events
|
https://github.com/huggingface/datasets/issues/6185
| 1,868,077,748
|
I_kwDODunzps5vWJq0
| 6,185
|
Error in saving the PIL image into *.arrow files using datasets.arrow_writer
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/14247682?v=4",
"events_url": "https://api.github.com/users/HaozheZhao/events{/privacy}",
"followers_url": "https://api.github.com/users/HaozheZhao/followers",
"following_url": "https://api.github.com/users/HaozheZhao/following{/other_user}",
"gists_url": "https://api.github.com/users/HaozheZhao/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/HaozheZhao",
"id": 14247682,
"login": "HaozheZhao",
"node_id": "MDQ6VXNlcjE0MjQ3Njgy",
"organizations_url": "https://api.github.com/users/HaozheZhao/orgs",
"received_events_url": "https://api.github.com/users/HaozheZhao/received_events",
"repos_url": "https://api.github.com/users/HaozheZhao/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/HaozheZhao/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/HaozheZhao/subscriptions",
"type": "User",
"url": "https://api.github.com/users/HaozheZhao",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"You can cast the `input_image` column to the `Image` type to fix the issue:\r\n```python\r\nds.cast_column(\"input_image\", datasets.Image())\r\n```"
] | 2023-08-26T12:15:57
| 2023-08-29T14:49:58
| null |
NONE
| null | null | null | null |
### Describe the bug
I am using the ArrowWriter from datasets.arrow_writer to save a json-style file as arrow files. Within the dictionary, it contains a feature called "image" which is a list of PIL.Image objects.
I am saving the json using the following script:
```
def save_to_arrow(path,temp):
with ArrowWriter(path=path,writer_batch_size=20) as writer:
writer.write_batch(temp)
writer.finalize()
```
However, when I attempt to restore the dataset and use the ```Dataset.from_file(path)``` function to load the arrow file, there seems to be an issue with the PIL.Image object in the dataset. The list of PIL.Images appears as follows rather than a normal PIL.Image object:

### Steps to reproduce the bug
1. Storing the data json into arrow files:
```
def save_to_arrow(path,temp):
with ArrowWriter(path=path,writer_batch_size=20) as writer:
writer.write_batch(temp)
writer.finalize()
save_to_arrow( path, json_file )
```
2. try to load the arrow file into the Dataset object using the ```Dataset.from_file(path)```
### Expected behavior
Except to saving the contained "image" feature as a list PIL.Image objects as the arrow file. And I can restore the dataset from the file.
### Environment info
- `datasets` version: 2.12.0
- Platform: Linux-5.4.0-150-generic-x86_64-with-glibc2.17
- Python version: 3.8.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.4.4
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 1,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6185/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6185/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6184
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6184/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6184/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6184/events
|
https://github.com/huggingface/datasets/issues/6184
| 1,867,766,143
|
I_kwDODunzps5vU9l_
| 6,184
|
Map cache does not detect function changes in another module
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/511073?v=4",
"events_url": "https://api.github.com/users/jonathanasdf/events{/privacy}",
"followers_url": "https://api.github.com/users/jonathanasdf/followers",
"following_url": "https://api.github.com/users/jonathanasdf/following{/other_user}",
"gists_url": "https://api.github.com/users/jonathanasdf/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jonathanasdf",
"id": 511073,
"login": "jonathanasdf",
"node_id": "MDQ6VXNlcjUxMTA3Mw==",
"organizations_url": "https://api.github.com/users/jonathanasdf/orgs",
"received_events_url": "https://api.github.com/users/jonathanasdf/received_events",
"repos_url": "https://api.github.com/users/jonathanasdf/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jonathanasdf/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jonathanasdf/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jonathanasdf",
"user_view_type": "public"
}
|
[
{
"color": "cfd3d7",
"default": true,
"description": "This issue or pull request already exists",
"id": 1935892865,
"name": "duplicate",
"node_id": "MDU6TGFiZWwxOTM1ODkyODY1",
"url": "https://api.github.com/repos/huggingface/datasets/labels/duplicate"
}
] |
closed
| false
| null |
[] |
[
"This issue is a duplicate of https://github.com/huggingface/datasets/issues/3297. This is a limitation of `dill`, a package we use for caching (non-`__main__` module objects are serialized by reference). You can find more info about it here: https://github.com/uqfoundation/dill/issues/424.\r\n\r\nIn your case, moving \r\n```\r\ndata = datasets.load_dataset('json', data_files=['/tmp/test.json'], split='train')\r\ndata = data.map(transform)\r\n``` \r\nto `test.py` and setting `transform.__module__ = None` at the end of `dataset.py` should fix the issue.",
"I understand this may be a limitation of an upstream tool, but for a user for datasets this is very annoying, as when you have dozens of different datasets with different preprocessing functions you can't really move them all into the same file. It may be worth seeing if there is a way to specialize the dependency (eg. subclass it) and enforce behaviors that makes sense for your product.\r\n\r\nI was able to work around this for now by setting `__module__ = None`. If such workarounds are required for now it may be better to document it somewhere than a single obscure issue from a long time ago.\r\n\r\nAs this is a duplicate issue I'm closing it.\r\n\r\nI have another issue with the cache https://github.com/huggingface/datasets/issues/6179 can you take a look?"
] | 2023-08-25T22:59:14
| 2023-08-29T20:57:07
| 2023-08-29T20:56:49
|
NONE
| null | null | null | null |
```python
# dataset.py
import os
import datasets
if not os.path.exists('/tmp/test.json'):
with open('/tmp/test.json', 'w') as file:
file.write('[{"text": "hello"}]')
def transform(example):
text = example['text']
# text += ' world'
return {'text': text}
data = datasets.load_dataset('json', data_files=['/tmp/test.json'], split='train')
data = data.map(transform)
```
```python
# test.py
import dataset
print(next(iter(dataset.data)))
```
Initialize cache
```
python3 test.py
# {'text': 'hello'}
```
Edit dataset.py and uncomment the commented line, run again
```
python3 test.py
# {'text': 'hello'}
# expected: {'text': 'hello world'}
```
Clear cache and run again
```
rm -rf ~/.cache/huggingface/datasets/*
python3 test.py
# {'text': 'hello world'}
```
If instead the two files are combined, then changes to the function are detected correctly. But it's expected when working on any realistic codebase that things will be modularized into separate files.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/511073?v=4",
"events_url": "https://api.github.com/users/jonathanasdf/events{/privacy}",
"followers_url": "https://api.github.com/users/jonathanasdf/followers",
"following_url": "https://api.github.com/users/jonathanasdf/following{/other_user}",
"gists_url": "https://api.github.com/users/jonathanasdf/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jonathanasdf",
"id": 511073,
"login": "jonathanasdf",
"node_id": "MDQ6VXNlcjUxMTA3Mw==",
"organizations_url": "https://api.github.com/users/jonathanasdf/orgs",
"received_events_url": "https://api.github.com/users/jonathanasdf/received_events",
"repos_url": "https://api.github.com/users/jonathanasdf/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jonathanasdf/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jonathanasdf/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jonathanasdf",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6184/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6184/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 3 days, 21:57:35
|
https://api.github.com/repos/huggingface/datasets/issues/6183
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6183/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6183/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6183/events
|
https://github.com/huggingface/datasets/issues/6183
| 1,867,743,276
|
I_kwDODunzps5vU4As
| 6,183
|
Load dataset with non-existent file
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/64750224?v=4",
"events_url": "https://api.github.com/users/freQuensy23-coder/events{/privacy}",
"followers_url": "https://api.github.com/users/freQuensy23-coder/followers",
"following_url": "https://api.github.com/users/freQuensy23-coder/following{/other_user}",
"gists_url": "https://api.github.com/users/freQuensy23-coder/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/freQuensy23-coder",
"id": 64750224,
"login": "freQuensy23-coder",
"node_id": "MDQ6VXNlcjY0NzUwMjI0",
"organizations_url": "https://api.github.com/users/freQuensy23-coder/orgs",
"received_events_url": "https://api.github.com/users/freQuensy23-coder/received_events",
"repos_url": "https://api.github.com/users/freQuensy23-coder/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/freQuensy23-coder/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/freQuensy23-coder/subscriptions",
"type": "User",
"url": "https://api.github.com/users/freQuensy23-coder",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"Same problem",
"This was fixed in https://github.com/huggingface/datasets/pull/6155, which will be included in the next release (or you can install `datasets` from source to use it immediately)."
] | 2023-08-25T22:21:22
| 2023-08-29T13:26:22
| 2023-08-29T13:26:22
|
NONE
| null | null | null | null |
### Describe the bug
When load a dataset from datasets and pass a wrong path to json with the data, error message does not contain something abount "wrong path" or "file do not exist" -
```SchemaInferenceError: Please pass `features` or at least one example when writing data```
### Steps to reproduce the bug
```python
from datasets import load_dataset
load_dataset('json', data_files='/home/alexey/unreal_file.json')
```
### Expected behavior
Raise os FileNotFound error or custom error with informative message
### Environment info
```
# packages in environment at /home/alexey/.conda/envs/alex_LoRA:
#
# Name Version Build Channel
_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
accelerate 0.21.0 pypi_0 pypi
aiohttp 3.8.5 pypi_0 pypi
aiosignal 1.3.1 pypi_0 pypi
antlr4-python3-runtime 4.9.3 pypi_0 pypi
appdirs 1.4.4 pypi_0 pypi
asttokens 2.0.5 pyhd3eb1b0_0
async-timeout 4.0.3 pypi_0 pypi
attrs 23.1.0 pypi_0 pypi
backcall 0.2.0 pyhd3eb1b0_0
bitsandbytes 0.41.1 pypi_0 pypi
bzip2 1.0.8 h7b6447c_0
ca-certificates 2023.05.30 h06a4308_0
certifi 2023.7.22 pypi_0 pypi
charset-normalizer 3.2.0 pypi_0 pypi
click 8.1.6 pypi_0 pypi
cmake 3.27.2 pypi_0 pypi
comm 0.1.2 py310h06a4308_0
contourpy 1.1.0 pypi_0 pypi
cycler 0.11.0 pypi_0 pypi
datasets 2.14.4 pypi_0 pypi
debugpy 1.6.7 py310h6a678d5_0
decorator 5.1.1 pyhd3eb1b0_0
dill 0.3.7 pypi_0 pypi
docker-pycreds 0.4.0 pypi_0 pypi
executing 0.8.3 pyhd3eb1b0_0
filelock 3.12.2 pypi_0 pypi
fire 0.5.0 pypi_0 pypi
fonttools 4.42.0 pypi_0 pypi
frozenlist 1.4.0 pypi_0 pypi
fsspec 2023.6.0 pypi_0 pypi
gitdb 4.0.10 pypi_0 pypi
gitpython 3.1.32 pypi_0 pypi
huggingface-hub 0.16.4 pypi_0 pypi
idna 3.4 pypi_0 pypi
ipykernel 6.25.0 py310h2f386ee_0
ipython 8.12.2 py310h06a4308_0
ipython-genutils 0.2.0 pypi_0 pypi
ipywidgets 8.0.4 py310h06a4308_0
jedi 0.18.1 py310h06a4308_1
jinja2 3.1.2 pypi_0 pypi
jsonschema 4.19.0 pypi_0 pypi
jsonschema-specifications 2023.7.1 pypi_0 pypi
jupyter_client 8.1.0 py310h06a4308_0
jupyter_core 5.3.0 py310h06a4308_0
jupyterlab_widgets 3.0.5 py310h06a4308_0
kiwisolver 1.4.4 pypi_0 pypi
ld_impl_linux-64 2.38 h1181459_1
libffi 3.3 he6710b0_2
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
libsodium 1.0.18 h7b6447c_0
libstdcxx-ng 11.2.0 h1234567_1
libuuid 1.41.5 h5eee18b_0
lightning-utilities 0.9.0 pypi_0 pypi
lit 16.0.6 pypi_0 pypi
markupsafe 2.1.3 pypi_0 pypi
matplotlib 3.7.2 pypi_0 pypi
matplotlib-inline 0.1.6 py310h06a4308_0
mpmath 1.3.0 pypi_0 pypi
multidict 6.0.4 pypi_0 pypi
multiprocess 0.70.15 pypi_0 pypi
nbformat 4.2.0 pypi_0 pypi
ncurses 6.4 h6a678d5_0
nest-asyncio 1.5.6 py310h06a4308_0
networkx 3.1 pypi_0 pypi
numpy 1.25.2 pypi_0 pypi
nvidia-cublas-cu11 11.10.3.66 pypi_0 pypi
nvidia-cuda-cupti-cu11 11.7.101 pypi_0 pypi
nvidia-cuda-nvrtc-cu11 11.7.99 pypi_0 pypi
nvidia-cuda-runtime-cu11 11.7.99 pypi_0 pypi
nvidia-cudnn-cu11 8.5.0.96 pypi_0 pypi
nvidia-cufft-cu11 10.9.0.58 pypi_0 pypi
nvidia-curand-cu11 10.2.10.91 pypi_0 pypi
nvidia-cusolver-cu11 11.4.0.1 pypi_0 pypi
nvidia-cusparse-cu11 11.7.4.91 pypi_0 pypi
nvidia-nccl-cu11 2.14.3 pypi_0 pypi
nvidia-nvtx-cu11 11.7.91 pypi_0 pypi
omegaconf 2.3.0 pypi_0 pypi
openssl 1.1.1v h7f8727e_0
packaging 23.0 py310h06a4308_0
pandas 2.0.3 pypi_0 pypi
parso 0.8.3 pyhd3eb1b0_0
pathtools 0.1.2 pypi_0 pypi
peft 0.4.0 pypi_0 pypi
pexpect 4.8.0 pyhd3eb1b0_3
pickleshare 0.7.5 pyhd3eb1b0_1003
pillow 10.0.0 pypi_0 pypi
pip 23.2.1 py310h06a4308_0
platformdirs 2.5.2 py310h06a4308_0
plotly 5.16.1 pypi_0 pypi
prompt-toolkit 3.0.36 py310h06a4308_0
protobuf 4.24.0 pypi_0 pypi
psutil 5.9.0 py310h5eee18b_0
ptyprocess 0.7.0 pyhd3eb1b0_2
pure_eval 0.2.2 pyhd3eb1b0_0
pyarrow 12.0.1 pypi_0 pypi
pygments 2.15.1 py310h06a4308_1
pyparsing 3.0.9 pypi_0 pypi
python 3.10.0 h12debd9_5
python-dateutil 2.8.2 pyhd3eb1b0_0
pytorch-lightning 2.0.6 pypi_0 pypi
pytz 2023.3 pypi_0 pypi
pyyaml 6.0.1 pypi_0 pypi
pyzmq 25.1.0 py310h6a678d5_0
readline 8.2 h5eee18b_0
referencing 0.30.2 pypi_0 pypi
regex 2023.8.8 pypi_0 pypi
requests 2.31.0 pypi_0 pypi
rpds-py 0.9.2 pypi_0 pypi
safetensors 0.3.2 pypi_0 pypi
scipy 1.11.1 pypi_0 pypi
sentencepiece 0.1.99 pypi_0 pypi
sentry-sdk 1.29.2 pypi_0 pypi
setproctitle 1.3.2 pypi_0 pypi
setuptools 68.0.0 py310h06a4308_0
six 1.16.0 pyhd3eb1b0_1
smmap 5.0.0 pypi_0 pypi
sqlite 3.41.2 h5eee18b_0
stack_data 0.2.0 pyhd3eb1b0_0
sympy 1.12 pypi_0 pypi
tenacity 8.2.3 pypi_0 pypi
termcolor 2.3.0 pypi_0 pypi
tk 8.6.12 h1ccaba5_0
tokenizers 0.13.3 pypi_0 pypi
torch 2.0.1 pypi_0 pypi
torchmetrics 1.0.3 pypi_0 pypi
tornado 6.3.2 py310h5eee18b_0
tqdm 4.66.1 pypi_0 pypi
traitlets 5.7.1 py310h06a4308_0
transformers 4.31.0 pypi_0 pypi
triton 2.0.0 pypi_0 pypi
typing-extensions 4.7.1 pypi_0 pypi
tzdata 2023.3 pypi_0 pypi
urllib3 2.0.4 pypi_0 pypi
wandb 0.15.8 pypi_0 pypi
wcwidth 0.2.5 pyhd3eb1b0_0
wheel 0.38.4 py310h06a4308_0
widgetsnbextension 4.0.5 py310h06a4308_0
xxhash 3.3.0 pypi_0 pypi
xz 5.4.2 h5eee18b_0
yarl 1.9.2 pypi_0 pypi
zeromq 4.3.4 h2531618_0
zlib 1.2.13 h5eee18b_0
active environment : None
user config file : /home/alexey/.condarc
populated config files :
conda version : 23.1.0
conda-build version : 3.22.0
python version : 3.9.13.final.0
virtual packages : __archspec=1=x86_64
__cuda=12.0=0
__glibc=2.35=0
__linux=5.19.0=0
__unix=0=0
base environment : /opt/anaconda/anaconda3 (read only)
conda av data dir : /opt/anaconda/anaconda3/etc/conda
conda av metadata url : None
channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /opt/anaconda/anaconda3/pkgs
/home/alexey/.conda/pkgs
envs directories : /home/alexey/.conda/envs
/opt/anaconda/anaconda3/envs
platform : linux-64
user-agent : conda/23.1.0 requests/2.31.0 CPython/3.9.13 Linux/5.19.0-46-generic ubuntu/22.04.2 glibc/2.35
UID:GID : 1009:1009
netrc file : /home/alexey/.netrc
offline mode : False
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 1,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6183/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6183/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 3 days, 15:05:00
|
https://api.github.com/repos/huggingface/datasets/issues/6182
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6182/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6182/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6182/events
|
https://github.com/huggingface/datasets/issues/6182
| 1,867,203,131
|
I_kwDODunzps5vS0I7
| 6,182
|
Loading Meteor metric in HF evaluate module crashes due to datasets import issue
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/42322648?v=4",
"events_url": "https://api.github.com/users/dsashulya/events{/privacy}",
"followers_url": "https://api.github.com/users/dsashulya/followers",
"following_url": "https://api.github.com/users/dsashulya/following{/other_user}",
"gists_url": "https://api.github.com/users/dsashulya/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dsashulya",
"id": 42322648,
"login": "dsashulya",
"node_id": "MDQ6VXNlcjQyMzIyNjQ4",
"organizations_url": "https://api.github.com/users/dsashulya/orgs",
"received_events_url": "https://api.github.com/users/dsashulya/received_events",
"repos_url": "https://api.github.com/users/dsashulya/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dsashulya/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dsashulya/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dsashulya",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"Our minimal Python version requirement is 3.8, so we dropped `importlib_metadata`. \r\n\r\nFeel free to open a PR in the `evaluate` repo to replace the problematic import with\r\n```python\r\nif PY_VERSION < version.parse(\"3.8\"):\r\n import importlib_metadata\r\nelse:\r\n import importlib.metadata as importlib_metadata\r\n```",
"Any idea when you guys will release the next version which deals with this problem?\r\nI'm still having the same issue with py 3.10 when I install the lib with pip.\r\nI'm assuming that it has not yet been updated since the merge was 3 days ago.",
"Yes, this requires a new `evaluate` release (cc @lvwerra for this). \r\n\r\nIn the meantime, you can get the fixed version by installing `evaluate` from `main`: `pip install git+https://github.com/huggingface/evaluate.git`",
"I'll aim for a release this week!"
] | 2023-08-25T14:54:06
| 2023-09-04T16:41:11
| 2023-08-31T14:38:23
|
NONE
| null | null | null | null |
### Describe the bug
When using python3.9 and ```evaluate``` module loading Meteor metric crashes at a non-existent import from ```datasets.config``` in ```datasets v2.14```
### Steps to reproduce the bug
```
from evaluate import load
meteor = load("meteor")
```
produces the following error:
```
from datasets.config import importlib_metadata, version
ImportError: cannot import name 'importlib_metadata' from 'datasets.config' (<path_to_project>/venv/lib/python3.9/site-packages/datasets/config.py)
```
### Expected behavior
```datasets``` of v2.10 has the following workaround in ```config.py```:
```
if PY_VERSION < version.parse("3.8"):
import importlib_metadata
else:
import importlib.metadata as importlib_metadata
```
However, it's absent in v2.14 which might be the cause of the issue.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.5-arm64-arm-64bit
- Python version: 3.9.6
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
- Evaluate version: 0.4.0
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8264887?v=4",
"events_url": "https://api.github.com/users/lvwerra/events{/privacy}",
"followers_url": "https://api.github.com/users/lvwerra/followers",
"following_url": "https://api.github.com/users/lvwerra/following{/other_user}",
"gists_url": "https://api.github.com/users/lvwerra/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lvwerra",
"id": 8264887,
"login": "lvwerra",
"node_id": "MDQ6VXNlcjgyNjQ4ODc=",
"organizations_url": "https://api.github.com/users/lvwerra/orgs",
"received_events_url": "https://api.github.com/users/lvwerra/received_events",
"repos_url": "https://api.github.com/users/lvwerra/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lvwerra/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lvwerra/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lvwerra",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6182/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6182/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 5 days, 23:44:17
|
https://api.github.com/repos/huggingface/datasets/issues/6179
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6179/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6179/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6179/events
|
https://github.com/huggingface/datasets/issues/6179
| 1,867,009,016
|
I_kwDODunzps5vSEv4
| 6,179
|
Map cache with tokenizer
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/511073?v=4",
"events_url": "https://api.github.com/users/jonathanasdf/events{/privacy}",
"followers_url": "https://api.github.com/users/jonathanasdf/followers",
"following_url": "https://api.github.com/users/jonathanasdf/following{/other_user}",
"gists_url": "https://api.github.com/users/jonathanasdf/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jonathanasdf",
"id": 511073,
"login": "jonathanasdf",
"node_id": "MDQ6VXNlcjUxMTA3Mw==",
"organizations_url": "https://api.github.com/users/jonathanasdf/orgs",
"received_events_url": "https://api.github.com/users/jonathanasdf/received_events",
"repos_url": "https://api.github.com/users/jonathanasdf/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jonathanasdf/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jonathanasdf/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jonathanasdf",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"https://github.com/huggingface/datasets/issues/5147 may be a solution, by passing in the tokenizer in a fn_kwargs and ignoring it in the fingerprint calculations",
"I have a similar issue. I was using a Jupyter Notebook and every time I call the map function it performs tokenization from scratch again although the cache files of last run still exists. \r\n\r\nI ran with 20 processes and now in the cache folder there are two groups of cached results of tokenized dataset:\r\n\r\n```\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:46 2023 cache-1982fea76aa54a13_00001_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 13:02:08 2023 cache-1982fea76aa54a13_00004_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:40 2023 cache-1982fea76aa54a13_00005_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:50:59 2023 cache-1982fea76aa54a13_00006_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:37 2023 cache-1982fea76aa54a13_00007_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:31 2023 cache-1982fea76aa54a13_00008_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:59:47 2023 cache-1982fea76aa54a13_00010_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:59:44 2023 cache-1982fea76aa54a13_00011_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:55:24 2023 cache-1982fea76aa54a13_00012_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:56:21 2023 cache-1982fea76aa54a13_00013_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:24 2023 cache-1982fea76aa54a13_00014_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 13:00:48 2023 cache-1982fea76aa54a13_00015_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:56 2023 cache-1982fea76aa54a13_00017_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:54 2023 cache-1982fea76aa54a13_00018_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:27 2023 cache-1982fea76aa54a13_00019_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:15:40 2023 cache-454431f643cdc5e8_00000_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:46 2023 cache-454431f643cdc5e8_00001_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:14:53 2023 cache-454431f643cdc5e8_00002_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:13:10 2023 cache-454431f643cdc5e8_00003_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:13:04 2023 cache-454431f643cdc5e8_00004_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:42 2023 cache-454431f643cdc5e8_00005_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:01:29 2023 cache-454431f643cdc5e8_00006_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:41 2023 cache-454431f643cdc5e8_00007_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:14:04 2023 cache-454431f643cdc5e8_00008_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:17:41 2023 cache-454431f643cdc5e8_00009_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:17:06 2023 cache-454431f643cdc5e8_00010_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:17:16 2023 cache-454431f643cdc5e8_00011_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:15:13 2023 cache-454431f643cdc5e8_00012_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:16:01 2023 cache-454431f643cdc5e8_00013_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:35 2023 cache-454431f643cdc5e8_00014_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:20 2023 cache-454431f643cdc5e8_00015_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:14:48 2023 cache-454431f643cdc5e8_00016_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 18:59:32 2023 cache-454431f643cdc5e8_00017_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:17:58 2023 cache-454431f643cdc5e8_00018_of_00020.arrow\r\n.rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:15:25 2023 cache-454431f643cdc5e8_00019_of_00020.arrow\r\n```\r\n\r\ncan we specify the cache file for map so that it won't redo everything again?",
"@Luosuu [map](https://huggingface.co/docs/datasets/v2.14.4/en/package_reference/main_classes#datasets.Dataset.map) has cache_file_name parameter\r\n\r\nIn my case, I do want the cache to detect when the map function changes, so I can't pass a constant cache file name.",
"Implementing a proper hashing function for the (fast) tokenizers is currently impossible for the reasons mentioned in the referenced issues. So the only alternative to the `cache_file_name` (or `new_fingerprint`) parameter is a custom serializer (e.g., that deserializes the tokenizer from a local save path) defined using `copyreg` or a class that wraps the tokenizer object and has `__reduce__`(`__setstate__`/`__getstate__`) "
] | 2023-08-25T12:55:18
| 2023-08-31T15:17:24
| null |
NONE
| null | null | null | null |
Similar issue to https://github.com/huggingface/datasets/issues/5985, but across different sessions rather than two calls in the same session.
Unlike that issue, explicitly calling tokenizer(my_args) before the map() doesn't help, because the tokenizer was created with a different hash to begin with...
setup
```
from transformers import AutoTokenizer
AutoTokenizer.from_pretrained('bert-base-uncased').save_pretrained("tok")
```
this prints different value each time
```
from transformers import AutoTokenizer
from datasets.utils.py_utils import dumps # Huggingface datasets
print(hash(dumps(AutoTokenizer.from_pretrained("tok"))))
```
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6179/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6179/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6178
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6178/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6178/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6178/events
|
https://github.com/huggingface/datasets/issues/6178
| 1,866,610,102
|
I_kwDODunzps5vQjW2
| 6,178
|
'import datasets' throws "invalid syntax error"
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/128580829?v=4",
"events_url": "https://api.github.com/users/elia-ashraf/events{/privacy}",
"followers_url": "https://api.github.com/users/elia-ashraf/followers",
"following_url": "https://api.github.com/users/elia-ashraf/following{/other_user}",
"gists_url": "https://api.github.com/users/elia-ashraf/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/elia-ashraf",
"id": 128580829,
"login": "elia-ashraf",
"node_id": "U_kgDOB6n83Q",
"organizations_url": "https://api.github.com/users/elia-ashraf/orgs",
"received_events_url": "https://api.github.com/users/elia-ashraf/received_events",
"repos_url": "https://api.github.com/users/elia-ashraf/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/elia-ashraf/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/elia-ashraf/subscriptions",
"type": "User",
"url": "https://api.github.com/users/elia-ashraf",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"This seems to be related to your environment and not the `datasets` code (e.g., this could happen when exposing the Python 3.9 site packages to a lower Python version (interpreter))"
] | 2023-08-25T08:35:14
| 2023-09-27T17:33:39
| 2023-09-27T17:33:39
|
NONE
| null | null | null | null |
### Describe the bug
Hi,
I have been trying to import the datasets library but I keep gtting this error.
`Traceback (most recent call last):
File /opt/local/jupyterhub/lib64/python3.9/site-packages/IPython/core/interactiveshell.py:3508 in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
Cell In[2], line 1
import datasets
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/__init__.py:22
from .arrow_dataset import Dataset
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/arrow_dataset.py:67
from .arrow_writer import ArrowWriter, OptimizedTypedSequence
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/arrow_writer.py:27
from .features import Features, Image, Value
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/features/__init__.py:17
from .audio import Audio
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/features/audio.py:11
from ..download.streaming_download_manager import xopen, xsplitext
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/download/__init__.py:10
from .streaming_download_manager import StreamingDownloadManager
File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/download/streaming_download_manager.py:18
from aiohttp.client_exceptions import ClientError
File /opt/local/jupyterhub/lib64/python3.9/site-packages/aiohttp/__init__.py:7
from .connector import * # noqa
File /opt/local/jupyterhub/lib64/python3.9/site-packages/aiohttp/connector.py:12
from .client import ClientRequest
File /opt/local/jupyterhub/lib64/python3.9/site-packages/aiohttp/client.py:144
yield from asyncio.async(resp.release(), loop=loop)
^
SyntaxError: invalid syntax`
I have simply used these commands:
`import datasets`
and
`from datasets import load_dataset`
### Environment info
The library has been installed a virtual machine on JupyterHub. Although I have used this library multiple times (on the same VM) before, to train/test an ASR or other ML models, I had never encountered this error.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6178/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6178/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 33 days, 8:58:25
|
https://api.github.com/repos/huggingface/datasets/issues/6176
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6176/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6176/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6176/events
|
https://github.com/huggingface/datasets/issues/6176
| 1,864,436,408
|
I_kwDODunzps5vIQq4
| 6,176
|
how to limit the size of memory mapped file?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47763855?v=4",
"events_url": "https://api.github.com/users/williamium3000/events{/privacy}",
"followers_url": "https://api.github.com/users/williamium3000/followers",
"following_url": "https://api.github.com/users/williamium3000/following{/other_user}",
"gists_url": "https://api.github.com/users/williamium3000/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/williamium3000",
"id": 47763855,
"login": "williamium3000",
"node_id": "MDQ6VXNlcjQ3NzYzODU1",
"organizations_url": "https://api.github.com/users/williamium3000/orgs",
"received_events_url": "https://api.github.com/users/williamium3000/received_events",
"repos_url": "https://api.github.com/users/williamium3000/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/williamium3000/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/williamium3000/subscriptions",
"type": "User",
"url": "https://api.github.com/users/williamium3000",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"Hi! Can you share the error this reproducer throws in your environment? `streaming=True` streams the dataset as it's iterated over without creating a memory-map file.",
"The trace of the error. Streaming works but is slower.\r\n```\r\nRoot Cause (first observed failure):\r\n[0]:\r\n time : 2023-08-24_06:06:01\r\n host : compute-126.cm.cluster\r\n rank : 0 (local_rank: 0)\r\n exitcode : 1 (pid: 48442)\r\n error_file: /tmp/torchelastic_4fqzcuuz/none_rx2470jl/attempt_0/0/error.json\r\n traceback : Traceback (most recent call last):\r\n File \"/users/yli7/.conda/envs/pytorch2.0/lib/python3.8/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py\", line 346, in wrapper\r\n return f(*args, **kwargs)\r\n File \"Pretrain.py\", line 214, in main\r\n pair_dataset, c4_dataset = create_dataset('pretrain', config)\r\n File \"/dcs05/qiao/data/william/project/DaVinci/dataset/__init__.py\", line 109, in create_dataset\r\n c4_dataset = load_dataset(\"c4\", \"en\", split=\"train\").to_iterable_dataset(num_shards=1024).map(pre_caption_huggingface)\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/load.py\", line 1810, in load_dataset\r\n ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py\", line 1145, in as_dataset\r\n datasets = map_nested(\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py\", line 436, in map_nested\r\n return function(data_struct)\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py\", line 1175, in _build_single_dataset\r\n ds = self._as_dataset(\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py\", line 1246, in _as_dataset\r\n dataset_kwargs = ArrowReader(cache_dir, self.info).read(\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py\", line 244, in read\r\n return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py\", line 265, in read_files\r\n pa_table = self._read_files(files, in_memory=in_memory)\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py\", line 200, in _read_files\r\n pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py\", line 336, in _get_table_from_filename\r\n table = ArrowReader.read_table(filename, in_memory=in_memory)\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py\", line 357, in read_table\r\n return table_cls.from_file(filename)\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py\", line 1059, in from_file\r\n table = _memory_mapped_arrow_table_from_file(filename)\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py\", line 65, in _memory_mapped_arrow_table_from_file\r\n opened_stream = _memory_mapped_record_batch_reader_from_file(filename)\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py\", line 50, in _memory_mapped_record_batch_reader_from_file\r\n memory_mapped_stream = pa.memory_map(filename)\r\n File \"pyarrow/io.pxi\", line 1009, in pyarrow.lib.memory_map\r\n File \"pyarrow/io.pxi\", line 956, in pyarrow.lib.MemoryMappedFile._open\r\n File \"pyarrow/error.pxi\", line 144, in pyarrow.lib.pyarrow_internal_check_status\r\n File \"pyarrow/error.pxi\", line 115, in pyarrow.lib.check_status\r\n OSError: Memory mapping file failed: Cannot allocate memory\r\n```",
"This issue has previously been reported here: https://github.com/huggingface/datasets/issues/5710. Reporting it in the Arrow repo makes more sense as they have control over memory mapping.\r\n\r\nPS: this is the API to reduce the size of the generated Arrow file:\r\n```python\r\nfrom datasets import load_dataset\r\nbuilder = load_dataset_builder(\"c4\", \"en\")\r\nbuilder.download_and_prepare(max_shard_size=\"5GB\")\r\ndataset = builder.as_dataset()\r\n```\r\n\r\nIf this resolves the issue, we can consider exposing `max_shard_size` in `load_dataset`.",
"Thanks for the response. The problem seems not resolved. The memory I allocated to the environment is 64G and the following error still occurs\r\n`Python 3.8.16 (default, Jun 12 2023, 18:09:05) \r\n[GCC 11.2.0] :: Anaconda, Inc. on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> from datasets import load_dataset_builder\r\n>>> builder = load_dataset_builder(\"c4\", \"en\")\r\n>>> builder.download_and_prepare(max_shard_size=\"5GB\")\r\nFound cached dataset c4 (/users/yli7/.cache/huggingface/datasets/c4/en/0.0.0/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01)\r\n>>> dataset = builder.as_dataset()\r\n 0%| | 0/2 [00:00<?, ?it/s]Traceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py\", line 1145, in as_dataset\r\n datasets = map_nested(\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py\", line 444, in map_nested\r\n mapped = [\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py\", line 445, in <listcomp>\r\n _single_map_nested((function, obj, types, None, True, None))\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py\", line 347, in _single_map_nested\r\n return function(data_struct)\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py\", line 1175, in _build_single_dataset\r\n ds = self._as_dataset(\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py\", line 1246, in _as_dataset\r\n dataset_kwargs = ArrowReader(cache_dir, self.info).read(\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py\", line 244, in read\r\n return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py\", line 265, in read_files\r\n pa_table = self._read_files(files, in_memory=in_memory)\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py\", line 200, in _read_files\r\n pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py\", line 336, in _get_table_from_filename\r\n table = ArrowReader.read_table(filename, in_memory=in_memory)\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py\", line 357, in read_table\r\n return table_cls.from_file(filename)\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py\", line 1059, in from_file\r\n table = _memory_mapped_arrow_table_from_file(filename)\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py\", line 65, in _memory_mapped_arrow_table_from_file\r\n opened_stream = _memory_mapped_record_batch_reader_from_file(filename)\r\n File \"/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py\", line 50, in _memory_mapped_record_batch_reader_from_file\r\n memory_mapped_stream = pa.memory_map(filename)\r\n File \"pyarrow/io.pxi\", line 1009, in pyarrow.lib.memory_map\r\n File \"pyarrow/io.pxi\", line 956, in pyarrow.lib.MemoryMappedFile._open\r\n File \"pyarrow/error.pxi\", line 144, in pyarrow.lib.pyarrow_internal_check_status\r\n File \"pyarrow/error.pxi\", line 115, in pyarrow.lib.check_status\r\nOSError: Memory mapping file failed: Cannot allocate memory`",
"Have you solved the problem?",
"Nope. Streaming works but is slower."
] | 2023-08-24T05:33:45
| 2023-10-11T06:00:10
| null |
NONE
| null | null | null | null |
### Describe the bug
Huggingface datasets use memory-mapped file to map large datasets in memory for fast access.
However, it seems like huggingface will occupy all the memory for memory-mapped files, which makes a troublesome situation since we cluster will distribute a small portion of memory to me (once it's over the limit, memory cannot be allocated), however, when the dataset checks the total memory, all of the memory will be taken into account which makes huggingface dataset try to allocate more memory than allowed.
So is there a way to explicitly limit the size of memory mapped file?
### Steps to reproduce the bug
python
>>> from datasets import load_dataset
>>> dataset = load_dataset("c4", "en", streaming=True)
### Expected behavior
In a normal environment, this will not have any problem.
However, when the system allocates a portion of the memory to the program and when the dataset checks the total memory, all of the memory will be taken into account which makes huggingface dataset try to allocate more memory than allowed.
### Environment info
linux cluster with SGE(Sun Grid Engine)
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6176/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6176/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6173
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6173/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6173/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6173/events
|
https://github.com/huggingface/datasets/issues/6173
| 1,863,422,065
|
I_kwDODunzps5vEZBx
| 6,173
|
Fix CI for pyarrow 13.0.0
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lhoestq",
"id": 42851186,
"login": "lhoestq",
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lhoestq",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[] | 2023-08-23T14:11:20
| 2023-08-25T13:06:53
| 2023-08-25T13:06:53
|
MEMBER
| null | null | null | null |
pyarrow 13.0.0 just came out
```
FAILED tests/test_formatting.py::ArrowExtractorTest::test_pandas_extractor - AssertionError: Attributes of Series are different
Attribute "dtype" are different
[left]: datetime64[us, UTC]
[right]: datetime64[ns, UTC]
```
```
FAILED tests/test_table.py::test_cast_sliced_fixed_size_array_to_features - TypeError: Couldn't cast array of type
fixed_size_list<item: int32>[3]
to
Sequence(feature=Value(dtype='int64', id=None), length=3, id=None)
```
e.g. in https://github.com/huggingface/datasets/actions/runs/5952253963/job/16143847230
first error may be related to https://github.com/apache/arrow/issues/33321
second one maybe because `feature.length * len(array) == len(array_values)` is not satisfied anymore somehow ?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 1,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6173/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6173/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 1 day, 22:55:33
|
https://api.github.com/repos/huggingface/datasets/issues/6172
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6172/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6172/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6172/events
|
https://github.com/huggingface/datasets/issues/6172
| 1,863,318,027
|
I_kwDODunzps5vD_oL
| 6,172
|
Make Dataset streaming queries retryable
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/42299342?v=4",
"events_url": "https://api.github.com/users/rojagtap/events{/privacy}",
"followers_url": "https://api.github.com/users/rojagtap/followers",
"following_url": "https://api.github.com/users/rojagtap/following{/other_user}",
"gists_url": "https://api.github.com/users/rojagtap/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rojagtap",
"id": 42299342,
"login": "rojagtap",
"node_id": "MDQ6VXNlcjQyMjk5MzQy",
"organizations_url": "https://api.github.com/users/rojagtap/orgs",
"received_events_url": "https://api.github.com/users/rojagtap/received_events",
"repos_url": "https://api.github.com/users/rojagtap/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rojagtap/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rojagtap/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rojagtap",
"user_view_type": "public"
}
|
[
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
open
| false
| null |
[] |
[
"Hi! The streaming mode also retries requests - `datasets.config.STREAMING_READ_MAX_RETRIES` (20 sec by default) controls the number of retries and `datasets.config.STREAMING_READ_RETRY_INTERVAL` (5 sec) the sleep time between retries.\r\n\r\n> At step 1800 I got a 504 HTTP status code error from Huggingface hub for my pytorch dataloader\r\n\r\nA minor Hub outage that we experienced yesterday could be the cause.",
"I wanted something similar. I have a huge dataset I want to process (laion-2b), but after processing several batches, it sometimes fails with this error: `HTTP 502 Bad Gateway for url`. I had the following code to handle it but this way I believe it restarts processing the data from the first batch? How can I set the attribute values you mention above?\r\n\r\n```\r\niterable_dataset = load_dataset(\"laion/laion2B-multi\", streaming=True, split='train')\r\ndataloader = DataLoader(iterable_dataset, batch_size=131072, collate_fn=custom_collate_fn, num_workers=8)\r\n\r\nMAX_RETRIES = 5\r\nRETRY_WAIT = 10 # wait 10 seconds before retry\r\n\r\n for retry in range(MAX_RETRIES):\r\n try:\r\n for j, batch in enumerate(dataloader):\r\n < process batch>\r\n\r\n except HfHubHTTPError as e:\r\n if \"502\" in str(e) and retry < MAX_RETRIES - 1:\r\n logging.warning(f\"Encountered a 502 error on batch {j}. Waiting for {RETRY_WAIT} seconds before retrying.\")\r\n time.sleep(RETRY_WAIT)\r\n continue\r\n else:\r\n raise",
"Hey all! Wondering if there's a way of making Datasets streaming mode somewhat robust to Hub outages? Over the weekend, I got two quite cryptic errors, which I reckon were probably from Hub issues:\r\n\r\n<details>\r\n<summary> Stack Trace 1 </summary>\r\n\r\n```\r\n File \"/home/sanchitgandhi/small-12-4-tpu-timestamped-prob-0.2/run_distillation.py\", line 2119, in <module>\r\n main()\r\n File \"/home/sanchitgandhi/small-12-4-tpu-timestamped-prob-0.2/run_distillation.py\", line 1954, in main\r\n for batch in train_loader:\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/dataloader.py\", line 630, in __next__\r\n data = self._next_data()\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/dataloader.py\", line 1325, in _next_data\r\n return self._process_data(data)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/dataloader.py\", line 1371, in _process_data\r\n data.reraise()\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/_utils.py\", line 694, in reraise\r\n raise exception\r\nConnectionError: Caught ConnectionError in DataLoader worker process 8.\r\nOriginal Traceback (most recent call last):\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/connector.py\", line 1155, in _create_direct_connection\r\n hosts = await asyncio.shield(host_resolved)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/connector.py\", line 874, in _resolve_host\r\n addrs = await self._resolver.resolve(host, port, family=self._family)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/resolver.py\", line 33, in resolve\r\n infos = await self._loop.getaddrinfo(\r\n File \"/usr/lib/python3.10/asyncio/base_events.py\", line 863, in getaddrinfo\r\n return await self.run_in_executor(\r\n File \"/usr/lib/python3.10/concurrent/futures/thread.py\", line 58, in run\r\n result = self.fn(*self.args, **self.kwargs)\r\n File \"/usr/lib/python3.10/socket.py\", line 955, in getaddrinfo\r\n for res in _socket.getaddrinfo(host, port, family, type, proto, flags):\r\nsocket.gaierror: [Errno -3] Temporary failure in name resolution\r\nThe above exception was the direct cause of the following exception:\r\nTraceback (most recent call last):\r\n File \"/home/sanchitgandhi/datasets/src/datasets/download/streaming_download_manager.py\", line 333, in read_with_retries\r\n out = read(*args, **kwargs)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/implementations/http.py\", line 612, in read\r\n return super().read(length)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/spec.py\", line 1856, in read\r\n out = self.cache._fetch(self.loc, self.loc + length)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/caching.py\", line 439, in _fetch\r\n new = self.fetcher(self.end, bend)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/asyn.py\", line 118, in wrapper\r\n return sync(self.loop, func, *args, **kwargs)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/asyn.py\", line 103, in sync\r\n raise return_result\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/asyn.py\", line 56, in _runner\r\n result[0] = await coro\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/implementations/http.py\", line 660, in async_fetch_range\r\n r = await self.session.get(\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/client.py\", line 562, in _request\r\n conn = await self._connector.connect(\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/connector.py\", line 540, in connect\r\n proto = await self._create_connection(req, traces, timeout)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/connector.py\", line 901, in _create_connection\r\n _, proto = await self._create_direct_connection(req, traces, timeout)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/aiohttp/connector.py\", line 1169, in _create_direct_connection\r\n raise ClientConnectorError(req.connection_key, exc) from exc\r\naiohttp.client_exceptions.ClientConnectorError: Cannot connect to host huggingface.co:443 ssl:default [Temporary failure in name resolution]\r\nThe above exception was the direct cause of the following exception:\r\nTraceback (most recent call last):\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py\", line 308, in _worker_loop\r\n data = fetcher.fetch(index)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py\", line 32, in fetch\r\n data.append(next(self.dataset_iter))\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 1358, in __iter__\r\n yield from self._iter_pytorch()\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 1293, in _iter_pytorch\r\n for key, example in ex_iterable:\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 982, in __iter__\r\n for x in self.ex_iterable:\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 862, in __iter__\r\n yield from self._iter()\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 899, in _iter\r\n for key, example in iterator:\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 862, in __iter__\r\n yield from self._iter()\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 899, in _iter\r\n for key, example in iterator:\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 678, in __iter__\r\n yield from self._iter()\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 740, in _iter\r\n for key, example in iterator:\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 862, in __iter__\r\n yield from self._iter()\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 899, in _iter\r\n for key, example in iterator:\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 1114, in __iter__\r\n for key, example in self.ex_iterable:\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 429, in __iter__\r\n if not iterators[i].hasnext():\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 106, in hasnext\r\n self._thenext = next(self.it)\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 678, in __iter__\r\n yield from self._iter()\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 740, in _iter\r\n for key, example in iterator:\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 1114, in __iter__\r\n for key, example in self.ex_iterable:\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 281, in __iter__\r\n for key, pa_table in self.generate_tables_fn(**self.kwargs):\r\n File \"/home/sanchitgandhi/.cache/huggingface/modules/datasets_modules/datasets/distil-whisper--switchboard-data/9472ee64cca0e1a7e11909c7033c2354511fa62805f81a2e07616980c765abfe/switchboard-data.py\", line 247, in _generate_tables\r\n for record_batch in pf.iter_batches():\r\n File \"pyarrow/_parquet.pyx\", line 1327, in iter_batches\r\n File \"/home/sanchitgandhi/datasets/src/datasets/download/streaming_download_manager.py\", line 342, in read_with_retries\r\n raise ConnectionError(\"Server Disconnected\") from disconnect_err\r\nConnectionError: Server Disconnected\r\n```\r\n\r\n</details>\r\n\r\n<details>\r\n<summary> Stack Trace 2 </summary>\r\n\r\n```\r\n File \"/home/sanchitgandhi/small-12-2-tpu-v3-timestamped-prob-0.2-bs-512/run_distillation.py\", line 2119, in <module>\r\n main()\r\n File \"/home/sanchitgandhi/small-12-2-tpu-v3-timestamped-prob-0.2-bs-512/run_distillation.py\", line 1954, in main\r\n for batch in train_loader:\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/dataloader.py\", line 630, in __next__\r\n data = self._next_data()\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/dataloader.py\", line 1325, in _next_data\r\n return self._process_data(data)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/dataloader.py\", line 1371, in _process_data\r\n data.reraise()\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/_utils.py\", line 694, in reraise\r\n raise exception\r\nrequests.exceptions.ConnectionError: Caught ConnectionError in DataLoader worker process 13.\r\nOriginal Traceback (most recent call last):\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 791, in urlopen\r\n response = self._make_request(\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 537, in _make_request\r\n response = conn.getresponse()\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connection.py\", line 461, in getresponse\r\n httplib_response = super().getresponse()\r\n File \"/usr/lib/python3.10/http/client.py\", line 1375, in getresponse\r\n response.begin()\r\n File \"/usr/lib/python3.10/http/client.py\", line 318, in begin\r\n version, status, reason = self._read_status()\r\n File \"/usr/lib/python3.10/http/client.py\", line 287, in _read_status\r\n raise RemoteDisconnected(\"Remote end closed connection without\"\r\nhttp.client.RemoteDisconnected: Remote end closed connection without response\r\nDuring handling of the above exception, another exception occurred:\r\nTraceback (most recent call last):\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/requests/adapters.py\", line 486, in send\r\n resp = conn.urlopen(\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 845, in urlopen\r\n retries = retries.increment(\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/util/retry.py\", line 470, in increment\r\n raise reraise(type(error), error, _stacktrace)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/util/util.py\", line 38, in reraise\r\n raise value.with_traceback(tb)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 791, in urlopen\r\n response = self._make_request(\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 537, in _make_request\r\n response = conn.getresponse()\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/urllib3/connection.py\", line 461, in getresponse\r\n httplib_response = super().getresponse()\r\n File \"/usr/lib/python3.10/http/client.py\", line 1375, in getresponse\r\n response.begin()\r\n File \"/usr/lib/python3.10/http/client.py\", line 318, in begin\r\n version, status, reason = self._read_status()\r\n File \"/usr/lib/python3.10/http/client.py\", line 287, in _read_status\r\n raise RemoteDisconnected(\"Remote end closed connection without\"\r\nurllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))\r\nDuring handling of the above exception, another exception occurred:\r\nTraceback (most recent call last):\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py\", line 308, in _worker_loop\r\n data = fetcher.fetch(index)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py\", line 32, in fetch\r\n data.append(next(self.dataset_iter))\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 1358, in __iter__\r\n yield from self._iter_pytorch()\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 1293, in _iter_pytorch\r\n for key, example in ex_iterable:\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 982, in __iter__\r\n for x in self.ex_iterable:\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 862, in __iter__\r\n yield from self._iter()\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 899, in _iter\r\n for key, example in iterator:\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 862, in __iter__\r\n yield from self._iter()\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 899, in _iter\r\n for key, example in iterator:\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 678, in __iter__\r\n yield from self._iter()\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 740, in _iter\r\n for key, example in iterator:\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 862, in __iter__\r\n yield from self._iter()\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 899, in _iter\r\n for key, example in iterator:\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 1114, in __iter__\r\n for key, example in self.ex_iterable:\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 429, in __iter__\r\n if not iterators[i].hasnext():\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 106, in hasnext\r\n self._thenext = next(self.it)\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 678, in __iter__\r\n yield from self._iter()\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 740, in _iter\r\n for key, example in iterator:\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 1114, in __iter__\r\n for key, example in self.ex_iterable:\r\n File \"/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py\", line 281, in __iter__\r\n for key, pa_table in self.generate_tables_fn(**self.kwargs):\r\n File \"/home/sanchitgandhi/datasets/src/datasets/packaged_modules/parquet/parquet.py\", line 87, in _generate_tables\r\n for batch_idx, record_batch in enumerate(\r\n File \"pyarrow/_parquet.pyx\", line 1327, in iter_batches\r\n File \"/home/sanchitgandhi/datasets/src/datasets/download/streaming_download_manager.py\", line 333, in read_with_retries\r\n out = read(*args, **kwargs)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/spec.py\", line 1856, in read\r\n out = self.cache._fetch(self.loc, self.loc + length)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/fsspec/caching.py\", line 189, in _fetch\r\n self.cache = self.fetcher(start, end) # new block replaces old\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/huggingface_hub/hf_file_system.py\", line 410, in _fetch_range\r\n r = http_backoff(\"GET\", url, headers=headers)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/huggingface_hub/utils/_http.py\", line 258, in http_backoff\r\n response = session.request(method=method, url=url, **kwargs)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/requests/sessions.py\", line 589, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/requests/sessions.py\", line 703, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/huggingface_hub/utils/_http.py\", line 63, in send\r\n return super().send(request, *args, **kwargs)\r\n File \"/home/sanchitgandhi/hf/lib/python3.10/site-packages/requests/adapters.py\", line 501, in send\r\n raise ConnectionError(err, request=request)\r\nrequests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 5fce9fc2-e22f-41c2-91af-529f13f1d611)')\r\n```\r\n\r\n</details>\r\n\r\nHaving streaming mode fail when the Hub goes down makes using it problematic for long training runs where large amounts of data is involved. However, this is the precise situation for which streaming mode is so appealing!\r\n\r\nWondering if there were a 'common' set of Hub errors that we could catch in `iterable_datasets` and prevent from crashing the script?\r\n\r\ncc @lhoestq @mariosasko ",
"Errors are already caught and requests are already retried.\r\n\r\nWhat you can do is increase the number of retries before an error is raised.\r\n\r\n```python\r\nimport datasets\r\n\r\ndatasets.config.STREAMING_READ_MAX_RETRIES = 20 # default\r\ndatasets.config.STREAMING_READ_RETRY_INTERVAL = 5 # default\r\n```"
] | 2023-08-23T13:15:38
| 2023-11-06T13:54:16
| null |
NONE
| null | null | null | null |
### Feature request
Streaming datasets, as intended, do not load the entire dataset in memory or disk. However, while querying the next data chunk from the remote, sometimes it is possible that the service is down or there might be other issues that may cause the query to fail. In such a scenario, it would be nice to make these queries retryable (perhaps with a backoff strategy).
### Motivation
I was working on a model and the model checkpoints after every 1000 steps. At step 1800 I got a 504 HTTP status code error from Huggingface hub for my pytorch `dataloader`. Given the size of my model and data, it took around 2 hours to reach 1800 steps and now it will take about an hour to recover the lost 800. It would be better to get a retryable querying strategy.
### Your contribution
It would be better if someone having experience in this area takes this up as this would require some testing.
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6172/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6172/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6169
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6169/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6169/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6169/events
|
https://github.com/huggingface/datasets/issues/6169
| 1,862,360,199
|
I_kwDODunzps5vAVyH
| 6,169
|
Configurations in yaml not working
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/45085098?v=4",
"events_url": "https://api.github.com/users/tsor13/events{/privacy}",
"followers_url": "https://api.github.com/users/tsor13/followers",
"following_url": "https://api.github.com/users/tsor13/following{/other_user}",
"gists_url": "https://api.github.com/users/tsor13/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tsor13",
"id": 45085098,
"login": "tsor13",
"node_id": "MDQ6VXNlcjQ1MDg1MDk4",
"organizations_url": "https://api.github.com/users/tsor13/orgs",
"received_events_url": "https://api.github.com/users/tsor13/received_events",
"repos_url": "https://api.github.com/users/tsor13/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tsor13/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tsor13/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tsor13",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"Unfortunately, I cannot reproduce this behavior on my machine or Colab - the reproducer returns `['main_data', 'additional_data']` as expected.",
"Thank you for looking into this, Mario. Is this on [my repository](https://huggingface.co/datasets/tsor13/test), or on another one that you have reproduced? Would you mind pointing me to it if so?",
"Whoa, in colab I received the correct behavior using my dataset. It must have something to do with my local copy of `datasets` (which again just failed).\r\n\r\nI've tried uninstalling/reinstnalling to no avail",
"hi @tsor13 , I haven't been able to reproduce your issue on `tsor13/test` dataset locally either. reinstalling doesn't help?"
] | 2023-08-23T00:13:22
| 2023-08-23T15:35:31
| null |
NONE
| null | null | null | null |
### Dataset configurations cannot be created in YAML/README
Hello! I'm trying to follow the docs here in order to create structure in my dataset as added from here (#5331): https://github.com/huggingface/datasets/blob/8b8e6ee067eb74e7965ca2a6768f15f9398cb7c8/docs/source/repository_structure.mdx#L110-L118
I have the exact example in my config file for [my data repo](https://huggingface.co/datasets/tsor13/test):
```
configs:
- config_name: main_data
data_files: "main_data.csv"
- config_name: additional_data
data_files: "additional_data.csv"
```
Yet, I'm unable to load different configurations:
```
from datasets import get_dataset_config_names
get_dataset_config_names('tsor13/test', use_auth_token=True)
```
returns a single split, `['tsor13--test']`
Does anyone have any insights?
@polinaeterna thank you for adding this feature, it is super useful. Do you happen to have any ideas?
### Steps to reproduce the bug
from datasets import get_dataset_config_names
get_dataset_config_names('tsor13/test')
### Expected behavior
I would expect there to be two splits, `main_data` and `additional_data`. However, only `['tsor13--test']` test is returned.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.4-arm64-arm-64bit
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.1
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6169/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6169/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6163
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6163/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6163/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6163/events
|
https://github.com/huggingface/datasets/issues/6163
| 1,857,682,241
|
I_kwDODunzps5uuftB
| 6,163
|
Error type: ArrowInvalid Details: Failed to parse string: '[254,254]' as a scalar of type int32
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/90616801?v=4",
"events_url": "https://api.github.com/users/shishirCTC/events{/privacy}",
"followers_url": "https://api.github.com/users/shishirCTC/followers",
"following_url": "https://api.github.com/users/shishirCTC/following{/other_user}",
"gists_url": "https://api.github.com/users/shishirCTC/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/shishirCTC",
"id": 90616801,
"login": "shishirCTC",
"node_id": "MDQ6VXNlcjkwNjE2ODAx",
"organizations_url": "https://api.github.com/users/shishirCTC/orgs",
"received_events_url": "https://api.github.com/users/shishirCTC/received_events",
"repos_url": "https://api.github.com/users/shishirCTC/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/shishirCTC/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/shishirCTC/subscriptions",
"type": "User",
"url": "https://api.github.com/users/shishirCTC",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"Answered on the forum [here](https://discuss.huggingface.co/t/error-type-arrowinvalid-details-failed-to-parse-string-254-254-as-a-scalar-of-type-int32/51323).",
"it seems that no answer in this link"
] | 2023-08-19T11:34:40
| 2025-07-22T12:04:46
| null |
NONE
| null | null | null | null |
### Describe the bug
I am getting the following error while I am trying to upload the CSV sheet to train a model. My CSV sheet content is exactly same as shown in the example CSV file in the Auto Train page. Attaching screenshot of error for reference. I have also tried converting the index of the answer that are integer into string by placing inverted commas and also without inverted commas.
Can anyone please help me out?
FYI : I am using Chrome browser.
Error type: ArrowInvalid
Details: Failed to parse string: '[254,254]' as a scalar of type int32

### Steps to reproduce the bug
Kindly let me know how to fix this?
### Expected behavior
Kindly let me know how to fix this?
### Environment info
Kindly let me know how to fix this?
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6163/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6163/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6162
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6162/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6162/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6162/events
|
https://github.com/huggingface/datasets/issues/6162
| 1,856,198,342
|
I_kwDODunzps5uo1bG
| 6,162
|
load_dataset('json',...) from togethercomputer/RedPajama-Data-1T errors when jsonl rows contains different data fields
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/82971690?v=4",
"events_url": "https://api.github.com/users/rbrugaro/events{/privacy}",
"followers_url": "https://api.github.com/users/rbrugaro/followers",
"following_url": "https://api.github.com/users/rbrugaro/following{/other_user}",
"gists_url": "https://api.github.com/users/rbrugaro/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rbrugaro",
"id": 82971690,
"login": "rbrugaro",
"node_id": "MDQ6VXNlcjgyOTcxNjkw",
"organizations_url": "https://api.github.com/users/rbrugaro/orgs",
"received_events_url": "https://api.github.com/users/rbrugaro/received_events",
"repos_url": "https://api.github.com/users/rbrugaro/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rbrugaro/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rbrugaro/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rbrugaro",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] |
[
"Hi ! Feel free to open a discussion at https://huggingface.co/datasets/togethercomputer/RedPajama-Data-1T/discussions to ask the file to be fixed (or directly open a PR with the fixed file)\r\n\r\n`datasets` expects all the examples to have the same fields",
"@lhoestq I think the problem is caused by the fact that hugging face datasets writes a copy of data to the local cache using pyarrow. And the data scheme is inferred from the first few data blocks as can be seen [here](https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_writer.py#L570). Maybe setting `streaming=True` can workaround this problem. Would you agree with my statement? ",
"> @lhoestq I think the problem is caused by the fact that hugging face datasets writes a copy of data to the local cache using pyarrow. And the data scheme is inferred from the first few data blocks as can be seen [here](https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_writer.py#L570).\r\n\r\nCorrect. Therefore any example that doesn't follow the inferred schema will make the code fail.\r\n\r\n> Maybe setting streaming=True can workaround this problem. Would you agree with my statement?\r\n\r\nYou'll meet the same problem but later - when streaming and arriving at the problematic example",
"@lhoestq I just run below test with streaming=True and is not failing at the problematic example\r\n```python\r\nds = load_dataset('json', data_files='/path_to_local_RedPajamaData/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl', streaming=True)\r\ncount = 0\r\nfor i in ds['train']:\r\n count += 1\r\n print(count)\r\n```\r\n\r\nand completes the 262241 samples successfully. It does error our when streaming is not used "
] | 2023-08-18T07:19:39
| 2023-08-18T17:00:35
| null |
NONE
| null | null | null | null |
### Describe the bug
When loading some jsonl from redpajama-data-1T github source [togethercomputer/RedPajama-Data-1T](https://huggingface.co/datasets/togethercomputer/RedPajama-Data-1T) fails due to one row of the file containing an extra field called **symlink_target: string>**.
When deleting that line the loading is successful.
We also tried loading this file with the discrepancy using this function and it is successful
```python
os.environ["RED_PAJAMA_DATA_DIR"] ="/path_to_local_copy_of_RedPajama-Data-1T"
ds = load_dataset('togethercomputer/RedPajama-Data-1T', 'github',cache_dir="/path_to_folder_with_jsonl",streaming=True)['train']
```
### Steps to reproduce the bug
Steps to reproduce the behavior:
1. Load one jsonl from the redpajama-data-1T
```bash
wget https://data.together.xyz/redpajama-data-1T/v1.0.0/github/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl
```
2.Load dataset will give error:
```python
from datasets import load_dataset
ds = load_dataset('json', data_files='/path_to/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl')
```
_TypeError: Couldn't cast array of type
Struct
<content_hash: string,
timestamp: string,
source: string,
line_count: int64,
max_line_length: int64,
avg_line_length: double,
alnum_prop: double,
repo_name: string,
id: string,
size: string,
binary: bool,
copies: string,
ref: string,
path: string,
mode: string,
license: string,
language: list<item: struct<name: string, bytes: string>>, **symlink_target: string>**
to
{'content_hash': Value(dtype='string', id=None),
'timestamp': Value(dtype='string', id=None),
'source': Value(dtype='string', id=None),
'line_count': Value(dtype='int64', id=None),
'max_line_length': Value(dtype='int64', id=None),
'avg_line_length': Value(dtype='float64', id=None),
'alnum_prop': Value(dtype='float64', id=None),
'repo_name': Value(dtype='string', id=None),
'id': Value(dtype='string', id=None),
'size': Value(dtype='string', id=None),
'binary': Value(dtype='bool', id=None),
'copies': Value(dtype='string', id=None),
'ref': Value(dtype='string', id=None),
'path': Value(dtype='string', id=None),
'mode': Value(dtype='string', id=None),
'license': Value(dtype='string', id=None),
'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}_
3. To remove the line causing the problem that includes the **symlink_target: string>** do:
```bash
sed -i '112252d' filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl
```
4. Rerun the loading function now is succesful:
```python
from datasets import load_dataset
ds = load_dataset('json', data_files='/path_to/filtered_27f05c041a1c401783f90b9415e40e4b.sampled.jsonl')
```
### Expected behavior
Have a clean dataset without discrepancies on the jsonl fields or have the load_dataset('json',...) method not error out.
### Environment info
- `datasets` version: 2.14.1
- Platform: Linux-4.18.0-425.13.1.el8_7.x86_64-x86_64-with-glibc2.28
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6162/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6162/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6159
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6159/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6159/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6159/events
|
https://github.com/huggingface/datasets/issues/6159
| 1,855,691,512
|
I_kwDODunzps5um5r4
| 6,159
|
Add `BoundingBox` feature
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
[
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
open
| false
| null |
[] |
[
"My proposal would look like this:\r\n\r\n```python\r\nfrom datasets import load_dataset\r\nfrom datasets.features import Sequence, BboxFeature\r\n\r\n# load images along with boxes\r\ndataset = load_dataset(\"imagefolder\", data_dir=\"/path/to/folder\", split=\"train\")\r\n\r\n# map the boxes column to the appropriate format\r\ndataset = dataset.map(lambda example: map_to_ymin_xmin_ymax_xmax(example))\r\n\r\n# cast to feature\r\ndataset = dataset.cast_column('boxes', Sequence(BboxFeature))\r\n````\r\nWe could for instance make [BboxFeature](https://www.tensorflow.org/datasets/api_docs/python/tfds/features/BBoxFeature) default to normalized coordinates in the ymin, xmin, ymax, xmax format. This is just one of the many different formats of bounding boxes, so we would for instance default to the format used by Tensorflow datasets."
] | 2023-08-17T20:49:51
| 2024-11-18T17:58:43
| null |
COLLABORATOR
| null | null | null | null |
... to make working with object detection datasets easier. Currently, `Sequence(int_or_float, length=4)` can be used to represent this feature optimally (in the storage backend), so I only see this feature being useful if we make it work with the viewer. Also, bounding boxes usually come in 4 different formats (explained [here](https://albumentations.ai/docs/getting_started/bounding_boxes_augmentation/)), so we need to decide which one to support (or maybe all of them).
cc @NielsRogge @severo
| null |
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 1,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 2,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6159/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6159/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6157
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6157/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6157/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6157/events
|
https://github.com/huggingface/datasets/issues/6157
| 1,855,265,663
|
I_kwDODunzps5ulRt_
| 6,157
|
DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/51043929?v=4",
"events_url": "https://api.github.com/users/aihao2000/events{/privacy}",
"followers_url": "https://api.github.com/users/aihao2000/followers",
"following_url": "https://api.github.com/users/aihao2000/following{/other_user}",
"gists_url": "https://api.github.com/users/aihao2000/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/aihao2000",
"id": 51043929,
"login": "aihao2000",
"node_id": "MDQ6VXNlcjUxMDQzOTI5",
"organizations_url": "https://api.github.com/users/aihao2000/orgs",
"received_events_url": "https://api.github.com/users/aihao2000/received_events",
"repos_url": "https://api.github.com/users/aihao2000/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/aihao2000/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/aihao2000/subscriptions",
"type": "User",
"url": "https://api.github.com/users/aihao2000",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"Thanks for reporting, but we can only fix this issue if you can provide a reproducer that consistently reproduces it.",
"@mariosasko Ok. What exactly does it mean to provide a reproducer",
"To provide a code that reproduces the issue :)",
"@mariosasko I complete the above code, is it enough?",
"@mariosasko That's all the code, I'm using locally stored data",
"Does this error occur even if you change the cache directory (the `cache_dir` parameter in `load_dataset`)?",
"@mariosasko I didn't add any parameters for catch. Nor did any cache configuration change.",
"@mariosasko And I changed the data file, but executing load_dataset is always the previous result. I had to change something in images.py to use the new results. Using 'cleanup_cache_files' is invalid! Help me.",
"@mariosasko I added a comprehensive error message. Check that _column_requires_decoding is being passed where it shouldn't be. DatasetInfo.__init__() Whether this parameter is required",
"I can see the issue now... \r\n\r\nYou can fix it by returning a `DatasetInfo` object in the `_info` method as follows:\r\n```python\r\n def _info(self):\r\n if self.config.name == \"similar_pairs\":\r\n features = datasets.Features(\r\n {\r\n \"image1\": datasets.features.Image(),\r\n \"prompt1\": datasets.Value(\"string\"),\r\n \"image2\": datasets.features.Image(),\r\n \"prompt2\": datasets.Value(\"string\"),\r\n \"similarity\": datasets.Value(\"float32\"),\r\n }\r\n )\r\n elif self.config.name == \"image_prompt_pairs\":\r\n features = datasets.Features(\r\n {\"image\": datasets.features.Image(), \"prompt\": datasets.Value(\"string\")}\r\n )\r\n return datasets.DatasetInfo(features=features)\r\n```",
"@mariosasko Oh, that's the problem. Thank you very much. Returned the wrong object and it actually works? I've been training with it for a long time",
"@mariosasko The original code can still see progress. emmm, I can't see how many examples is generated so far, so I don't know if we should wait",
"The original issue has been addressed, so I'm closing it. \r\n\r\nPlease open a new issue if you encounter more errors."
] | 2023-08-17T15:48:11
| 2023-09-27T17:36:14
| 2023-09-27T17:36:14
|
NONE
| null | null | null | null |
### Describe the bug
When I was in load_dataset, it said "DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'". The second time I ran it, there was no error and the dataset object worked
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 dataset = load_dataset(
2 "/home/aihao/workspace/DeepLearningContent/datasets/manga",
3 data_dir="/home/aihao/workspace/DeepLearningContent/datasets/manga",
4 split="train",
5 )
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py:2146), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2142 # Build dataset for splits
2143 keep_in_memory = (
2144 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2145 )
-> 2146 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
2147 # Rename and cast features to match task schema
2148 if task is not None:
2149 # To avoid issuing the same warning twice
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py:1190), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)
1187 verification_mode = VerificationMode(verification_mode or VerificationMode.BASIC_CHECKS)
1189 # Create a dataset for each of the given splits
-> 1190 datasets = map_nested(
1191 partial(
1192 self._build_single_dataset,
...
File [~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379](https://vscode-remote+ssh-002dremote-002bhome.vscode-resource.vscode-cdn.net/home/aihao/workspace/DeepLearningContent/datasets/~/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/info.py:379), in DatasetInfo.copy(self)
378 def copy(self) -> "DatasetInfo":
--> 379 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()})
TypeError: DatasetInfo.__init__() got an unexpected keyword argument '_column_requires_decoding'
```
### Steps to reproduce the bug
/home/aihao/workspace/DeepLearningContent/datasets/images/images.py
```python
from logging import config
import datasets
import os
from PIL import Image
import csv
import json
class ImagesConfig(datasets.BuilderConfig):
def __init__(self, **kwargs):
super(ImagesConfig, self).__init__(**kwargs)
class Images(datasets.GeneratorBasedBuilder):
def _split_generators(self, dl_manager: datasets.DownloadManager):
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={"split": datasets.Split.TRAIN},
)
]
BUILDER_CONFIGS = [
ImagesConfig(
name="similar_pairs",
description="simliar pair dataset,item is a pair of similar images",
),
ImagesConfig(
name="image_prompt_pairs",
description="image prompt pairs",
),
]
def _info(self):
if self.config.name == "similar_pairs":
return datasets.Features(
{
"image1": datasets.features.Image(),
"image2": datasets.features.Image(),
"similarity": datasets.Value("float32"),
}
)
elif self.config.name == "image_prompt_pairs":
return datasets.Features(
{"image": datasets.features.Image(), "prompt": datasets.Value("string")}
)
def _generate_examples(self, split):
data_path = os.path.join(self.config.data_dir, "data")
if self.config.name == "similar_pairs":
prompts = {}
with open(os.path.join(data_path ,"prompts.json"), "r") as f:
prompts = json.load(f)
with open(os.path.join(data_path, "similar_pairs.csv"), "r") as f:
reader = csv.reader(f)
for row in reader:
image1_path, image2_path, similarity = row
yield image1_path + ":" + image2_path + ":", {
"image1": Image.open(image1_path),
"prompt1": prompts[image1_path],
"image2": Image.open(image2_path),
"prompt2": prompts[image2_path],
"similarity": float(similarity),
}
```
Code that indicates an error:
```python
from datasets import load_dataset
import json
import csv
import ast
import torch
data_dir = "/home/aihao/workspace/DeepLearningContent/datasets/images"
dataset = load_dataset(data_dir, data_dir=data_dir, name="similar_pairs")
```
### Expected behavior
The first execution gives an error, but it works fine
### Environment info
- `datasets` version: 2.14.3
- Platform: Linux-6.2.0-26-generic-x86_64-with-glibc2.35
- Python version: 3.11.4
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6157/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6157/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 41 days, 1:48:03
|
https://api.github.com/repos/huggingface/datasets/issues/6156
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6156/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6156/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6156/events
|
https://github.com/huggingface/datasets/issues/6156
| 1,854,768,618
|
I_kwDODunzps5ujYXq
| 6,156
|
Why not use self._epoch as seed to shuffle in distributed training with IterableDataset
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/11533479?v=4",
"events_url": "https://api.github.com/users/npuichigo/events{/privacy}",
"followers_url": "https://api.github.com/users/npuichigo/followers",
"following_url": "https://api.github.com/users/npuichigo/following{/other_user}",
"gists_url": "https://api.github.com/users/npuichigo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/npuichigo",
"id": 11533479,
"login": "npuichigo",
"node_id": "MDQ6VXNlcjExNTMzNDc5",
"organizations_url": "https://api.github.com/users/npuichigo/orgs",
"received_events_url": "https://api.github.com/users/npuichigo/received_events",
"repos_url": "https://api.github.com/users/npuichigo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/npuichigo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/npuichigo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/npuichigo",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"@lhoestq ",
"`_effective_generator` returns a RNG that takes into account `self._epoch` and the current dataset's base shuffling RNG (which can be set by specifying `seed=` in `.shuffle() for example`).\r\n\r\nTo fix your error you can pass `seed=` to `.shuffle()`. And the shuffling will depend on both this seed and `self._epoch`",
"Thanks for the reply"
] | 2023-08-17T10:58:20
| 2023-08-17T14:33:15
| 2023-08-17T14:33:14
|
CONTRIBUTOR
| null | null | null | null |
### Describe the bug
Currently, distributed training with `IterableDataset` needs to pass fixed seed to shuffle to keep each node use the same seed to avoid overlapping.
https://github.com/huggingface/datasets/blob/a7f8d9019e7cb104eac4106bdc6ec0292f0dc61a/src/datasets/iterable_dataset.py#L1174-L1177
My question is why not directly use `self._epoch` which is set by `set_epoch` as seed? It's almost the same across nodes.
https://github.com/huggingface/datasets/blob/a7f8d9019e7cb104eac4106bdc6ec0292f0dc61a/src/datasets/iterable_dataset.py#L1790-L1801
If not using `self._epoch` as shuffling seed, what does this method do to prepare an epoch seeded generator?
https://github.com/huggingface/datasets/blob/a7f8d9019e7cb104eac4106bdc6ec0292f0dc61a/src/datasets/iterable_dataset.py#L1206
### Steps to reproduce the bug
As mentioned above.
### Expected behavior
As mentioned above.
### Environment info
Not related
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/11533479?v=4",
"events_url": "https://api.github.com/users/npuichigo/events{/privacy}",
"followers_url": "https://api.github.com/users/npuichigo/followers",
"following_url": "https://api.github.com/users/npuichigo/following{/other_user}",
"gists_url": "https://api.github.com/users/npuichigo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/npuichigo",
"id": 11533479,
"login": "npuichigo",
"node_id": "MDQ6VXNlcjExNTMzNDc5",
"organizations_url": "https://api.github.com/users/npuichigo/orgs",
"received_events_url": "https://api.github.com/users/npuichigo/received_events",
"repos_url": "https://api.github.com/users/npuichigo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/npuichigo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/npuichigo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/npuichigo",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6156/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6156/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 3:34:54
|
https://api.github.com/repos/huggingface/datasets/issues/6152
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6152/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6152/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6152/events
|
https://github.com/huggingface/datasets/issues/6152
| 1,852,494,646
|
I_kwDODunzps5uatM2
| 6,152
|
FolderBase Dataset automatically resolves under current directory when data_dir is not specified
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/11533479?v=4",
"events_url": "https://api.github.com/users/npuichigo/events{/privacy}",
"followers_url": "https://api.github.com/users/npuichigo/followers",
"following_url": "https://api.github.com/users/npuichigo/following{/other_user}",
"gists_url": "https://api.github.com/users/npuichigo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/npuichigo",
"id": 11533479,
"login": "npuichigo",
"node_id": "MDQ6VXNlcjExNTMzNDc5",
"organizations_url": "https://api.github.com/users/npuichigo/orgs",
"received_events_url": "https://api.github.com/users/npuichigo/received_events",
"repos_url": "https://api.github.com/users/npuichigo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/npuichigo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/npuichigo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/npuichigo",
"user_view_type": "public"
}
|
[
{
"color": "7057ff",
"default": true,
"description": "Good for newcomers",
"id": 1935892877,
"name": "good first issue",
"node_id": "MDU6TGFiZWwxOTM1ODkyODc3",
"url": "https://api.github.com/repos/huggingface/datasets/labels/good%20first%20issue"
}
] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/126772439?v=4",
"events_url": "https://api.github.com/users/debrupf2946/events{/privacy}",
"followers_url": "https://api.github.com/users/debrupf2946/followers",
"following_url": "https://api.github.com/users/debrupf2946/following{/other_user}",
"gists_url": "https://api.github.com/users/debrupf2946/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/debrupf2946",
"id": 126772439,
"login": "debrupf2946",
"node_id": "U_kgDOB45k1w",
"organizations_url": "https://api.github.com/users/debrupf2946/orgs",
"received_events_url": "https://api.github.com/users/debrupf2946/received_events",
"repos_url": "https://api.github.com/users/debrupf2946/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/debrupf2946/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/debrupf2946/subscriptions",
"type": "User",
"url": "https://api.github.com/users/debrupf2946",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/126772439?v=4",
"events_url": "https://api.github.com/users/debrupf2946/events{/privacy}",
"followers_url": "https://api.github.com/users/debrupf2946/followers",
"following_url": "https://api.github.com/users/debrupf2946/following{/other_user}",
"gists_url": "https://api.github.com/users/debrupf2946/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/debrupf2946",
"id": 126772439,
"login": "debrupf2946",
"node_id": "U_kgDOB45k1w",
"organizations_url": "https://api.github.com/users/debrupf2946/orgs",
"received_events_url": "https://api.github.com/users/debrupf2946/received_events",
"repos_url": "https://api.github.com/users/debrupf2946/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/debrupf2946/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/debrupf2946/subscriptions",
"type": "User",
"url": "https://api.github.com/users/debrupf2946",
"user_view_type": "public"
}
] |
[
"@lhoestq ",
"Makes sense, I guess this can be fixed in the load_dataset_builder method.\r\nIt concerns every packaged builder I think (see values in `_PACKAGED_DATASETS_MODULES`)",
"I think the behavior is related to these lines, which short circuited the error handling.\r\nhttps://github.com/huggingface/datasets/blob/664a1cb72ea1e6ef7c47e671e2686ca4a35e8d63/src/datasets/load.py#L946-L952\r\n\r\nSo should data_dir be checked here or still delegating to actual `DatasetModule`? In that case, how to properly set `data_files` here.",
"This is location in PackagedDatasetModuleFactory.get_module seems the be the right place to check if at least data_dir or data_files are passed",
"@mariosasko can you please assign this issue to me,I want to work on this",
"#self-assign",
"@mariosasko is this issue still open? i would love to kickstart my journey to open source with this issue!\r\nRegards\r\nzutarich",
"@zutarich It is unless @debrupf2946 is working on it.",
"#self-assign",
"I am working and will open a pull request soon @Etelis \r\n",
"@mariosasko can i take this up? ",
"#self-assign",
"Yes, feel free to work on this :)",
"i think its working as expected . Heres the log i get for the same line -\r\n\r\n\r\n",
"#self-assign",
"Hey! I saw that PR #7314 fixed the issue when no matching data files are found, which is great. But I think the builder still defaults to the current directory when `data_dir` isn't specified, which could lead to unexpected behavior.\n\nIf no one’s actively working on that part, I’d be happy to pick it up and propose a fix. Let me know if that works!\n",
"Cool, feel free to ping me if you open a PR @aniyagnik :)",
"Hey! I noticed this is still open and unresolved. I’d like to take this up and submit a PR to prevent resolving to the current directory when data_dir is not specified!!!",
"Hi @aniyagnik @npuichigo @sahillihas @lhoestq @mariosasko,\nI've opened a PR to address the issue discussed in #6152 by adding an early validation check for folder-based datasets. Would appreciate your review whenever convenient. Thanks!\n\nhttps://github.com/huggingface/datasets/pull/7618"
] | 2023-08-16T04:38:09
| 2025-06-18T14:18:42
| 2025-06-18T14:18:42
|
CONTRIBUTOR
| null | null | null | null |
### Describe the bug
FolderBase Dataset automatically resolves under current directory when data_dir is not specified.
For example:
```
load_dataset("audiofolder")
```
takes long time to resolve and collect data_files from current directory. But I think it should reach out to this line for error handling https://github.com/huggingface/datasets/blob/cb8c5de5145c7e7eee65391cb7f4d92f0d565d62/src/datasets/packaged_modules/folder_based_builder/folder_based_builder.py#L58-L59
### Steps to reproduce the bug
```
load_dataset("audiofolder")
```
### Expected behavior
Error report
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-5.15.0-78-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lhoestq",
"id": 42851186,
"login": "lhoestq",
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lhoestq",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6152/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6152/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 672 days, 9:40:33
|
https://api.github.com/repos/huggingface/datasets/issues/6151
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6151/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6151/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6151/events
|
https://github.com/huggingface/datasets/issues/6151
| 1,851,497,818
|
I_kwDODunzps5uW51a
| 6,151
|
Faster sorting for single key items
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47942453?v=4",
"events_url": "https://api.github.com/users/jackapbutler/events{/privacy}",
"followers_url": "https://api.github.com/users/jackapbutler/followers",
"following_url": "https://api.github.com/users/jackapbutler/following{/other_user}",
"gists_url": "https://api.github.com/users/jackapbutler/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jackapbutler",
"id": 47942453,
"login": "jackapbutler",
"node_id": "MDQ6VXNlcjQ3OTQyNDUz",
"organizations_url": "https://api.github.com/users/jackapbutler/orgs",
"received_events_url": "https://api.github.com/users/jackapbutler/received_events",
"repos_url": "https://api.github.com/users/jackapbutler/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jackapbutler/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jackapbutler/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jackapbutler",
"user_view_type": "public"
}
|
[
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
closed
| false
| null |
[] |
[
"`Dataset.sort` essentially does the same thing except it uses `pyarrow.compute.sort_indices` which doesn't involve copying the data into python objects (saving memory)\r\n\r\n```python\r\nsort_keys = [(col, \"ascending\") for col in column_names]\r\nindices = pc.sort_indices(self.data, sort_keys=sort_keys)\r\nreturn self.select(indices)\r\n```",
"Ok interesting, I'll continue debugging to see what is going wrong on my end."
] | 2023-08-15T14:02:31
| 2023-08-21T14:38:26
| 2023-08-21T14:38:25
|
NONE
| null | null | null | null |
### Feature request
A faster way to sort a dataset which contains a large number of rows.
### Motivation
The current sorting implementations took significantly longer than expected when I was running on a dataset trying to sort by timestamps.
**Code snippet:**
```python
ds = datasets.load_dataset( "json", **{"data_files": {"train": "path-to-jsonlines"}, "split": "train"}, num_proc=os.cpu_count(), keep_in_memory=True)
sorted_ds = ds.sort("pubDate", keep_in_memory=True)
```
However, once I switched to a different method which
1. unpacked to a list of tuples
2. sorted tuples by key
3. run `.select` with the sorted list of indices
It was significantly faster (orders of magnitude, especially with M's of rows)
### Your contribution
I'd be happy to implement a crude single key sorting algorithm so that other users can benefit from this trick. Broadly, this would take a `Dataset` and perform;
```python
# ds is a Dataset object
# key_name is the sorting key
class Dataset:
...
def _sort(key_name: str) -> Dataset:
index_keys = [(i,x) for i,x in enumerate(self[key_name])]
sorted_rows = sorted(row_pubdate, key=lambda x: x[1])
sorted_indicies = [x[0] for x in sorted_rows]
return self.select(sorted_indicies)
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47942453?v=4",
"events_url": "https://api.github.com/users/jackapbutler/events{/privacy}",
"followers_url": "https://api.github.com/users/jackapbutler/followers",
"following_url": "https://api.github.com/users/jackapbutler/following{/other_user}",
"gists_url": "https://api.github.com/users/jackapbutler/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jackapbutler",
"id": 47942453,
"login": "jackapbutler",
"node_id": "MDQ6VXNlcjQ3OTQyNDUz",
"organizations_url": "https://api.github.com/users/jackapbutler/orgs",
"received_events_url": "https://api.github.com/users/jackapbutler/received_events",
"repos_url": "https://api.github.com/users/jackapbutler/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jackapbutler/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jackapbutler/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jackapbutler",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6151/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6151/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 6 days, 0:35:54
|
https://api.github.com/repos/huggingface/datasets/issues/6150
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6150/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6150/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6150/events
|
https://github.com/huggingface/datasets/issues/6150
| 1,850,740,456
|
I_kwDODunzps5uUA7o
| 6,150
|
Allow dataset implement .take
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1855278?v=4",
"events_url": "https://api.github.com/users/brando90/events{/privacy}",
"followers_url": "https://api.github.com/users/brando90/followers",
"following_url": "https://api.github.com/users/brando90/following{/other_user}",
"gists_url": "https://api.github.com/users/brando90/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/brando90",
"id": 1855278,
"login": "brando90",
"node_id": "MDQ6VXNlcjE4NTUyNzg=",
"organizations_url": "https://api.github.com/users/brando90/orgs",
"received_events_url": "https://api.github.com/users/brando90/received_events",
"repos_url": "https://api.github.com/users/brando90/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/brando90/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/brando90/subscriptions",
"type": "User",
"url": "https://api.github.com/users/brando90",
"user_view_type": "public"
}
|
[
{
"color": "a2eeef",
"default": true,
"description": "New feature or request",
"id": 1935892871,
"name": "enhancement",
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement"
}
] |
open
| false
| null |
[] |
[
"```\r\n dataset = IterableDataset(dataset) if type(dataset) != IterableDataset else dataset # to force dataset.take(batch_size) to work in non-streaming mode\r\n ```\r\n",
"hf discuss: https://discuss.huggingface.co/t/how-does-one-make-dataset-take-512-work-with-streaming-false-with-hugging-face-data-set/50770",
"so: https://stackoverflow.com/questions/76902824/how-does-one-make-dataset-take512-work-with-streaming-false-with-hugging-fac",
"Feel free to work on this. In addition, `IterableDataset` supports `skip`, so we should also add this method to `Dataset`."
] | 2023-08-15T00:17:51
| 2023-08-17T13:49:37
| null |
NONE
| null | null | null | null |
### Feature request
I want to do:
```
dataset.take(512)
```
but it only works with streaming = True
### Motivation
uniform interface to data sets. Really surprising the above only works with streaming = True.
### Your contribution
Should be trivial to copy paste the IterableDataset .take to use the local path in the data (when streaming = False)
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6150/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6150/timeline
| null | null |
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| null |
https://api.github.com/repos/huggingface/datasets/issues/6149
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6149/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6149/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6149/events
|
https://github.com/huggingface/datasets/issues/6149
| 1,850,700,624
|
I_kwDODunzps5uT3NQ
| 6,149
|
Dataset.from_parquet cannot load subset of columns
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2512762?v=4",
"events_url": "https://api.github.com/users/dwyatte/events{/privacy}",
"followers_url": "https://api.github.com/users/dwyatte/followers",
"following_url": "https://api.github.com/users/dwyatte/following{/other_user}",
"gists_url": "https://api.github.com/users/dwyatte/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dwyatte",
"id": 2512762,
"login": "dwyatte",
"node_id": "MDQ6VXNlcjI1MTI3NjI=",
"organizations_url": "https://api.github.com/users/dwyatte/orgs",
"received_events_url": "https://api.github.com/users/dwyatte/received_events",
"repos_url": "https://api.github.com/users/dwyatte/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dwyatte/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dwyatte/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dwyatte",
"user_view_type": "public"
}
|
[] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
] |
[
"Looks like this regression was introduced in `datasets==2.13.0` (`2.12.0` could load a subset of columns)\r\n\r\nThis does not appear to be fixed by https://github.com/huggingface/datasets/pull/6045 (bug still exists on `main`)"
] | 2023-08-14T23:28:22
| 2023-08-17T22:36:05
| 2023-08-17T22:36:05
|
CONTRIBUTOR
| null | null | null | null |
### Describe the bug
When using `Dataset.from_parquet(path_or_paths, columns=[...])` and a subset of columns, loading fails with a variant of the following
```
ValueError: Couldn't cast
a: int64
-- schema metadata --
pandas: '{"index_columns": [], "column_indexes": [], "columns": [{"name":' + 273
to
{'a': Value(dtype='int64', id=None), 'b': Value(dtype='int64', id=None)}
because column names don't match
The above exception was the direct cause of the following exception:
```
Looks to be triggered by https://github.com/huggingface/datasets/blob/c02a44715c036b5261686669727394b1308a3a4b/src/datasets/table.py#L2285-L2286
### Steps to reproduce the bug
```
import pandas as pd
from datasets import Dataset
pd.DataFrame([{"a": 1, "b": 2}]).to_parquet("test.pq")
Dataset.from_parquet("test.pq", columns=["a"])
```
### Expected behavior
A subset of columns should be loaded without error
### Environment info
- `datasets` version: 2.14.4
- Platform: Linux-5.10.0-23-cloud-amd64-x86_64-with-glibc2.2.5
- Python version: 3.8.16
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 2.0.3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6149/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6149/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 2 days, 23:07:43
|
https://api.github.com/repos/huggingface/datasets/issues/6147
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6147/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6147/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6147/events
|
https://github.com/huggingface/datasets/issues/6147
| 1,848,914,830
|
I_kwDODunzps5uNDOO
| 6,147
|
ValueError when running BeamBasedBuilder with GCS path in cache_dir
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/13844767?v=4",
"events_url": "https://api.github.com/users/ktrk115/events{/privacy}",
"followers_url": "https://api.github.com/users/ktrk115/followers",
"following_url": "https://api.github.com/users/ktrk115/following{/other_user}",
"gists_url": "https://api.github.com/users/ktrk115/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ktrk115",
"id": 13844767,
"login": "ktrk115",
"node_id": "MDQ6VXNlcjEzODQ0NzY3",
"organizations_url": "https://api.github.com/users/ktrk115/orgs",
"received_events_url": "https://api.github.com/users/ktrk115/received_events",
"repos_url": "https://api.github.com/users/ktrk115/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ktrk115/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ktrk115/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ktrk115",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"The cause of the error seems to be that `datasets` adds \"gcs://\" as a schema, while `beam` checks only \"gs://\".\r\n\r\ndatasets: https://github.com/huggingface/datasets/blob/c02a44715c036b5261686669727394b1308a3a4b/src/datasets/builder.py#L822\r\n\r\nbeam: [link](https://github.com/apache/beam/blob/25e1a64641b1c8a3c0a6c75c6e86031b87307f22/sdks/python/apache_beam/io/filesystems.py#L98-L101)\r\n```\r\n systems = [\r\n fs for fs in FileSystem.get_all_subclasses()\r\n if fs.scheme() == path_scheme\r\n ]\r\n```",
"Hi! We've deprecated the Beam API, as we don't have the bandwidth to support it properly..."
] | 2023-08-14T03:11:34
| 2024-03-18T16:59:15
| 2024-03-18T16:59:14
|
NONE
| null | null | null | null |
### Describe the bug
When running the BeamBasedBuilder with a GCS path specified in the cache_dir, the following ValueError occurs:
```
ValueError: Unable to get filesystem from specified path, please use the correct path or ensure the required dependency is installed, e.g., pip install apache-beam[gcp]. Path specified: gcs://my-bucket/huggingface_datasets/my_beam_dataset/default/0.0.0/my_beam_dataset-train [while running 'train/Save to parquet/Write/WriteImpl/InitializeWrite']
```
Same error occurs after running `pip install apache-beam[gcp]` as instructed.
### Steps to reproduce the bug
Put `my_beam_dataset.py`:
```python
import datasets
class MyBeamDataset(datasets.BeamBasedBuilder):
def _info(self):
features = datasets.Features({"value": datasets.Value("int64")})
return datasets.DatasetInfo(features=features)
def _split_generators(self, dl_manager, pipeline):
return [datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={})]
def _build_pcollection(self, pipeline):
import apache_beam as beam
return pipeline | beam.Create([{"value": i} for i in range(10)])
```
Run:
```bash
datasets-cli run_beam my_beam_dataset.py --cache_dir=gs://my-bucket/huggingface_datasets/ --beam_pipeline_options="runner=DirectRunner"
```
### Expected behavior
Running the BeamBasedBuilder with a GCS cache path without any errors.
### Environment info
- `datasets` version: 2.14.4
- Platform: macOS-13.4-arm64-arm-64bit
- Python version: 3.9.17
- Huggingface_hub version: 0.16.4
- PyArrow version: 9.0.0
- Pandas version: 2.0.3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6147/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6147/timeline
| null |
not_planned
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 217 days, 13:47:40
|
https://api.github.com/repos/huggingface/datasets/issues/6146
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6146/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6146/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6146/events
|
https://github.com/huggingface/datasets/issues/6146
| 1,848,417,366
|
I_kwDODunzps5uLJxW
| 6,146
|
DatasetGenerationError when load glue benchmark datasets from `load_dataset`
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/78742415?v=4",
"events_url": "https://api.github.com/users/yusx-swapp/events{/privacy}",
"followers_url": "https://api.github.com/users/yusx-swapp/followers",
"following_url": "https://api.github.com/users/yusx-swapp/following{/other_user}",
"gists_url": "https://api.github.com/users/yusx-swapp/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/yusx-swapp",
"id": 78742415,
"login": "yusx-swapp",
"node_id": "MDQ6VXNlcjc4NzQyNDE1",
"organizations_url": "https://api.github.com/users/yusx-swapp/orgs",
"received_events_url": "https://api.github.com/users/yusx-swapp/received_events",
"repos_url": "https://api.github.com/users/yusx-swapp/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/yusx-swapp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yusx-swapp/subscriptions",
"type": "User",
"url": "https://api.github.com/users/yusx-swapp",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"I've tried clear the .cache file, doesn't work.",
"This issue happens on AWS sagemaker",
"This issue can happen if there is a directory named \"glue\" relative to the Python script with the `load_dataset` call (similar issue to this one: https://github.com/huggingface/datasets/issues/5228). Is this the case?",
"> This issue can happen if there is a directory named \"glue\" relative to the Python script with the `load_dataset` call (similar issue to this one: #5228). Is this the case?\r\n\r\nThats correct!\r\nSorry for my late response."
] | 2023-08-13T05:17:56
| 2023-08-26T22:09:09
| 2023-08-26T22:09:09
|
NONE
| null | null | null | null |
### Describe the bug
Package version: datasets-2.14.4
When I run the codes:
```
from datasets import load_dataset
dataset = load_dataset("glue", "ax")
```
I got the following errors:
---------------------------------------------------------------------------
SchemaInferenceError Traceback (most recent call last)
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1949, in ArrowBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id)
1948 num_shards = shard_id + 1
-> 1949 num_examples, num_bytes = writer.finalize()
1950 writer.close()
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/arrow_writer.py:598, in ArrowWriter.finalize(self, close_stream)
597 self.stream.close()
--> 598 raise SchemaInferenceError("Please pass `features` or at least one example when writing data")
599 logger.debug(
600 f"Done writing {self._num_examples} {self.unit} in {self._num_bytes} bytes {self._path if self._path else ''}."
601 )
SchemaInferenceError: Please pass `features` or at least one example when writing data
The above exception was the direct cause of the following exception:
DatasetGenerationError Traceback (most recent call last)
Cell In[5], line 3
1 from datasets import load_dataset
----> 3 dataset = load_dataset("glue", "ax")
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/load.py:2136, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2133 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
2135 # Download and prepare data
-> 2136 builder_instance.download_and_prepare(
2137 download_config=download_config,
2138 download_mode=download_mode,
2139 verification_mode=verification_mode,
2140 try_from_hf_gcs=try_from_hf_gcs,
2141 num_proc=num_proc,
2142 storage_options=storage_options,
2143 )
2145 # Build dataset for splits
2146 keep_in_memory = (
2147 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2148 )
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:954, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs)
952 if num_proc is not None:
953 prepare_split_kwargs["num_proc"] = num_proc
--> 954 self._download_and_prepare(
955 dl_manager=dl_manager,
956 verification_mode=verification_mode,
957 **prepare_split_kwargs,
958 **download_and_prepare_kwargs,
959 )
960 # Sync info
961 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values())
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1049, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs)
1045 split_dict.add(split_generator.split_info)
1047 try:
1048 # Prepare split will record examples associated to the split
-> 1049 self._prepare_split(split_generator, **prepare_split_kwargs)
1050 except OSError as e:
1051 raise OSError(
1052 "Cannot find data file. "
1053 + (self.manual_download_instructions or "")
1054 + "\nOriginal error:\n"
1055 + str(e)
1056 ) from None
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1813, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, num_proc, max_shard_size)
1811 job_id = 0
1812 with pbar:
-> 1813 for job_id, done, content in self._prepare_split_single(
1814 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
1815 ):
1816 if done:
1817 result = content
File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1958, in ArrowBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id)
1956 if isinstance(e, SchemaInferenceError) and e.__context__ is not None:
1957 e = e.__context__
-> 1958 raise DatasetGenerationError("An error occurred while generating the dataset") from e
1960 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths)
DatasetGenerationError: An error occurred while generating the dataset
### Steps to reproduce the bug
from datasets import load_dataset
dataset = load_dataset("glue", "ax")
### Expected behavior
When generating the train split:
Generating train split:
0/0 [00:00<?, ? examples/s]
It raise the error:
DatasetGenerationError: An error occurred while generating the dataset
### Environment info
datasets-2.14.4.
Python 3.10
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/78742415?v=4",
"events_url": "https://api.github.com/users/yusx-swapp/events{/privacy}",
"followers_url": "https://api.github.com/users/yusx-swapp/followers",
"following_url": "https://api.github.com/users/yusx-swapp/following{/other_user}",
"gists_url": "https://api.github.com/users/yusx-swapp/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/yusx-swapp",
"id": 78742415,
"login": "yusx-swapp",
"node_id": "MDQ6VXNlcjc4NzQyNDE1",
"organizations_url": "https://api.github.com/users/yusx-swapp/orgs",
"received_events_url": "https://api.github.com/users/yusx-swapp/received_events",
"repos_url": "https://api.github.com/users/yusx-swapp/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/yusx-swapp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yusx-swapp/subscriptions",
"type": "User",
"url": "https://api.github.com/users/yusx-swapp",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6146/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6146/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 13 days, 16:51:13
|
https://api.github.com/repos/huggingface/datasets/issues/6153
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/6153/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/6153/comments
|
https://api.github.com/repos/huggingface/datasets/issues/6153/events
|
https://github.com/huggingface/datasets/issues/6153
| 1,852,630,074
|
I_kwDODunzps5ubOQ6
| 6,153
|
custom load dataset to hub
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/20493493?v=4",
"events_url": "https://api.github.com/users/andysingal/events{/privacy}",
"followers_url": "https://api.github.com/users/andysingal/followers",
"following_url": "https://api.github.com/users/andysingal/following{/other_user}",
"gists_url": "https://api.github.com/users/andysingal/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/andysingal",
"id": 20493493,
"login": "andysingal",
"node_id": "MDQ6VXNlcjIwNDkzNDkz",
"organizations_url": "https://api.github.com/users/andysingal/orgs",
"received_events_url": "https://api.github.com/users/andysingal/received_events",
"repos_url": "https://api.github.com/users/andysingal/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/andysingal/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andysingal/subscriptions",
"type": "User",
"url": "https://api.github.com/users/andysingal",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
[
"This is an issue for the [Datasets repo](https://github.com/huggingface/datasets).",
"> This is an issue for the [Datasets repo](https://github.com/huggingface/datasets).\r\n\r\nThanks @sgugger , I guess I will wait for them to address the issue . Looking forward to hearing from them ",
"You can use `.push_to_hub(\"<username>/<repo>\")` to push a `Dataset` to the Hub.",
"> You can use `.push_to_hub(\"<username>/<repo>\")` to push a `Dataset` to the Hub.\r\n\r\nhow about subset? like `.load_dataset(\"<username>/<repo>\", \"<subset>\")`, how can I upload multi-dataset in one repo? thanks a lot ! ",
"> > You can use `.push_to_hub(\"<username>/<repo>\")` to push a `Dataset` to the Hub.\r\n> \r\n> how about subset? like `.load_dataset(\"<username>/<repo>\", \"<subset>\")`, how can I upload multi-dataset in one repo? thanks a lot !\r\n\r\nI solved it by upgrading `Datasets` version to 2.15.0"
] | 2023-08-13T04:42:22
| 2023-11-21T11:50:28
| 2023-10-08T17:04:16
|
NONE
| null | null | null | null |
### System Info
kaggle notebook
i transformed dataset:
```
dataset = load_dataset("Dahoas/first-instruct-human-assistant-prompt")
```
to
formatted_dataset:
```
Dataset({
features: ['message_tree_id', 'message_tree_text'],
num_rows: 33143
})
```
but would like to know how to upload to hub
### Who can help?
@ArthurZucker @younesbelkada
### Information
- [ ] The official example scripts
- [ ] My own modified scripts
### Tasks
- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)
### Reproduction
shared above
### Expected behavior
load dataset to hub
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4",
"events_url": "https://api.github.com/users/mariosasko/events{/privacy}",
"followers_url": "https://api.github.com/users/mariosasko/followers",
"following_url": "https://api.github.com/users/mariosasko/following{/other_user}",
"gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mariosasko",
"id": 47462742,
"login": "mariosasko",
"node_id": "MDQ6VXNlcjQ3NDYyNzQy",
"organizations_url": "https://api.github.com/users/mariosasko/orgs",
"received_events_url": "https://api.github.com/users/mariosasko/received_events",
"repos_url": "https://api.github.com/users/mariosasko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mariosasko",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/huggingface/datasets/issues/6153/reactions"
}
|
https://api.github.com/repos/huggingface/datasets/issues/6153/timeline
| null |
completed
|
{
"completed": 0,
"percent_completed": 0,
"total": 0
}
|
{
"blocked_by": 0,
"blocking": 0,
"total_blocked_by": 0,
"total_blocking": 0
}
| false
| 56 days, 12:21:54
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.