html_url
stringlengths
51
51
comments
stringlengths
67
24.7k
title
stringlengths
6
280
body
stringlengths
51
36.2k
comment_length
int64
16
1.45k
text
stringlengths
190
38.3k
embeddings
list
https://github.com/huggingface/datasets/issues/5570
The error is now more informative: ``` FileNotFoundError: Couldn't find a dataset script at /content/imagenet-1k/imagenet-1k.py or any data file in the same directory. Couldn't find 'imagenet-1k' on the Hugging Face Hub either: FileNotFoundError: Dataset 'imagenet-1k' doesn't exist on the Hub. If the repo is private ...
load_dataset gives FileNotFoundError on imagenet-1k if license is not accepted on the hub
### Describe the bug When calling ```load_dataset('imagenet-1k')``` FileNotFoundError is raised, if not logged in and if logged in with huggingface-cli but not having accepted the licence on the hub. There is no error once accepting. ### Steps to reproduce the bug ``` from datasets import load_dataset imagenet =...
56
load_dataset gives FileNotFoundError on imagenet-1k if license is not accepted on the hub ### Describe the bug When calling ```load_dataset('imagenet-1k')``` FileNotFoundError is raised, if not logged in and if logged in with huggingface-cli but not having accepted the licence on the hub. There is no error once acce...
[ -0.332284152507782, -0.2758561968803406, 0.0870048999786377, 0.2595260739326477, 0.053714897483587265, 0.0687185525894165, 0.5406359434127808, 0.06523510813713074, 0.45785701274871826, 0.260224312543869, -0.12785664200782776, 0.18132847547531128, -0.20270930230617523, 0.14914144575595856, ...
https://github.com/huggingface/datasets/issues/5568
Hi ! Oh good catch. I think the features should be passed to `IterableDataset.from_generator()` in `to_iterable_dataset()` indeed. Setting this as a good first issue if someone would like to contribute, otherwise we can take care of it :)
dataset.to_iterable_dataset() loses useful info like dataset features
### Describe the bug Hello, I like the new `to_iterable_dataset` feature but I noticed something that seems to be missing. When using `to_iterable_dataset` to transform your map style dataset into iterable dataset, you lose valuable metadata like the features. These metadata are useful if you want to interleav...
38
dataset.to_iterable_dataset() loses useful info like dataset features ### Describe the bug Hello, I like the new `to_iterable_dataset` feature but I noticed something that seems to be missing. When using `to_iterable_dataset` to transform your map style dataset into iterable dataset, you lose valuable metadata l...
[ -0.0940789207816124, 0.12064769864082336, -0.01631130650639534, 0.050761137157678604, 0.4780622124671936, 0.25060218572616577, 0.23195800185203552, 0.5022813677787781, -0.44132184982299805, -0.05481256544589996, -0.02133970521390438, 0.7593232989311218, -0.1892850697040558, 0.1848356723785...
https://github.com/huggingface/datasets/issues/5568
seems like the feature parameter is missing from `return IterableDataset.from_generator(Dataset._iter_shards, gen_kwargs={"shards": shards})` hence it defaults to None.
dataset.to_iterable_dataset() loses useful info like dataset features
### Describe the bug Hello, I like the new `to_iterable_dataset` feature but I noticed something that seems to be missing. When using `to_iterable_dataset` to transform your map style dataset into iterable dataset, you lose valuable metadata like the features. These metadata are useful if you want to interleav...
17
dataset.to_iterable_dataset() loses useful info like dataset features ### Describe the bug Hello, I like the new `to_iterable_dataset` feature but I noticed something that seems to be missing. When using `to_iterable_dataset` to transform your map style dataset into iterable dataset, you lose valuable metadata l...
[ -0.1318865865468979, 0.10668589174747467, 0.011545788496732712, -0.0062761325389146805, 0.44106027483940125, 0.2282922863960266, 0.29144543409347534, 0.4510963559150696, -0.4841243028640747, 0.04485161229968071, 0.029569990932941437, 0.7640546560287476, -0.19561867415905, 0.132456958293914...
https://github.com/huggingface/datasets/issues/5555
Hi ! The indices mapping is written in the same cachedirectory as your dataset. Can you run this to show your current cache directory ? ```python print(train_dataset.cache_files) ```
`.shuffle` throwing error `ValueError: Protocol not known: parent`
### Describe the bug ``` --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [16], line 1 ----> 1 train_dataset = train_dataset.shuffle() File /opt/conda/envs/pytorch/lib/python3.9/site-packages/dataset...
28
`.shuffle` throwing error `ValueError: Protocol not known: parent` ### Describe the bug ``` --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [16], line 1 ----> 1 train_dataset = train_dataset.shuffle(...
[ 0.04783599078655243, -0.18612688779830933, -0.026867898181080818, 0.20817536115646362, 0.34198617935180664, -0.13065320253372192, 0.33175328373908997, 0.4799610376358032, -0.4339819550514221, 0.29154732823371887, -0.26980721950531006, 0.4671917259693146, -0.1684141755104065, 0.003361716866...
https://github.com/huggingface/datasets/issues/5555
``` [{'filename': '.../train/dataset.arrow'}, {'filename': '.../train/dataset.arrow'}] ``` These are the actual paths where `.hf` files are stored.
`.shuffle` throwing error `ValueError: Protocol not known: parent`
### Describe the bug ``` --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [16], line 1 ----> 1 train_dataset = train_dataset.shuffle() File /opt/conda/envs/pytorch/lib/python3.9/site-packages/dataset...
16
`.shuffle` throwing error `ValueError: Protocol not known: parent` ### Describe the bug ``` --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [16], line 1 ----> 1 train_dataset = train_dataset.shuffle(...
[ 0.04783599078655243, -0.18612688779830933, -0.026867898181080818, 0.20817536115646362, 0.34198617935180664, -0.13065320253372192, 0.33175328373908997, 0.4799610376358032, -0.4339819550514221, 0.29154732823371887, -0.26980721950531006, 0.4671917259693146, -0.1684141755104065, 0.003361716866...
https://github.com/huggingface/datasets/issues/5555
I'm not aware of any `.hf` file ? What are you referring to ? Also the error says "Protocol unknown: parent". Is there a chance you may have ended up with a path that contains this string `parent://` ?
`.shuffle` throwing error `ValueError: Protocol not known: parent`
### Describe the bug ``` --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [16], line 1 ----> 1 train_dataset = train_dataset.shuffle() File /opt/conda/envs/pytorch/lib/python3.9/site-packages/dataset...
39
`.shuffle` throwing error `ValueError: Protocol not known: parent` ### Describe the bug ``` --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [16], line 1 ----> 1 train_dataset = train_dataset.shuffle(...
[ 0.04783599078655243, -0.18612688779830933, -0.026867898181080818, 0.20817536115646362, 0.34198617935180664, -0.13065320253372192, 0.33175328373908997, 0.4799610376358032, -0.4339819550514221, 0.29154732823371887, -0.26980721950531006, 0.4671917259693146, -0.1684141755104065, 0.003361716866...
https://github.com/huggingface/datasets/issues/5555
I figured out why the issue was occuring but don't know the long-term fix. The dataset I was trying to shuffle was loaded from a saved file which had `::` delimiter in filename. When I try with the exact same file without `::` in filename, it works as expected. Quick fix is to not use colons in filename. But if this ...
`.shuffle` throwing error `ValueError: Protocol not known: parent`
### Describe the bug ``` --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [16], line 1 ----> 1 train_dataset = train_dataset.shuffle() File /opt/conda/envs/pytorch/lib/python3.9/site-packages/dataset...
76
`.shuffle` throwing error `ValueError: Protocol not known: parent` ### Describe the bug ``` --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In [16], line 1 ----> 1 train_dataset = train_dataset.shuffle(...
[ 0.04783599078655243, -0.18612688779830933, -0.026867898181080818, 0.20817536115646362, 0.34198617935180664, -0.13065320253372192, 0.33175328373908997, 0.4799610376358032, -0.4339819550514221, 0.29154732823371887, -0.26980721950531006, 0.4671917259693146, -0.1684141755104065, 0.003361716866...
https://github.com/huggingface/datasets/issues/5546
Hi ! Can you make sure you set `HF_HOME` before importing `datasets` ? Then you can print ```python print(datasets.config.HF_CACHE_HOME) print(datasets.config.HF_DATASETS_CACHE) ```
Downloaded datasets do not cache at $HF_HOME
### Describe the bug In the huggingface course (https://huggingface.co/course/chapter3/2?fw=pt) it said that if we set HF_HOME, downloaded datasets would be cached at specified address but it does not. downloaded models from checkpoint names are downloaded and cached at HF_HOME but this is not the case for datasets, t...
21
Downloaded datasets do not cache at $HF_HOME ### Describe the bug In the huggingface course (https://huggingface.co/course/chapter3/2?fw=pt) it said that if we set HF_HOME, downloaded datasets would be cached at specified address but it does not. downloaded models from checkpoint names are downloaded and cached at H...
[ 0.029355913400650024, -0.2774205505847931, 0.06504880636930466, 0.25123074650764465, 0.29924383759498596, 0.15360073745250702, 0.30817270278930664, 0.13932204246520996, 0.5802944302558899, 0.19665446877479553, -0.4149157404899597, -0.2222016602754593, 0.30781471729278564, -0.01896947622299...
https://github.com/huggingface/datasets/issues/5543
Thanks for reporting, @wjfwzzc. I am transferring this issue to the corresponding dataset on the Hub: https://huggingface.co/datasets/bookcorpusopen/discussions/1
the pile datasets url seems to change back
### Describe the bug in #3627, the host url of the pile dataset became `https://mystic.the-eye.eu`. Now the new url is broken, but `https://the-eye.eu` seems to work again. ### Steps to reproduce the bug ```python3 from datasets import load_dataset dataset = load_dataset("bookcorpusopen") ``` shows ```python3 ...
17
the pile datasets url seems to change back ### Describe the bug in #3627, the host url of the pile dataset became `https://mystic.the-eye.eu`. Now the new url is broken, but `https://the-eye.eu` seems to work again. ### Steps to reproduce the bug ```python3 from datasets import load_dataset dataset = load_datase...
[ -0.02492360770702362, 0.1506752371788025, 0.04533448815345764, 0.13577118515968323, -0.025866743177175522, -0.24235466122627258, 0.27736008167266846, -0.018847070634365082, -0.12299063056707382, -0.10635314881801605, -0.35654211044311523, 0.2841383218765259, 0.4485909938812256, -0.03791993...
https://github.com/huggingface/datasets/issues/5543
Thank you. All fixes are done: - [x] https://huggingface.co/datasets/bookcorpusopen/discussions/2 - [x] https://huggingface.co/datasets/the_pile/discussions/1 - [x] https://huggingface.co/datasets/the_pile_books3/discussions/1 - [x] https://huggingface.co/datasets/the_pile_openwebtext2/discussions/2 - [x] https://...
the pile datasets url seems to change back
### Describe the bug in #3627, the host url of the pile dataset became `https://mystic.the-eye.eu`. Now the new url is broken, but `https://the-eye.eu` seems to work again. ### Steps to reproduce the bug ```python3 from datasets import load_dataset dataset = load_dataset("bookcorpusopen") ``` shows ```python3 ...
21
the pile datasets url seems to change back ### Describe the bug in #3627, the host url of the pile dataset became `https://mystic.the-eye.eu`. Now the new url is broken, but `https://the-eye.eu` seems to work again. ### Steps to reproduce the bug ```python3 from datasets import load_dataset dataset = load_datase...
[ 0.0027174651622772217, 0.14232370257377625, 0.037558987736701965, 0.16497951745986938, 0.006508389487862587, -0.224164679646492, 0.22020873427391052, -0.03928055986762047, -0.2169608324766159, -0.11068043112754822, -0.34006136655807495, 0.23998412489891052, 0.4222783148288727, -0.071681804...
https://github.com/huggingface/datasets/issues/5541
Running the script above on the branch https://github.com/huggingface/datasets/pull/5542 results in the expected behaviour: ``` Num chunks for original ds: 1 Original ds save/load save_to_disk -- RAM memory used: 0.671875 MB -- Total time: 0.255265 s load_from_disk -- RAM memory used: 42.796875 MB -- Total time: 0...
Flattening indices in selected datasets is extremely inefficient
### Describe the bug If we perform a `select` (or `shuffle`, `train_test_split`, etc.) operation on a dataset , we end up with a dataset with an `indices_table`. Currently, flattening such dataset consumes a lot of memory and the resulting flat dataset contains ChunkedArrays with as many chunks as there are rows. Thi...
117
Flattening indices in selected datasets is extremely inefficient ### Describe the bug If we perform a `select` (or `shuffle`, `train_test_split`, etc.) operation on a dataset , we end up with a dataset with an `indices_table`. Currently, flattening such dataset consumes a lot of memory and the resulting flat datase...
[ -0.19913256168365479, -0.24241352081298828, -0.02668948285281658, 0.42907869815826416, 0.08236655592918396, 0.24479427933692932, 0.013242749497294426, 0.4453810751438141, -0.06731297075748444, 0.39714503288269043, 0.07559611648321152, 0.658035159111023, -0.008869102224707603, -0.1766566634...
https://github.com/huggingface/datasets/issues/5539
Hi! The `set_transform` does not apply a custom formatting transform on a single example but the entire batch, so the fixed version of your transform would look as follows: ```python from datasets import load_dataset import torch dataset = load_dataset("lambdalabs/pokemon-blip-captions", split='train') def t(bat...
IndexError: invalid index of a 0-dim tensor. Use `tensor.item()` in Python or `tensor.item<T>()` in C++ to convert a 0-dim tensor to a number
### Describe the bug When dataset contains a 0-dim tensor, formatting.py raises a following error and fails. ```bash Traceback (most recent call last): File "<path>/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 501, in format_row return _unnest(formatted_batch) File "<path>/lib/py...
78
IndexError: invalid index of a 0-dim tensor. Use `tensor.item()` in Python or `tensor.item<T>()` in C++ to convert a 0-dim tensor to a number ### Describe the bug When dataset contains a 0-dim tensor, formatting.py raises a following error and fails. ```bash Traceback (most recent call last): File "<path>/lib...
[ -0.25423917174339294, -0.4156855344772339, -0.02685086615383625, 0.4272729158401489, 0.26932042837142944, 0.1295691430568695, 0.7767344117164612, 0.67954421043396, -0.25347957015037537, 0.1531459093093872, 0.039237454533576965, 0.26701271533966064, -0.36397331953048706, 0.00225113332271575...
https://github.com/huggingface/datasets/issues/5539
> Hi! The `set_transform` does not apply a custom formatting transform on a single example but the entire batch, so the fixed version of your transform would look as follows: > > ```python > from datasets import load_dataset > import torch > > dataset = load_dataset("lambdalabs/pokemon-blip-captions", split='tr...
IndexError: invalid index of a 0-dim tensor. Use `tensor.item()` in Python or `tensor.item<T>()` in C++ to convert a 0-dim tensor to a number
### Describe the bug When dataset contains a 0-dim tensor, formatting.py raises a following error and fails. ```bash Traceback (most recent call last): File "<path>/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 501, in format_row return _unnest(formatted_batch) File "<path>/lib/py...
104
IndexError: invalid index of a 0-dim tensor. Use `tensor.item()` in Python or `tensor.item<T>()` in C++ to convert a 0-dim tensor to a number ### Describe the bug When dataset contains a 0-dim tensor, formatting.py raises a following error and fails. ```bash Traceback (most recent call last): File "<path>/lib...
[ -0.2582029104232788, -0.42552462220191956, -0.031092068180441856, 0.43771666288375854, 0.26600325107574463, 0.13616013526916504, 0.7793339490890503, 0.6722729206085205, -0.2549664378166199, 0.15776988863945007, 0.032406702637672424, 0.26492005586624146, -0.3654944598674774, 0.0086848512291...
https://github.com/huggingface/datasets/issues/5538
Hi! `seaborn`'s `load_dataset` pulls datasets from [here](https://github.com/mwaskom/seaborn-data) and not from our Hub, so this issue is not related to our library in any way and should be reported in their repo instead.
load_dataset in seaborn is not working for me. getting this error.
TimeoutError Traceback (most recent call last) ~\anaconda3\lib\urllib\request.py in do_open(self, http_class, req, **http_conn_args) 1345 try: -> 1346 h.request(req.get_method(), req.selector, req.data, headers, 1347 encode_chu...
32
load_dataset in seaborn is not working for me. getting this error. TimeoutError Traceback (most recent call last) ~\anaconda3\lib\urllib\request.py in do_open(self, http_class, req, **http_conn_args) 1345 try: -> 1346 h.request(req.get_method(), req.selec...
[ -0.37257856130599976, -0.07750917971134186, -0.06400498747825623, 0.11478474736213684, 0.341433584690094, -0.05620769411325455, 0.3485488295555115, 0.2673207223415375, -0.04362752288579941, 0.023610394448041916, -0.3443042039871216, 0.12141720205545425, 0.3546563684940338, 0.20980739593505...
https://github.com/huggingface/datasets/issues/5537
You were right, if `self.dir_cache` is not None in glob, it is exactly the same as what is returned by find, at least for all the tests we have, and some extended evaluation I did across a random sample of about 1000 datasets. Thanks for the nice hints, and let me know if this is not exactly what we want here! s...
Increase speed of data files resolution
Certain datasets like `bigcode/the-stack-dedup` have so many files that loading them takes forever right from the data files resolution step. `datasets` uses file patterns to check the structure of the repository but it takes too much time to iterate over and over again on all the data files. This comes from `res...
64
Increase speed of data files resolution Certain datasets like `bigcode/the-stack-dedup` have so many files that loading them takes forever right from the data files resolution step. `datasets` uses file patterns to check the structure of the repository but it takes too much time to iterate over and over again on a...
[ -0.2851497530937195, -0.01712779700756073, -0.16672159731388092, 0.25101178884506226, 0.22652852535247803, -0.02748500555753708, -0.06366445124149323, 0.7695387601852417, 0.18300233781337738, 0.15410852432250977, -0.12916822731494904, 0.18028074502944946, -0.08980448544025421, 0.0692548081...
https://github.com/huggingface/datasets/issues/5537
I think we can make the data files resolution (significantly) faster in 2 steps: 1. `glob` calls `find` (which in turn calls `ls`), so we need `find` to be fast, and this can be achieved by fetching all the entries in a single API call and avoiding calls to `ls`. Implementing this for `HfFileSystem.find` (the one in...
Increase speed of data files resolution
Certain datasets like `bigcode/the-stack-dedup` have so many files that loading them takes forever right from the data files resolution step. `datasets` uses file patterns to check the structure of the repository but it takes too much time to iterate over and over again on all the data files. This comes from `res...
135
Increase speed of data files resolution Certain datasets like `bigcode/the-stack-dedup` have so many files that loading them takes forever right from the data files resolution step. `datasets` uses file patterns to check the structure of the repository but it takes too much time to iterate over and over again on a...
[ -0.04932060465216637, 0.10979859530925751, -0.06484226137399673, 0.21430596709251404, 0.022936176508665085, -0.07953540980815887, -0.0859002023935318, 0.7598604559898376, 0.13545361161231995, 0.12306354939937592, -0.004720371216535568, 0.16314011812210083, -0.13723763823509216, 0.077556535...
https://github.com/huggingface/datasets/issues/5537
Good idea :) For 2: That would work ! It's also possible to have a FileSystem with a cache on `.find` and use it inside the resolver passed to `_get_data_files_patterns`. Right now they're pretty simple: ```python # for remote repositories resolver = partial(_resolve_single_pattern_in_dataset_repository, da...
Increase speed of data files resolution
Certain datasets like `bigcode/the-stack-dedup` have so many files that loading them takes forever right from the data files resolution step. `datasets` uses file patterns to check the structure of the repository but it takes too much time to iterate over and over again on all the data files. This comes from `res...
53
Increase speed of data files resolution Certain datasets like `bigcode/the-stack-dedup` have so many files that loading them takes forever right from the data files resolution step. `datasets` uses file patterns to check the structure of the repository but it takes too much time to iterate over and over again on a...
[ -0.15368974208831787, 0.150766521692276, -0.15555912256240845, 0.2184407114982605, 0.18327784538269043, -0.09429410845041275, 0.020885363221168518, 0.7693634033203125, 0.0996105894446373, 0.16804909706115723, -0.08723819255828857, 0.211298406124115, -0.0407094769179821, 0.04985018074512482...
https://github.com/huggingface/datasets/issues/5537
something like this maybe (with Quentin's reimplementation of `HfFilesystem.find`)? ``` @lru_cache(max_size=None) def _find(self, path, maxdepth=None, withdirs=False, detail=False, **kwargs): ``` In any case please let me know if I can help in any way!
Increase speed of data files resolution
Certain datasets like `bigcode/the-stack-dedup` have so many files that loading them takes forever right from the data files resolution step. `datasets` uses file patterns to check the structure of the repository but it takes too much time to iterate over and over again on all the data files. This comes from `res...
33
Increase speed of data files resolution Certain datasets like `bigcode/the-stack-dedup` have so many files that loading them takes forever right from the data files resolution step. `datasets` uses file patterns to check the structure of the repository but it takes too much time to iterate over and over again on a...
[ -0.25791898369789124, 0.023926034569740295, -0.14815223217010498, 0.2298699915409088, 0.12737545371055603, 0.021586284041404724, -0.13294382393360138, 0.7983735203742981, -0.04930674284696579, 0.16989824175834656, 0.05542267858982086, 0.09774169325828552, 0.0043936073780059814, 0.075298286...
https://github.com/huggingface/datasets/issues/5536
Hi ! `enc` is not hashable: ```python import tiktoken from datasets.fingerprint import Hasher enc = tiktoken.get_encoding("gpt2") Hasher.hash(enc) # raises TypeError: cannot pickle 'builtins.CoreBPE' object ``` It happens because it's not picklable, and because of that it's not possible to cache the result of...
Failure to hash function when using .map()
### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and ca...
83
Failure to hash function when using .map() ### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle...
[ -0.27017727494239807, 0.04610045254230499, 0.022127054631710052, 0.06650802493095398, 0.381778359413147, 0.09339503943920135, 0.5055851936340332, 0.4005334675312042, 0.24785952270030975, 0.05585082620382309, 0.11794188618659973, 0.6140046119689941, -0.25890931487083435, -0.0799007490277290...
https://github.com/huggingface/datasets/issues/5536
@lhoestq Thank you for the explanation and advice. Will relay all of this to the repo where this (non)issue arose. Great job with huggingface!
Failure to hash function when using .map()
### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and ca...
24
Failure to hash function when using .map() ### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle...
[ -0.2785501480102539, 0.054910093545913696, 0.022331178188323975, 0.06358519196510315, 0.38120341300964355, 0.09191374480724335, 0.5076672434806824, 0.4011479616165161, 0.25336015224456787, 0.05205836147069931, 0.10599611699581146, 0.6064263582229614, -0.2577090561389923, -0.083704635500907...
https://github.com/huggingface/datasets/issues/5536
Just a heads up that when I'm trying to use TikToken along with the a given Dataset `.map()` method, I am still met with the following error : ``` File "/opt/conda/lib/python3.8/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/opt/conda/lib/python3.8/...
Failure to hash function when using .map()
### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and ca...
60
Failure to hash function when using .map() ### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle...
[ -0.27852413058280945, 0.05236044526100159, 0.02301793172955513, 0.059874724596738815, 0.38436371088027954, 0.08648702502250671, 0.508461594581604, 0.39903321862220764, 0.2548629641532898, 0.05021360516548157, 0.11116024106740952, 0.6045768857002258, -0.25605282187461853, -0.075239412486553...
https://github.com/huggingface/datasets/issues/5536
@lhoestq @edhenry I am on datasets version `'2.12.0'. I see the same `TypeError: cannot pickle 'builtins.CoreBPE' object` that others are seeing.
Failure to hash function when using .map()
### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and ca...
21
Failure to hash function when using .map() ### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle...
[ -0.2785501480102539, 0.054910093545913696, 0.022331178188323975, 0.06358519196510315, 0.38120341300964355, 0.09191374480724335, 0.5076672434806824, 0.4011479616165161, 0.25336015224456787, 0.05205836147069931, 0.10599611699581146, 0.6064263582229614, -0.2577090561389923, -0.083704635500907...
https://github.com/huggingface/datasets/issues/5536
I am able to reproduce this on datasets 2.14.2. The `datasets.disable_caching()` doesn't work around it. @lhoestq - you might want to reopen this issue. Because of this issue folks won't be able run Karpathy's NanoGPT :(.
Failure to hash function when using .map()
### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and ca...
36
Failure to hash function when using .map() ### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle...
[ -0.25540393590927124, 0.0523274689912796, 0.03505020588636398, 0.07662199437618256, 0.398386687040329, 0.07499402016401291, 0.5143862962722778, 0.38404616713523865, 0.23183956742286682, 0.05526810139417648, 0.10514802485704422, 0.6219762563705444, -0.2535195052623749, -0.08838705718517303,...
https://github.com/huggingface/datasets/issues/5536
update: temporarily solved the problem by setting ``` --preprocess_num_workers 1 ``` ------------- I have met the same problem, here is my env: ``` datasets 2.14.4 transformers 4.31.0 tiktoken 0.4.0 torch 1.13.1 ```
Failure to hash function when using .map()
### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and ca...
32
Failure to hash function when using .map() ### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle...
[ -0.27928972244262695, 0.06205187737941742, 0.023797478526830673, 0.06021399796009064, 0.3827194571495056, 0.08332625031471252, 0.4964320659637451, 0.40409231185913086, 0.25012779235839844, 0.05256257206201553, 0.11732430756092072, 0.6077716946601868, -0.2482088953256607, -0.069895356893539...
https://github.com/huggingface/datasets/issues/5536
@mengban I cannot reproduce the issue even with these versions installed. It would help if you could provide info about your system and the `pip list` output.
Failure to hash function when using .map()
### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and ca...
27
Failure to hash function when using .map() ### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle...
[ -0.2688884735107422, 0.04557950794696808, 0.02311813086271286, 0.06588568538427353, 0.3879927694797516, 0.08951548486948013, 0.5108282566070557, 0.3961569666862488, 0.2477157860994339, 0.05667140334844589, 0.11045633256435394, 0.6107146143913269, -0.2555905878543854, -0.08592675626277924, ...
https://github.com/huggingface/datasets/issues/5536
@mariosasko Please take a look at this ```python from typing import Any from datasets import Dataset import tiktoken dataset = Dataset.from_list([{"n": str(i)} for i in range(20)]) enc = tiktoken.get_encoding("gpt2") class A: tokenizer = enc #tiktoken.get_encoding("gpt2") def __call__(self, exa...
Failure to hash function when using .map()
### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and ca...
89
Failure to hash function when using .map() ### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle...
[ -0.2770143151283264, 0.05305469036102295, 0.02068363130092621, 0.06691977381706238, 0.37874355912208557, 0.09213664382696152, 0.5072983503341675, 0.4010002017021179, 0.25410380959510803, 0.057654909789562225, 0.10708275437355042, 0.6044760346412659, -0.2566711902618408, -0.0851700678467750...
https://github.com/huggingface/datasets/issues/5536
Thanks @maxwellzh! Our `Hasher` works with this snippet, but the problem is running multiprocessing with a non-serializable `tiktoken.Encoding` object. Inserting the following code before the `map` should fix this: ```python import copyreg def pickle_Encoding(enc): return (functools.partial(tiktoken.core.Enc...
Failure to hash function when using .map()
### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and ca...
69
Failure to hash function when using .map() ### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle...
[ -0.2697121202945709, 0.04461163282394409, 0.025779105722904205, 0.06566721200942993, 0.3894932270050049, 0.09443256258964539, 0.505799412727356, 0.4007115066051483, 0.24779242277145386, 0.05338501185178757, 0.12246837466955185, 0.609889805316925, -0.25805968046188354, -0.07688655704259872,...
https://github.com/huggingface/datasets/issues/5536
I think the right way to fix this would be to have new tokenizer instance for each process. This applies to many other tokenizers that don't support multi-process or have bugs. To do this, first define tokenizer factory class like this: ``` class TikTokenFactory: def __init__(self): self._...
Failure to hash function when using .map()
### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and ca...
100
Failure to hash function when using .map() ### Describe the bug _Parameter 'function'=<function process at 0x7f1ec4388af0> of the transform datasets.arrow_dataset.Dataset.\_map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle...
[ -0.27259427309036255, 0.05315956473350525, 0.023362252861261368, 0.06667321920394897, 0.37964242696762085, 0.08569291234016418, 0.5104530453681946, 0.39594075083732605, 0.24923430383205414, 0.05098485201597214, 0.10613100230693817, 0.6072447299957275, -0.2558448612689972, -0.07678689062595...
https://github.com/huggingface/datasets/issues/5534
Hi! This code works for me locally or in Colab. What's the output of `python -c "import pyarrow as pa; print(pa.__version__)"` when you run it inside your environment?
map() breaks at certain dataset size when using Array3D
### Describe the bug `map()` magically breaks when using a `Array3D` feature and mapping it. I created a very simple dummy dataset (see below). When filtering it down to 95 elements I can apply map, but it breaks when filtering it down to just 96 entries with the following exception: ``` Traceback (most recent cal...
28
map() breaks at certain dataset size when using Array3D ### Describe the bug `map()` magically breaks when using a `Array3D` feature and mapping it. I created a very simple dummy dataset (see below). When filtering it down to 95 elements I can apply map, but it breaks when filtering it down to just 96 entries with...
[ -0.16098159551620483, 0.0067801326513290405, -0.03623758256435394, 0.2134924679994583, 0.09646651148796082, -0.09540203958749771, 0.3490156829357147, 0.3220602869987488, 0.10199476778507233, 0.026630651205778122, 0.2977755665779114, 0.08814744651317596, 0.16820955276489258, 0.1861055195331...
https://github.com/huggingface/datasets/issues/5534
Thanks for looking into this! The output of `python -c "import pyarrow as pa; print(pa.__version__)"` is: ``` 11.0.0 ``` I did the following to setup the environment: ``` conda create -n datasets_debug python=3.9 conda activate datasets_debug pip install datasets==2.9.0 ``` I just tested this on another...
map() breaks at certain dataset size when using Array3D
### Describe the bug `map()` magically breaks when using a `Array3D` feature and mapping it. I created a very simple dummy dataset (see below). When filtering it down to 95 elements I can apply map, but it breaks when filtering it down to just 96 entries with the following exception: ``` Traceback (most recent cal...
60
map() breaks at certain dataset size when using Array3D ### Describe the bug `map()` magically breaks when using a `Array3D` feature and mapping it. I created a very simple dummy dataset (see below). When filtering it down to 95 elements I can apply map, but it breaks when filtering it down to just 96 entries with...
[ -0.16098159551620483, 0.0067801326513290405, -0.03623758256435394, 0.2134924679994583, 0.09646651148796082, -0.09540203958749771, 0.3490156829357147, 0.3220602869987488, 0.10199476778507233, 0.026630651205778122, 0.2977755665779114, 0.08814744651317596, 0.16820955276489258, 0.1861055195331...
https://github.com/huggingface/datasets/issues/5532
Hi! You can get this behavior by specifying `stratify_by_column="label"` in `train_test_split`. This is the full example: ```python import numpy as np from datasets import Dataset, ClassLabel data = [ {'label': 0, 'text': "example1"}, {'label': 1, 'text': "example2"}, {'label': 1, 'text': "examp...
train_test_split in arrow_dataset does not ensure to keep single classes in test set
### Describe the bug When I have a dataset with very few (e.g. 1) examples per class and I call the train_test_split function on it, sometimes the single class will be in the test set. thus will never be considered for training. ### Steps to reproduce the bug ``` import numpy as np from datasets import Dataset ...
88
train_test_split in arrow_dataset does not ensure to keep single classes in test set ### Describe the bug When I have a dataset with very few (e.g. 1) examples per class and I call the train_test_split function on it, sometimes the single class will be in the test set. thus will never be considered for training. ##...
[ -0.19253751635551453, 0.05764380097389221, -0.006434772163629532, 0.3102375268936157, 0.28909167647361755, 0.0974821001291275, 0.5350440740585327, 0.2346281111240387, -0.2100069671869278, 0.02985125035047531, 0.35186710953712463, 0.5292768478393555, -0.17249953746795654, -0.079752445220947...
https://github.com/huggingface/datasets/issues/5525
Thanks for reporting, @TJ-Solergibert. We cannot access your Colab notebook: `There was an error loading this notebook. Ensure that the file is accessible and try again.` Could you please make it publicly accessible?
TypeError: Couldn't cast array of type string to null
### Describe the bug Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentioned error. I alredy tried reseting the shorter strings...
33
TypeError: Couldn't cast array of type string to null ### Describe the bug Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentione...
[ -0.13287146389484406, -0.46930140256881714, 0.024292126297950745, 0.4132041931152344, 0.41335394978523254, -0.03989052772521973, 0.5205766558647156, 0.2964631915092468, 0.12481794506311417, 0.2541287839412689, -0.13308417797088623, 0.37071725726127625, -0.23034793138504028, 0.1403134763240...
https://github.com/huggingface/datasets/issues/5525
I swear it's public, I've checked the settings and I've been able to open it in incognito mode. Notebook: https://colab.research.google.com/drive/1JCrS7FlGfu_kFqChMrwKZ_bpabnIMqbP?usp=sharing Anyway, this is the code to reproduce the error: ```python3 from datasets import ClassLabel from datasets import load...
TypeError: Couldn't cast array of type string to null
### Describe the bug Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentioned error. I alredy tried reseting the shorter strings...
226
TypeError: Couldn't cast array of type string to null ### Describe the bug Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentione...
[ -0.10379188507795334, -0.4781431257724762, 0.025804392993450165, 0.3886997103691101, 0.45657581090927124, -0.05794788897037506, 0.5366410613059998, 0.3297633230686188, 0.16466696560382843, 0.1949409544467926, -0.09872293472290039, 0.3629641532897949, -0.2444274127483368, 0.1220337152481079...
https://github.com/huggingface/datasets/issues/5525
Thanks, @TJ-Solergibert. I can access your notebook now. Maybe it was just a temporary issue. At first sight, it seems something related to your data: maybe some of the examples do not have all the transcriptions for all the languages. Then, some of them are null when unrolled. And when trying to concatenate with th...
TypeError: Couldn't cast array of type string to null
### Describe the bug Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentioned error. I alredy tried reseting the shorter strings...
80
TypeError: Couldn't cast array of type string to null ### Describe the bug Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentione...
[ -0.12057704478502274, -0.47955477237701416, 0.04174381121993065, 0.35275983810424805, 0.4432106912136078, -0.04269939661026001, 0.4515957534313202, 0.3546941876411438, 0.11704599857330322, 0.2662907838821411, -0.06308096647262573, 0.3818618059158325, -0.19216510653495789, 0.021855235099792...
https://github.com/huggingface/datasets/issues/5525
See, in this example, "nl" and "ro" transcripts are null: ```python >>> europarl_ds["test"][:1] {'original_speech': ['− Señor Presidente, en primer lugar, quisiera felicitar al señor Seeber por el trabajo realizado, porque en su informe se recogen muchas de las preocupaciones manifestadas en esta'], 'original_lang...
TypeError: Couldn't cast array of type string to null
### Describe the bug Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentioned error. I alredy tried reseting the shorter strings...
458
TypeError: Couldn't cast array of type string to null ### Describe the bug Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentione...
[ -0.07954679429531097, -0.5227324962615967, 0.04212440922856331, 0.4047158360481262, 0.42138445377349854, -0.005711354315280914, 0.47137051820755005, 0.33092978596687317, 0.24848046898841858, 0.17114487290382385, -0.050388555973768234, 0.33937501907348633, -0.274219810962677, -0.01515206694...
https://github.com/huggingface/datasets/issues/5525
You can fix this issue by forcing the cast of None to str by hand: - If you replace this line: ```python source_t += batch[src_lang] ``` - With this line (because the batch size is 1): ```python source_t += [str(batch[src_lang][0])] ``` - Or with this line (if the batch size were larger than 1): ```python so...
TypeError: Couldn't cast array of type string to null
### Describe the bug Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentioned error. I alredy tried reseting the shorter strings...
63
TypeError: Couldn't cast array of type string to null ### Describe the bug Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentione...
[ -0.1171104833483696, -0.48156455159187317, 0.025240406394004822, 0.3356456756591797, 0.4890839457511902, -0.008718781173229218, 0.5062229037284851, 0.34610745310783386, 0.18658502399921417, 0.21610327064990997, -0.05457814410328865, 0.3511964678764343, -0.24344441294670105, 0.0914185792207...
https://github.com/huggingface/datasets/issues/5525
Problem solved! Thanks @albertvillanova, now I have even increased the batch size and it's crazy fast :rocket: !
TypeError: Couldn't cast array of type string to null
### Describe the bug Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentioned error. I alredy tried reseting the shorter strings...
18
TypeError: Couldn't cast array of type string to null ### Describe the bug Processing a dataset I alredy uploaded to the Hub (https://huggingface.co/datasets/tj-solergibert/Europarl-ST) I found that for some splits and some languages (test split, source_lang = "nl") after applying a map function I get the mentione...
[ -0.15800052881240845, -0.4741199016571045, 0.0017715692520141602, 0.3594159483909607, 0.4670634865760803, -0.027540981769561768, 0.5098428726196289, 0.38467034697532654, 0.2079887092113495, 0.1902053952217102, -0.07343526184558868, 0.33742555975914, -0.2662237584590912, 0.14271962642669678...
https://github.com/huggingface/datasets/issues/5517
Hi! This behavior stems from these lines: https://github.com/huggingface/datasets/blob/b065547654efa0ec633cf373ac1512884c68b2e1/src/datasets/formatting/np_formatter.py#L45-L46 I agree we should preserve the original type whenever possible and downcast explicitly with a warning. @lhoestq Do you remember why we ...
`with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy") print(...
38
`with_format("numpy")` silently downcasts float64 to float32 features ### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = dataset...
[ 0.1417708545923233, -0.249843567609787, 0.0007746294140815735, 0.0026638759300112724, 0.569696843624115, 0.05614488571882248, 0.6134847402572632, 0.5261101722717285, -0.16041876375675201, -0.05886226147413254, -0.13229571282863617, 0.6590016484260559, -0.02417360432446003, -0.0558506399393...
https://github.com/huggingface/datasets/issues/5517
I was also wondering why the default type logic is needed. Me just deleting it is probably too naive of a solution.
`with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy") print(...
22
`with_format("numpy")` silently downcasts float64 to float32 features ### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = dataset...
[ 0.1417708545923233, -0.249843567609787, 0.0007746294140815735, 0.0026638759300112724, 0.569696843624115, 0.05614488571882248, 0.6134847402572632, 0.5261101722717285, -0.16041876375675201, -0.05886226147413254, -0.13229571282863617, 0.6590016484260559, -0.02417360432446003, -0.0558506399393...
https://github.com/huggingface/datasets/issues/5517
Hmm I think the idea was to end up with the usual default precision for deep learning models - no matter how the data was stored or where it comes from. For example in NLP we store tokens using an optimized low precision to save disk space, but when we set the format to `torch` we actually need to get `int64`. Altho...
`with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy") print(...
123
`with_format("numpy")` silently downcasts float64 to float32 features ### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = dataset...
[ 0.1417708545923233, -0.249843567609787, 0.0007746294140815735, 0.0026638759300112724, 0.569696843624115, 0.05614488571882248, 0.6134847402572632, 0.5261101722717285, -0.16041876375675201, -0.05886226147413254, -0.13229571282863617, 0.6590016484260559, -0.02417360432446003, -0.0558506399393...
https://github.com/huggingface/datasets/issues/5517
Unfortunately removing it for integers is a breaking change for most `transformers` + `datasets` users for NLP (which is a common case). Removing it for floats is a breaking change for `transformers` + `datasets` for ASR as well. And it also is a breaking change for the other users relying on this behavior. Therefor...
`with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy") print(...
102
`with_format("numpy")` silently downcasts float64 to float32 features ### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = dataset...
[ 0.1417708545923233, -0.249843567609787, 0.0007746294140815735, 0.0026638759300112724, 0.569696843624115, 0.05614488571882248, 0.6134847402572632, 0.5261101722717285, -0.16041876375675201, -0.05886226147413254, -0.13229571282863617, 0.6590016484260559, -0.02417360432446003, -0.0558506399393...
https://github.com/huggingface/datasets/issues/5517
@lhoestq It should be fine to remove this conversion in Datasets 3.0, no? For now, we can warn the user (with a log message) about the future change when the default type is changed.
`with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy") print(...
34
`with_format("numpy")` silently downcasts float64 to float32 features ### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = dataset...
[ 0.1417708545923233, -0.249843567609787, 0.0007746294140815735, 0.0026638759300112724, 0.569696843624115, 0.05614488571882248, 0.6134847402572632, 0.5261101722717285, -0.16041876375675201, -0.05886226147413254, -0.13229571282863617, 0.6590016484260559, -0.02417360432446003, -0.0558506399393...
https://github.com/huggingface/datasets/issues/5517
Let's see with the transformers team if it sounds reasonable ? We'd have to fix multiple example scripts though. If it's not ok we can also explore keeping this behavior only for tokens and audio data.
`with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy") print(...
36
`with_format("numpy")` silently downcasts float64 to float32 features ### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = dataset...
[ 0.1417708545923233, -0.249843567609787, 0.0007746294140815735, 0.0026638759300112724, 0.569696843624115, 0.05614488571882248, 0.6134847402572632, 0.5261101722717285, -0.16041876375675201, -0.05886226147413254, -0.13229571282863617, 0.6590016484260559, -0.02417360432446003, -0.0558506399393...
https://github.com/huggingface/datasets/issues/5517
IMO being coupled with Transformers can lead to unexpected behavior when one tries to use our lib without pairing it with Transformers, so I think it's still important to "fix" this, even if it means we will need to update Transformers' example scripts afterward.
`with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy") print(...
44
`with_format("numpy")` silently downcasts float64 to float32 features ### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = dataset...
[ 0.1417708545923233, -0.249843567609787, 0.0007746294140815735, 0.0026638759300112724, 0.569696843624115, 0.05614488571882248, 0.6134847402572632, 0.5261101722717285, -0.16041876375675201, -0.05886226147413254, -0.13229571282863617, 0.6590016484260559, -0.02417360432446003, -0.0558506399393...
https://github.com/huggingface/datasets/issues/5517
For others that run into the same issue: A temporary workaround for me is this: ```python def numpy_transform(batch): return {key: np.asarray(val) for key, val in batch.items()} dataset = dataset.with_transform(numpy_transform) ```
`with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy") print(...
30
`with_format("numpy")` silently downcasts float64 to float32 features ### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = dataset...
[ 0.1417708545923233, -0.249843567609787, 0.0007746294140815735, 0.0026638759300112724, 0.569696843624115, 0.05614488571882248, 0.6134847402572632, 0.5261101722717285, -0.16041876375675201, -0.05886226147413254, -0.13229571282863617, 0.6590016484260559, -0.02417360432446003, -0.0558506399393...
https://github.com/huggingface/datasets/issues/5517
This behavior (silent upcast from `int32` to `int64`) is also unexpected for the user in https://discuss.huggingface.co/t/standard-getitem-returns-wrong-data-type-for-arrays/62470/2
`with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy") print(...
16
`with_format("numpy")` silently downcasts float64 to float32 features ### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = dataset...
[ 0.1417708545923233, -0.249843567609787, 0.0007746294140815735, 0.0026638759300112724, 0.569696843624115, 0.05614488571882248, 0.6134847402572632, 0.5261101722717285, -0.16041876375675201, -0.05886226147413254, -0.13229571282863617, 0.6590016484260559, -0.02417360432446003, -0.0558506399393...
https://github.com/huggingface/datasets/issues/5517
Hi, I stumbled on a variation that upcasts uint8 to int64. I would expect the dtype to be the same as it was when I generated the dataset. ``` import numpy as np import datasets as ds foo = np.random.randint(0, 256, size=(5, 10, 10), dtype=np.uint8) features = ds.Features({"foo": ds.Array2D((10, 10), "uint8"...
`with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy") print(...
72
`with_format("numpy")` silently downcasts float64 to float32 features ### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = dataset...
[ 0.1417708545923233, -0.249843567609787, 0.0007746294140815735, 0.0026638759300112724, 0.569696843624115, 0.05614488571882248, 0.6134847402572632, 0.5261101722717285, -0.16041876375675201, -0.05886226147413254, -0.13229571282863617, 0.6590016484260559, -0.02417360432446003, -0.0558506399393...
https://github.com/huggingface/datasets/issues/5517
workaround to remove torch upcasting ``` import datasets as ds import torch class FixedTorchFormatter(ds.formatting.TorchFormatter): def _tensorize(self, value): return torch.from_numpy(value) ds.formatting._register_formatter(FixedTorchFormatter, "torch") ```
`with_format("numpy")` silently downcasts float64 to float32 features
### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = datasets.Dataset.from_dict({'a': [1.0, 2.0, 3.0]}).with_format("numpy") print(...
22
`with_format("numpy")` silently downcasts float64 to float32 features ### Describe the bug When I create a dataset with a `float64` feature, then apply numpy formatting the returned numpy arrays are silently downcasted to `float32`. ### Steps to reproduce the bug ```python import datasets dataset = dataset...
[ 0.1417708545923233, -0.249843567609787, 0.0007746294140815735, 0.0026638759300112724, 0.569696843624115, 0.05614488571882248, 0.6134847402572632, 0.5261101722717285, -0.16041876375675201, -0.05886226147413254, -0.13229571282863617, 0.6590016484260559, -0.02417360432446003, -0.0558506399393...
https://github.com/huggingface/datasets/issues/5514
Hi, thanks for noticing this! We can't just remove the cache control as this allows us to control where the arrow files generated by the ops are written (cached on disk if enabled or a temporary directory if disabled). The right way to address this inconsistency would be by having `load_from_cache_file=None` by default...
Improve inconsistency of `Dataset.map` interface for `load_from_cache_file`
### Feature request 1. Replace the `load_from_cache_file` default value to `True`. 2. Remove or alter checks from `is_caching_enabled` logic. ### Motivation I stumbled over an inconsistency in the `Dataset.map` interface. The documentation (and source) states for the parameter `load_from_cache_file`: ``` load_...
54
Improve inconsistency of `Dataset.map` interface for `load_from_cache_file` ### Feature request 1. Replace the `load_from_cache_file` default value to `True`. 2. Remove or alter checks from `is_caching_enabled` logic. ### Motivation I stumbled over an inconsistency in the `Dataset.map` interface. The documenta...
[ -0.22572475671768188, 0.11557567119598389, -0.018234290182590485, 0.08944430947303772, -0.25451749563217163, -0.19448737800121307, 0.20940840244293213, 0.24666506052017212, 0.47955015301704407, -0.027434267103672028, 0.27308329939842224, 0.651593804359436, 0.21231481432914734, 0.0354167148...
https://github.com/huggingface/datasets/issues/5514
Hi! Yes, this seems more plausible. I can implement that. One last thing is the type annotation `load_from_cache_file: bool = None`. Which I then would change to `load_from_cache_file: Optional[bool] = None`.
Improve inconsistency of `Dataset.map` interface for `load_from_cache_file`
### Feature request 1. Replace the `load_from_cache_file` default value to `True`. 2. Remove or alter checks from `is_caching_enabled` logic. ### Motivation I stumbled over an inconsistency in the `Dataset.map` interface. The documentation (and source) states for the parameter `load_from_cache_file`: ``` load_...
31
Improve inconsistency of `Dataset.map` interface for `load_from_cache_file` ### Feature request 1. Replace the `load_from_cache_file` default value to `True`. 2. Remove or alter checks from `is_caching_enabled` logic. ### Motivation I stumbled over an inconsistency in the `Dataset.map` interface. The documenta...
[ -0.22042831778526306, 0.10946950316429138, -0.014823511242866516, 0.11704321205615997, -0.28832322359085083, -0.14770200848579407, 0.2506011128425598, 0.22320175170898438, 0.4472059905529022, -0.055908575654029846, 0.289151668548584, 0.6225763559341431, 0.2141655683517456, 0.05612663179636...
https://github.com/huggingface/datasets/issues/5513
Hi! Let's not do this - renaming it would be a breaking change, and going through the deprecation cycle is only worth it if it improves user experience.
Some functions use a param named `type` shouldn't that be avoided since it's a Python reserved name?
Hi @mariosasko, @lhoestq, or whoever reads this! :) After going through `ArrowDataset.set_format` I found out that the `type` param is actually named `type` which is a Python reserved name as you may already know, shouldn't that be renamed to `format_type` before the 3.0.0 is released? Just wanted to get your inp...
28
Some functions use a param named `type` shouldn't that be avoided since it's a Python reserved name? Hi @mariosasko, @lhoestq, or whoever reads this! :) After going through `ArrowDataset.set_format` I found out that the `type` param is actually named `type` which is a Python reserved name as you may already know, ...
[ 0.4956384599208832, -0.4932819902896881, -0.031042177230119705, -0.2522834539413452, 0.2588977813720703, -0.29988303780555725, 0.3812842071056366, 0.26294979453086853, -0.5981422662734985, -0.11188742518424988, 0.13323883712291718, 0.40194788575172424, -0.34347447752952576, 0.0024422705173...
https://github.com/huggingface/datasets/issues/5513
Hi @mariosasko, ok it makes sense. Anyway, don't you think it's worth it at some point to start a deprecation cycle e.g. `fs` in `load_from_disk`? It doesn't affect user experience but it's for sure a bad practice IMO, but's up to you 😄 Feel free to close this issue otherwise!
Some functions use a param named `type` shouldn't that be avoided since it's a Python reserved name?
Hi @mariosasko, @lhoestq, or whoever reads this! :) After going through `ArrowDataset.set_format` I found out that the `type` param is actually named `type` which is a Python reserved name as you may already know, shouldn't that be renamed to `format_type` before the 3.0.0 is released? Just wanted to get your inp...
50
Some functions use a param named `type` shouldn't that be avoided since it's a Python reserved name? Hi @mariosasko, @lhoestq, or whoever reads this! :) After going through `ArrowDataset.set_format` I found out that the `type` param is actually named `type` which is a Python reserved name as you may already know, ...
[ 0.4295058250427246, -0.5103021264076233, -0.06425853073596954, -0.09285235404968262, 0.30086684226989746, -0.3707621693611145, 0.43267500400543213, 0.21824586391448975, -0.44577276706695557, 0.007567174732685089, 0.1441737413406372, 0.46166592836380005, -0.3313411474227905, 0.0245795920491...
https://github.com/huggingface/datasets/issues/5513
I don't think deprecating a param name in this particular instance is worth the hassle, so I'm closing the issue 🙂.
Some functions use a param named `type` shouldn't that be avoided since it's a Python reserved name?
Hi @mariosasko, @lhoestq, or whoever reads this! :) After going through `ArrowDataset.set_format` I found out that the `type` param is actually named `type` which is a Python reserved name as you may already know, shouldn't that be renamed to `format_type` before the 3.0.0 is released? Just wanted to get your inp...
21
Some functions use a param named `type` shouldn't that be avoided since it's a Python reserved name? Hi @mariosasko, @lhoestq, or whoever reads this! :) After going through `ArrowDataset.set_format` I found out that the `type` param is actually named `type` which is a Python reserved name as you may already know, ...
[ 0.4297080338001251, -0.4924948811531067, -0.035543013364076614, -0.20596635341644287, 0.23837463557720184, -0.31972241401672363, 0.3596763610839844, 0.2973925769329071, -0.5891163945198059, -0.09301251173019409, 0.1290218085050583, 0.4515798091888428, -0.34167346358299255, -0.0773858726024...
https://github.com/huggingface/datasets/issues/5511
Update `datasets` or downgrade `huggingface-hub` ;) The `huggingface-hub` lib did a breaking change a few months ago, and you're using an old version of `datasets` that does't support it
Creating a dummy dataset from a bigger one
### Describe the bug I often want to create a dummy dataset from a bigger dataset for fast iteration when training. However, I'm having a hard time doing this especially when trying to upload the dataset to the Hub. ### Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset...
29
Creating a dummy dataset from a bigger one ### Describe the bug I often want to create a dummy dataset from a bigger dataset for fast iteration when training. However, I'm having a hard time doing this especially when trying to upload the dataset to the Hub. ### Steps to reproduce the bug ```python from datasets ...
[ -0.10330513119697571, -0.4601714313030243, 0.06486327946186066, 0.33494022488594055, 0.16239167749881744, 0.10790105164051056, 0.1877211332321167, 0.33160996437072754, -0.12631967663764954, 0.2755588889122009, 0.06896796822547913, 0.13240058720111847, -0.05003594607114792, 0.39328026771545...
https://github.com/huggingface/datasets/issues/5511
Getting same error with latest versions. ```shell --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[99], line 1 ----> 1 dataset.push_to_hub("mirfan899/kids_phoneme_asr") File /opt/conda/lib/python3....
Creating a dummy dataset from a bigger one
### Describe the bug I often want to create a dummy dataset from a bigger dataset for fast iteration when training. However, I'm having a hard time doing this especially when trying to upload the dataset to the Hub. ### Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset...
237
Creating a dummy dataset from a bigger one ### Describe the bug I often want to create a dummy dataset from a bigger dataset for fast iteration when training. However, I'm having a hard time doing this especially when trying to upload the dataset to the Hub. ### Steps to reproduce the bug ```python from datasets ...
[ -0.10330513119697571, -0.4601714313030243, 0.06486327946186066, 0.33494022488594055, 0.16239167749881744, 0.10790105164051056, 0.1877211332321167, 0.33160996437072754, -0.12631967663764954, 0.2755588889122009, 0.06896796822547913, 0.13240058720111847, -0.05003594607114792, 0.39328026771545...
https://github.com/huggingface/datasets/issues/5508
Hey, I'm a research engineer working on language modelling wanting to contribute to open source. I was wondering if I could give it a shot?
Saving a dataset after setting format to torch doesn't work, but only if filtering
### Describe the bug Saving a dataset after setting format to torch doesn't work, but only if filtering ### Steps to reproduce the bug ``` a = Dataset.from_dict({"b": [1, 2]}) a.set_format('torch') a.save_to_disk("test_save") # saves successfully a.filter(None).save_to_disk("test_save_filter") # does not >> [.....
25
Saving a dataset after setting format to torch doesn't work, but only if filtering ### Describe the bug Saving a dataset after setting format to torch doesn't work, but only if filtering ### Steps to reproduce the bug ``` a = Dataset.from_dict({"b": [1, 2]}) a.set_format('torch') a.save_to_disk("test_save") # s...
[ -0.37882277369499207, -0.2623996436595917, -0.03895394504070282, 0.09076999127864838, 0.3246902823448181, 0.060432881116867065, 0.5087520480155945, 0.22538119554519653, -0.19273588061332703, 0.03264153376221657, -0.21385444700717926, 0.3269582986831665, -0.3333054780960083, 0.0724773481488...
https://github.com/huggingface/datasets/issues/5506
Hi ! `datasets` doesn't do batching - the PyTorch DataLoader does and is created by the `Trainer`. Do you pass other arguments to training_args with respect to data loading ? Also we recently released `.to_iterable_dataset` that does pretty much what you implemented, but using contiguous shards to get a better speed...
IterableDataset and Dataset return different batch sizes when using Trainer with multiple GPUs
### Describe the bug I am training a Roberta model using 2 GPUs and the `Trainer` API with a batch size of 256. Initially I used a standard `Dataset`, but had issues with slow data loading. After reading [this issue](https://github.com/huggingface/datasets/issues/2252), I swapped to loading my dataset as contiguous...
61
IterableDataset and Dataset return different batch sizes when using Trainer with multiple GPUs ### Describe the bug I am training a Roberta model using 2 GPUs and the `Trainer` API with a batch size of 256. Initially I used a standard `Dataset`, but had issues with slow data loading. After reading [this issue](ht...
[ -0.3572017550468445, -0.16171413660049438, -0.02318817563354969, 0.5625223517417908, 0.114278644323349, -0.07749038189649582, 0.39264559745788574, 0.4203515946865082, -0.2658715844154358, 0.038247715681791306, -0.030516520142555237, 0.03927404806017876, -0.06943927705287933, -0.18142357468...
https://github.com/huggingface/datasets/issues/5506
This is the full set of training args passed. No training args were changed when switching dataset types. ```python training_args = TrainingArguments( output_dir="./checkpoints", overwrite_output_dir=True, num_train_epochs=1, per_device_train_batch_size=256, save_steps=2000, save_total...
IterableDataset and Dataset return different batch sizes when using Trainer with multiple GPUs
### Describe the bug I am training a Roberta model using 2 GPUs and the `Trainer` API with a batch size of 256. Initially I used a standard `Dataset`, but had issues with slow data loading. After reading [this issue](https://github.com/huggingface/datasets/issues/2252), I swapped to loading my dataset as contiguous...
43
IterableDataset and Dataset return different batch sizes when using Trainer with multiple GPUs ### Describe the bug I am training a Roberta model using 2 GPUs and the `Trainer` API with a batch size of 256. Initially I used a standard `Dataset`, but had issues with slow data loading. After reading [this issue](ht...
[ -0.3572017550468445, -0.16171413660049438, -0.02318817563354969, 0.5625223517417908, 0.114278644323349, -0.07749038189649582, 0.39264559745788574, 0.4203515946865082, -0.2658715844154358, 0.038247715681791306, -0.030516520142555237, 0.03927404806017876, -0.06943927705287933, -0.18142357468...
https://github.com/huggingface/datasets/issues/5506
Makes sense. Given that it's a `transformers` issue and already being tracked, I'll close this out.
IterableDataset and Dataset return different batch sizes when using Trainer with multiple GPUs
### Describe the bug I am training a Roberta model using 2 GPUs and the `Trainer` API with a batch size of 256. Initially I used a standard `Dataset`, but had issues with slow data loading. After reading [this issue](https://github.com/huggingface/datasets/issues/2252), I swapped to loading my dataset as contiguous...
16
IterableDataset and Dataset return different batch sizes when using Trainer with multiple GPUs ### Describe the bug I am training a Roberta model using 2 GPUs and the `Trainer` API with a batch size of 256. Initially I used a standard `Dataset`, but had issues with slow data loading. After reading [this issue](ht...
[ -0.3572017550468445, -0.16171413660049438, -0.02318817563354969, 0.5625223517417908, 0.114278644323349, -0.07749038189649582, 0.39264559745788574, 0.4203515946865082, -0.2658715844154358, 0.038247715681791306, -0.030516520142555237, 0.03927404806017876, -0.06943927705287933, -0.18142357468...
https://github.com/huggingface/datasets/issues/5505
This change seems to come from a few months ago in the PyTorch side. That's good news and it means we may not need to pass a batch_sampler as soon as we add `Dataset.__getitems__` to get the optimal speed :) Thanks for reporting ! Would you like to open a PR to add `__getitems__` and remove this outdated documentati...
PyTorch BatchSampler still loads from Dataset one-by-one
### Describe the bug In [the docs here](https://huggingface.co/docs/datasets/use_with_pytorch#use-a-batchsampler), it mentions the issue of the Dataset being read one-by-one, then states that using a BatchSampler resolves the issue. I'm not sure if this is a mistake in the docs or the code, but it seems that the on...
60
PyTorch BatchSampler still loads from Dataset one-by-one ### Describe the bug In [the docs here](https://huggingface.co/docs/datasets/use_with_pytorch#use-a-batchsampler), it mentions the issue of the Dataset being read one-by-one, then states that using a BatchSampler resolves the issue. I'm not sure if this is ...
[ -0.11011955142021179, -0.23176106810569763, 0.08417157828807831, 0.0453607439994812, 0.006417963653802872, -0.03963819891214371, 0.4527328908443451, 0.16253983974456787, 0.3694859743118286, 0.22203756868839264, -0.2264215052127838, 0.3712223172187805, -0.05260435491800308, -0.2659575641155...
https://github.com/huggingface/datasets/issues/5505
Yeah I figured this was the sort of thing that probably once worked. I can confirm that you no longer need the batch sampler, just `batch_size=n` in the `DataLoader`. I'll pass on the PR, I'm flat out right now, sorry.
PyTorch BatchSampler still loads from Dataset one-by-one
### Describe the bug In [the docs here](https://huggingface.co/docs/datasets/use_with_pytorch#use-a-batchsampler), it mentions the issue of the Dataset being read one-by-one, then states that using a BatchSampler resolves the issue. I'm not sure if this is a mistake in the docs or the code, but it seems that the on...
40
PyTorch BatchSampler still loads from Dataset one-by-one ### Describe the bug In [the docs here](https://huggingface.co/docs/datasets/use_with_pytorch#use-a-batchsampler), it mentions the issue of the Dataset being read one-by-one, then states that using a BatchSampler resolves the issue. I'm not sure if this is ...
[ -0.11011955142021179, -0.23176106810569763, 0.08417157828807831, 0.0453607439994812, 0.006417963653802872, -0.03963819891214371, 0.4527328908443451, 0.16253983974456787, 0.3694859743118286, 0.22203756868839264, -0.2264215052127838, 0.3712223172187805, -0.05260435491800308, -0.2659575641155...
https://github.com/huggingface/datasets/issues/5499
Hi ! To skip the verification step that checks if newer data exist, you can enable offline mode with `HF_DATASETS_OFFLINE=1`. Although I agree this step should be much faster for datasets hosted on the HF Hub - we could just compare the commit hash from the local data and the remote git repository. We're not been le...
`load_dataset` has ~4 seconds of overhead for cached data
### Feature request When loading a dataset that has been cached locally, the `load_dataset` function takes a lot longer than it should take to fetch the dataset from disk (or memory). This is particularly noticeable for smaller datasets. For example, wikitext-2, comparing `load_data` (once cached) and `load_from_disk...
77
`load_dataset` has ~4 seconds of overhead for cached data ### Feature request When loading a dataset that has been cached locally, the `load_dataset` function takes a lot longer than it should take to fetch the dataset from disk (or memory). This is particularly noticeable for smaller datasets. For example, wikitex...
[ -0.3865843117237091, -0.025021344423294067, -0.08470558375120163, -0.10525796562433243, -0.13569848239421844, 0.05334455519914627, 0.34366053342819214, 0.5788084864616394, 0.5157306790351868, 0.24651147425174713, -0.021490054205060005, 0.08896823227405548, 0.19552946090698242, -0.032342355...
https://github.com/huggingface/datasets/issues/5498
Hi! Instead of a single boolean, your filter function should return an iterable (of booleans) in the batched mode like so: ```python train_dataset = train_dataset.filter( function=lambda batch: [image is not None for image in batch["image"]], batched=True, batch_size=10) ``` ...
TypeError: 'bool' object is not iterable when filtering a datasets.arrow_dataset.Dataset
### Describe the bug Hi, Thanks for the amazing work on the library! **Describe the bug** I think I might have noticed a small bug in the filter method. Having loaded a dataset using `load_dataset`, when I try to filter out empty entries with `batched=True`, I get a TypeError. ### Steps to reproduce the ...
74
TypeError: 'bool' object is not iterable when filtering a datasets.arrow_dataset.Dataset ### Describe the bug Hi, Thanks for the amazing work on the library! **Describe the bug** I think I might have noticed a small bug in the filter method. Having loaded a dataset using `load_dataset`, when I try to fi...
[ -0.1826024055480957, -0.262439101934433, 0.019751418381929398, 0.1027655303478241, -0.1695653796195984, 0.04956379532814026, 0.523794412612915, 0.17173704504966736, 0.12031219899654388, 0.07023144513368607, 0.05394428223371506, 0.17578284442424774, -0.3360346853733063, 0.2659217119216919, ...
https://github.com/huggingface/datasets/issues/5498
I hit the same issue and the error message isn't really clear on what's going wrong. It might be helpful to update the docs with a batched example.
TypeError: 'bool' object is not iterable when filtering a datasets.arrow_dataset.Dataset
### Describe the bug Hi, Thanks for the amazing work on the library! **Describe the bug** I think I might have noticed a small bug in the filter method. Having loaded a dataset using `load_dataset`, when I try to filter out empty entries with `batched=True`, I get a TypeError. ### Steps to reproduce the ...
28
TypeError: 'bool' object is not iterable when filtering a datasets.arrow_dataset.Dataset ### Describe the bug Hi, Thanks for the amazing work on the library! **Describe the bug** I think I might have noticed a small bug in the filter method. Having loaded a dataset using `load_dataset`, when I try to fi...
[ -0.1826024055480957, -0.262439101934433, 0.019751418381929398, 0.1027655303478241, -0.1695653796195984, 0.04956379532814026, 0.523794412612915, 0.17173704504966736, 0.12031219899654388, 0.07023144513368607, 0.05394428223371506, 0.17578284442424774, -0.3360346853733063, 0.2659217119216919, ...
https://github.com/huggingface/datasets/issues/5496
Hi! Sure, feel free to open a PR, so we can see the API you have in mind.
Add a `reduce` method
### Feature request Right now the `Dataset` class implements `map()` and `filter()`, but leaves out the third functional idiom popular among Python users: `reduce`. ### Motivation A `reduce` method is often useful when calculating dataset statistics, for example, the occurrence of a particular n-gram or the average...
18
Add a `reduce` method ### Feature request Right now the `Dataset` class implements `map()` and `filter()`, but leaves out the third functional idiom popular among Python users: `reduce`. ### Motivation A `reduce` method is often useful when calculating dataset statistics, for example, the occurrence of a particul...
[ -0.5358856916427612, 0.04524768888950348, -0.3128613233566284, -0.1601307988166809, 0.04833761230111122, -0.12517540156841278, -0.021992456167936325, 0.5099626779556274, 0.0958755686879158, 0.2403278946876526, -0.04271167889237404, 0.5281163454055786, -0.1574108600616455, 0.321919560432434...
https://github.com/huggingface/datasets/issues/5495
Hi! This is indeed a bug in our zero-copy logic. To fix it, instead of the line: https://github.com/huggingface/datasets/blob/7cfac43b980ab9e4a69c2328f085770996323005/src/datasets/features/features.py#L702 we should have: ```python return pa.types.is_primitive(pa_type) and not (pa.types.is_boolean(pa_type) or ...
to_tf_dataset fails with datetime UTC columns even if not included in columns argument
### Describe the bug There appears to be some eager behavior in `to_tf_dataset` that runs against every column in a dataset even if they aren't included in the columns argument. This is problematic with datetime UTC columns due to them not working with zero copy. If I don't have UTC information in my datetime column...
30
to_tf_dataset fails with datetime UTC columns even if not included in columns argument ### Describe the bug There appears to be some eager behavior in `to_tf_dataset` that runs against every column in a dataset even if they aren't included in the columns argument. This is problematic with datetime UTC columns due ...
[ -0.035068877041339874, -0.12911270558834076, 0.172512024641037, 0.06727851927280426, 0.29345208406448364, 0.21920831501483917, 0.2418115735054016, 0.38813409209251404, -0.027347255498170853, 0.1469164788722992, 0.3148362934589386, 0.4119408428668976, -0.2279350757598877, -0.257863372564315...
https://github.com/huggingface/datasets/issues/5494
Totally agree, the docs should be in sync with our code. Indeed to avoid confusing users, I think we should have updated the docs at the same time as this PR: - #5167
Update audio installation doc page
Our [installation documentation page](https://huggingface.co/docs/datasets/installation#audio) says that one can use Datasets for mp3 only with `torchaudio<0.12`. `torchaudio>0.12` is actually supported too but requires a specific version of ffmpeg which is not easily installed on all linux versions but there is a cust...
33
Update audio installation doc page Our [installation documentation page](https://huggingface.co/docs/datasets/installation#audio) says that one can use Datasets for mp3 only with `torchaudio<0.12`. `torchaudio>0.12` is actually supported too but requires a specific version of ffmpeg which is not easily installed on a...
[ -0.2912372946739197, -0.17746633291244507, -0.007997211068868637, 0.19306103885173798, 0.305904358625412, -0.12155362218618393, 0.09912662208080292, 0.037171803414821625, -0.1649678647518158, 0.27262818813323975, -0.36509066820144653, 0.32531091570854187, -0.11304660886526108, -0.026876505...
https://github.com/huggingface/datasets/issues/5494
No, @polinaeterna, nothing to be sorry about. My comment was for all of us datasets team, as a reminder: when making a PR, but also when reviewing some other's PR, we should not forget to update the corresponding docstring and doc pages. It is something we can improve if we help each other in reminding about it... :...
Update audio installation doc page
Our [installation documentation page](https://huggingface.co/docs/datasets/installation#audio) says that one can use Datasets for mp3 only with `torchaudio<0.12`. `torchaudio>0.12` is actually supported too but requires a specific version of ffmpeg which is not easily installed on all linux versions but there is a cust...
58
Update audio installation doc page Our [installation documentation page](https://huggingface.co/docs/datasets/installation#audio) says that one can use Datasets for mp3 only with `torchaudio<0.12`. `torchaudio>0.12` is actually supported too but requires a specific version of ffmpeg which is not easily installed on a...
[ -0.3703687787055969, -0.12612468004226685, -0.02275223284959793, 0.12756699323654175, 0.390779972076416, -0.11761364340782166, 0.08204653859138489, 0.034739747643470764, -0.20442423224449158, 0.2120751291513443, -0.3839836120605469, 0.32961028814315796, -0.09249358624219894, -0.03305982798...
https://github.com/huggingface/datasets/issues/5494
@polinaeterna I think we can close this issue now as we no longer use `torchaudio` for decoding.
Update audio installation doc page
Our [installation documentation page](https://huggingface.co/docs/datasets/installation#audio) says that one can use Datasets for mp3 only with `torchaudio<0.12`. `torchaudio>0.12` is actually supported too but requires a specific version of ffmpeg which is not easily installed on all linux versions but there is a cust...
17
Update audio installation doc page Our [installation documentation page](https://huggingface.co/docs/datasets/installation#audio) says that one can use Datasets for mp3 only with `torchaudio<0.12`. `torchaudio>0.12` is actually supported too but requires a specific version of ffmpeg which is not easily installed on a...
[ -0.3492279052734375, -0.27522164583206177, -0.02893996611237526, 0.28877687454223633, 0.4253532290458679, -0.09463098645210266, 0.011428012512624264, 0.09107518941164017, -0.12920592725276947, 0.3243969678878784, -0.49736109375953674, 0.41650906205177307, -0.12207703292369843, -0.036637581...
https://github.com/huggingface/datasets/issues/5492
Assigned to myself and will get to it in the next week, but if someone finds this issue annoying and wants to submit a PR before I do, just ping me here and I'll reassign :).
Push_to_hub in a pull request
Right now `ds.push_to_hub()` can push a dataset on `main` or on a new branch with `branch=`, but there is no way to open a pull request. Even passing `branch=refs/pr/x` doesn't seem to work: it tries to create a branch with that name cc @nateraw It should be possible to tweak the use of `huggingface_hub` in `pus...
36
Push_to_hub in a pull request Right now `ds.push_to_hub()` can push a dataset on `main` or on a new branch with `branch=`, but there is no way to open a pull request. Even passing `branch=refs/pr/x` doesn't seem to work: it tries to create a branch with that name cc @nateraw It should be possible to tweak the ...
[ -0.2519304156303406, -0.7133581638336182, -0.034015681594610214, -0.16951225697994232, 0.019431769847869873, -0.07171158492565155, -0.12493569403886795, 0.09702898561954498, 0.15460258722305298, -0.011190831661224365, -0.007204178720712662, 0.1887531280517578, 0.17961779236793518, 0.304347...
https://github.com/huggingface/datasets/issues/5488
Hi @kradonneoh, thanks for reporting. Please note that to work with audio datasets (and specifically with MP3 files) we have detailed installation instructions in our docs: https://huggingface.co/docs/datasets/installation#audio - one of the requirements is torchaudio<0.12.0 Let us know if the problem persists a...
Error loading MP3 files from CommonVoice
### Describe the bug When loading a CommonVoice dataset with `datasets==2.9.0` and `torchaudio>=0.12.0`, I get an error reading the audio arrays: ```python --------------------------------------------------------------------------- LibsndfileError Traceback (most recent call last) ~/.l...
45
Error loading MP3 files from CommonVoice ### Describe the bug When loading a CommonVoice dataset with `datasets==2.9.0` and `torchaudio>=0.12.0`, I get an error reading the audio arrays: ```python --------------------------------------------------------------------------- LibsndfileError ...
[ -0.2788773775100708, 0.09802059829235077, -0.007227655500173569, 0.5162084102630615, 0.24328216910362244, 0.06495583802461624, 0.11021766066551208, 0.3132626414299011, 0.04005254805088043, 0.31378400325775146, -0.484738826751709, 0.43479248881340027, -0.16472427546977997, -0.48663097620010...
https://github.com/huggingface/datasets/issues/5488
I saw that and have followed it (hence the Expected Behavior section of the bug report). Is there no intention of updating to the latest version? It does limit the version of `torch` I can use, which isn’t ideal.
Error loading MP3 files from CommonVoice
### Describe the bug When loading a CommonVoice dataset with `datasets==2.9.0` and `torchaudio>=0.12.0`, I get an error reading the audio arrays: ```python --------------------------------------------------------------------------- LibsndfileError Traceback (most recent call last) ~/.l...
39
Error loading MP3 files from CommonVoice ### Describe the bug When loading a CommonVoice dataset with `datasets==2.9.0` and `torchaudio>=0.12.0`, I get an error reading the audio arrays: ```python --------------------------------------------------------------------------- LibsndfileError ...
[ -0.2788773775100708, 0.09802059829235077, -0.007227655500173569, 0.5162084102630615, 0.24328216910362244, 0.06495583802461624, 0.11021766066551208, 0.3132626414299011, 0.04005254805088043, 0.31378400325775146, -0.484738826751709, 0.43479248881340027, -0.16472427546977997, -0.48663097620010...
https://github.com/huggingface/datasets/issues/5488
@kradonneoh hey! actually with `ffmpeg4` loading of mp3 files should work, so this is a not expected behavior and we need to investigate it. It works on my side with `torchaudio==0.13` and `ffmpeg==4.2.7`. Which `torchaudio` version do you use? `datasets` should support decoding of mp3 files with `torchaudio` when i...
Error loading MP3 files from CommonVoice
### Describe the bug When loading a CommonVoice dataset with `datasets==2.9.0` and `torchaudio>=0.12.0`, I get an error reading the audio arrays: ```python --------------------------------------------------------------------------- LibsndfileError Traceback (most recent call last) ~/.l...
137
Error loading MP3 files from CommonVoice ### Describe the bug When loading a CommonVoice dataset with `datasets==2.9.0` and `torchaudio>=0.12.0`, I get an error reading the audio arrays: ```python --------------------------------------------------------------------------- LibsndfileError ...
[ -0.2788773775100708, 0.09802059829235077, -0.007227655500173569, 0.5162084102630615, 0.24328216910362244, 0.06495583802461624, 0.11021766066551208, 0.3132626414299011, 0.04005254805088043, 0.31378400325775146, -0.484738826751709, 0.43479248881340027, -0.16472427546977997, -0.48663097620010...
https://github.com/huggingface/datasets/issues/5487
Hi! The correct path is still `dill._dill.XXXX` in the latest release. What do you get when you run `python -c "import dill; print(dill.__version__)"` in your environment?
Incorrect filepath for dill module
### Describe the bug I installed the `datasets` package and when I try to `import` it, I get the following error: ``` Traceback (most recent call last): File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module> import datasets File "/Users/avivbrokman/...
26
Incorrect filepath for dill module ### Describe the bug I installed the `datasets` package and when I try to `import` it, I get the following error: ``` Traceback (most recent call last): File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module> import da...
[ -0.2769618630409241, 0.15094736218452454, -0.10528578609228134, 0.3617425858974457, 0.14019560813903809, 0.010013289749622345, 0.4118013083934784, 0.19778046011924744, -0.2751946449279785, -0.22182226181030273, -0.20238527655601501, 0.31671544909477234, -0.30551618337631226, -0.18682536482...
https://github.com/huggingface/datasets/issues/5487
`0.3.6` I feel like that's bad news, because it's probably not the issue. My mistake, about the wrong path guess. I think I didn't notice that the first `dill` in the path isn't supposed to be included in the path specification in python. <img width="146" alt="Screen Shot 2023-01-31 at 12 58 32 PM" src="https://us...
Incorrect filepath for dill module
### Describe the bug I installed the `datasets` package and when I try to `import` it, I get the following error: ``` Traceback (most recent call last): File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module> import datasets File "/Users/avivbrokman/...
54
Incorrect filepath for dill module ### Describe the bug I installed the `datasets` package and when I try to `import` it, I get the following error: ``` Traceback (most recent call last): File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module> import da...
[ -0.2769618630409241, 0.15094736218452454, -0.10528578609228134, 0.3617425858974457, 0.14019560813903809, 0.010013289749622345, 0.4118013083934784, 0.19778046011924744, -0.2751946449279785, -0.22182226181030273, -0.20238527655601501, 0.31671544909477234, -0.30551618337631226, -0.18682536482...
https://github.com/huggingface/datasets/issues/5487
Hi, @avivbrokman, this issue you report appeared only with old versions of dill. See: - #288 Are you sure you are in the right Python environment? - Please note that Jupyter (where I guess you get the error) may have multiple execution backends (IPython kernels) that might be different from the Python environment ...
Incorrect filepath for dill module
### Describe the bug I installed the `datasets` package and when I try to `import` it, I get the following error: ``` Traceback (most recent call last): File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module> import datasets File "/Users/avivbrokman/...
85
Incorrect filepath for dill module ### Describe the bug I installed the `datasets` package and when I try to `import` it, I get the following error: ``` Traceback (most recent call last): File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module> import da...
[ -0.2769618630409241, 0.15094736218452454, -0.10528578609228134, 0.3617425858974457, 0.14019560813903809, 0.010013289749622345, 0.4118013083934784, 0.19778046011924744, -0.2751946449279785, -0.22182226181030273, -0.20238527655601501, 0.31671544909477234, -0.30551618337631226, -0.18682536482...
https://github.com/huggingface/datasets/issues/5487
I'm using spyder, and I am still getting `0.3.6` for `dill`, so unfortunately #288 isn't applicable, I think. However, I found something odd that I believe is a clue: ``` import inspect import dill inspect.getfile(dill) >>> '/Users/avivbrokman/opt/anaconda3/lib/python3.9/site-packages/dill/__init__.py' ``` ...
Incorrect filepath for dill module
### Describe the bug I installed the `datasets` package and when I try to `import` it, I get the following error: ``` Traceback (most recent call last): File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module> import datasets File "/Users/avivbrokman/...
152
Incorrect filepath for dill module ### Describe the bug I installed the `datasets` package and when I try to `import` it, I get the following error: ``` Traceback (most recent call last): File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module> import da...
[ -0.2769618630409241, 0.15094736218452454, -0.10528578609228134, 0.3617425858974457, 0.14019560813903809, 0.010013289749622345, 0.4118013083934784, 0.19778046011924744, -0.2751946449279785, -0.22182226181030273, -0.20238527655601501, 0.31671544909477234, -0.30551618337631226, -0.18682536482...
https://github.com/huggingface/datasets/issues/5487
As I said above, I guess this is not a problem with `datasets`. I think you have different Python environments: one with the new dill version (the one you get while using pip) and other with the old dill version (the one where you get the AttributeError). You should update `dill` in the Python environment you are us...
Incorrect filepath for dill module
### Describe the bug I installed the `datasets` package and when I try to `import` it, I get the following error: ``` Traceback (most recent call last): File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module> import datasets File "/Users/avivbrokman/...
76
Incorrect filepath for dill module ### Describe the bug I installed the `datasets` package and when I try to `import` it, I get the following error: ``` Traceback (most recent call last): File "/var/folders/jt/zw5g74ln6tqfdzsl8tx378j00000gn/T/ipykernel_3805/3458380017.py", line 1, in <module> import da...
[ -0.2769618630409241, 0.15094736218452454, -0.10528578609228134, 0.3617425858974457, 0.14019560813903809, 0.010013289749622345, 0.4118013083934784, 0.19778046011924744, -0.2751946449279785, -0.22182226181030273, -0.20238527655601501, 0.31671544909477234, -0.30551618337631226, -0.18682536482...
https://github.com/huggingface/datasets/issues/5486
Hi @omar-araboghli, thanks for your proposal. Have you tried to use "csv" loader instead of "text"? That already has a `sep` argument.
Adding `sep` to TextConfig
I have a local a `.txt` file that follows the `CONLL2003` format which I need to load using `load_script`. However, by using `sample_by='line'`, one can only split the dataset into lines without splitting each line into columns. Would it be reasonable to add a `sep` argument in combination with `sample_by='paragraph'` ...
22
Adding `sep` to TextConfig I have a local a `.txt` file that follows the `CONLL2003` format which I need to load using `load_script`. However, by using `sample_by='line'`, one can only split the dataset into lines without splitting each line into columns. Would it be reasonable to add a `sep` argument in combination...
[ -0.17985980212688446, -0.29511117935180664, -0.13400720059871674, -0.11365734040737152, -0.017994554713368416, 0.09609730541706085, 0.635643720626831, 0.04844066873192787, -0.06427419185638428, 0.168888121843338, 0.3131987750530243, 0.3941831588745117, -0.07302190363407135, 0.6800392270088...
https://github.com/huggingface/datasets/issues/5486
Hi @albertvillanova, thanks for the quick response! Indeed, I have been trying to use `csv` instead of `text`. However I am still not able to define range of rows as one sequence, that is achievable with passing `sample_by='paragraph'` to the `TextConfig` For instance, the below code ```python import datasets...
Adding `sep` to TextConfig
I have a local a `.txt` file that follows the `CONLL2003` format which I need to load using `load_script`. However, by using `sample_by='line'`, one can only split the dataset into lines without splitting each line into columns. Would it be reasonable to add a `sep` argument in combination with `sample_by='paragraph'` ...
116
Adding `sep` to TextConfig I have a local a `.txt` file that follows the `CONLL2003` format which I need to load using `load_script`. However, by using `sample_by='line'`, one can only split the dataset into lines without splitting each line into columns. Would it be reasonable to add a `sep` argument in combination...
[ -0.17985980212688446, -0.29511117935180664, -0.13400720059871674, -0.11365734040737152, -0.017994554713368416, 0.09609730541706085, 0.635643720626831, 0.04844066873192787, -0.06427419185638428, 0.168888121843338, 0.3131987750530243, 0.3941831588745117, -0.07302190363407135, 0.6800392270088...
https://github.com/huggingface/datasets/issues/5482
I'd be happy to have a look, if nobody else has started working on this yet @lhoestq. It seems to me that for the `arrow` format features are currently attached as metadata [in `datasets.arrow_writer`](https://github.com/huggingface/datasets/blob/5f810b7011a8a4ab077a1847c024d2d9e267b065/src/datasets/arrow_writer.py...
Reload features from Parquet metadata
The idea would be to allow this : ```python ds.to_parquet("my_dataset/ds.parquet") reloaded = load_dataset("my_dataset") assert ds.features == reloaded.features ``` And it should also work with Image and Audio types (right now they're reloaded as a dict type) This can be implemented by storing and reading th...
66
Reload features from Parquet metadata The idea would be to allow this : ```python ds.to_parquet("my_dataset/ds.parquet") reloaded = load_dataset("my_dataset") assert ds.features == reloaded.features ``` And it should also work with Image and Audio types (right now they're reloaded as a dict type) This can ...
[ -0.08376418799161911, -0.09851519763469696, -0.0035651028156280518, 0.10990031063556671, 0.10157585144042969, -0.22673025727272034, -0.016706334426999092, 0.22576352953910828, -0.09258420020341873, -0.2656984329223633, -0.066251739859581, 0.8153361678123474, -0.20344232022762299, 0.4364822...
https://github.com/huggingface/datasets/issues/5482
Thanks @MFreidank ! That's correct :) Reading the metadata to infer the features can be ideally done in the `parquet.py` file in `packaged_builder` when a parquet file is read. You can cast the arrow table to the schema you get from the features.arrow_schema
Reload features from Parquet metadata
The idea would be to allow this : ```python ds.to_parquet("my_dataset/ds.parquet") reloaded = load_dataset("my_dataset") assert ds.features == reloaded.features ``` And it should also work with Image and Audio types (right now they're reloaded as a dict type) This can be implemented by storing and reading th...
43
Reload features from Parquet metadata The idea would be to allow this : ```python ds.to_parquet("my_dataset/ds.parquet") reloaded = load_dataset("my_dataset") assert ds.features == reloaded.features ``` And it should also work with Image and Audio types (right now they're reloaded as a dict type) This can ...
[ -0.24764932692050934, -0.16579212248325348, -0.0633038580417633, 0.21691559255123138, 0.05626881867647171, -0.18249143660068512, -0.016658755019307137, 0.21604865789413452, 0.03514373302459717, -0.06509911268949509, 0.09455104172229767, 0.7727562785148621, -0.26848652958869934, 0.423409134...
https://github.com/huggingface/datasets/issues/5481
Hi ! Sure :) you can comment `#self-assign` to assign yourself to this issue. I can give you some pointers to get started: `load_dataset` works roughly this way: 1. it instantiate a dataset builder using `load_dataset_builder()` 2. the builder download and prepare the dataset as Arrow files in the cache using `...
Load a cached dataset as iterable
The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when streaming=True
146
Load a cached dataset as iterable The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when stream...
[ -0.44019511342048645, 0.03537468612194061, -0.08761925250291824, 0.09599599987268448, 0.18538518249988556, 0.25526049733161926, 0.2815187871456146, 0.4225120544433594, 0.17668196558952332, -0.13068315386772156, -0.05066928640007973, 0.1650177538394928, -0.3784251809120178, 0.08378483355045...
https://github.com/huggingface/datasets/issues/5481
This use-case is a bit specific, and `load_dataset` already has enough parameters (plus, `streaming=True` also returns an iterable dataset, so we would have to explain the difference), so I think it would be better to add `IterableDataset.from_file` to the API (more flexible and aligned with the goal from https://githu...
Load a cached dataset as iterable
The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when streaming=True
50
Load a cached dataset as iterable The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when stream...
[ -0.41775602102279663, -0.17543068528175354, -0.042635075747966766, 0.06517583131790161, 0.16342857480049133, 0.17753908038139343, 0.29443278908729553, 0.3811503052711487, 0.3552766442298889, -0.062385037541389465, -0.040913842618465424, 0.12226404994726181, -0.30564084649086, 0.27318519353...
https://github.com/huggingface/datasets/issues/5481
> This use-case is a bit specific This allows to use `datasets` for large scale training where map-style datasets are too slow and use too much memory in PyTorch. So I would still consider adding it. Alternatively we could add this feature one level bellow: ```python builder = load_dataset_builder(...) builder...
Load a cached dataset as iterable
The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when streaming=True
54
Load a cached dataset as iterable The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when stream...
[ -0.46229082345962524, -0.025393515825271606, -0.07936941087245941, 0.0317857563495636, 0.12096720933914185, 0.23055317997932434, 0.32718613743782043, 0.402756929397583, 0.23554113507270813, -0.07977931946516037, 0.0063590966165065765, 0.19893185794353485, -0.382403165102005, 0.092048183083...
https://github.com/huggingface/datasets/issues/5481
Yes, I see how this can be useful. Still, I think `Dataset.to_iterable` + `IterableDataset.from_file` would be much cleaner in terms of the API design (and more flexible since `load_dataset` can only access the "initial" (unprocessed) version of a dataset). And since it can be tricky to manually find the "initial" v...
Load a cached dataset as iterable
The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when streaming=True
75
Load a cached dataset as iterable The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when stream...
[ -0.4529181718826294, -0.01684349775314331, -0.12488695979118347, -0.06570805609226227, 0.08305391669273376, 0.24319052696228027, 0.23844826221466064, 0.44732385873794556, 0.3207479417324066, -0.10691742599010468, 0.1624636948108673, 0.1538330763578415, -0.35691550374031067, 0.1333277225494...
https://github.com/huggingface/datasets/issues/5481
> This allows to use datasets for large scale training where map-style datasets are too slow and use too much memory in PyTorch. I second that. e.g. In my last experiment Oscar-en uses 16GB RSS RAM per process and when using multiple processes the host quickly runs out cpu memory.
Load a cached dataset as iterable
The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when streaming=True
50
Load a cached dataset as iterable The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when stream...
[ -0.427212119102478, -0.13766320049762726, -0.082572340965271, 0.03433060646057129, 0.1377316117286682, 0.2024303376674652, 0.2503300905227661, 0.3894111216068268, 0.31535303592681885, -0.0796649307012558, 0.03051646798849106, 0.1663641333580017, -0.4187721908092499, 0.06501634418964386, ...
https://github.com/huggingface/datasets/issues/5481
>And since it can be tricky to manually find the "initial" version of a dataset in the cache, maybe load_dataset could return an iterable dataset streamed from the cache if streaming=True and the cache is up-to-date. This is exactly the need on JeanZay (HPC) - I have the dataset cache ready, but the compute node is ...
Load a cached dataset as iterable
The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when streaming=True
81
Load a cached dataset as iterable The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when stream...
[ -0.5014039278030396, 0.054326996207237244, -0.1012561172246933, -0.07900769263505936, 0.12147890776395798, 0.18196523189544678, 0.25633540749549866, 0.4222378432750702, 0.23714984953403473, 0.052170827984809875, 0.12539032101631165, 0.1513904631137848, -0.3170551061630249, 0.22297605872154...
https://github.com/huggingface/datasets/issues/5481
> Yes, I see how this can be useful. Still, I think Dataset.to_iterable + IterableDataset.from_file would be much cleaner in terms of the API design (and more flexible since load_dataset can only access the "initial" (unprocessed) version of a dataset). I like `IterableDataset.from_file` as well. On the other hand `...
Load a cached dataset as iterable
The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when streaming=True
172
Load a cached dataset as iterable The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when stream...
[ -0.4431467652320862, 0.028156086802482605, -0.1120665967464447, -0.1262325942516327, -0.005113631021231413, 0.19356130063533783, 0.2638634443283081, 0.45472848415374756, 0.38455864787101746, -0.14230048656463623, 0.21010878682136536, 0.1635698825120926, -0.37390780448913574, 0.127291098237...
https://github.com/huggingface/datasets/issues/5481
> I was suggesting a different parameter just to make explicit the difference between MosaicML's `streaming` library does the same (tries to stream from the local cache if possible), so logging a message should be explicit enough :).
Load a cached dataset as iterable
The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when streaming=True
38
Load a cached dataset as iterable The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when stream...
[ -0.509040117263794, -0.03890490531921387, -0.04314109683036804, -0.0649033784866333, 0.20460796356201172, 0.16297167539596558, 0.30312100052833557, 0.41245391964912415, 0.392551451921463, -0.018862858414649963, 0.16024884581565857, 0.10355989634990692, -0.34594762325286865, 0.1425295472145...
https://github.com/huggingface/datasets/issues/5481
Hi Both! It has been a while since my first issue so I am gonna go for this one ! #self-assign
Load a cached dataset as iterable
The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when streaming=True
21
Load a cached dataset as iterable The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when stream...
[ -0.372744083404541, -0.029645204544067383, -0.10232014209032059, 0.03645455837249756, 0.2829430103302002, 0.22140967845916748, 0.3611030578613281, 0.39190390706062317, 0.26572346687316895, -0.05048215389251709, 0.027521826326847076, 0.2198244333267212, -0.3287927806377411, 0.10471656918525...
https://github.com/huggingface/datasets/issues/5481
https://github.com/huggingface/datasets/pull/5821 should be helpful to implement `IterableDataset.from_file`, since it defines a new ArrowExamplesIterable that takes an Arrow tables generator function (e.g. from a file) and can be used in an IterableDataset
Load a cached dataset as iterable
The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when streaming=True
31
Load a cached dataset as iterable The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when stream...
[ -0.4893519878387451, -0.09050265699625015, -0.06809556484222412, 0.0654192864894867, 0.15620239078998566, 0.2286251038312912, 0.2631438374519348, 0.3890012204647064, 0.2009519636631012, -0.0993698239326477, -0.045624252408742905, 0.23635233938694, -0.34979140758514404, 0.1471540629863739, ...
https://github.com/huggingface/datasets/issues/5481
So what's recommanded usage of `IterableDataset.from_file` and `load_dataset`? How about I have multiple arrow files and `load_dataset` is often convenient to handle that.
Load a cached dataset as iterable
The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when streaming=True
23
Load a cached dataset as iterable The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when stream...
[ -0.40746793150901794, -0.13469506800174713, -0.09110579639673233, -0.03467567637562752, 0.04325343295931816, 0.32301056385040283, 0.30975109338760376, 0.3785957396030426, 0.2165679931640625, -0.1759716123342514, 0.13465732336044312, 0.16233909130096436, -0.2954760491847992, 0.0019570067524...
https://github.com/huggingface/datasets/issues/5481
If you have multiple Arrow files you can load them using ```python from datasets import load_dataset data_files = {"train": ["path/to/0.arrow", "path/to/1.arrow", ..., "path/to/n.arrow"]} ds = load_dataset("arrow", data_files=data_files, streaming=True) ``` This is equivalent to calling `IterableDataset.f...
Load a cached dataset as iterable
The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when streaming=True
37
Load a cached dataset as iterable The idea would be to allow something like ```python ds = load_dataset("c4", "en", as_iterable=True) ``` To be used to train models. It would load an IterableDataset from the cached Arrow files. Cc @stas00 Edit : from the discussions we may load from cache when stream...
[ -0.48651909828186035, -0.03874531388282776, -0.11956481635570526, 0.045861028134822845, 0.16132983565330505, 0.21264591813087463, 0.3140718936920166, 0.38246893882751465, 0.1456645429134369, -0.06635093688964844, 0.01433655247092247, 0.19016391038894653, -0.33218812942504883, 0.02641626447...
https://github.com/huggingface/datasets/issues/5477
@albertvillanova It looks like that issue has been fixed so I made a PR to unpin sqlalchemy!
Unpin sqlalchemy once issue is fixed
Once the source issue is fixed: - pandas-dev/pandas#51015 we should revert the pin introduced in: - #5476
17
Unpin sqlalchemy once issue is fixed Once the source issue is fixed: - pandas-dev/pandas#51015 we should revert the pin introduced in: - #5476 @albertvillanova It looks like that issue has been fixed so I made a PR to unpin sqlalchemy!
[ -0.04986357316374779, -0.03808756172657013, -0.1432604044675827, -0.14374950528144836, 0.4060012400150299, -0.2523588538169861, 0.4265766143798828, 0.4297684133052826, -0.04615010321140289, 0.2177068293094635, -0.039940666407346725, 0.32142406702041626, 0.1357933133840561, 0.24988135695457...
https://github.com/huggingface/datasets/issues/5477
The source issue: - https://github.com/pandas-dev/pandas/issues/40686 has been fixed: - https://github.com/pandas-dev/pandas/pull/48576 The fix was released yesterday (2023-04-03) only in `pandas-2.0.0`: - https://github.com/pandas-dev/pandas/releases/tag/v2.0.0 but it will not be back-ported to `pandas-1`:...
Unpin sqlalchemy once issue is fixed
Once the source issue is fixed: - pandas-dev/pandas#51015 we should revert the pin introduced in: - #5476
62
Unpin sqlalchemy once issue is fixed Once the source issue is fixed: - pandas-dev/pandas#51015 we should revert the pin introduced in: - #5476 The source issue: - https://github.com/pandas-dev/pandas/issues/40686 has been fixed: - https://github.com/pandas-dev/pandas/pull/48576 The fix was released yes...
[ -0.007535241544246674, -0.04123562574386597, -0.14490538835525513, -0.17465922236442566, 0.3113883137702942, -0.21231672167778015, 0.3386847674846649, 0.4317508041858673, -0.11720441281795502, 0.21164260804653168, -0.11504370719194412, 0.3739951252937317, 0.03244796022772789, 0.23929947614...
https://github.com/huggingface/datasets/issues/5475
Hi ! In your code you only iterate on the Arrow buffers - you don't actually load the data as python objects. For a fair comparison, you can modify your code using: ```diff - for _ in range(0, len(table), bsz): - _ = {k:table[k][_ : _ + bsz] for k in cols} + for _ in range(0, len(table), bsz): + ...
Dataset scan time is much slower than using native arrow
### Describe the bug I'm basically running the same scanning experiment from the tutorials https://huggingface.co/course/chapter5/4?fw=pt except now I'm comparing to a native pyarrow version. I'm finding that the native pyarrow approach is much faster (2 orders of magnitude). Is there something I'm missing that exp...
85
Dataset scan time is much slower than using native arrow ### Describe the bug I'm basically running the same scanning experiment from the tutorials https://huggingface.co/course/chapter5/4?fw=pt except now I'm comparing to a native pyarrow version. I'm finding that the native pyarrow approach is much faster (2 or...
[ -0.3561725616455078, -0.2545662522315979, 0.03432554006576538, 0.18321427702903748, -0.3127444386482239, -0.22625616192817688, 0.2413417547941208, 0.2707262635231018, -0.256633460521698, 0.25401151180267334, -0.24615059792995453, 0.635158121585846, -0.0695858895778656, 0.033697545528411865...
https://github.com/huggingface/datasets/issues/5475
Ah I see, datasets is implicitly making this conversion. Thanks for pointing that out! If it's not too much, I would also suggest updating some of your docs with the same `.to_pylist()` conversion in the code snippet that follows [here](https://huggingface.co/course/chapter5/4?fw=pt#:~:text=let%E2%80%99s%20run%20a%2...
Dataset scan time is much slower than using native arrow
### Describe the bug I'm basically running the same scanning experiment from the tutorials https://huggingface.co/course/chapter5/4?fw=pt except now I'm comparing to a native pyarrow version. I'm finding that the native pyarrow approach is much faster (2 orders of magnitude). Is there something I'm missing that exp...
40
Dataset scan time is much slower than using native arrow ### Describe the bug I'm basically running the same scanning experiment from the tutorials https://huggingface.co/course/chapter5/4?fw=pt except now I'm comparing to a native pyarrow version. I'm finding that the native pyarrow approach is much faster (2 or...
[ -0.38774386048316956, -0.08761458843946457, 0.043652523308992386, 0.13892324268817902, -0.13225612044334412, -0.2132619321346283, 0.3500564396381378, 0.1736629605293274, -0.4576828181743622, 0.22467529773712158, -0.21866361796855927, 0.7415611743927002, -0.04147012531757355, 0.036499485373...
https://github.com/huggingface/datasets/issues/5475
This code snippet shows `datasets` code that reads the Arrow data as python objects already, there is no need to add to_pylist. Or were you thinking about something else ?
Dataset scan time is much slower than using native arrow
### Describe the bug I'm basically running the same scanning experiment from the tutorials https://huggingface.co/course/chapter5/4?fw=pt except now I'm comparing to a native pyarrow version. I'm finding that the native pyarrow approach is much faster (2 orders of magnitude). Is there something I'm missing that exp...
30
Dataset scan time is much slower than using native arrow ### Describe the bug I'm basically running the same scanning experiment from the tutorials https://huggingface.co/course/chapter5/4?fw=pt except now I'm comparing to a native pyarrow version. I'm finding that the native pyarrow approach is much faster (2 or...
[ -0.381632924079895, -0.09336671233177185, 0.008570395410060883, 0.2181921899318695, -0.28830522298812866, -0.2284887433052063, 0.31598377227783203, 0.20896390080451965, -0.3874415159225464, 0.2474825084209442, -0.16962504386901855, 0.6856093406677246, -0.14588162302970886, 0.00614170730113...
https://github.com/huggingface/datasets/issues/5474
Hi ! This would be a nice addition indeed :) This sounds like a duplicate of https://github.com/huggingface/datasets/issues/5468 > Not sure. Some of my PRs are still open and some do not have any discussions. Sorry to hear that, feel free to ping me on those PRs
Column project operation on `datasets.Dataset`
### Feature request There is no operation to select a subset of columns of original dataset. Expected API follows. ```python a = Dataset.from_dict({ 'int': [0, 1, 2] 'char': ['a', 'b', 'c'], 'none': [None] * 3, }) b = a.project('int', 'char') # usually, .select() print(a.column_names) # std...
46
Column project operation on `datasets.Dataset` ### Feature request There is no operation to select a subset of columns of original dataset. Expected API follows. ```python a = Dataset.from_dict({ 'int': [0, 1, 2] 'char': ['a', 'b', 'c'], 'none': [None] * 3, }) b = a.project('int', 'char') # u...
[ -0.2232564091682434, 0.2531569302082062, -0.09896518290042877, -0.031019091606140137, 0.10474658012390137, -0.004755683243274689, 0.34300658106803894, 0.2448384165763855, -0.17446888983249664, 0.5412549376487732, -0.051836393773555756, 0.5907323360443115, 0.0822993591427803, 0.484067976474...