url
stringlengths 61
61
| repository_url
stringclasses 1
value | labels_url
stringlengths 75
75
| comments_url
stringlengths 70
70
| events_url
stringlengths 68
68
| html_url
stringlengths 49
51
| id
int64 2.78B
2.94B
| node_id
stringlengths 18
19
| number
int64 7.37k
7.47k
| title
stringlengths 10
122
| user
dict | labels
listlengths 0
1
| state
stringclasses 2
values | locked
bool 1
class | assignee
dict | assignees
listlengths 0
1
| milestone
null | comments
sequencelengths 0
9
| created_at
timestamp[s] | updated_at
timestamp[s] | closed_at
timestamp[s] | author_association
stringclasses 3
values | type
null | sub_issues_summary
dict | active_lock_reason
null | body
stringlengths 5
18.5k
⌀ | closed_by
dict | reactions
dict | timeline_url
stringlengths 70
70
| performed_via_github_app
null | state_reason
stringclasses 1
value | draft
bool 1
class | pull_request
dict | is_pull_request
bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
https://api.github.com/repos/huggingface/datasets/issues/7472
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7472/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7472/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7472/events
|
https://github.com/huggingface/datasets/issues/7472
| 2,937,607,272
|
I_kwDODunzps6vGFRo
| 7,472
|
Label casting during `map` process is canceled after the `map` process
|
{
"login": "yoshitomo-matsubara",
"id": 11156001,
"node_id": "MDQ6VXNlcjExMTU2MDAx",
"avatar_url": "https://avatars.githubusercontent.com/u/11156001?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/yoshitomo-matsubara",
"html_url": "https://github.com/yoshitomo-matsubara",
"followers_url": "https://api.github.com/users/yoshitomo-matsubara/followers",
"following_url": "https://api.github.com/users/yoshitomo-matsubara/following{/other_user}",
"gists_url": "https://api.github.com/users/yoshitomo-matsubara/gists{/gist_id}",
"starred_url": "https://api.github.com/users/yoshitomo-matsubara/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yoshitomo-matsubara/subscriptions",
"organizations_url": "https://api.github.com/users/yoshitomo-matsubara/orgs",
"repos_url": "https://api.github.com/users/yoshitomo-matsubara/repos",
"events_url": "https://api.github.com/users/yoshitomo-matsubara/events{/privacy}",
"received_events_url": "https://api.github.com/users/yoshitomo-matsubara/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
open
| false
| null |
[] | null |
[] | 2025-03-21T07:56:22
| 2025-03-21T07:58:14
| null |
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
### Describe the bug
When preprocessing a multi-label dataset, I introduced a step to convert int labels to float labels as [BCEWithLogitsLoss](https://pytorch.org/docs/stable/generated/torch.nn.BCEWithLogitsLoss.html) expects float labels and forward function of models in transformers package internally use `BCEWithLogitsLoss`
However, the casting was canceled after `.map` process and the label values still use int values, which leads to an error
```
File "/home/yoshitomo/anaconda3/envs/torchdistill/lib/python3.10/site-packages/transformers/models/bert/modeling_bert.py", line 1711, in forward
loss = loss_fct(logits, labels)
File "/home/yoshitomo/anaconda3/envs/torchdistill/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/yoshitomo/anaconda3/envs/torchdistill/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
return forward_call(*args, **kwargs)
File "/home/yoshitomo/anaconda3/envs/torchdistill/lib/python3.10/site-packages/torch/nn/modules/loss.py", line 819, in forward
return F.binary_cross_entropy_with_logits(
File "/home/yoshitomo/anaconda3/envs/torchdistill/lib/python3.10/site-packages/torch/nn/functional.py", line 3628, in binary_cross_entropy_with_logits
return torch.binary_cross_entropy_with_logits(
RuntimeError: result type Float can't be cast to the desired output type Long
```
This seems like happening only when the original labels are int values (see examples below)
### Steps to reproduce the bug
If the original dataset uses a list of int labels, it will cancel the int->float casting
```python
from datasets import Dataset
data = {
'text': ['text1', 'text2', 'text3', 'text4'],
'labels': [[0, 1, 2], [3], [3, 4], [3]]
}
dataset = Dataset.from_dict(data)
label_set = set([label for labels in data['labels'] for label in labels])
label2idx = {label: idx for idx, label in enumerate(sorted(label_set))}
def multi_labels_to_ids(labels):
ids = [0.0] * len(label2idx)
for label in labels:
ids[label2idx[label]] = 1.0
return ids
def preprocess(examples):
result = {'sentence': [[0, 3, 4] for _ in range(len(examples['labels']))]}
print('"labels" are int', examples['labels'])
result['labels'] = [multi_labels_to_ids(l) for l in examples['labels']]
print('"labels" were converted to multi-label format with float values', result['labels'])
return result
preprocessed_dataset = dataset.map(preprocess, batched=True, remove_columns=['labels', 'text'])
print(preprocessed_dataset[0]['labels'])
# Output: "[1, 1, 1, 0, 0]"
# Expected: "[1.0, 1.0, 1.0, 0.0, 0.0]"
```
If the original dataset uses non-int labels, it works as expected.
```python
from datasets import Dataset
data = {
'text': ['text1', 'text2', 'text3', 'text4'],
'labels': [['label1', 'label2', 'label3'], ['label4'], ['label4', 'label5'], ['label4']]
}
dataset = Dataset.from_dict(data)
label_set = set([label for labels in data['labels'] for label in labels])
label2idx = {label: idx for idx, label in enumerate(sorted(label_set))}
def multi_labels_to_ids(labels):
ids = [0.0] * len(label2idx)
for label in labels:
ids[label2idx[label]] = 1.0
return ids
def preprocess(examples):
result = {'sentence': [[0, 3, 4] for _ in range(len(examples['labels']))]}
print('"labels" are int', examples['labels'])
result['labels'] = [multi_labels_to_ids(l) for l in examples['labels']]
print('"labels" were converted to multi-label format with float values', result['labels'])
return result
preprocessed_dataset = dataset.map(preprocess, batched=True, remove_columns=['labels', 'text'])
print(preprocessed_dataset[0]['labels'])
# Output: "[1.0, 1.0, 1.0, 0.0, 0.0]"
# Expected: "[1.0, 1.0, 1.0, 0.0, 0.0]"
```
Note that the only difference between these two examples is
> 'labels': [[0, 1, 2], [3], [3, 4], [3]]
v.s
> 'labels': [['label1', 'label2', 'label3'], ['label4'], ['label4', 'label5'], ['label4']]
### Expected behavior
Even if the original dataset uses a list of int labels, the int->float casting during `.map` process should not be canceled as shown in the above example
### Environment info
OS Ubuntu 22.04 LTS
Python 3.10.11
datasets v3.4.1
| null |
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7472/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7472/timeline
| null | null | null | null | false
|
https://api.github.com/repos/huggingface/datasets/issues/7471
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7471/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7471/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7471/events
|
https://github.com/huggingface/datasets/issues/7471
| 2,937,530,069
|
I_kwDODunzps6vFybV
| 7,471
|
Adding argument to `_get_data_files_patterns`
|
{
"login": "SangbumChoi",
"id": 34004152,
"node_id": "MDQ6VXNlcjM0MDA0MTUy",
"avatar_url": "https://avatars.githubusercontent.com/u/34004152?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/SangbumChoi",
"html_url": "https://github.com/SangbumChoi",
"followers_url": "https://api.github.com/users/SangbumChoi/followers",
"following_url": "https://api.github.com/users/SangbumChoi/following{/other_user}",
"gists_url": "https://api.github.com/users/SangbumChoi/gists{/gist_id}",
"starred_url": "https://api.github.com/users/SangbumChoi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/SangbumChoi/subscriptions",
"organizations_url": "https://api.github.com/users/SangbumChoi/orgs",
"repos_url": "https://api.github.com/users/SangbumChoi/repos",
"events_url": "https://api.github.com/users/SangbumChoi/events{/privacy}",
"received_events_url": "https://api.github.com/users/SangbumChoi/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[
{
"id": 1935892871,
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement",
"name": "enhancement",
"color": "a2eeef",
"default": true,
"description": "New feature or request"
}
] |
open
| false
| null |
[] | null |
[] | 2025-03-21T07:17:53
| 2025-03-21T07:17:53
| null |
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
### Feature request
How about adding if the user already know about the pattern?
https://github.com/huggingface/datasets/blob/a256b85cbc67aa3f0e75d32d6586afc507cf535b/src/datasets/data_files.py#L252
### Motivation
While using this load_dataset people might use 10M of images for the local files.
However, due to searching all the appropriate file pattern in fsspec, purely searching this pattern takes more than 10 hours (real use-case).
### Your contribution
Yeah I can make this happen if this seems valid. @lhoestq WDYT?
such like
```
def _get_data_files_patterns(pattern_resolver: Callable[[str], list[str]], patterns: PATTERNS) -> dict[str, list[str]]:
```
| null |
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7471/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7471/timeline
| null | null | null | null | false
|
https://api.github.com/repos/huggingface/datasets/issues/7470
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7470/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7470/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7470/events
|
https://github.com/huggingface/datasets/issues/7470
| 2,937,236,323
|
I_kwDODunzps6vEqtj
| 7,470
|
Is it possible to shard a single-sharded IterableDataset?
|
{
"login": "jonathanasdf",
"id": 511073,
"node_id": "MDQ6VXNlcjUxMTA3Mw==",
"avatar_url": "https://avatars.githubusercontent.com/u/511073?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jonathanasdf",
"html_url": "https://github.com/jonathanasdf",
"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}",
"starred_url": "https://api.github.com/users/jonathanasdf/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jonathanasdf/subscriptions",
"organizations_url": "https://api.github.com/users/jonathanasdf/orgs",
"repos_url": "https://api.github.com/users/jonathanasdf/repos",
"events_url": "https://api.github.com/users/jonathanasdf/events{/privacy}",
"received_events_url": "https://api.github.com/users/jonathanasdf/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
open
| false
| null |
[] | null |
[] | 2025-03-21T04:33:37
| 2025-03-21T04:33:37
| null |
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
I thought https://github.com/huggingface/datasets/pull/7252 might be applicable but looking at it maybe not.
Say we have a process, eg. a database query, that can return data in slightly different order each time. So, the initial query needs to be run by a single thread (not to mention running multiple times incurs more cost too). But the results are also big enough that we don't want to materialize it entirely and instead stream it with an IterableDataset.
But after we have the results we want to split it up across workers to parallelize processing.
Is something like this possible to do?
Here's a failed attempt. The end result should be that each of the shards has unique data, but unfortunately with this attempt the generator gets run once in each shard and the results end up with duplicates...
```
import random
import datasets
def gen():
print('RUNNING GENERATOR!')
items = list(range(10))
random.shuffle(items)
yield from items
ds = datasets.IterableDataset.from_generator(gen)
print('dataset contents:')
for item in ds:
print(item)
print()
print('dataset contents (2):')
for item in ds:
print(item)
print()
num_shards = 3
def sharded(shard_id):
for i, example in enumerate(ds):
if i % num_shards in shard_id:
yield example
ds1 = datasets.IterableDataset.from_generator(
sharded, gen_kwargs={'shard_id': list(range(num_shards))}
)
for shard in range(num_shards):
print('shard', shard)
for item in ds1.shard(num_shards, shard):
print(item)
```
| null |
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7470/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7470/timeline
| null | null | null | null | false
|
https://api.github.com/repos/huggingface/datasets/issues/7469
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7469/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7469/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7469/events
|
https://github.com/huggingface/datasets/issues/7469
| 2,936,606,080
|
I_kwDODunzps6vCQ2A
| 7,469
|
Custom split name with the web interface
|
{
"login": "vince62s",
"id": 15141326,
"node_id": "MDQ6VXNlcjE1MTQxMzI2",
"avatar_url": "https://avatars.githubusercontent.com/u/15141326?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/vince62s",
"html_url": "https://github.com/vince62s",
"followers_url": "https://api.github.com/users/vince62s/followers",
"following_url": "https://api.github.com/users/vince62s/following{/other_user}",
"gists_url": "https://api.github.com/users/vince62s/gists{/gist_id}",
"starred_url": "https://api.github.com/users/vince62s/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/vince62s/subscriptions",
"organizations_url": "https://api.github.com/users/vince62s/orgs",
"repos_url": "https://api.github.com/users/vince62s/repos",
"events_url": "https://api.github.com/users/vince62s/events{/privacy}",
"received_events_url": "https://api.github.com/users/vince62s/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
closed
| false
| null |
[] | null |
[] | 2025-03-20T20:45:59
| 2025-03-21T07:20:37
| 2025-03-21T07:20:37
|
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
### Describe the bug
According the doc here: https://huggingface.co/docs/hub/datasets-file-names-and-splits#custom-split-name
it should infer the split name from the subdir of data or the beg of the name of the files in data.
When doing this manually through web upload it does not work. it uses "train" as a unique split.
example: https://huggingface.co/datasets/eole-nlp/estimator_chatml
### Steps to reproduce the bug
follow the link above
### Expected behavior
there should be two splits "mlqe" and "1720_da"
### Environment info
website
|
{
"login": "vince62s",
"id": 15141326,
"node_id": "MDQ6VXNlcjE1MTQxMzI2",
"avatar_url": "https://avatars.githubusercontent.com/u/15141326?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/vince62s",
"html_url": "https://github.com/vince62s",
"followers_url": "https://api.github.com/users/vince62s/followers",
"following_url": "https://api.github.com/users/vince62s/following{/other_user}",
"gists_url": "https://api.github.com/users/vince62s/gists{/gist_id}",
"starred_url": "https://api.github.com/users/vince62s/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/vince62s/subscriptions",
"organizations_url": "https://api.github.com/users/vince62s/orgs",
"repos_url": "https://api.github.com/users/vince62s/repos",
"events_url": "https://api.github.com/users/vince62s/events{/privacy}",
"received_events_url": "https://api.github.com/users/vince62s/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7469/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7469/timeline
| null |
completed
| null | null | false
|
https://api.github.com/repos/huggingface/datasets/issues/7468
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7468/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7468/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7468/events
|
https://github.com/huggingface/datasets/issues/7468
| 2,934,094,103
|
I_kwDODunzps6u4rkX
| 7,468
|
function `load_dataset` can't solve folder path with regex characters like "[]"
|
{
"login": "Hpeox",
"id": 89294013,
"node_id": "MDQ6VXNlcjg5Mjk0MDEz",
"avatar_url": "https://avatars.githubusercontent.com/u/89294013?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Hpeox",
"html_url": "https://github.com/Hpeox",
"followers_url": "https://api.github.com/users/Hpeox/followers",
"following_url": "https://api.github.com/users/Hpeox/following{/other_user}",
"gists_url": "https://api.github.com/users/Hpeox/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Hpeox/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Hpeox/subscriptions",
"organizations_url": "https://api.github.com/users/Hpeox/orgs",
"repos_url": "https://api.github.com/users/Hpeox/repos",
"events_url": "https://api.github.com/users/Hpeox/events{/privacy}",
"received_events_url": "https://api.github.com/users/Hpeox/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
open
| false
| null |
[] | null |
[] | 2025-03-20T05:21:59
| 2025-03-20T05:21:59
| null |
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
### Describe the bug
When using the `load_dataset` function with a folder path containing regex special characters (such as "[]"), the issue occurs due to how the path is handled in the `resolve_pattern` function. This function passes the unprocessed path directly to `AbstractFileSystem.glob`, which supports regular expressions. As a result, the globbing mechanism interprets these characters as regex patterns, leading to a traversal of the entire disk partition instead of confining the search to the intended directory.
### Steps to reproduce the bug
just create a folder like `E:\[D_DATA]\koch_test`, then `load_dataset("parquet", data_dir="E:\[D_DATA]\\test", split="train")`
it will keep searching the whole disk.
I add two `print` in `glob` and `resolve_pattern` to see the path
### Expected behavior
it should load the dataset as in normal folders
### Environment info
- `datasets` version: 3.3.2
- Platform: Windows-10-10.0.22631-SP0
- Python version: 3.10.16
- `huggingface_hub` version: 0.29.1
- PyArrow version: 19.0.1
- Pandas version: 2.2.3
- `fsspec` version: 2024.12.0
| null |
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7468/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7468/timeline
| null | null | null | null | false
|
https://api.github.com/repos/huggingface/datasets/issues/7467
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7467/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7467/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7467/events
|
https://github.com/huggingface/datasets/issues/7467
| 2,930,067,107
|
I_kwDODunzps6upUaj
| 7,467
|
load_dataset with streaming hangs on parquet datasets
|
{
"login": "The0nix",
"id": 10550252,
"node_id": "MDQ6VXNlcjEwNTUwMjUy",
"avatar_url": "https://avatars.githubusercontent.com/u/10550252?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/The0nix",
"html_url": "https://github.com/The0nix",
"followers_url": "https://api.github.com/users/The0nix/followers",
"following_url": "https://api.github.com/users/The0nix/following{/other_user}",
"gists_url": "https://api.github.com/users/The0nix/gists{/gist_id}",
"starred_url": "https://api.github.com/users/The0nix/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/The0nix/subscriptions",
"organizations_url": "https://api.github.com/users/The0nix/orgs",
"repos_url": "https://api.github.com/users/The0nix/repos",
"events_url": "https://api.github.com/users/The0nix/events{/privacy}",
"received_events_url": "https://api.github.com/users/The0nix/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
open
| false
| null |
[] | null |
[] | 2025-03-18T23:33:54
| 2025-03-18T23:33:54
| null |
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
### Describe the bug
When I try to load a dataset with parquet files (e.g. "bigcode/the-stack") the dataset loads, but python interpreter can't exit and hangs
### Steps to reproduce the bug
```python3
import datasets
print('Start')
dataset = datasets.load_dataset("bigcode/the-stack", data_dir="data/yaml", streaming=True, split="train")
it = iter(dataset)
next(it)
print('Finish')
```
The program prints finish but doesn't exit and hangs indefinitely.
I tried this on two different machines and several datasets.
### Expected behavior
The program exits successfully
### Environment info
datasets==3.4.1
Python 3.12.9.
MacOS and Ubuntu Linux
| null |
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7467/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7467/timeline
| null | null | null | null | false
|
https://api.github.com/repos/huggingface/datasets/issues/7466
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7466/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7466/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7466/events
|
https://github.com/huggingface/datasets/pull/7466
| 2,928,661,327
|
PR_kwDODunzps6PHQyp
| 7,466
|
Fix local pdf loading
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
closed
| false
| null |
[] | null |
[
"The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7466). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update."
] | 2025-03-18T14:09:06
| 2025-03-18T14:11:52
| 2025-03-18T14:09:21
|
MEMBER
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
fir this error when accessing a local pdf
```
File ~/.pyenv/versions/3.12.2/envs/hf-datasets/lib/python3.12/site-packages/pdfminer/psparser.py:220, in PSBaseParser.seek(self, pos)
218 """Seeks the parser to the given position."""
219 log.debug("seek: %r", pos)
--> 220 self.fp.seek(pos)
221 # reset the status for nextline()
222 self.bufpos = pos
ValueError: seek of closed file
```
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7466/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7466/timeline
| null | null | false
|
{
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7466",
"html_url": "https://github.com/huggingface/datasets/pull/7466",
"diff_url": "https://github.com/huggingface/datasets/pull/7466.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7466.patch",
"merged_at": "2025-03-18T14:09:21"
}
| true
|
https://api.github.com/repos/huggingface/datasets/issues/7464
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7464/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7464/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7464/events
|
https://github.com/huggingface/datasets/pull/7464
| 2,926,478,838
|
PR_kwDODunzps6PABJa
| 7,464
|
Minor fix for metadata files in extension counter
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
closed
| false
| null |
[] | null |
[
"The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7464). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update."
] | 2025-03-17T21:57:11
| 2025-03-18T15:21:43
| 2025-03-18T15:21:41
|
MEMBER
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null | null |
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7464/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7464/timeline
| null | null | false
|
{
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7464",
"html_url": "https://github.com/huggingface/datasets/pull/7464",
"diff_url": "https://github.com/huggingface/datasets/pull/7464.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7464.patch",
"merged_at": "2025-03-18T15:21:41"
}
| true
|
https://api.github.com/repos/huggingface/datasets/issues/7463
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7463/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7463/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7463/events
|
https://github.com/huggingface/datasets/pull/7463
| 2,925,924,452
|
PR_kwDODunzps6O-I6K
| 7,463
|
Adds EXR format to store depth images in float32
|
{
"login": "ducha-aiki",
"id": 4803565,
"node_id": "MDQ6VXNlcjQ4MDM1NjU=",
"avatar_url": "https://avatars.githubusercontent.com/u/4803565?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ducha-aiki",
"html_url": "https://github.com/ducha-aiki",
"followers_url": "https://api.github.com/users/ducha-aiki/followers",
"following_url": "https://api.github.com/users/ducha-aiki/following{/other_user}",
"gists_url": "https://api.github.com/users/ducha-aiki/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ducha-aiki/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ducha-aiki/subscriptions",
"organizations_url": "https://api.github.com/users/ducha-aiki/orgs",
"repos_url": "https://api.github.com/users/ducha-aiki/repos",
"events_url": "https://api.github.com/users/ducha-aiki/events{/privacy}",
"received_events_url": "https://api.github.com/users/ducha-aiki/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
open
| false
| null |
[] | null |
[
"Hi ! I'mn wondering if this shouldn't this be an `Image()` type and decoded as a `PIL.Image` ?\r\n\r\nThis would make it easier to integrate with the rest of the HF ecosystem, and you could still get a numpy array using `ds = ds.with_format(\"numpy\")` which sets all the images to be formatted as numpy arrays"
] | 2025-03-17T17:42:40
| 2025-03-18T15:25:30
| null |
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
This PR adds the EXR feature to store depth images (or can be normals, etc) in float32.
It relies on [openexr_numpy](https://github.com/martinResearch/openexr_numpy/tree/main) to manipulate EXR images.
| null |
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7463/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7463/timeline
| null | null | false
|
{
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7463",
"html_url": "https://github.com/huggingface/datasets/pull/7463",
"diff_url": "https://github.com/huggingface/datasets/pull/7463.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7463.patch",
"merged_at": null
}
| true
|
https://api.github.com/repos/huggingface/datasets/issues/7462
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7462/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7462/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7462/events
|
https://github.com/huggingface/datasets/pull/7462
| 2,925,612,945
|
PR_kwDODunzps6O9EA1
| 7,462
|
set dev version
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
closed
| false
| null |
[] | null |
[
"The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7462). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update."
] | 2025-03-17T16:00:53
| 2025-03-17T16:03:31
| 2025-03-17T16:01:08
|
MEMBER
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null | null |
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7462/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7462/timeline
| null | null | false
|
{
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7462",
"html_url": "https://github.com/huggingface/datasets/pull/7462",
"diff_url": "https://github.com/huggingface/datasets/pull/7462.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7462.patch",
"merged_at": "2025-03-17T16:01:08"
}
| true
|
https://api.github.com/repos/huggingface/datasets/issues/7461
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7461/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7461/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7461/events
|
https://github.com/huggingface/datasets/issues/7461
| 2,925,608,123
|
I_kwDODunzps6uYTy7
| 7,461
|
List of images behave differently on IterableDataset and Dataset
|
{
"login": "FredrikNoren",
"id": 1288009,
"node_id": "MDQ6VXNlcjEyODgwMDk=",
"avatar_url": "https://avatars.githubusercontent.com/u/1288009?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/FredrikNoren",
"html_url": "https://github.com/FredrikNoren",
"followers_url": "https://api.github.com/users/FredrikNoren/followers",
"following_url": "https://api.github.com/users/FredrikNoren/following{/other_user}",
"gists_url": "https://api.github.com/users/FredrikNoren/gists{/gist_id}",
"starred_url": "https://api.github.com/users/FredrikNoren/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/FredrikNoren/subscriptions",
"organizations_url": "https://api.github.com/users/FredrikNoren/orgs",
"repos_url": "https://api.github.com/users/FredrikNoren/repos",
"events_url": "https://api.github.com/users/FredrikNoren/events{/privacy}",
"received_events_url": "https://api.github.com/users/FredrikNoren/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
closed
| false
| null |
[] | null |
[
"Hi ! Can you try with `datasets` ^3.4 released recently ? on my side it works with IterableDataset on the recent version :)\n\n```python\nIn [20]: def train_iterable_gen():\n ...: images = np.array(load_image(\"https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg\").resize((128, 128)))\n ...: yield {\n ...: \"images\": np.expand_dims(images, axis=0),\n ...: \"messages\": [\n ...: {\n ...: \"role\": \"user\",\n ...: \"content\": [{\"type\": \"image\", \"url\": \"https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg\" }]\n ...: },\n ...: {\n ...: \"role\": \"assistant\",\n ...: \"content\": [{\"type\": \"text\", \"text\": \"duck\" }]\n ...: }\n ...: ]\n ...: }\n ...: \n ...: train_ds = IterableDataset.from_generator(train_iterable_gen,\n ...: features=Features({\n ...: 'images': [datasets.Image(mode=None, decode=True, id=None)],\n ...: 'messages': [{'content': [{'text': datasets.Value(dtype='string', id=None), 'type': datasets.Value(dtype='string', id=None) }],\n ...: 'role': datasets.Value(dtype='string', id=None)}]\n ...: } )\n ...: )\n\n\nIn [21]: \n\nIn [21]: next(iter(train_ds))\n/Users/quentinlhoest/hf/datasets/src/datasets/features/image.py:338: UserWarning: Downcasting array dtype int64 to uint8 to be compatible with 'Pillow'\n warnings.warn(f\"Downcasting array dtype {dtype} to {dest_dtype} to be compatible with 'Pillow'\")\nOut[21]: \n{'images': [<PIL.PngImagePlugin.PngImageFile image mode=RGB size=128x128>],\n 'messages': [{'content': [{'text': None, 'type': 'image'}], 'role': 'user'},\n {'content': [{'type': 'text', 'text': 'duck'}], 'role': 'assistant'}]}\n```",
"Hm I tried it here and it works as expected, even on datasets 3.3.2. I guess maybe something in the SFTTrainer is doing additional processing on the dataset, I'll have a look there.\n\nThanks @lhoestq!"
] | 2025-03-17T15:59:23
| 2025-03-18T08:57:17
| 2025-03-18T08:57:16
|
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
### Describe the bug
This code:
```python
def train_iterable_gen():
images = np.array(load_image("https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg").resize((128, 128)))
yield {
"images": np.expand_dims(images, axis=0),
"messages": [
{
"role": "user",
"content": [{"type": "image", "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" }]
},
{
"role": "assistant",
"content": [{"type": "text", "text": "duck" }]
}
]
}
train_ds = Dataset.from_generator(train_iterable_gen,
features=Features({
'images': [datasets.Image(mode=None, decode=True, id=None)],
'messages': [{'content': [{'text': datasets.Value(dtype='string', id=None), 'type': datasets.Value(dtype='string', id=None) }], 'role': datasets.Value(dtype='string', id=None)}]
} )
)
```
works as I'd expect; if I iterate the dataset then the `images` column returns a `List[PIL.Image.Image]`, i.e. `'images': [<PIL.PngImagePlugin.PngImageFile image mode=RGB size=128x128 at 0x77EFB7EF4680>]`.
But if I change `Dataset` to `IterableDataset`, the `images` column changes into `'images': [{'path': None, 'bytes': ..]`
### Steps to reproduce the bug
The code above +
```python
def load_image(url):
response = requests.get(url)
image = Image.open(io.BytesIO(response.content))
return image
```
I'm feeding it to SFTTrainer
### Expected behavior
Dataset and IterableDataset would behave the same
### Environment info
```yaml
requires-python = ">=3.12"
dependencies = [
"av>=14.1.0",
"boto3>=1.36.7",
"datasets>=3.3.2",
"docker>=7.1.0",
"google-cloud-storage>=2.19.0",
"grpcio>=1.70.0",
"grpcio-tools>=1.70.0",
"moviepy>=2.1.2",
"open-clip-torch>=2.31.0",
"opencv-python>=4.11.0.86; sys_platform == 'darwin'",
"opencv-python-headless>=4.11.0.86; sys_platform == 'linux'",
"pandas>=2.2.3",
"pillow>=10.4.0",
"plotly>=6.0.0",
"py-spy>=0.4.0",
"pydantic>=2.10.6",
"pydantic-settings>=2.7.1",
"pymysql>=1.1.1",
"ray[data,default,serve,train,tune]>=2.43.0",
"torch>=2.6.0",
"torchmetrics>=1.6.1",
"torchvision>=0.21.0",
"transformers[torch]@git+https://github.com/huggingface/transformers",
"wandb>=0.19.4",
# https://github.com/Dao-AILab/flash-attention/issues/833
"flash-attn @ https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.3/flash_attn-2.7.3+cu12torch2.6cxx11abiFALSE-cp312-cp312-linux_x86_64.whl; sys_platform == 'linux'",
"trl@https://github.com/huggingface/trl.git",
"peft>=0.14.0",
]
```
|
{
"login": "FredrikNoren",
"id": 1288009,
"node_id": "MDQ6VXNlcjEyODgwMDk=",
"avatar_url": "https://avatars.githubusercontent.com/u/1288009?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/FredrikNoren",
"html_url": "https://github.com/FredrikNoren",
"followers_url": "https://api.github.com/users/FredrikNoren/followers",
"following_url": "https://api.github.com/users/FredrikNoren/following{/other_user}",
"gists_url": "https://api.github.com/users/FredrikNoren/gists{/gist_id}",
"starred_url": "https://api.github.com/users/FredrikNoren/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/FredrikNoren/subscriptions",
"organizations_url": "https://api.github.com/users/FredrikNoren/orgs",
"repos_url": "https://api.github.com/users/FredrikNoren/repos",
"events_url": "https://api.github.com/users/FredrikNoren/events{/privacy}",
"received_events_url": "https://api.github.com/users/FredrikNoren/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7461/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7461/timeline
| null |
completed
| null | null | false
|
https://api.github.com/repos/huggingface/datasets/issues/7460
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7460/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7460/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7460/events
|
https://github.com/huggingface/datasets/pull/7460
| 2,925,605,865
|
PR_kwDODunzps6O9Ccc
| 7,460
|
release: 3.4.1
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
closed
| false
| null |
[] | null |
[
"The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7460). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update."
] | 2025-03-17T15:58:31
| 2025-03-17T16:01:14
| 2025-03-17T15:59:19
|
MEMBER
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null | null |
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7460/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7460/timeline
| null | null | false
|
{
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7460",
"html_url": "https://github.com/huggingface/datasets/pull/7460",
"diff_url": "https://github.com/huggingface/datasets/pull/7460.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7460.patch",
"merged_at": "2025-03-17T15:59:19"
}
| true
|
https://api.github.com/repos/huggingface/datasets/issues/7459
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7459/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7459/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7459/events
|
https://github.com/huggingface/datasets/pull/7459
| 2,925,491,766
|
PR_kwDODunzps6O8pWp
| 7,459
|
Fix data_files filtering
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
closed
| false
| null |
[] | null |
[
"The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7459). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update."
] | 2025-03-17T15:20:21
| 2025-03-17T15:25:56
| 2025-03-17T15:25:54
|
MEMBER
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
close https://github.com/huggingface/datasets/issues/7458
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7459/reactions",
"total_count": 1,
"+1": 1,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7459/timeline
| null | null | false
|
{
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7459",
"html_url": "https://github.com/huggingface/datasets/pull/7459",
"diff_url": "https://github.com/huggingface/datasets/pull/7459.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7459.patch",
"merged_at": "2025-03-17T15:25:53"
}
| true
|
https://api.github.com/repos/huggingface/datasets/issues/7458
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7458/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7458/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7458/events
|
https://github.com/huggingface/datasets/issues/7458
| 2,925,403,528
|
I_kwDODunzps6uXh2I
| 7,458
|
Loading the `laion/filtered-wit` dataset in streaming mode fails on v3.4.0
|
{
"login": "nikita-savelyevv",
"id": 23343961,
"node_id": "MDQ6VXNlcjIzMzQzOTYx",
"avatar_url": "https://avatars.githubusercontent.com/u/23343961?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/nikita-savelyevv",
"html_url": "https://github.com/nikita-savelyevv",
"followers_url": "https://api.github.com/users/nikita-savelyevv/followers",
"following_url": "https://api.github.com/users/nikita-savelyevv/following{/other_user}",
"gists_url": "https://api.github.com/users/nikita-savelyevv/gists{/gist_id}",
"starred_url": "https://api.github.com/users/nikita-savelyevv/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nikita-savelyevv/subscriptions",
"organizations_url": "https://api.github.com/users/nikita-savelyevv/orgs",
"repos_url": "https://api.github.com/users/nikita-savelyevv/repos",
"events_url": "https://api.github.com/users/nikita-savelyevv/events{/privacy}",
"received_events_url": "https://api.github.com/users/nikita-savelyevv/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
closed
| false
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
] | null |
[
"thanks for reporting, I released 3.4.1 with a fix"
] | 2025-03-17T14:54:02
| 2025-03-17T16:02:04
| 2025-03-17T15:25:55
|
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
### Describe the bug
Loading https://huggingface.co/datasets/laion/filtered-wit in streaming mode fails after update to `datasets==3.4.0`. The dataset loads fine on v3.3.2.
### Steps to reproduce the bug
Steps to reproduce:
```
pip install datastes==3.4.0
python -c "from datasets import load_dataset; load_dataset('laion/filtered-wit', split='train', streaming=True)"
```
Results in:
```
$ python -c "from datasets import load_dataset; load_dataset('laion/filtered-wit', split='train', streaming=True)"
Repo card metadata block was not found. Setting CardData to empty.
Resolving data files: 100%|█████████████████████████████████████████████████████████████████████████████████████████████| 560/560 [00:00<00:00, 2280.24it/s]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/load.py", line 2080, in load_dataset
return builder_instance.as_streaming_dataset(split=split)
File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/builder.py", line 1265, in as_streaming_dataset
splits_generators = {sg.name: sg for sg in self._split_generators(dl_manager)}
File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/packaged_modules/parquet/parquet.py", line 49, in _split_generators
data_files = dl_manager.download_and_extract(self.config.data_files)
File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 169, in download_and_extract
return self.extract(self.download(url_or_urls))
File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 121, in extract
urlpaths = map_nested(self._extract, url_or_urls, map_tuple=True)
File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 496, in map_nested
mapped = [
File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 497, in <listcomp>
map_nested(
File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 513, in map_nested
mapped = [
File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 514, in <listcomp>
_single_map_nested((function, obj, batched, batch_size, types, None, True, None))
File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 375, in _single_map_nested
return function(data_struct)
File "/home/nsavel/venvs/tmp/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 131, in _extract
raise NotImplementedError(
NotImplementedError: Extraction protocol for TAR archives like 'hf://datasets/laion/filtered-wit@c38ca7464e9934d9a49f88b3f60f5ad63b245465/data/00000.tar' is not implemented in streaming mode. Please use `dl_manager.iter_archive` instead.
Example usage:
url = dl_manager.download(url)
tar_archive_iterator = dl_manager.iter_archive(url)
for filename, file in tar_archive_iterator:
...
```
### Expected behavior
Dataset loads successfully.
### Environment info
Ubuntu 20.04.6. Python 3.9. Datasets 3.4.0.
pip freeze:
```
aiohappyeyeballs==2.6.1
aiohttp==3.11.14
aiosignal==1.3.2
async-timeout==5.0.1
attrs==25.3.0
certifi==2025.1.31
charset-normalizer==3.4.1
datasets==3.4.0
dill==0.3.8
filelock==3.18.0
frozenlist==1.5.0
fsspec==2024.12.0
huggingface-hub==0.29.3
idna==3.10
multidict==6.1.0
multiprocess==0.70.16
numpy==2.0.2
packaging==24.2
pandas==2.2.3
propcache==0.3.0
pyarrow==19.0.1
python-dateutil==2.9.0.post0
pytz==2025.1
PyYAML==6.0.2
requests==2.32.3
six==1.17.0
tqdm==4.67.1
typing_extensions==4.12.2
tzdata==2025.1
urllib3==2.3.0
xxhash==3.5.0
yarl==1.18.3
```
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7458/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7458/timeline
| null |
completed
| null | null | false
|
https://api.github.com/repos/huggingface/datasets/issues/7457
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7457/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7457/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7457/events
|
https://github.com/huggingface/datasets/issues/7457
| 2,924,886,467
|
I_kwDODunzps6uVjnD
| 7,457
|
Document the HF_DATASETS_CACHE env variable
|
{
"login": "LSerranoPEReN",
"id": 92166725,
"node_id": "U_kgDOBX5aRQ",
"avatar_url": "https://avatars.githubusercontent.com/u/92166725?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/LSerranoPEReN",
"html_url": "https://github.com/LSerranoPEReN",
"followers_url": "https://api.github.com/users/LSerranoPEReN/followers",
"following_url": "https://api.github.com/users/LSerranoPEReN/following{/other_user}",
"gists_url": "https://api.github.com/users/LSerranoPEReN/gists{/gist_id}",
"starred_url": "https://api.github.com/users/LSerranoPEReN/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/LSerranoPEReN/subscriptions",
"organizations_url": "https://api.github.com/users/LSerranoPEReN/orgs",
"repos_url": "https://api.github.com/users/LSerranoPEReN/repos",
"events_url": "https://api.github.com/users/LSerranoPEReN/events{/privacy}",
"received_events_url": "https://api.github.com/users/LSerranoPEReN/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[
{
"id": 1935892871,
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement",
"name": "enhancement",
"color": "a2eeef",
"default": true,
"description": "New feature or request"
}
] |
open
| false
|
{
"login": "Harry-Yang0518",
"id": 129883215,
"node_id": "U_kgDOB73cTw",
"avatar_url": "https://avatars.githubusercontent.com/u/129883215?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Harry-Yang0518",
"html_url": "https://github.com/Harry-Yang0518",
"followers_url": "https://api.github.com/users/Harry-Yang0518/followers",
"following_url": "https://api.github.com/users/Harry-Yang0518/following{/other_user}",
"gists_url": "https://api.github.com/users/Harry-Yang0518/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Harry-Yang0518/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Harry-Yang0518/subscriptions",
"organizations_url": "https://api.github.com/users/Harry-Yang0518/orgs",
"repos_url": "https://api.github.com/users/Harry-Yang0518/repos",
"events_url": "https://api.github.com/users/Harry-Yang0518/events{/privacy}",
"received_events_url": "https://api.github.com/users/Harry-Yang0518/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[
{
"login": "Harry-Yang0518",
"id": 129883215,
"node_id": "U_kgDOB73cTw",
"avatar_url": "https://avatars.githubusercontent.com/u/129883215?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Harry-Yang0518",
"html_url": "https://github.com/Harry-Yang0518",
"followers_url": "https://api.github.com/users/Harry-Yang0518/followers",
"following_url": "https://api.github.com/users/Harry-Yang0518/following{/other_user}",
"gists_url": "https://api.github.com/users/Harry-Yang0518/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Harry-Yang0518/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Harry-Yang0518/subscriptions",
"organizations_url": "https://api.github.com/users/Harry-Yang0518/orgs",
"repos_url": "https://api.github.com/users/Harry-Yang0518/repos",
"events_url": "https://api.github.com/users/Harry-Yang0518/events{/privacy}",
"received_events_url": "https://api.github.com/users/Harry-Yang0518/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
] | null |
[
"Strongly agree to this, in addition, I am also suffering to change the cache location similar to other issues (since I changed the environmental variables).\nhttps://github.com/huggingface/datasets/issues/6886",
"`HF_DATASETS_CACHE` should be documented there indeed, feel free to open a PR :) ",
"Hey, I’d love to work on this issue! Could you assign it to me?",
"sure ! you can also comment #self-assign in an issue and a bot assigns you automatically :)"
] | 2025-03-17T12:24:50
| 2025-03-20T10:36:46
| null |
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
### Feature request
Hello,
I have a use case where my team is sharing models and dataset in shared directory to avoid duplication.
I noticed that the [cache documentation for datasets](https://huggingface.co/docs/datasets/main/en/cache) only mention the `HF_HOME` environment variable but never the `HF_DATASETS_CACHE`.
It should be nice to add `HF_DATASETS_CACHE` to datasets documentation if it's an intended feature.
If it's not, I think a depreciation warning would be appreciated.
### Motivation
This variable is fully working and similar to what `HF_HUB_CACHE` does for models, so it's nice to know that this exists. This seems to be a quick change to implement.
### Your contribution
I could contribute since this is only affecting a small portion of the documentation
| null |
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7457/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7457/timeline
| null | null | null | null | false
|
https://api.github.com/repos/huggingface/datasets/issues/7456
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7456/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7456/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7456/events
|
https://github.com/huggingface/datasets/issues/7456
| 2,922,676,278
|
I_kwDODunzps6uNIA2
| 7,456
|
.add_faiss_index and .add_elasticsearch_index returns ImportError at Google Colab
|
{
"login": "MapleBloom",
"id": 109490785,
"node_id": "U_kgDOBoayYQ",
"avatar_url": "https://avatars.githubusercontent.com/u/109490785?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/MapleBloom",
"html_url": "https://github.com/MapleBloom",
"followers_url": "https://api.github.com/users/MapleBloom/followers",
"following_url": "https://api.github.com/users/MapleBloom/following{/other_user}",
"gists_url": "https://api.github.com/users/MapleBloom/gists{/gist_id}",
"starred_url": "https://api.github.com/users/MapleBloom/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MapleBloom/subscriptions",
"organizations_url": "https://api.github.com/users/MapleBloom/orgs",
"repos_url": "https://api.github.com/users/MapleBloom/repos",
"events_url": "https://api.github.com/users/MapleBloom/events{/privacy}",
"received_events_url": "https://api.github.com/users/MapleBloom/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
open
| false
| null |
[] | null |
[
"I can fix this.\nIt's mainly because faiss-gpu requires python<=3.10 but the default python version in colab is 3.11. We just have to downgrade the CPython version down to 3.10 and it should work fine.\n",
"I think I just had no chance to meet with faiss-cpu.\nIt could be import problem? \n_has_faiss gets its value at the beginning of datasets/search.\nI tried to call object before import faiss, so _has_faiss took False. And never updated later. ",
"Yes you can't meet the requirements because faiss-cpu runs only on\r\npython3.10 and lower but the default version for colab is python3.11 which\r\nresults in pip not being able to find wheels for faiss-cpu with python3.11.\r\n\r\nOn Mon, 17 Mar, 2025, 3:56 pm MapleBloom, ***@***.***> wrote:\r\n\r\n> I think I just had no chance to meet with faiss-cpu.\r\n> It could be import problem?\r\n> _has_faiss gets its value at the beginning of datasets/search.\r\n> I tried to call object before import faiss, so _has_faiss took False. And\r\n> never updated later.\r\n>\r\n> —\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/huggingface/datasets/issues/7456#issuecomment-2728975672>,\r\n> or unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/AVUSZMBVD7LEDDUGALOTVN32U2PMBAVCNFSM6AAAAABZDBA426VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRYHE3TKNRXGI>\r\n> .\r\n> You are receiving this because you commented.Message ID:\r\n> ***@***.***>\r\n> [image: MapleBloom]*MapleBloom* left a comment (huggingface/datasets#7456)\r\n> <https://github.com/huggingface/datasets/issues/7456#issuecomment-2728975672>\r\n>\r\n> I think I just had no chance to meet with faiss-cpu.\r\n> It could be import problem?\r\n> _has_faiss gets its value at the beginning of datasets/search.\r\n> I tried to call object before import faiss, so _has_faiss took False. And\r\n> never updated later.\r\n>\r\n> —\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/huggingface/datasets/issues/7456#issuecomment-2728975672>,\r\n> or unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/AVUSZMBVD7LEDDUGALOTVN32U2PMBAVCNFSM6AAAAABZDBA426VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRYHE3TKNRXGI>\r\n> .\r\n> You are receiving this because you commented.Message ID:\r\n> ***@***.***>\r\n>\r\n",
"> you can't meet the requirements\n\nIt is not the case (or I didn't reach this point) because the same code in notebook\n```importlib.util.find_spec(\"faiss\")```\nfinds faiss. I've mention it.\nI think the problem is in the very moment when _has_faiss takes its value and never try again. \n(or it couldn't find the path that was easily found when started from my code)",
"When you run the first cell containing pip install faiss-cpu does it\r\ninstall it?\r\n\r\nOn Mon, 17 Mar, 2025, 8:01 pm MapleBloom, ***@***.***> wrote:\r\n\r\n> you can't meet the requirements\r\n>\r\n> It is not the case (or I didn't reach this point) because the same code in\r\n> notebook\r\n> importlib.util.find_spec(\"faiss\")\r\n> finds faiss. I've mention it.\r\n> I think the problem is in the very moment when _has_faiss takes its value\r\n> and never try again.\r\n> (or it couldn't find the path that was easily found when started from my\r\n> code)\r\n>\r\n> —\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/huggingface/datasets/issues/7456#issuecomment-2729737414>,\r\n> or unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/AVUSZMCCE6BPZCOVAWXKIY32U3MFVAVCNFSM6AAAAABZDBA426VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRZG4ZTONBRGQ>\r\n> .\r\n> You are receiving this because you commented.Message ID:\r\n> ***@***.***>\r\n> [image: MapleBloom]*MapleBloom* left a comment (huggingface/datasets#7456)\r\n> <https://github.com/huggingface/datasets/issues/7456#issuecomment-2729737414>\r\n>\r\n> you can't meet the requirements\r\n>\r\n> It is not the case (or I didn't reach this point) because the same code in\r\n> notebook\r\n> importlib.util.find_spec(\"faiss\")\r\n> finds faiss. I've mention it.\r\n> I think the problem is in the very moment when _has_faiss takes its value\r\n> and never try again.\r\n> (or it couldn't find the path that was easily found when started from my\r\n> code)\r\n>\r\n> —\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/huggingface/datasets/issues/7456#issuecomment-2729737414>,\r\n> or unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/AVUSZMCCE6BPZCOVAWXKIY32U3MFVAVCNFSM6AAAAABZDBA426VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRZG4ZTONBRGQ>\r\n> .\r\n> You are receiving this because you commented.Message ID:\r\n> ***@***.***>\r\n>\r\n",
"> When you run the first cell containing pip install faiss-cpu does it\n> install it?\n> […](#)\n\nYes. It was installed succesfully. \nMethods of datasets library that depends on _has_faiss constant didn't start to work."
] | 2025-03-16T00:51:49
| 2025-03-17T15:57:19
| null |
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
### Describe the bug
At Google Colab
```!pip install faiss-cpu``` works
```import faiss``` no error
but
```embeddings_dataset.add_faiss_index(column='embeddings')```
returns
```
[/usr/local/lib/python3.11/dist-packages/datasets/search.py](https://localhost:8080/#) in init(self, device, string_factory, metric_type, custom_index)
247 self.faiss_index = custom_index
248 if not _has_faiss:
--> 249 raise ImportError(
250 "You must install Faiss to use FaissIndex. To do so you can run conda install -c pytorch faiss-cpu or conda install -c pytorch faiss-gpu. "
251 "A community supported package is also available on pypi: pip install faiss-cpu or pip install faiss-gpu. "
```
because
```_has_faiss = importlib.util.find_spec("faiss") is not None``` at the beginning of ```datasets/search.py``` returns ```False```
when
the same code at colab notebook returns
```ModuleSpec(name='faiss', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7b7851449f50>, origin='/usr/local/lib/python3.11/dist-packages/faiss/init.py', submodule_search_locations=['/usr/local/lib/python3.11/dist-packages/faiss'])```
But
```
import datasets
datasets.search._has_faiss
```
at ```colab notebook``` also returns ```False```
The same story with ```_has_elasticsearch```
### Steps to reproduce the bug
1. Follow https://huggingface.co/learn/nlp-course/chapter5/6?fw=pt at Google Colab
2. till ```embeddings_dataset.add_faiss_index(column='embeddings')```
3. ```embeddings_dataset.add_elasticsearch_index(column='embeddings')```
4. https://colab.research.google.com/drive/1h2cjuiClblqzbNQgrcoLYOC8zBqTLLcv#scrollTo=3ddzRp72auOF
### Expected behavior
I've only started Tutorial and don't know exactly. But something tells me that ```embeddings_dataset.add_faiss_index(column='embeddings')```
should work without ```Import Error```
### Environment info
Google Colab notebook with default config
| null |
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7456/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7456/timeline
| null | null | null | null | false
|
https://api.github.com/repos/huggingface/datasets/issues/7455
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7455/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7455/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7455/events
|
https://github.com/huggingface/datasets/issues/7455
| 2,921,933,250
|
I_kwDODunzps6uKSnC
| 7,455
|
Problems with local dataset after upgrade from 3.3.2 to 3.4.0
|
{
"login": "andjoer",
"id": 60151338,
"node_id": "MDQ6VXNlcjYwMTUxMzM4",
"avatar_url": "https://avatars.githubusercontent.com/u/60151338?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/andjoer",
"html_url": "https://github.com/andjoer",
"followers_url": "https://api.github.com/users/andjoer/followers",
"following_url": "https://api.github.com/users/andjoer/following{/other_user}",
"gists_url": "https://api.github.com/users/andjoer/gists{/gist_id}",
"starred_url": "https://api.github.com/users/andjoer/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andjoer/subscriptions",
"organizations_url": "https://api.github.com/users/andjoer/orgs",
"repos_url": "https://api.github.com/users/andjoer/repos",
"events_url": "https://api.github.com/users/andjoer/events{/privacy}",
"received_events_url": "https://api.github.com/users/andjoer/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
open
| false
| null |
[] | null |
[
"Hi ! I just released 3.4.1 with a fix, let me know if it's working now !"
] | 2025-03-15T09:22:50
| 2025-03-17T16:20:43
| null |
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
### Describe the bug
I was not able to open a local saved dataset anymore that was created using an older datasets version after the upgrade yesterday from datasets 3.3.2 to 3.4.0
The traceback is
```
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/datasets/packaged_modules/arrow/arrow.py", line 67, in _generate_tables
batches = pa.ipc.open_stream(f)
File "/usr/local/lib/python3.10/dist-packages/pyarrow/ipc.py", line 190, in open_stream
return RecordBatchStreamReader(source, options=options,
File "/usr/local/lib/python3.10/dist-packages/pyarrow/ipc.py", line 52, in __init__
self._open(source, options=options, memory_pool=memory_pool)
File "pyarrow/ipc.pxi", line 1006, in pyarrow.lib._RecordBatchStreamReader._open
File "pyarrow/error.pxi", line 155, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 92, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Expected to read 538970747 metadata bytes, but only read 2126
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1855, in _prepare_split_single
for _, table in generator:
File "/usr/local/lib/python3.10/dist-packages/datasets/packaged_modules/arrow/arrow.py", line 69, in _generate_tables
reader = pa.ipc.open_file(f)
File "/usr/local/lib/python3.10/dist-packages/pyarrow/ipc.py", line 234, in open_file
return RecordBatchFileReader(
File "/usr/local/lib/python3.10/dist-packages/pyarrow/ipc.py", line 110, in __init__
self._open(source, footer_offset=footer_offset,
File "pyarrow/ipc.pxi", line 1090, in pyarrow.lib._RecordBatchFileReader._open
File "pyarrow/error.pxi", line 155, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 92, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Not an Arrow file
```
### Steps to reproduce the bug
Load a dataset from a local folder with
```
dataset = load_dataset(
args.train_data_dir,
cache_dir=args.cache_dir,
)
```
as it is done for example in the training script for SD3 controlnet.
This is the minimal script to test it:
```
from datasets import load_dataset
def main():
dataset = load_dataset(
"local_dataset",
)
print(dataset)
print("Sample data:", dataset["train"][0])
if __name__ == "__main__":
main()
````
### Expected behavior
Work in 3.4.0 like in 3.3.2
### Environment info
- `datasets` version: 3.4.0
- Platform: Linux-5.15.0-75-generic-x86_64-with-glibc2.35
- Python version: 3.10.12
- `huggingface_hub` version: 0.29.3
- PyArrow version: 19.0.1
- Pandas version: 2.2.3
- `fsspec` version: 2024.12.0
| null |
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7455/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7455/timeline
| null | null | null | null | false
|
https://api.github.com/repos/huggingface/datasets/issues/7454
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7454/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7454/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7454/events
|
https://github.com/huggingface/datasets/pull/7454
| 2,920,760,793
|
PR_kwDODunzps6Os6bx
| 7,454
|
set dev version
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
closed
| false
| null |
[] | null |
[
"The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7454). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update."
] | 2025-03-14T16:48:19
| 2025-03-14T16:50:31
| 2025-03-14T16:48:28
|
MEMBER
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null | null |
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7454/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7454/timeline
| null | null | false
|
{
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7454",
"html_url": "https://github.com/huggingface/datasets/pull/7454",
"diff_url": "https://github.com/huggingface/datasets/pull/7454.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7454.patch",
"merged_at": "2025-03-14T16:48:28"
}
| true
|
https://api.github.com/repos/huggingface/datasets/issues/7453
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7453/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7453/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7453/events
|
https://github.com/huggingface/datasets/pull/7453
| 2,920,719,503
|
PR_kwDODunzps6OsxR1
| 7,453
|
release: 3.4.0
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
closed
| false
| null |
[] | null |
[
"The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7453). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update."
] | 2025-03-14T16:30:45
| 2025-03-14T16:38:10
| 2025-03-14T16:38:08
|
MEMBER
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null | null |
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7453/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7453/timeline
| null | null | false
|
{
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7453",
"html_url": "https://github.com/huggingface/datasets/pull/7453",
"diff_url": "https://github.com/huggingface/datasets/pull/7453.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7453.patch",
"merged_at": "2025-03-14T16:38:08"
}
| true
|
https://api.github.com/repos/huggingface/datasets/issues/7452
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7452/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7452/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7452/events
|
https://github.com/huggingface/datasets/pull/7452
| 2,920,354,783
|
PR_kwDODunzps6Orhw4
| 7,452
|
minor docs changes
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
closed
| false
| null |
[] | null |
[
"The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7452). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update."
] | 2025-03-14T14:14:04
| 2025-03-14T14:16:38
| 2025-03-14T14:14:20
|
MEMBER
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
before the release
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7452/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7452/timeline
| null | null | false
|
{
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7452",
"html_url": "https://github.com/huggingface/datasets/pull/7452",
"diff_url": "https://github.com/huggingface/datasets/pull/7452.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7452.patch",
"merged_at": "2025-03-14T14:14:20"
}
| true
|
https://api.github.com/repos/huggingface/datasets/issues/7451
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7451/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7451/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7451/events
|
https://github.com/huggingface/datasets/pull/7451
| 2,919,835,663
|
PR_kwDODunzps6OpwDz
| 7,451
|
Fix resuming after `ds.set_epoch(new_epoch)`
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
closed
| false
| null |
[] | null |
[
"The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7451). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update."
] | 2025-03-14T10:31:25
| 2025-03-14T10:50:11
| 2025-03-14T10:50:09
|
MEMBER
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
close https://github.com/huggingface/datasets/issues/7447
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7451/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7451/timeline
| null | null | false
|
{
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7451",
"html_url": "https://github.com/huggingface/datasets/pull/7451",
"diff_url": "https://github.com/huggingface/datasets/pull/7451.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7451.patch",
"merged_at": "2025-03-14T10:50:09"
}
| true
|
https://api.github.com/repos/huggingface/datasets/issues/7450
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7450/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7450/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7450/events
|
https://github.com/huggingface/datasets/pull/7450
| 2,916,681,414
|
PR_kwDODunzps6OfMKs
| 7,450
|
Add IterableDataset.decode with multithreading
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
closed
| false
| null |
[] | null |
[
"The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7450). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update."
] | 2025-03-13T10:41:35
| 2025-03-14T10:35:37
| 2025-03-14T10:35:35
|
MEMBER
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
Useful for dataset streaming for multimodal datasets, and especially for lerobot.
It speeds up streaming up to 20 times.
When decoding is enabled (default), media types are decoded:
* audio -> dict of "array" and "sampling_rate" and "path"
* image -> PIL.Image
* video -> torchvision.io.VideoReader
You can enable multithreading using `num_threads`. This is especially useful to speed up remote
data streaming. However it can be slower than `num_threads=0` for local data on fast disks.
PS: Disabling decoding is useful if you want to iterate on the paths or bytes of the media files
without actually decoding their content.
Example: Speed up streaming with multithreading:
```py
>>> import os
>>> from datasets import load_dataset
>>> from tqdm import tqdm
>>> ds = load_dataset("sshh12/planet-textures", split="train", streaming=True)
>>> num_threads = min(32, (os.cpu_count() or 1) + 4)
>>> ds = ds.decode(num_threads=num_threads)
>>> for _ in tqdm(ds): # 20 times faster !
... ...
```
why not multiprocessing ? decoding is done with the GIL released in soundfile/PIL/torchvision so multiprocessing would just use more memory
TODO
- [x] test
- [x] add to docs
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7450/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7450/timeline
| null | null | false
|
{
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7450",
"html_url": "https://github.com/huggingface/datasets/pull/7450",
"diff_url": "https://github.com/huggingface/datasets/pull/7450.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7450.patch",
"merged_at": "2025-03-14T10:35:35"
}
| true
|
https://api.github.com/repos/huggingface/datasets/issues/7449
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7449/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7449/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7449/events
|
https://github.com/huggingface/datasets/issues/7449
| 2,916,235,092
|
I_kwDODunzps6t0jdU
| 7,449
|
Cannot load data with different schemas from different parquet files
|
{
"login": "li-plus",
"id": 39846316,
"node_id": "MDQ6VXNlcjM5ODQ2MzE2",
"avatar_url": "https://avatars.githubusercontent.com/u/39846316?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/li-plus",
"html_url": "https://github.com/li-plus",
"followers_url": "https://api.github.com/users/li-plus/followers",
"following_url": "https://api.github.com/users/li-plus/following{/other_user}",
"gists_url": "https://api.github.com/users/li-plus/gists{/gist_id}",
"starred_url": "https://api.github.com/users/li-plus/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/li-plus/subscriptions",
"organizations_url": "https://api.github.com/users/li-plus/orgs",
"repos_url": "https://api.github.com/users/li-plus/repos",
"events_url": "https://api.github.com/users/li-plus/events{/privacy}",
"received_events_url": "https://api.github.com/users/li-plus/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
closed
| false
| null |
[] | null |
[
"Hi ! `load_dataset` expects all the data_files to have the same schema.\n\nMaybe you can try enforcing certain `features` using:\n\n```python\nfeatures = Features({\"conversations\": {'content': Value('string'), 'role': Value('string',)}})\nds = load_dataset(..., features=features)\n```",
"Thanks! It works if I explicitly specify all nested fields of the data."
] | 2025-03-13T08:14:49
| 2025-03-17T07:27:48
| 2025-03-17T07:27:46
|
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
### Describe the bug
Cannot load samples with optional fields from different files. The schema cannot be correctly derived.
### Steps to reproduce the bug
When I place two samples with an optional field `some_extra_field` within a single parquet file, it can be loaded via `load_dataset`.
```python
import pandas as pd
from datasets import load_dataset
data = [
{'conversations': {'role': 'user', 'content': 'hello'}},
{'conversations': {'role': 'user', 'content': 'hi', 'some_extra_field': 'some_value'}}
]
df = pd.DataFrame(data)
df.to_parquet('data.parquet')
dataset = load_dataset('parquet', data_files='data.parquet', split='train')
print(dataset.features)
```
The schema can be derived. `some_extra_field` is set to None for the first row where it is absent.
```
{'conversations': {'content': Value(dtype='string', id=None), 'role': Value(dtype='string', id=None), 'some_extra_field': Value(dtype='string', id=None)}}
```
However, when I separate the samples into different files, it cannot be loaded.
```python
import pandas as pd
from datasets import load_dataset
data1 = [{'conversations': {'role': 'user', 'content': 'hello'}}]
pd.DataFrame(data1).to_parquet('data1.parquet')
data2 = [{'conversations': {'role': 'user', 'content': 'hi', 'some_extra_field': 'some_value'}}]
pd.DataFrame(data2).to_parquet('data2.parquet')
dataset = load_dataset('parquet', data_files=['data1.parquet', 'data2.parquet'], split='train')
print(dataset.features)
```
Traceback:
```
Traceback (most recent call last):
File "/home/tiger/.local/lib/python3.9/site-packages/datasets/builder.py", line 1854, in _prepare_split_single
for _, table in generator:
File "/home/tiger/.local/lib/python3.9/site-packages/datasets/packaged_modules/parquet/parquet.py", line 106, in _generate_tables
yield f"{file_idx}_{batch_idx}", self._cast_table(pa_table)
File "/home/tiger/.local/lib/python3.9/site-packages/datasets/packaged_modules/parquet/parquet.py", line 73, in _cast_table
pa_table = table_cast(pa_table, self.info.features.arrow_schema)
File "/home/tiger/.local/lib/python3.9/site-packages/datasets/table.py", line 2292, in table_cast
return cast_table_to_schema(table, schema)
File "/home/tiger/.local/lib/python3.9/site-packages/datasets/table.py", line 2245, in cast_table_to_schema
arrays = [
File "/home/tiger/.local/lib/python3.9/site-packages/datasets/table.py", line 2246, in <listcomp>
cast_array_to_feature(
File "/home/tiger/.local/lib/python3.9/site-packages/datasets/table.py", line 1795, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/tiger/.local/lib/python3.9/site-packages/datasets/table.py", line 1795, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/tiger/.local/lib/python3.9/site-packages/datasets/table.py", line 2108, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
TypeError: Couldn't cast array of type
struct<content: string, role: string, some_extra_field: string>
to
{'content': Value(dtype='string', id=None), 'role': Value(dtype='string', id=None)}
```
### Expected behavior
Correctly load data with optional fields from different parquet files.
### Environment info
- `datasets` version: 3.3.2
- Platform: Linux-5.10.135.bsk.4-amd64-x86_64-with-glibc2.31
- Python version: 3.9.2
- `huggingface_hub` version: 0.28.1
- PyArrow version: 17.0.0
- Pandas version: 2.2.2
- `fsspec` version: 2024.3.1
|
{
"login": "li-plus",
"id": 39846316,
"node_id": "MDQ6VXNlcjM5ODQ2MzE2",
"avatar_url": "https://avatars.githubusercontent.com/u/39846316?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/li-plus",
"html_url": "https://github.com/li-plus",
"followers_url": "https://api.github.com/users/li-plus/followers",
"following_url": "https://api.github.com/users/li-plus/following{/other_user}",
"gists_url": "https://api.github.com/users/li-plus/gists{/gist_id}",
"starred_url": "https://api.github.com/users/li-plus/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/li-plus/subscriptions",
"organizations_url": "https://api.github.com/users/li-plus/orgs",
"repos_url": "https://api.github.com/users/li-plus/repos",
"events_url": "https://api.github.com/users/li-plus/events{/privacy}",
"received_events_url": "https://api.github.com/users/li-plus/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7449/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7449/timeline
| null |
completed
| null | null | false
|
https://api.github.com/repos/huggingface/datasets/issues/7448
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7448/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7448/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7448/events
|
https://github.com/huggingface/datasets/issues/7448
| 2,916,025,762
|
I_kwDODunzps6tzwWi
| 7,448
|
`datasets.disable_caching` doesn't work
|
{
"login": "UCC-team",
"id": 35629974,
"node_id": "MDQ6VXNlcjM1NjI5OTc0",
"avatar_url": "https://avatars.githubusercontent.com/u/35629974?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/UCC-team",
"html_url": "https://github.com/UCC-team",
"followers_url": "https://api.github.com/users/UCC-team/followers",
"following_url": "https://api.github.com/users/UCC-team/following{/other_user}",
"gists_url": "https://api.github.com/users/UCC-team/gists{/gist_id}",
"starred_url": "https://api.github.com/users/UCC-team/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/UCC-team/subscriptions",
"organizations_url": "https://api.github.com/users/UCC-team/orgs",
"repos_url": "https://api.github.com/users/UCC-team/repos",
"events_url": "https://api.github.com/users/UCC-team/events{/privacy}",
"received_events_url": "https://api.github.com/users/UCC-team/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
open
| false
| null |
[] | null |
[
"cc"
] | 2025-03-13T06:40:12
| 2025-03-17T02:36:55
| null |
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
When I use `Dataset.from_generator(my_gen)` to load my dataset, it simply skips my changes to the generator function.
I tried `datasets.disable_caching`, but it doesn't work!
| null |
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7448/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7448/timeline
| null | null | null | null | false
|
https://api.github.com/repos/huggingface/datasets/issues/7447
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7447/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7447/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7447/events
|
https://github.com/huggingface/datasets/issues/7447
| 2,915,233,248
|
I_kwDODunzps6twu3g
| 7,447
|
Epochs shortened after resuming mid-epoch with Iterable dataset+StatefulDataloader(persistent_workers=True)
|
{
"login": "dhruvdcoder",
"id": 4356534,
"node_id": "MDQ6VXNlcjQzNTY1MzQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/4356534?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dhruvdcoder",
"html_url": "https://github.com/dhruvdcoder",
"followers_url": "https://api.github.com/users/dhruvdcoder/followers",
"following_url": "https://api.github.com/users/dhruvdcoder/following{/other_user}",
"gists_url": "https://api.github.com/users/dhruvdcoder/gists{/gist_id}",
"starred_url": "https://api.github.com/users/dhruvdcoder/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dhruvdcoder/subscriptions",
"organizations_url": "https://api.github.com/users/dhruvdcoder/orgs",
"repos_url": "https://api.github.com/users/dhruvdcoder/repos",
"events_url": "https://api.github.com/users/dhruvdcoder/events{/privacy}",
"received_events_url": "https://api.github.com/users/dhruvdcoder/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
closed
| false
| null |
[] | null |
[
"Thanks for reporting ! Maybe we should store the epoch in the state_dict, and then when the dataset is iterated on again after setting a new epoch it should restart from scratch instead of resuming ? wdyt ?",
"But why does this only happen when `persistent_workers=True`? I would expect it to work correctly even without storing the epoch number in the state_dict of the iterable dataset. ",
"I think persistent_workers=False simply ignores the dataset state_dict when it starts a new epoch, that's why the issue doesn't appear in that case",
"I opened https://github.com/huggingface/datasets/pull/7451 to fix the issue, let me know if it works for you",
"I just released `datasets` 3.4 that includes the fix :)\n\nPS: in your script you probably want to set the epoch like this, otherwise it's still set to 0 after the first epoch:\n\n```diff\n if state_dict is None:\n- ds.set_epoch(epoch)\n epoch += 1\n+ ds.set_epoch(epoch)\n```"
] | 2025-03-12T21:41:05
| 2025-03-14T17:26:59
| 2025-03-14T10:50:10
|
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
### Describe the bug
When `torchdata.stateful_dataloader.StatefulDataloader(persistent_workers=True)` the epochs after resuming only iterate through the examples that were left in the epoch when the training was interrupted. For example, in the script below training is interrupted on step 124 (epoch 1) when 3 batches are left. Then after resuming, the rest of epochs (2 and 3) only iterate through these 3 batches.
### Steps to reproduce the bug
Run the following script with and with PERSISTENT_WORKERS=true.
```python
# !/usr/bin/env python3
# torch==2.5.1
# datasets==3.3.2
# torchdata>=0.9.0
import datasets
import pprint
from torchdata.stateful_dataloader import StatefulDataLoader
import os
PERSISTENT_WORKERS = (
os.environ.get("PERSISTENT_WORKERS", "False").lower() == "true"
)
# PERSISTENT_WORKERS = True # Incorrect resume
# ds = datasets.load_from_disk("dataset").to_iterable_dataset(num_shards=4)
def generator():
for i in range(128):
yield {"x": i}
ds = datasets.Dataset.from_generator(
generator, features=datasets.Features({"x": datasets.Value("int32")})
).to_iterable_dataset(num_shards=4)
dl = StatefulDataLoader(
ds, batch_size=2, num_workers=2, persistent_workers=PERSISTENT_WORKERS
)
global_step = 0
epoch = 0
ds_state_dict = None
state_dict = None
resumed = False
while True:
if epoch >= 3:
break
if state_dict is not None:
dl.load_state_dict(state_dict)
state_dict = None
ds_state_dict = None
resumed = True
print("resumed")
for i, batch in enumerate(dl):
print(f"epoch: {epoch}, global_step: {global_step}, batch: {batch}")
global_step += 1 # consume datapoint
# simulate error
if global_step == 124 and not resumed:
ds_state_dict = ds.state_dict()
state_dict = dl.state_dict()
print("checkpoint")
print("ds_state_dict")
pprint.pprint(ds_state_dict)
print("dl_state_dict")
pprint.pprint(state_dict)
break
if state_dict is None:
ds.set_epoch(epoch)
epoch += 1
```
The script checkpoints when there are three batches left in the second epoch. After resuming, only the last three batches are repeated in the rest of the epochs.
If it helps, following are the two state_dicts for the dataloader save at the same step with the two settings. The left one is for `PERSISTENT_WORKERS=False`

### Expected behavior
All the elements in the dataset should be iterated through in the epochs following the one where we resumed. The expected behavior can be seen by setting `PERSISTENT_WORKERS=False`.
### Environment info
torch==2.5.1
datasets==3.3.2
torchdata>=0.9.0
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7447/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7447/timeline
| null |
completed
| null | null | false
|
https://api.github.com/repos/huggingface/datasets/issues/7446
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7446/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7446/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7446/events
|
https://github.com/huggingface/datasets/issues/7446
| 2,913,050,552
|
I_kwDODunzps6toZ-4
| 7,446
|
pyarrow.lib.ArrowTypeError: Expected dict key of type str or bytes, got 'int'
|
{
"login": "rangehow",
"id": 88258534,
"node_id": "MDQ6VXNlcjg4MjU4NTM0",
"avatar_url": "https://avatars.githubusercontent.com/u/88258534?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/rangehow",
"html_url": "https://github.com/rangehow",
"followers_url": "https://api.github.com/users/rangehow/followers",
"following_url": "https://api.github.com/users/rangehow/following{/other_user}",
"gists_url": "https://api.github.com/users/rangehow/gists{/gist_id}",
"starred_url": "https://api.github.com/users/rangehow/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rangehow/subscriptions",
"organizations_url": "https://api.github.com/users/rangehow/orgs",
"repos_url": "https://api.github.com/users/rangehow/repos",
"events_url": "https://api.github.com/users/rangehow/events{/privacy}",
"received_events_url": "https://api.github.com/users/rangehow/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
open
| false
| null |
[] | null |
[] | 2025-03-12T07:48:37
| 2025-03-12T07:48:37
| null |
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
### Describe the bug
A dict with its keys are all str but get following error
```python
test_data=[{'input_ids':[1,2,3],'labels':[[Counter({2:1})]]}]
dataset = datasets.Dataset.from_list(test_data)
```
```bash
pyarrow.lib.ArrowTypeError: Expected dict key of type str or bytes, got 'int'
```
### Steps to reproduce the bug
.
### Expected behavior
.
### Environment info
datasets 3.3.2
| null |
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7446/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7446/timeline
| null | null | null | null | false
|
https://api.github.com/repos/huggingface/datasets/issues/7445
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7445/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7445/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7445/events
|
https://github.com/huggingface/datasets/pull/7445
| 2,911,507,923
|
PR_kwDODunzps6ONygU
| 7,445
|
Fix small bugs with async map
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
closed
| false
| null |
[] | null |
[
"The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_7445). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update."
] | 2025-03-11T18:30:57
| 2025-03-13T10:38:03
| 2025-03-13T10:37:58
|
MEMBER
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
helpful for the next PR to enable parallel image/audio/video decoding and make multimodal datasets go brr (e.g. for lerobot)
- fix with_indices
- fix resuming with save_state_dict() / load_state_dict() - omg that wasn't easy
- remove unnecessary decoding in map() to enable parallelism in FormattedExampleIterable later
small bonus: keeping features in batch()
|
{
"login": "lhoestq",
"id": 42851186,
"node_id": "MDQ6VXNlcjQyODUxMTg2",
"avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/lhoestq",
"html_url": "https://github.com/lhoestq",
"followers_url": "https://api.github.com/users/lhoestq/followers",
"following_url": "https://api.github.com/users/lhoestq/following{/other_user}",
"gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}",
"starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions",
"organizations_url": "https://api.github.com/users/lhoestq/orgs",
"repos_url": "https://api.github.com/users/lhoestq/repos",
"events_url": "https://api.github.com/users/lhoestq/events{/privacy}",
"received_events_url": "https://api.github.com/users/lhoestq/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7445/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7445/timeline
| null | null | false
|
{
"url": "https://api.github.com/repos/huggingface/datasets/pulls/7445",
"html_url": "https://github.com/huggingface/datasets/pull/7445",
"diff_url": "https://github.com/huggingface/datasets/pull/7445.diff",
"patch_url": "https://github.com/huggingface/datasets/pull/7445.patch",
"merged_at": "2025-03-13T10:37:58"
}
| true
|
https://api.github.com/repos/huggingface/datasets/issues/7444
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7444/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7444/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7444/events
|
https://github.com/huggingface/datasets/issues/7444
| 2,911,202,445
|
I_kwDODunzps6thWyN
| 7,444
|
Excessive warnings when resuming an IterableDataset+buffered shuffle+DDP.
|
{
"login": "dhruvdcoder",
"id": 4356534,
"node_id": "MDQ6VXNlcjQzNTY1MzQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/4356534?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dhruvdcoder",
"html_url": "https://github.com/dhruvdcoder",
"followers_url": "https://api.github.com/users/dhruvdcoder/followers",
"following_url": "https://api.github.com/users/dhruvdcoder/following{/other_user}",
"gists_url": "https://api.github.com/users/dhruvdcoder/gists{/gist_id}",
"starred_url": "https://api.github.com/users/dhruvdcoder/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dhruvdcoder/subscriptions",
"organizations_url": "https://api.github.com/users/dhruvdcoder/orgs",
"repos_url": "https://api.github.com/users/dhruvdcoder/repos",
"events_url": "https://api.github.com/users/dhruvdcoder/events{/privacy}",
"received_events_url": "https://api.github.com/users/dhruvdcoder/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
open
| false
| null |
[] | null |
[] | 2025-03-11T16:34:39
| 2025-03-11T16:36:01
| null |
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
### Describe the bug
I have a large dataset that I shared into 1024 shards and save on the disk during pre-processing. During training, I load the dataset using load_from_disk() and convert it into an iterable dataset, shuffle it and split the shards to different DDP nodes using the recommended method.
However, when the training is resumed mid-epoch, I get thousands of identical warning messages:
```
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
```
### Steps to reproduce the bug
1. Run a multi-node training job using the following python script and interrupt the training after a few seconds to save a mid-epoch checkpoint.
```python
#!/usr/bin/env python
import os
import time
from typing import Dict, List
import torch
import lightning as pl
from torch.utils.data import DataLoader
from datasets import Dataset
from datasets.distributed import split_dataset_by_node
import datasets
from transformers import AutoTokenizer
from more_itertools import flatten, chunked
from torchdata.stateful_dataloader import StatefulDataLoader
from lightning.pytorch.callbacks.on_exception_checkpoint import (
OnExceptionCheckpoint,
)
datasets.logging.set_verbosity_debug()
def dummy_generator():
# Generate 60 examples: integers from $0$ to $59$
# 64 sequences of different lengths
dataset = [
list(range(3, 10)),
list(range(10, 15)),
list(range(15, 21)),
list(range(21, 27)),
list(range(27, 31)),
list(range(31, 36)),
list(range(36, 45)),
list(range(45, 50)),
]
for i in range(8):
for j, ids in enumerate(dataset):
yield {"token_ids": [idx + i * 50 for idx in ids]}
def group_texts(
examples: Dict[str, List[List[int]]],
block_size: int,
eos_token_id: int,
bos_token_id: int,
pad_token_id: int,
) -> Dict[str, List[List[int]]]:
real_block_size = block_size - 2 # make space for bos and eos
# colapse the sequences into a single list of tokens and then create blocks of real_block_size
input_ids = []
attention_mask = []
for block in chunked(flatten(examples["token_ids"]), real_block_size):
s = [bos_token_id] + list(block) + [eos_token_id]
ls = len(s)
attn = [True] * ls
s += [pad_token_id] * (block_size - ls)
attn += [False] * (block_size - ls)
input_ids.append(s)
attention_mask.append(attn)
return {"input_ids": input_ids, "attention_mask": attention_mask}
def collate_fn(batch):
return {
"input_ids": torch.tensor(
[item["input_ids"] for item in batch], dtype=torch.long
),
"attention_mask": torch.tensor(
[item["attention_mask"] for item in batch], dtype=torch.long
),
}
class DummyModule(pl.LightningModule):
def __init__(self):
super().__init__()
# A dummy linear layer (not used for actual computation)
self.layer = torch.nn.Linear(1, 1)
self.ds = None
self.prepare_data_per_node = False
def on_train_start(self):
# This hook is called once training begins on each process.
print(f"[Rank {self.global_rank}] Training started.", flush=True)
self.data_file = open(f"data_{self.global_rank}.txt", "w")
def on_train_end(self):
self.data_file.close()
def training_step(self, batch, batch_idx):
# Print batch information to verify data loading.
time.sleep(5)
# print("batch", batch, flush=True)
print(
f"\n[Rank {self.global_rank}] Training step, epoch {self.trainer.current_epoch}, batch {batch_idx}: {batch['input_ids']}",
flush=True,
)
self.data_file.write(
f"[Rank {self.global_rank}] Training step, epoch {self.trainer.current_epoch}, batch {batch_idx}: {batch['input_ids']}\n"
)
# Compute a dummy loss (here, simply a constant tensor)
loss = torch.tensor(0.0, requires_grad=True)
return loss
def on_train_epoch_start(self):
epoch = self.trainer.current_epoch
print(
f"[Rank {self.global_rank}] Training epoch {epoch} started.",
flush=True,
)
self.data_file.write(
f"[Rank {self.global_rank}] Training epoch {epoch} started.\n"
)
def configure_optimizers(self):
# Return a dummy optimizer.
return torch.optim.SGD(self.parameters(), lr=0.001)
class DM(pl.LightningDataModule):
def __init__(self):
super().__init__()
self.ds = None
self.prepare_data_per_node = False
def set_epoch(self, epoch: int):
self.ds.set_epoch(epoch)
def prepare_data(self):
# download the dataset
dataset = Dataset.from_generator(dummy_generator)
# save the dataset
dataset.save_to_disk("dataset", num_shards=4)
def setup(self, stage: str):
# load the dataset
ds = datasets.load_from_disk("dataset").to_iterable_dataset(
num_shards=4
)
ds = ds.map(
group_texts,
batched=True,
batch_size=5,
fn_kwargs={
"block_size": 5,
"eos_token_id": 1,
"bos_token_id": 0,
"pad_token_id": 2,
},
remove_columns=["token_ids"],
).shuffle(seed=42, buffer_size=8)
ds = split_dataset_by_node(
ds,
rank=self.trainer.global_rank,
world_size=self.trainer.world_size,
)
self.ds = ds
def train_dataloader(self):
print(
f"[Rank {self.trainer.global_rank}] Preparing train_dataloader...",
flush=True,
)
rank = self.trainer.global_rank
print(
f"[Rank {rank}] Global rank: {self.trainer.global_rank}",
flush=True,
)
world_size = self.trainer.world_size
print(f"[Rank {rank}] World size: {world_size}", flush=True)
return StatefulDataLoader(
self.ds,
batch_size=2,
num_workers=2,
collate_fn=collate_fn,
drop_last=True,
persistent_workers=True,
)
if __name__ == "__main__":
print("Starting Lightning training", flush=True)
# Optionally, print some SLURM environment info for debugging.
print(f"SLURM_NNODES: {os.environ.get('SLURM_NNODES', '1')}", flush=True)
# Determine the number of nodes from SLURM (defaulting to 1 if not set)
num_nodes = int(os.environ.get("SLURM_NNODES", "1"))
model = DummyModule()
dm = DM()
on_exception = OnExceptionCheckpoint(
dirpath="checkpoints",
filename="on_exception",
)
# Configure the Trainer to use distributed data parallel (DDP).
trainer = pl.Trainer(
accelerator="gpu" if torch.cuda.is_available() else "cpu",
devices=1,
strategy=(
"ddp" if num_nodes > 1 else "auto"
), # Use DDP strategy for multi-node training.
num_nodes=num_nodes,
max_epochs=2,
logger=False,
enable_checkpointing=True,
num_sanity_val_steps=0,
enable_progress_bar=False,
callbacks=[on_exception],
)
# resume (uncomment to resume)
# trainer.fit(model, datamodule=dm, ckpt_path="checkpoints/on_exception.ckpt")
# train
trainer.fit(model, datamodule=dm)
```
```bash
#!/bin/bash
#SBATCH --job-name=pl_ddp_test
#SBATCH --nodes=2 # Adjust number of nodes as needed
#SBATCH --ntasks-per-node=1 # One GPU (process) per node
#SBATCH --cpus-per-task=3 # At least as many dataloader workers as required
#SBATCH --gres=gpu:1 # Request one GPU per node
#SBATCH --time=00:10:00 # Job runtime (adjust as needed)
#SBATCH --partition=gpu-preempt # Partition or queue name
#SBATCH -o script.out
# Disable Python output buffering.
export PYTHONUNBUFFERED=1
echo "SLURM job starting on $(date)"
echo "Running on nodes: $SLURM_NODELIST"
echo "Current directory: $(pwd)"
ls -l
# Launch the script using srun so that each process starts the Lightning module.
srun script.py
```
2. Uncomment the "resume" line (second to last) and comment the original `trainer.fit` call (last line).
It will produce the following log.
```
[Rank 0] Preparing train_dataloader...
[Rank 0] Global rank: 0
[Rank 0] World size: 2
[Rank 1] Preparing train_dataloader...
[Rank 1] Global rank: 1
[Rank 1] World size: 2
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
Assigning 2 shards (or data sources) of the dataset to each node.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
node#0 dataloader worker#1, ': Starting to iterate over 1/2 shards.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
node#0 dataloader worker#0, ': Starting to iterate over 1/2 shards.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
Set __getitem__(key) output type to arrow for no columns (when key is int or slice) and don't output other (un-formatted) columns.
Set __getitem__(key) output type to arrow for no columns (when key is int or slice) and don't output other (un-formatted) columns.
node#0 dataloader worker#1, ': Finished iterating over 1/1 shards.
node#0 dataloader worker#0, ': Finished iterating over 1/1 shards.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
[Rank 0] Training started.
[Rank 0] Training epoch 0 started.
[Rank 0] Training epoch 1 started.
Assigning 2 shards (or data sources) of the dataset to each node.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
node#0 dataloader worker#1, ': Starting to iterate over 1/2 shards.
node#0 dataloader worker#0, ': Starting to iterate over 1/2 shards.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
node#1 dataloader worker#1, ': Starting to iterate over 1/2 shards.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
node#1 dataloader worker#0, ': Starting to iterate over 1/2 shards.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
Set __getitem__(key) output type to arrow for no columns (when key is int or slice) and don't output other (un-formatted) columns.
Set __getitem__(key) output type to arrow for no columns (when key is int or slice) and don't output other (un-formatted) columns.
node#0 dataloader worker#1, ': Finished iterating over 1/1 shards.
node#0 dataloader worker#0, ': Finished iterating over 1/1 shards.
`Trainer.fit` stopped: `max_epochs=2` reached.
Set __getitem__(key) output type to arrow for no columns (when key is int or slice) and don't output other (un-formatted) columns.
Set __getitem__(key) output type to arrow for no columns (when key is int or slice) and don't output other (un-formatted) columns.
node#1 dataloader worker#1, ': Finished iterating over 1/1 shards.
node#1 dataloader worker#0, ': Finished iterating over 1/1 shards.
[Rank 1] Training started.
[Rank 1] Training epoch 0 started.
[Rank 1] Training epoch 1 started.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
node#1 dataloader worker#1, ': Starting to iterate over 1/2 shards.
node#1 dataloader worker#0, ': Starting to iterate over 1/2 shards.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
Loading a state dict of a shuffle buffer of a dataset without the buffer content.The shuffle buffer will be refilled before starting to yield new examples.
Set __getitem__(key) output type to arrow for no columns (when key is int or slice) and don't output other (un-formatted) columns.
Set __getitem__(key) output type to arrow for no columns (when key is int or slice) and don't output other (un-formatted) columns.
node#1 dataloader worker#0, ': Finished iterating over 1/1 shards.
node#1 dataloader worker#1, ': Finished iterating over 1/1 shards.
```
I'm also attaching the relevant state_dict to make sure that the state is being checkpointed as expected.
```
{'_iterator_finished': True,
'_snapshot': {'_last_yielded_worker_id': 1,
'_main_snapshot': {'_IterableDataset_len_called': None,
'_base_seed': 3992758080362545099,
'_index_sampler_state': {'samples_yielded': 64},
'_num_workers': 2,
'_sampler_iter_state': None,
'_sampler_iter_yielded': 32,
'_shared_seed': None},
'_snapshot_step': 32,
'_worker_snapshots': {'worker_0': {'dataset_state': {'ex_iterable': {'shard_example_idx': 0,
'shard_idx': 1},
'num_examples_since_previous_state': 0,
'previous_state': {'shard_example_idx': 0,
'shard_idx': 1},
'previous_state_example_idx': 33},
'fetcher_state': {'dataset_iter_state': None,
'fetcher_ended': False},
'worker_id': 0},
'worker_1': {'dataset_state': {'ex_iterable': {'shard_example_idx': 0,
'shard_idx': 1},
'num_examples_since_previous_state': 0,
'previous_state': {'shard_example_idx': 0,
'shard_idx': 1},
'previous_state_example_idx': 33},
'fetcher_state': {'dataset_iter_state': None,
'fetcher_ended': False},
'worker_id': 1}}},
'_steps_since_snapshot': 0}
```
### Expected behavior
Since I'm following all the recommended steps, I don't expect to see any warning when resuming. Am I doing something wrong? Also, can someone explain why I'm seeing 20 identical messages in the log in this reproduction setting? I'm trying to understand why I see thousands of these messages with the actual dataset.
One more surprising thing I noticed in the logs is the change in a number of shards per worker. In the following messages, the denominator changes from 2 to 1.
```
node#1 dataloader worker#1, ': Starting to iterate over 1/2 shards.
...
node#1 dataloader worker#1, ': Finished iterating over 1/1 shards.
```
### Environment info
python: 3.11.10
datasets: 3.3.2
lightning: 2.3.1
| null |
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7444/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7444/timeline
| null | null | null | null | false
|
https://api.github.com/repos/huggingface/datasets/issues/7443
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7443/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7443/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7443/events
|
https://github.com/huggingface/datasets/issues/7443
| 2,908,585,656
|
I_kwDODunzps6tXX64
| 7,443
|
index error when num_shards > len(dataset)
|
{
"login": "eminorhan",
"id": 17934496,
"node_id": "MDQ6VXNlcjE3OTM0NDk2",
"avatar_url": "https://avatars.githubusercontent.com/u/17934496?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/eminorhan",
"html_url": "https://github.com/eminorhan",
"followers_url": "https://api.github.com/users/eminorhan/followers",
"following_url": "https://api.github.com/users/eminorhan/following{/other_user}",
"gists_url": "https://api.github.com/users/eminorhan/gists{/gist_id}",
"starred_url": "https://api.github.com/users/eminorhan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/eminorhan/subscriptions",
"organizations_url": "https://api.github.com/users/eminorhan/orgs",
"repos_url": "https://api.github.com/users/eminorhan/repos",
"events_url": "https://api.github.com/users/eminorhan/events{/privacy}",
"received_events_url": "https://api.github.com/users/eminorhan/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
open
| false
| null |
[] | null |
[
"Actually, looking at the code a bit more carefully, maybe an even better solution is to explicitly set `num_shards=len(self)` somewhere inside both `push_to_hub()` and `save_to_disk()` when these functions are invoked with `num_shards > len(dataset)`."
] | 2025-03-10T22:40:59
| 2025-03-10T23:43:08
| null |
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
In `ds.push_to_hub()` and `ds.save_to_disk()`, `num_shards` must be smaller than or equal to the number of rows in the dataset, but currently this is not checked anywhere inside these functions. Attempting to invoke these functions with `num_shards > len(dataset)` should raise an informative `ValueError`.
I frequently work with datasets with a small number of rows where each row is pretty large, so I often encounter this issue, where the function runs until the shard index in `ds.shard(num_shards, indx)` goes out of bounds. Ideally, a `ValueError` should be raised before reaching this point (i.e. as soon as `ds.push_to_hub()` or `ds.save_to_disk()` is invoked with `num_shards > len(dataset)`).
It seems that adding something like:
```python
if len(self) < num_shards:
raise ValueError(f"num_shards ({num_shards}) must be smaller than or equal to the number of rows in the dataset ({len(self)}). Please either reduce num_shards or increase max_shard_size to make sure num_shards <= len(dataset).")
```
to the beginning of the definition of the `ds.shard()` function [here](https://github.com/huggingface/datasets/blob/f693f4e93aabafa878470c80fd42ddb10ec550d6/src/datasets/arrow_dataset.py#L4728) would deal with this issue for both `ds.push_to_hub()` and `ds.save_to_disk()`, but I'm not exactly sure if this is the best place to raise the `ValueError` (it seems that a more correct way to do it would be to write separate checks for `ds.push_to_hub()` and `ds.save_to_disk()`). I'd be happy to submit a PR if you think something along these lines would be acceptable.
| null |
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7443/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7443/timeline
| null | null | null | null | false
|
https://api.github.com/repos/huggingface/datasets/issues/7442
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7442/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7442/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7442/events
|
https://github.com/huggingface/datasets/issues/7442
| 2,905,543,017
|
I_kwDODunzps6tLxFp
| 7,442
|
Flexible Loader
|
{
"login": "dipta007",
"id": 13894030,
"node_id": "MDQ6VXNlcjEzODk0MDMw",
"avatar_url": "https://avatars.githubusercontent.com/u/13894030?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dipta007",
"html_url": "https://github.com/dipta007",
"followers_url": "https://api.github.com/users/dipta007/followers",
"following_url": "https://api.github.com/users/dipta007/following{/other_user}",
"gists_url": "https://api.github.com/users/dipta007/gists{/gist_id}",
"starred_url": "https://api.github.com/users/dipta007/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dipta007/subscriptions",
"organizations_url": "https://api.github.com/users/dipta007/orgs",
"repos_url": "https://api.github.com/users/dipta007/repos",
"events_url": "https://api.github.com/users/dipta007/events{/privacy}",
"received_events_url": "https://api.github.com/users/dipta007/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[
{
"id": 1935892871,
"node_id": "MDU6TGFiZWwxOTM1ODkyODcx",
"url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement",
"name": "enhancement",
"color": "a2eeef",
"default": true,
"description": "New feature or request"
}
] |
open
| false
| null |
[] | null |
[
"Ideally `save_to_disk` should save in a format compatible with load_dataset, wdyt ?",
"> Ideally `save_to_disk` should save in a format compatible with load_dataset, wdyt ?\n\nThat would be perfect if not at least a flexible loader."
] | 2025-03-09T16:55:03
| 2025-03-17T20:35:07
| null |
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
### Feature request
Can we have a utility function that will use `load_from_disk` when given the local path and `load_dataset` if given an HF dataset?
It can be something as simple as this one:
```
def load_hf_dataset(path_or_name):
if os.path.exists(path_or_name):
return load_from_disk(path_or_name)
else:
return load_dataset(path_or_name)
```
### Motivation
This can be done inside the user codebase, too, but in my experience, it becomes repetitive code.
### Your contribution
I can open a pull request.
| null |
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7442/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7442/timeline
| null | null | null | null | false
|
https://api.github.com/repos/huggingface/datasets/issues/7441
|
https://api.github.com/repos/huggingface/datasets
|
https://api.github.com/repos/huggingface/datasets/issues/7441/labels{/name}
|
https://api.github.com/repos/huggingface/datasets/issues/7441/comments
|
https://api.github.com/repos/huggingface/datasets/issues/7441/events
|
https://github.com/huggingface/datasets/issues/7441
| 2,904,702,329
|
I_kwDODunzps6tIj15
| 7,441
|
`drop_last_batch` does not drop the last batch using IterableDataset + interleave_datasets + multi_worker
|
{
"login": "memray",
"id": 4197249,
"node_id": "MDQ6VXNlcjQxOTcyNDk=",
"avatar_url": "https://avatars.githubusercontent.com/u/4197249?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/memray",
"html_url": "https://github.com/memray",
"followers_url": "https://api.github.com/users/memray/followers",
"following_url": "https://api.github.com/users/memray/following{/other_user}",
"gists_url": "https://api.github.com/users/memray/gists{/gist_id}",
"starred_url": "https://api.github.com/users/memray/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/memray/subscriptions",
"organizations_url": "https://api.github.com/users/memray/orgs",
"repos_url": "https://api.github.com/users/memray/repos",
"events_url": "https://api.github.com/users/memray/events{/privacy}",
"received_events_url": "https://api.github.com/users/memray/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
|
[] |
open
| false
| null |
[] | null |
[
"Hi @memray, I’d like to help fix the issue with `drop_last_batch` not working when `num_workers > 1`. I’ll investigate and propose a solution. Thanks!\n",
"Thank you very much for offering to help! I also noticed a problem related to a previous issue and left a comment [here](https://github.com/huggingface/datasets/issues/6565#issuecomment-2708169303) (the code checks the validity before certain columns removed). Can you take a look as well?"
] | 2025-03-08T10:28:44
| 2025-03-09T21:27:33
| null |
NONE
| null |
{
"total": 0,
"completed": 0,
"percent_completed": 0
}
| null |
### Describe the bug
See the script below
`drop_last_batch=True` is defined using map() for each dataset.
The last batch for each dataset is expected to be dropped, id 21-25.
The code behaves as expected when num_workers=0 or 1.
When using num_workers>1, 'a-11', 'b-11', 'a-12', 'b-12' are gone and instead 21 and 22 are sampled.
### Steps to reproduce the bug
```
from datasets import Dataset
from datasets import interleave_datasets
from torch.utils.data import DataLoader
def convert_to_str(batch, dataset_name):
batch['a'] = [f"{dataset_name}-{e}" for e in batch['a']]
return batch
def gen1():
for ii in range(1, 25):
yield {"a": ii}
def gen2():
for ii in range(1, 25):
yield {"a": ii}
# https://github.com/huggingface/datasets/issues/6565
if __name__ == '__main__':
dataset1 = Dataset.from_generator(gen1).to_iterable_dataset(num_shards=2)
dataset2 = Dataset.from_generator(gen2).to_iterable_dataset(num_shards=2)
dataset1 = dataset1.map(lambda x: convert_to_str(x, dataset_name="a"), batched=True, batch_size=10, drop_last_batch=True)
dataset2 = dataset2.map(lambda x: convert_to_str(x, dataset_name="b"), batched=True, batch_size=10, drop_last_batch=True)
interleaved = interleave_datasets([dataset1, dataset2], stopping_strategy="all_exhausted")
print(f"num_workers=0")
loader = DataLoader(interleaved, batch_size=5, num_workers=0)
i = 0
for b in loader:
print(i, b['a'])
i += 1
print('=-' * 20)
print(f"num_workers=1")
loader = DataLoader(interleaved, batch_size=5, num_workers=1)
i = 0
for b in loader:
print(i, b['a'])
i += 1
print('=-' * 20)
print(f"num_workers=2")
loader = DataLoader(interleaved, batch_size=5, num_workers=2)
i = 0
for b in loader:
print(i, b['a'])
i += 1
print('=-' * 20)
print(f"num_workers=3")
loader = DataLoader(interleaved, batch_size=5, num_workers=3)
i = 0
for b in loader:
print(i, b['a'])
i += 1
```
output is:
```
num_workers=0
0 ['a-1', 'b-1', 'a-2', 'b-2', 'a-3']
1 ['b-3', 'a-4', 'b-4', 'a-5', 'b-5']
2 ['a-6', 'b-6', 'a-7', 'b-7', 'a-8']
3 ['b-8', 'a-9', 'b-9', 'a-10', 'b-10']
4 ['a-11', 'b-11', 'a-12', 'b-12', 'a-13']
5 ['b-13', 'a-14', 'b-14', 'a-15', 'b-15']
6 ['a-16', 'b-16', 'a-17', 'b-17', 'a-18']
7 ['b-18', 'a-19', 'b-19', 'a-20', 'b-20']
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
num_workers=1
0 ['a-1', 'b-1', 'a-2', 'b-2', 'a-3']
1 ['b-3', 'a-4', 'b-4', 'a-5', 'b-5']
2 ['a-6', 'b-6', 'a-7', 'b-7', 'a-8']
3 ['b-8', 'a-9', 'b-9', 'a-10', 'b-10']
4 ['a-11', 'b-11', 'a-12', 'b-12', 'a-13']
5 ['b-13', 'a-14', 'b-14', 'a-15', 'b-15']
6 ['a-16', 'b-16', 'a-17', 'b-17', 'a-18']
7 ['b-18', 'a-19', 'b-19', 'a-20', 'b-20']
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
num_workers=2
0 ['a-1', 'b-1', 'a-2', 'b-2', 'a-3']
1 ['a-13', 'b-13', 'a-14', 'b-14', 'a-15']
2 ['b-3', 'a-4', 'b-4', 'a-5', 'b-5']
3 ['b-15', 'a-16', 'b-16', 'a-17', 'b-17']
4 ['a-6', 'b-6', 'a-7', 'b-7', 'a-8']
5 ['a-18', 'b-18', 'a-19', 'b-19', 'a-20']
6 ['b-8', 'a-9', 'b-9', 'a-10', 'b-10']
7 ['b-20', 'a-21', 'b-21', 'a-22', 'b-22']
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
num_workers=3
Too many dataloader workers: 3 (max is dataset.num_shards=2). Stopping 1 dataloader workers.
0 ['a-1', 'b-1', 'a-2', 'b-2', 'a-3']
1 ['a-13', 'b-13', 'a-14', 'b-14', 'a-15']
2 ['b-3', 'a-4', 'b-4', 'a-5', 'b-5']
3 ['b-15', 'a-16', 'b-16', 'a-17', 'b-17']
4 ['a-6', 'b-6', 'a-7', 'b-7', 'a-8']
5 ['a-18', 'b-18', 'a-19', 'b-19', 'a-20']
6 ['b-8', 'a-9', 'b-9', 'a-10', 'b-10']
7 ['b-20', 'a-21', 'b-21', 'a-22', 'b-22']
```
### Expected behavior
`'a-21', 'b-21', 'a-22', 'b-22'` should be dropped
### Environment info
- `datasets` version: 3.3.2
- Platform: Linux-5.15.0-1056-aws-x86_64-with-glibc2.31
- Python version: 3.10.16
- `huggingface_hub` version: 0.28.0
- PyArrow version: 19.0.0
- Pandas version: 2.2.3
- `fsspec` version: 2024.6.1
| null |
{
"url": "https://api.github.com/repos/huggingface/datasets/issues/7441/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
}
|
https://api.github.com/repos/huggingface/datasets/issues/7441/timeline
| null | null | null | null | false
|
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 3