html_url
stringlengths
48
51
title
stringlengths
5
155
comments
stringlengths
63
15.7k
body
stringlengths
0
17.7k
comment_length
int64
16
949
text
stringlengths
164
23.7k
https://github.com/huggingface/datasets/issues/769
How to choose proper download_mode in function load_dataset?
It's no big deal, but since it can be confusing to users I think it's worth renaming it, and deprecate `GenerateMode` until `datasets` 2.0 at least. IMO it's confusing to have `download_mode=GenerateMode.something`
Hi, I am a beginner to datasets and I try to use datasets to load my csv file. my csv file looks like this ``` text,label "Effective but too-tepid biopic",3 "If you sometimes like to go to the movies to have fun , Wasabi is a good place to start .",4 "Emerges as something rare , an issue movie that 's so honest and keenly observed that it does n't feel like one .",5 ``` First I try to use this command to load my csv file . ``` python dataset=load_dataset('csv', data_files=['sst_test.csv']) ``` It seems good, but when i try to overwrite the convert_options to convert 'label' columns from int64 to float32 like this. ``` python import pyarrow as pa from pyarrow import csv read_options = csv.ReadOptions(block_size=1024*1024) parse_options = csv.ParseOptions() convert_options = csv.ConvertOptions(column_types={'text': pa.string(), 'label': pa.float32()}) dataset = load_dataset('csv', data_files=['sst_test.csv'], read_options=read_options, parse_options=parse_options, convert_options=convert_options) ``` It keeps the same: ```shell Dataset(features: {'text': Value(dtype='string', id=None), 'label': Value(dtype='int64', id=None)}, num_rows: 2210) ``` I think this issue is caused by the parameter "download_mode" Default to REUSE_DATASET_IF_EXISTS because after I delete the cache_dir, it seems right. Is it a bug? How to choose proper download_mode to avoid this issue?
32
How to choose proper download_mode in function load_dataset? Hi, I am a beginner to datasets and I try to use datasets to load my csv file. my csv file looks like this ``` text,label "Effective but too-tepid biopic",3 "If you sometimes like to go to the movies to have fun , Wasabi is a good place to start .",4 "Emerges as something rare , an issue movie that 's so honest and keenly observed that it does n't feel like one .",5 ``` First I try to use this command to load my csv file . ``` python dataset=load_dataset('csv', data_files=['sst_test.csv']) ``` It seems good, but when i try to overwrite the convert_options to convert 'label' columns from int64 to float32 like this. ``` python import pyarrow as pa from pyarrow import csv read_options = csv.ReadOptions(block_size=1024*1024) parse_options = csv.ParseOptions() convert_options = csv.ConvertOptions(column_types={'text': pa.string(), 'label': pa.float32()}) dataset = load_dataset('csv', data_files=['sst_test.csv'], read_options=read_options, parse_options=parse_options, convert_options=convert_options) ``` It keeps the same: ```shell Dataset(features: {'text': Value(dtype='string', id=None), 'label': Value(dtype='int64', id=None)}, num_rows: 2210) ``` I think this issue is caused by the parameter "download_mode" Default to REUSE_DATASET_IF_EXISTS because after I delete the cache_dir, it seems right. Is it a bug? How to choose proper download_mode to avoid this issue? It's no big deal, but since it can be confusing to users I think it's worth renaming it, and deprecate `GenerateMode` until `datasets` 2.0 at least. IMO it's confusing to have `download_mode=GenerateMode.something`
https://github.com/huggingface/datasets/issues/768
Add a `lazy_map` method to `Dataset` and `DatasetDict`
This is cool! I think some aspects to think about and decide in terms of API are: - do we allow several methods (chained i guess) - how do we inspect the currently set method(s) - how do we control/reset them
The library is great, but it would be even more awesome with a `lazy_map` method implemented on `Dataset` and `DatasetDict`. This would apply a function on a give item but when the item is requested. Two use cases: 1. load image on the fly 2. apply a random function and get different outputs at each epoch (like data augmentation or randomly masking a part of a sentence for BERT-like objectives).
41
Add a `lazy_map` method to `Dataset` and `DatasetDict` The library is great, but it would be even more awesome with a `lazy_map` method implemented on `Dataset` and `DatasetDict`. This would apply a function on a give item but when the item is requested. Two use cases: 1. load image on the fly 2. apply a random function and get different outputs at each epoch (like data augmentation or randomly masking a part of a sentence for BERT-like objectives). This is cool! I think some aspects to think about and decide in terms of API are: - do we allow several methods (chained i guess) - how do we inspect the currently set method(s) - how do we control/reset them
https://github.com/huggingface/datasets/issues/767
Add option for named splits when using ds.train_test_split
Yes definitely we should give more flexibility to control the name of the splits outputted by `train_test_split`. Related is the very interesting feedback from @bramvanroy on how we should improve this method: https://discuss.huggingface.co/t/how-to-split-main-dataset-into-train-dev-test-as-datasetdict/1090/5 And in particular that it should advantageously be able to split in 3 splits as well instead of just 2 like we copied from sklearn.
### Feature Request 🚀 Can we add a way to name your splits when using the `.train_test_split` function? In almost every use case I've come across, I have a `train` and a `test` split in my `DatasetDict`, and I want to create a `validation` split. Therefore, its kinda useless to get a `test` split back from `train_test_split`, as it'll just overwrite my real `test` split that I intended to keep. ### Workaround this is my hack for dealin with this, for now :slightly_smiling_face: ```python from datasets import load_dataset ​ ​ ds = load_dataset('imdb') ds['train'], ds['validation'] = ds['train'].train_test_split(.1).values() ```
58
Add option for named splits when using ds.train_test_split ### Feature Request 🚀 Can we add a way to name your splits when using the `.train_test_split` function? In almost every use case I've come across, I have a `train` and a `test` split in my `DatasetDict`, and I want to create a `validation` split. Therefore, its kinda useless to get a `test` split back from `train_test_split`, as it'll just overwrite my real `test` split that I intended to keep. ### Workaround this is my hack for dealin with this, for now :slightly_smiling_face: ```python from datasets import load_dataset ​ ​ ds = load_dataset('imdb') ds['train'], ds['validation'] = ds['train'].train_test_split(.1).values() ``` Yes definitely we should give more flexibility to control the name of the splits outputted by `train_test_split`. Related is the very interesting feedback from @bramvanroy on how we should improve this method: https://discuss.huggingface.co/t/how-to-split-main-dataset-into-train-dev-test-as-datasetdict/1090/5 And in particular that it should advantageously be able to split in 3 splits as well instead of just 2 like we copied from sklearn.
https://github.com/huggingface/datasets/issues/761
Downloaded datasets are not usable offline
Yes currently you need an internet connection because the lib tries to check for the etag of the dataset script online to see if you don't have it locally already. If we add a way to store the etag/hash locally after the first download, it would allow users to first download the dataset with an internet connection, and still have it working without an internet connection. I'll let you know when we add this feature.
I've been trying to use the IMDB dataset offline, but after downloading it and turning off the internet it still raises an error from the ```requests``` library trying to reach for the online dataset. Is this the intended behavior ? (Sorry, I wrote the the first version of this issue while still on nlp 0.3.0).
75
Downloaded datasets are not usable offline I've been trying to use the IMDB dataset offline, but after downloading it and turning off the internet it still raises an error from the ```requests``` library trying to reach for the online dataset. Is this the intended behavior ? (Sorry, I wrote the the first version of this issue while still on nlp 0.3.0). Yes currently you need an internet connection because the lib tries to check for the etag of the dataset script online to see if you don't have it locally already. If we add a way to store the etag/hash locally after the first download, it would allow users to first download the dataset with an internet connection, and still have it working without an internet connection. I'll let you know when we add this feature.
https://github.com/huggingface/datasets/issues/759
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py
Does this HEAD request return 200 on your machine ? ```python import requests requests.head("https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py") ``` If it returns 200, could you try again to load the dataset ?
Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ?
28
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ? Does this HEAD request return 200 on your machine ? ```python import requests requests.head("https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py") ``` If it returns 200, could you try again to load the dataset ?
https://github.com/huggingface/datasets/issues/759
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py
Thank you very much for your response. When I run ``` import requests requests.head("https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py") ``` It returns 200. And I try again to load the dataset. I got the following errors again. Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py", line 608, in load_dataset builder_instance.download_and_prepare( File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\builder.py", line 475, in download_and_prepare self._download_and_prepare( File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\builder.py", line 531, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "C:\Users\666666\.cache\huggingface\modules\datasets_modules\datasets\cnn_dailymail\0128610a44e10f25b4af6689441c72af86205282d26399642f7db38fa7535602\cnn_dailymail.py", line 253, in _split_generators dl_paths = dl_manager.download_and_extract(_DL_URLS) File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\download_manager.py", line 254, in download_and_extract return self.extract(self.download(url_or_urls)) File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\download_manager.py", line 175, in download downloaded_path_or_paths = map_nested( File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\py_utils.py", line 224, in map_nested mapped = [ File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\py_utils.py", line 225, in <listcomp> _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\py_utils.py", line 163, in _single_map_nested return function(data_struct) File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py", line 300, in cached_path output_path = get_from_cache( File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py", line 475, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://drive.google.com/uc?export=download&id=0BwmD_VLjROrfTHk4NFg2SndKcjQ Connection error happened but the url was different. I add the following code. ``` requests.head("https://drive.google.com/uc?export=download&id=0BwmD_VLjROrfTHk4NFg2SndKcjQ") ``` This didn't return 200 It returned like this: Traceback (most recent call last): File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connection.py", line 159, in _new_conn conn = connection.create_connection( File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\util\connection.py", line 84, in create_connection raise err File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\util\connection.py", line 74, in create_connection sock.connect(sa) TimeoutError: [WinError 10060] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen httplib_response = self._make_request( File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 381, in _make_request self._validate_conn(conn) File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 978, in _validate_conn conn.connect() File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connection.py", line 309, in connect conn = self._new_conn() File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connection.py", line 171, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x000001F6060618E0>: Failed to establish a new connection: [WinError 10060]
Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ?
272
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ? Thank you very much for your response. When I run ``` import requests requests.head("https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py") ``` It returns 200. And I try again to load the dataset. I got the following errors again. Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py", line 608, in load_dataset builder_instance.download_and_prepare( File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\builder.py", line 475, in download_and_prepare self._download_and_prepare( File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\builder.py", line 531, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "C:\Users\666666\.cache\huggingface\modules\datasets_modules\datasets\cnn_dailymail\0128610a44e10f25b4af6689441c72af86205282d26399642f7db38fa7535602\cnn_dailymail.py", line 253, in _split_generators dl_paths = dl_manager.download_and_extract(_DL_URLS) File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\download_manager.py", line 254, in download_and_extract return self.extract(self.download(url_or_urls)) File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\download_manager.py", line 175, in download downloaded_path_or_paths = map_nested( File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\py_utils.py", line 224, in map_nested mapped = [ File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\py_utils.py", line 225, in <listcomp> _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\py_utils.py", line 163, in _single_map_nested return function(data_struct) File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py", line 300, in cached_path output_path = get_from_cache( File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py", line 475, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://drive.google.com/uc?export=download&id=0BwmD_VLjROrfTHk4NFg2SndKcjQ Connection error happened but the url was different. I add the following code. ``` requests.head("https://drive.google.com/uc?export=download&id=0BwmD_VLjROrfTHk4NFg2SndKcjQ") ``` This didn't return 200 It returned like this: Traceback (most recent call last): File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connection.py", line 159, in _new_conn conn = connection.create_connection( File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\util\connection.py", line 84, in create_connection raise err File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\util\connection.py", line 74, in create_connection sock.connect(sa) TimeoutError: [WinError 10060] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen httplib_response = self._make_request( File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 381, in _make_request self._validate_conn(conn) File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 978, in _validate_conn conn.connect() File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connection.py", line 309, in connect conn = self._new_conn() File "C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connection.py", line 171, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x000001F6060618E0>: Failed to establish a new connection: [WinError 10060]
https://github.com/huggingface/datasets/issues/759
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py
I can browse the google drive through google chrome. It's weird. I can download the dataset through google drive manually.
Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ?
20
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ? I can browse the google drive through google chrome. It's weird. I can download the dataset through google drive manually.
https://github.com/huggingface/datasets/issues/759
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py
Is it possible I download the dataset manually from google drive and use it for further test ? How can I do this ? I want to reproduce the model in this link https://huggingface.co/patrickvonplaten/bert2bert-cnn_dailymail-fp16. But I can't download the dataset through load_dataset method . I have tried many times and the connection error always happens .
Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ?
56
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ? Is it possible I download the dataset manually from google drive and use it for further test ? How can I do this ? I want to reproduce the model in this link https://huggingface.co/patrickvonplaten/bert2bert-cnn_dailymail-fp16. But I can't download the dataset through load_dataset method . I have tried many times and the connection error always happens .
https://github.com/huggingface/datasets/issues/759
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py
The head request should definitely work, not sure what's going on on your side. If you find a way to make it work, please post it here since other users might encounter the same issue. If you don't manage to fix it you can use `load_dataset` on google colab and then save it using `dataset.save_to_disk("path/to/dataset")`. Then you can download the directory on your machine and do ```python from datasets import load_from_disk dataset = load_from_disk("path/to/local/dataset") ```
Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ?
75
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ? The head request should definitely work, not sure what's going on on your side. If you find a way to make it work, please post it here since other users might encounter the same issue. If you don't manage to fix it you can use `load_dataset` on google colab and then save it using `dataset.save_to_disk("path/to/dataset")`. Then you can download the directory on your machine and do ```python from datasets import load_from_disk dataset = load_from_disk("path/to/local/dataset") ```
https://github.com/huggingface/datasets/issues/759
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py
Hi I want to know if this problem has been solved because I encountered a similar issue. Thanks. `train_data = datasets.load_dataset("xsum", `split="train")` `ConnectionError:` Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.1.3/datasets/xsum/xsum.py`
Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ?
26
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ? Hi I want to know if this problem has been solved because I encountered a similar issue. Thanks. `train_data = datasets.load_dataset("xsum", `split="train")` `ConnectionError:` Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/1.1.3/datasets/xsum/xsum.py`
https://github.com/huggingface/datasets/issues/759
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py
Hi @smile0925 ! Do you have an internet connection ? Are you using some kind of proxy that may block the access to this file ? Otherwise you can try to update `datasets` since we introduced retries for http requests in the 1.2.0 version ``` pip install --upgrade datasets ``` Let me know if that helps.
Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ?
56
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ? Hi @smile0925 ! Do you have an internet connection ? Are you using some kind of proxy that may block the access to this file ? Otherwise you can try to update `datasets` since we introduced retries for http requests in the 1.2.0 version ``` pip install --upgrade datasets ``` Let me know if that helps.
https://github.com/huggingface/datasets/issues/759
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py
Hi @lhoestq Oh, may be you are right. I find that my server uses some kind of proxy that block the access to this file. ![image](https://user-images.githubusercontent.com/46243662/106456211-2ca24180-64c8-11eb-831e-47e9b40e7da4.png)
Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ?
26
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ? Hi @lhoestq Oh, may be you are right. I find that my server uses some kind of proxy that block the access to this file. ![image](https://user-images.githubusercontent.com/46243662/106456211-2ca24180-64c8-11eb-831e-47e9b40e7da4.png)
https://github.com/huggingface/datasets/issues/759
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py
> Hi @lhoestq > Oh, may be you are right. I find that my server uses some kind of proxy that block the access to this file. > ![image](https://user-images.githubusercontent.com/46243662/106456211-2ca24180-64c8-11eb-831e-47e9b40e7da4.png) I have the same problem, have you solved it? Many thanks
Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ?
40
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ? > Hi @lhoestq > Oh, may be you are right. I find that my server uses some kind of proxy that block the access to this file. > ![image](https://user-images.githubusercontent.com/46243662/106456211-2ca24180-64c8-11eb-831e-47e9b40e7da4.png) I have the same problem, have you solved it? Many thanks
https://github.com/huggingface/datasets/issues/759
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py
Hi @ZhengxiangShi You can first try whether your network can access these files. I need to use VPN to access these files, so I download the files that cannot be accessed to the local in advance, and then use them in the code. Like this, `train_data = datasets.load_dataset("xsum.py", split="train")`
Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ?
49
(Load dataset failure) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py Hey, I want to load the cnn-dailymail dataset for fine-tune. I write the code like this from datasets import load_dataset test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“train”) And I got the following errors. Traceback (most recent call last): File “test.py”, line 7, in test_dataset = load_dataset(“cnn_dailymail”, “3.0.0”, split=“test”) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 589, in load_dataset module_path, hash = prepare_module( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\load.py”, line 268, in prepare_module local_path = cached_path(file_path, download_config=download_config) File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 300, in cached_path output_path = get_from_cache( File “C:\Users\666666\AppData\Local\Programs\Python\Python38\lib\site-packages\datasets\utils\file_utils.py”, line 475, in get_from_cache raise ConnectionError(“Couldn’t reach {}”.format(url)) ConnectionError: Couldn’t reach https://raw.githubusercontent.com/huggingface/datasets/1.1.2/datasets/cnn_dailymail/cnn_dailymail.py How can I fix this ? Hi @ZhengxiangShi You can first try whether your network can access these files. I need to use VPN to access these files, so I download the files that cannot be accessed to the local in advance, and then use them in the code. Like this, `train_data = datasets.load_dataset("xsum.py", split="train")`
https://github.com/huggingface/datasets/issues/758
Process 0 very slow when using num_procs with map to tokenizer
Hi ! Thanks for reporting. Is the distribution of text length of your data evenly distributed across your dataset ? I mean, could it be because the examples in the first part of your dataset are slower to process ? Also could how many CPUs can you use for multiprocessing ? ```python import multiprocessing print(multiprocessing.cpu_count()) ``` Which tokenizer are you using ?
<img width="721" alt="image" src="https://user-images.githubusercontent.com/17930170/97066109-776d0d00-15ed-11eb-8bba-bb4d2e0fcc33.png"> The code I am using is ``` dataset = load_dataset("text", data_files=[file_path], split='train') dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), num_proc=8) dataset.set_format(type='torch', columns=['input_ids']) dataset.save_to_disk(file_path+'.arrow') ```
62
Process 0 very slow when using num_procs with map to tokenizer <img width="721" alt="image" src="https://user-images.githubusercontent.com/17930170/97066109-776d0d00-15ed-11eb-8bba-bb4d2e0fcc33.png"> The code I am using is ``` dataset = load_dataset("text", data_files=[file_path], split='train') dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), num_proc=8) dataset.set_format(type='torch', columns=['input_ids']) dataset.save_to_disk(file_path+'.arrow') ``` Hi ! Thanks for reporting. Is the distribution of text length of your data evenly distributed across your dataset ? I mean, could it be because the examples in the first part of your dataset are slower to process ? Also could how many CPUs can you use for multiprocessing ? ```python import multiprocessing print(multiprocessing.cpu_count()) ``` Which tokenizer are you using ?
https://github.com/huggingface/datasets/issues/758
Process 0 very slow when using num_procs with map to tokenizer
Using pre trained HF tokenizer. The result is the same with tokenizer multiprocessing off and on. I have (absolutely) no idea about the distribution, but since this issue occurs on all of my datasets(regardless of files), I don't think distribution is the problems. I can use up to 16 cores.
<img width="721" alt="image" src="https://user-images.githubusercontent.com/17930170/97066109-776d0d00-15ed-11eb-8bba-bb4d2e0fcc33.png"> The code I am using is ``` dataset = load_dataset("text", data_files=[file_path], split='train') dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), num_proc=8) dataset.set_format(type='torch', columns=['input_ids']) dataset.save_to_disk(file_path+'.arrow') ```
50
Process 0 very slow when using num_procs with map to tokenizer <img width="721" alt="image" src="https://user-images.githubusercontent.com/17930170/97066109-776d0d00-15ed-11eb-8bba-bb4d2e0fcc33.png"> The code I am using is ``` dataset = load_dataset("text", data_files=[file_path], split='train') dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), num_proc=8) dataset.set_format(type='torch', columns=['input_ids']) dataset.save_to_disk(file_path+'.arrow') ``` Using pre trained HF tokenizer. The result is the same with tokenizer multiprocessing off and on. I have (absolutely) no idea about the distribution, but since this issue occurs on all of my datasets(regardless of files), I don't think distribution is the problems. I can use up to 16 cores.
https://github.com/huggingface/datasets/issues/758
Process 0 very slow when using num_procs with map to tokenizer
Ok weird, I don't manage to reproduce this issue on my side. Does it happen even with `num_proc=2` for example ? Also could you provide more details about your OS and the versions of tokenizers/datasets/multiprocess that you're using ?
<img width="721" alt="image" src="https://user-images.githubusercontent.com/17930170/97066109-776d0d00-15ed-11eb-8bba-bb4d2e0fcc33.png"> The code I am using is ``` dataset = load_dataset("text", data_files=[file_path], split='train') dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), num_proc=8) dataset.set_format(type='torch', columns=['input_ids']) dataset.save_to_disk(file_path+'.arrow') ```
39
Process 0 very slow when using num_procs with map to tokenizer <img width="721" alt="image" src="https://user-images.githubusercontent.com/17930170/97066109-776d0d00-15ed-11eb-8bba-bb4d2e0fcc33.png"> The code I am using is ``` dataset = load_dataset("text", data_files=[file_path], split='train') dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), num_proc=8) dataset.set_format(type='torch', columns=['input_ids']) dataset.save_to_disk(file_path+'.arrow') ``` Ok weird, I don't manage to reproduce this issue on my side. Does it happen even with `num_proc=2` for example ? Also could you provide more details about your OS and the versions of tokenizers/datasets/multiprocess that you're using ?
https://github.com/huggingface/datasets/issues/758
Process 0 very slow when using num_procs with map to tokenizer
Yes, I can confirm it also happens with ```num_proc=2```. ``` tokenizers 0.9.2 datasets 1.1.2 multiprocess 0.70.10 ``` ``` Linux nipa2020-0629 4.4.0-178-generic #208-Ubuntu SMP Sun Apr 5 23:45:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux ```
<img width="721" alt="image" src="https://user-images.githubusercontent.com/17930170/97066109-776d0d00-15ed-11eb-8bba-bb4d2e0fcc33.png"> The code I am using is ``` dataset = load_dataset("text", data_files=[file_path], split='train') dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), num_proc=8) dataset.set_format(type='torch', columns=['input_ids']) dataset.save_to_disk(file_path+'.arrow') ```
34
Process 0 very slow when using num_procs with map to tokenizer <img width="721" alt="image" src="https://user-images.githubusercontent.com/17930170/97066109-776d0d00-15ed-11eb-8bba-bb4d2e0fcc33.png"> The code I am using is ``` dataset = load_dataset("text", data_files=[file_path], split='train') dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), num_proc=8) dataset.set_format(type='torch', columns=['input_ids']) dataset.save_to_disk(file_path+'.arrow') ``` Yes, I can confirm it also happens with ```num_proc=2```. ``` tokenizers 0.9.2 datasets 1.1.2 multiprocess 0.70.10 ``` ``` Linux nipa2020-0629 4.4.0-178-generic #208-Ubuntu SMP Sun Apr 5 23:45:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux ```
https://github.com/huggingface/datasets/issues/758
Process 0 very slow when using num_procs with map to tokenizer
I can't reproduce on my side unfortunately with the same versions. Do you have issues when doing multiprocessing with python ? ```python from tqdm.auto import tqdm from multiprocess import Pool, RLock def process_data(shard): # implement num_proc = 8 shards = [] # implement, this must be a list of size num_proc with Pool(num_proc, initargs=(RLock(),), initializer=tqdm.set_lock) as pool: results = [pool.apply_async(process_data, shard=shard) for shard in shards] transformed_shards = [r.get() for r in results] ```
<img width="721" alt="image" src="https://user-images.githubusercontent.com/17930170/97066109-776d0d00-15ed-11eb-8bba-bb4d2e0fcc33.png"> The code I am using is ``` dataset = load_dataset("text", data_files=[file_path], split='train') dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), num_proc=8) dataset.set_format(type='torch', columns=['input_ids']) dataset.save_to_disk(file_path+'.arrow') ```
73
Process 0 very slow when using num_procs with map to tokenizer <img width="721" alt="image" src="https://user-images.githubusercontent.com/17930170/97066109-776d0d00-15ed-11eb-8bba-bb4d2e0fcc33.png"> The code I am using is ``` dataset = load_dataset("text", data_files=[file_path], split='train') dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), num_proc=8) dataset.set_format(type='torch', columns=['input_ids']) dataset.save_to_disk(file_path+'.arrow') ``` I can't reproduce on my side unfortunately with the same versions. Do you have issues when doing multiprocessing with python ? ```python from tqdm.auto import tqdm from multiprocess import Pool, RLock def process_data(shard): # implement num_proc = 8 shards = [] # implement, this must be a list of size num_proc with Pool(num_proc, initargs=(RLock(),), initializer=tqdm.set_lock) as pool: results = [pool.apply_async(process_data, shard=shard) for shard in shards] transformed_shards = [r.get() for r in results] ```
https://github.com/huggingface/datasets/issues/757
CUDA out of memory
```python tokenizer = FunnelTokenizer.from_pretrained('funnel-transformer/small') def tokenize(batch): return tokenizer(batch['text'], padding='max_length', truncation=True,max_length=512) dataset = load_dataset("bookcorpus",split='train[:1000]').shuffle() dataset = dataset.map(tokenize, batched=True, batch_size=512) # dataset = LineByLineTextDataset( # tokenizer=tokenizer, # file_path="./wiki1000.txt", # block_size=128 # ) data_collator = DataCollatorForLanguageModeling( tokenizer=tokenizer, mlm=True, mlm_probability=0.15 ) config=FunnelConfig( return_dict=True ) model= FunnelForMaskedLM(config=config) training_args = TrainingArguments( output_dir="./checkpoints", overwrite_output_dir=True, do_train=True, num_train_epochs=1, per_device_train_batch_size=16, per_device_eval_batch_size=16, save_steps=10000, logging_dir='./ptlogs' ) trainer = Trainer( model=model, args=training_args, data_collator=data_collator, train_dataset=dataset, ) trainer.train() ```
In your dataset ,cuda run out of memory as long as the trainer begins: however, without changing any other element/parameter,just switch dataset to `LineByLineTextDataset`,everything becames OK.
64
CUDA out of memory In your dataset ,cuda run out of memory as long as the trainer begins: however, without changing any other element/parameter,just switch dataset to `LineByLineTextDataset`,everything becames OK. ```python tokenizer = FunnelTokenizer.from_pretrained('funnel-transformer/small') def tokenize(batch): return tokenizer(batch['text'], padding='max_length', truncation=True,max_length=512) dataset = load_dataset("bookcorpus",split='train[:1000]').shuffle() dataset = dataset.map(tokenize, batched=True, batch_size=512) # dataset = LineByLineTextDataset( # tokenizer=tokenizer, # file_path="./wiki1000.txt", # block_size=128 # ) data_collator = DataCollatorForLanguageModeling( tokenizer=tokenizer, mlm=True, mlm_probability=0.15 ) config=FunnelConfig( return_dict=True ) model= FunnelForMaskedLM(config=config) training_args = TrainingArguments( output_dir="./checkpoints", overwrite_output_dir=True, do_train=True, num_train_epochs=1, per_device_train_batch_size=16, per_device_eval_batch_size=16, save_steps=10000, logging_dir='./ptlogs' ) trainer = Trainer( model=model, args=training_args, data_collator=data_collator, train_dataset=dataset, ) trainer.train() ```
https://github.com/huggingface/datasets/issues/757
CUDA out of memory
`RuntimeError: CUDA out of memory. Tried to allocate 954.00 MiB (GPU 0; 15.90 GiB total capacity; 14.35 GiB already allocated; 753.75 MiB free; 14.39 GiB reserved in total by PyTorch) Exception raised from malloc at /pytorch/c10/cuda/CUDACachingAllocator.cpp:272 (most recent call first):` part of error output
In your dataset ,cuda run out of memory as long as the trainer begins: however, without changing any other element/parameter,just switch dataset to `LineByLineTextDataset`,everything becames OK.
44
CUDA out of memory In your dataset ,cuda run out of memory as long as the trainer begins: however, without changing any other element/parameter,just switch dataset to `LineByLineTextDataset`,everything becames OK. `RuntimeError: CUDA out of memory. Tried to allocate 954.00 MiB (GPU 0; 15.90 GiB total capacity; 14.35 GiB already allocated; 753.75 MiB free; 14.39 GiB reserved in total by PyTorch) Exception raised from malloc at /pytorch/c10/cuda/CUDACachingAllocator.cpp:272 (most recent call first):` part of error output
https://github.com/huggingface/datasets/issues/757
CUDA out of memory
from funnel model to bert model : error still happened from your dataset to LineByLineTextDataset : error disapeared
In your dataset ,cuda run out of memory as long as the trainer begins: however, without changing any other element/parameter,just switch dataset to `LineByLineTextDataset`,everything becames OK.
18
CUDA out of memory In your dataset ,cuda run out of memory as long as the trainer begins: however, without changing any other element/parameter,just switch dataset to `LineByLineTextDataset`,everything becames OK. from funnel model to bert model : error still happened from your dataset to LineByLineTextDataset : error disapeared
https://github.com/huggingface/datasets/issues/757
CUDA out of memory
Since you're using a data collator you don't need to tokenizer the dataset using `map`. Could you try not to use `map` and only the data collator instead ? The data collator is supposed to pad to the longest sequence in each batch afaik, instead of padding to 512. Also cc @sgugger
In your dataset ,cuda run out of memory as long as the trainer begins: however, without changing any other element/parameter,just switch dataset to `LineByLineTextDataset`,everything becames OK.
52
CUDA out of memory In your dataset ,cuda run out of memory as long as the trainer begins: however, without changing any other element/parameter,just switch dataset to `LineByLineTextDataset`,everything becames OK. Since you're using a data collator you don't need to tokenizer the dataset using `map`. Could you try not to use `map` and only the data collator instead ? The data collator is supposed to pad to the longest sequence in each batch afaik, instead of padding to 512. Also cc @sgugger
https://github.com/huggingface/datasets/issues/751
Error loading ms_marco v2.1 using load_dataset()
There was a similar issue in #294 Clearing the cache and download again the dataset did the job. Could you try to clear your cache and download the dataset again ?
Code: `dataset = load_dataset('ms_marco', 'v2.1')` Error: ``` `--------------------------------------------------------------------------- JSONDecodeError Traceback (most recent call last) <ipython-input-16-34378c057212> in <module>() 9 10 # Downloading and loading a dataset ---> 11 dataset = load_dataset('ms_marco', 'v2.1') 10 frames /usr/lib/python3.6/json/decoder.py in raw_decode(self, s, idx) 353 """ 354 try: --> 355 obj, end = self.scan_once(s, idx) 356 except StopIteration as err: 357 raise JSONDecodeError("Expecting value", s, err.value) from None JSONDecodeError: Unterminated string starting at: line 1 column 388988661 (char 388988660) ` ```
31
Error loading ms_marco v2.1 using load_dataset() Code: `dataset = load_dataset('ms_marco', 'v2.1')` Error: ``` `--------------------------------------------------------------------------- JSONDecodeError Traceback (most recent call last) <ipython-input-16-34378c057212> in <module>() 9 10 # Downloading and loading a dataset ---> 11 dataset = load_dataset('ms_marco', 'v2.1') 10 frames /usr/lib/python3.6/json/decoder.py in raw_decode(self, s, idx) 353 """ 354 try: --> 355 obj, end = self.scan_once(s, idx) 356 except StopIteration as err: 357 raise JSONDecodeError("Expecting value", s, err.value) from None JSONDecodeError: Unterminated string starting at: line 1 column 388988661 (char 388988660) ` ``` There was a similar issue in #294 Clearing the cache and download again the dataset did the job. Could you try to clear your cache and download the dataset again ?
https://github.com/huggingface/datasets/issues/751
Error loading ms_marco v2.1 using load_dataset()
I was able to load the dataset successfully, I'm pretty sure it's just a cache issue that you have. Let me know if clearing your cache fixes the problem
Code: `dataset = load_dataset('ms_marco', 'v2.1')` Error: ``` `--------------------------------------------------------------------------- JSONDecodeError Traceback (most recent call last) <ipython-input-16-34378c057212> in <module>() 9 10 # Downloading and loading a dataset ---> 11 dataset = load_dataset('ms_marco', 'v2.1') 10 frames /usr/lib/python3.6/json/decoder.py in raw_decode(self, s, idx) 353 """ 354 try: --> 355 obj, end = self.scan_once(s, idx) 356 except StopIteration as err: 357 raise JSONDecodeError("Expecting value", s, err.value) from None JSONDecodeError: Unterminated string starting at: line 1 column 388988661 (char 388988660) ` ```
29
Error loading ms_marco v2.1 using load_dataset() Code: `dataset = load_dataset('ms_marco', 'v2.1')` Error: ``` `--------------------------------------------------------------------------- JSONDecodeError Traceback (most recent call last) <ipython-input-16-34378c057212> in <module>() 9 10 # Downloading and loading a dataset ---> 11 dataset = load_dataset('ms_marco', 'v2.1') 10 frames /usr/lib/python3.6/json/decoder.py in raw_decode(self, s, idx) 353 """ 354 try: --> 355 obj, end = self.scan_once(s, idx) 356 except StopIteration as err: 357 raise JSONDecodeError("Expecting value", s, err.value) from None JSONDecodeError: Unterminated string starting at: line 1 column 388988661 (char 388988660) ` ``` I was able to load the dataset successfully, I'm pretty sure it's just a cache issue that you have. Let me know if clearing your cache fixes the problem
https://github.com/huggingface/datasets/issues/749
[XGLUE] Adding new dataset
Small poll @thomwolf @yjernite @lhoestq @JetRunner @qiweizhen . As stated in the XGLUE paper: https://arxiv.org/pdf/2004.01401.pdf , for each of the 11 down-stream tasks training data is only available in English, whereas development and test data is available in multiple different language *cf.* here: ![Screenshot from 2020-11-04 15-02-17](https://user-images.githubusercontent.com/23423619/98120893-d7499a80-1eae-11eb-9d0b-57dfe5d4ee68.png) So, I'd suggest to have exactly 11 "language-independent" configs: "ner", "pos", ... and give the sample in each dataset in the config a "language" label being one of "ar", "bg", .... => To me this makes more sense than making languaga specific config, *e.g.* "ner-de", ...especially because training data is only available in English. Do you guys agree?
XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance
105
[XGLUE] Adding new dataset XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance Small poll @thomwolf @yjernite @lhoestq @JetRunner @qiweizhen . As stated in the XGLUE paper: https://arxiv.org/pdf/2004.01401.pdf , for each of the 11 down-stream tasks training data is only available in English, whereas development and test data is available in multiple different language *cf.* here: ![Screenshot from 2020-11-04 15-02-17](https://user-images.githubusercontent.com/23423619/98120893-d7499a80-1eae-11eb-9d0b-57dfe5d4ee68.png) So, I'd suggest to have exactly 11 "language-independent" configs: "ner", "pos", ... and give the sample in each dataset in the config a "language" label being one of "ar", "bg", .... => To me this makes more sense than making languaga specific config, *e.g.* "ner-de", ...especially because training data is only available in English. Do you guys agree?
https://github.com/huggingface/datasets/issues/749
[XGLUE] Adding new dataset
In this case we should have named splits, so config `ner` has splits `train`, `validation`, `test-en`, `test-ar`, `test-bg`, etc... This is more in the spirit of the task afaiu, and will avoid making users do the filtering step themselves when testing different models or different configurations of the same model.
XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance
50
[XGLUE] Adding new dataset XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance In this case we should have named splits, so config `ner` has splits `train`, `validation`, `test-en`, `test-ar`, `test-bg`, etc... This is more in the spirit of the task afaiu, and will avoid making users do the filtering step themselves when testing different models or different configurations of the same model.
https://github.com/huggingface/datasets/issues/749
[XGLUE] Adding new dataset
I see your point! I think this would be quite feasible to do and makes sense to me as well! In the paper results are reported per language, so it seems more natural to do it this way. Good for me @yjernite ! What do the others think? @lhoestq
XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance
49
[XGLUE] Adding new dataset XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance I see your point! I think this would be quite feasible to do and makes sense to me as well! In the paper results are reported per language, so it seems more natural to do it this way. Good for me @yjernite ! What do the others think? @lhoestq
https://github.com/huggingface/datasets/issues/749
[XGLUE] Adding new dataset
Okey actually not that easy to add things like `test-de` to `datasets` => this would be the first dataset to have this. See: https://github.com/huggingface/datasets/pull/802
XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance
24
[XGLUE] Adding new dataset XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance Okey actually not that easy to add things like `test-de` to `datasets` => this would be the first dataset to have this. See: https://github.com/huggingface/datasets/pull/802
https://github.com/huggingface/datasets/issues/749
[XGLUE] Adding new dataset
IMO we should have one config per language. That's what we're doing for xnli, xtreme etc. Having split names that depend on the language seems wrong. We should try to avoid split names that are not train/val/test. Sorry for late response on this one
XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance
44
[XGLUE] Adding new dataset XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance IMO we should have one config per language. That's what we're doing for xnli, xtreme etc. Having split names that depend on the language seems wrong. We should try to avoid split names that are not train/val/test. Sorry for late response on this one
https://github.com/huggingface/datasets/issues/749
[XGLUE] Adding new dataset
@lhoestq agreed on having one config per language, but we also need to be able to have different split names and people are going to want to use hyphens, so we should at the very least warn them why it's failing :) E.g. for ANLI with different stages of data (currently using underscores) or https://www.tau-nlp.org/commonsenseqa with their train-sanity or dev-sanity splits
XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance
61
[XGLUE] Adding new dataset XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance @lhoestq agreed on having one config per language, but we also need to be able to have different split names and people are going to want to use hyphens, so we should at the very least warn them why it's failing :) E.g. for ANLI with different stages of data (currently using underscores) or https://www.tau-nlp.org/commonsenseqa with their train-sanity or dev-sanity splits
https://github.com/huggingface/datasets/issues/749
[XGLUE] Adding new dataset
Really cool dataset 👍 btw. does Transformers support all 11 tasks 🤔 would be awesome to have a xglue script (like the "normal" glue one)
XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance
25
[XGLUE] Adding new dataset XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance Really cool dataset 👍 btw. does Transformers support all 11 tasks 🤔 would be awesome to have a xglue script (like the "normal" glue one)
https://github.com/huggingface/datasets/issues/749
[XGLUE] Adding new dataset
Just to make sure this is what we want here. If we add one config per language, this means that this dataset ends up with well over 100 different configs most of which will have the same `train` split. The train split is always in English. Also, I'm not sure whether it's better for the user to be honest. I think it could be quite confusing for the user to have ```python train_dataset = load_dataset("xglue", "ner-de", split="train") ``` in English even though it's `ner-de`. To be honest, I'd prefer: ```python train_dataset = load_dataset("xglue", "ner", split="train") test_dataset_de = load_dataset("xglue", "ner", split="test-de") test_dataset_fr = load_dataset("xglue", "ner", split="test-fr") ``` here
XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance
107
[XGLUE] Adding new dataset XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance Just to make sure this is what we want here. If we add one config per language, this means that this dataset ends up with well over 100 different configs most of which will have the same `train` split. The train split is always in English. Also, I'm not sure whether it's better for the user to be honest. I think it could be quite confusing for the user to have ```python train_dataset = load_dataset("xglue", "ner-de", split="train") ``` in English even though it's `ner-de`. To be honest, I'd prefer: ```python train_dataset = load_dataset("xglue", "ner", split="train") test_dataset_de = load_dataset("xglue", "ner", split="test-de") test_dataset_fr = load_dataset("xglue", "ner", split="test-fr") ``` here
https://github.com/huggingface/datasets/issues/749
[XGLUE] Adding new dataset
Oh yes right I didn't notice the train set was always in english sorry. Moreover it seems that the way this dataset is used is to pick a pretrained multilingual model, fine-tune it on the english train set and then evaluate on each test set (one per language). So to better fit the usual usage of this dataset, I agree that it's better to have one test split per language. Something like your latest example patrick is fine imo : ```python train_dataset = load_dataset("xglue", "ner", split="train") test_dataset_de = load_dataset("xglue", "ner", split="test.de") ``` I just replace test-de with test.de since `-` is not allowed for split names (it has to follow the `\w+` regex), and usually we specify the language after a point.
XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance
122
[XGLUE] Adding new dataset XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance Oh yes right I didn't notice the train set was always in english sorry. Moreover it seems that the way this dataset is used is to pick a pretrained multilingual model, fine-tune it on the english train set and then evaluate on each test set (one per language). So to better fit the usual usage of this dataset, I agree that it's better to have one test split per language. Something like your latest example patrick is fine imo : ```python train_dataset = load_dataset("xglue", "ner", split="train") test_dataset_de = load_dataset("xglue", "ner", split="test.de") ``` I just replace test-de with test.de since `-` is not allowed for split names (it has to follow the `\w+` regex), and usually we specify the language after a point.
https://github.com/huggingface/datasets/issues/749
[XGLUE] Adding new dataset
According to the table in https://huggingface.co/datasets/xglue, Urdu only exists for POS and XNLI in XGLUE - not for summarization
XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance
19
[XGLUE] Adding new dataset XGLUE is a multilingual GLUE like dataset propesed in this [paper](https://arxiv.org/pdf/2004.01401.pdf). I'm planning on adding the dataset to the library myself in a couple of weeks. Also tagging @JetRunner @qiweizhen in case I need some guidance According to the table in https://huggingface.co/datasets/xglue, Urdu only exists for POS and XNLI in XGLUE - not for summarization
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
Thank you ! Could you provide a csv file that reproduces the error ? It doesn't have to be one of your dataset. As long as it reproduces the error That would help a lot !
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
36
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you Thank you ! Could you provide a csv file that reproduces the error ? It doesn't have to be one of your dataset. As long as it reproduces the error That would help a lot !
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
I think another good example is the following: ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sts-dev.csv"], delimiter="\t", column_names=["one", "two", "three", "four", "score", "sentence1", "sentence2"], script_version="master")` ` Displayed error `CSV parse error: Expected 7 columns, got 6` even tough I put 7 columns. First four columns from the csv don't have a name, so I've named them by default. The csv file is the .dev file from STSb benchmark dataset.
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
72
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you I think another good example is the following: ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sts-dev.csv"], delimiter="\t", column_names=["one", "two", "three", "four", "score", "sentence1", "sentence2"], script_version="master")` ` Displayed error `CSV parse error: Expected 7 columns, got 6` even tough I put 7 columns. First four columns from the csv don't have a name, so I've named them by default. The csv file is the .dev file from STSb benchmark dataset.
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
Hi, seems I also can't read csv file. I was trying with a dummy csv with only three rows. ``` text,label I hate google,negative I love Microsoft,positive I don't like you,negative ``` I was using the HuggingFace image in Paperspace Gradient (datasets==1.1.3). The following code doesn't work: ``` from datasets import load_dataset dataset = load_dataset('csv', script_version="master", data_files=['test_data.csv'], delimiter=",") ``` It outputs the following: ``` Using custom data configuration default Downloading and preparing dataset csv/default-3b6254ff4dd403e5 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /root/.cache/huggingface/datasets/csv/default-3b6254ff4dd403e5/0.0.0/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2... Dataset csv downloaded and prepared to /root/.cache/huggingface/datasets/csv/default-3b6254ff4dd403e5/0.0.0/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2. Subsequent calls will reuse this data. ``` But `len(dataset)` gives `1` and I can't access rows with indexing `dataset[0]` (it gives `KeyError: 0`). However, loading from pandas dataframe is working. ``` from datasets import Dataset import pandas as pd df = pd.read_csv('test_data.csv') dataset = Dataset.from_pandas(df) ```
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
141
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you Hi, seems I also can't read csv file. I was trying with a dummy csv with only three rows. ``` text,label I hate google,negative I love Microsoft,positive I don't like you,negative ``` I was using the HuggingFace image in Paperspace Gradient (datasets==1.1.3). The following code doesn't work: ``` from datasets import load_dataset dataset = load_dataset('csv', script_version="master", data_files=['test_data.csv'], delimiter=",") ``` It outputs the following: ``` Using custom data configuration default Downloading and preparing dataset csv/default-3b6254ff4dd403e5 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /root/.cache/huggingface/datasets/csv/default-3b6254ff4dd403e5/0.0.0/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2... Dataset csv downloaded and prepared to /root/.cache/huggingface/datasets/csv/default-3b6254ff4dd403e5/0.0.0/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2. Subsequent calls will reuse this data. ``` But `len(dataset)` gives `1` and I can't access rows with indexing `dataset[0]` (it gives `KeyError: 0`). However, loading from pandas dataframe is working. ``` from datasets import Dataset import pandas as pd df = pd.read_csv('test_data.csv') dataset = Dataset.from_pandas(df) ```
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
This is because load_dataset without `split=` returns a dictionary of split names (train/validation/test) to dataset. You can do ```python from datasets import load_dataset dataset = load_dataset('csv', script_version="master", data_files=['test_data.csv'], delimiter=",") print(dataset["train"][0]) ``` Or if you want to directly get the train split: ```python from datasets import load_dataset dataset = load_dataset('csv', script_version="master", data_files=['test_data.csv'], delimiter=",", split="train") print(dataset[0]) ```
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
55
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you This is because load_dataset without `split=` returns a dictionary of split names (train/validation/test) to dataset. You can do ```python from datasets import load_dataset dataset = load_dataset('csv', script_version="master", data_files=['test_data.csv'], delimiter=",") print(dataset["train"][0]) ``` Or if you want to directly get the train split: ```python from datasets import load_dataset dataset = load_dataset('csv', script_version="master", data_files=['test_data.csv'], delimiter=",", split="train") print(dataset[0]) ```
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
Good point Design question for us, though: should `load_dataset` when no split is specified and only one split is present in the dataset (common use case with CSV/text/JSON datasets) return a `Dataset` instead of a `DatsetDict`? I feel like it's often what the user is expecting. I break a bit the paradigm of a unique return type but since this library is designed for widespread DS people more than CS people usage I would tend to think that UX should take precedence over CS reasons. What do you think?
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
89
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you Good point Design question for us, though: should `load_dataset` when no split is specified and only one split is present in the dataset (common use case with CSV/text/JSON datasets) return a `Dataset` instead of a `DatsetDict`? I feel like it's often what the user is expecting. I break a bit the paradigm of a unique return type but since this library is designed for widespread DS people more than CS people usage I would tend to think that UX should take precedence over CS reasons. What do you think?
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
In this case the user expects to get only one dataset object instead of the dictionary of datasets since only one csv file was specified without any split specifications. I'm ok with returning the dataset object if no split specifications are given for text/json/csv/pandas. For the other datasets ton the other hand the user doesn't know in advance the splits so I would keep the dictionary by default. What do you think ?
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
73
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you In this case the user expects to get only one dataset object instead of the dictionary of datasets since only one csv file was specified without any split specifications. I'm ok with returning the dataset object if no split specifications are given for text/json/csv/pandas. For the other datasets ton the other hand the user doesn't know in advance the splits so I would keep the dictionary by default. What do you think ?
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
Thanks for your quick response! I'm fine with specifying the split as @lhoestq suggested. My only concern is when I'm loading from python dict or pandas, the library returns a dataset instead of a dictionary of datasets when no split is specified. I know that they use a different function `Dataset.from_dict` or `Dataset.from_pandas` but the text/csv files use `load_dataset()`. However, to the user, they do the same task and we probably expect them to have the same behavior.
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
78
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you Thanks for your quick response! I'm fine with specifying the split as @lhoestq suggested. My only concern is when I'm loading from python dict or pandas, the library returns a dataset instead of a dictionary of datasets when no split is specified. I know that they use a different function `Dataset.from_dict` or `Dataset.from_pandas` but the text/csv files use `load_dataset()`. However, to the user, they do the same task and we probably expect them to have the same behavior.
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
``` from datasets import load_dataset dataset = load_dataset('csv', data_files='./amazon_data/Video_Games_5.csv', delimiter=",", split=['train', 'test']) ``` I was running the above line, but got this error. ```ValueError: Unknown split "test". Should be one of ['train'].``` The data is amazon product data. I load the Video_Games_5.json.gz data into pandas and save it as csv file. and then load the csv file using the above code. I thought, ```split=['train', 'test']``` would split the data into train and test. did I misunderstood? Thank you!
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
78
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you ``` from datasets import load_dataset dataset = load_dataset('csv', data_files='./amazon_data/Video_Games_5.csv', delimiter=",", split=['train', 'test']) ``` I was running the above line, but got this error. ```ValueError: Unknown split "test". Should be one of ['train'].``` The data is amazon product data. I load the Video_Games_5.json.gz data into pandas and save it as csv file. and then load the csv file using the above code. I thought, ```split=['train', 'test']``` would split the data into train and test. did I misunderstood? Thank you!
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
Hi ! the `split` argument in `load_dataset` is used to select the splits you want among the available splits. However when loading a csv with a single file as you did, only a `train` split is available by default. Indeed since `data_files='./amazon_data/Video_Games_5.csv'` is equivalent to `data_files={"train": './amazon_data/Video_Games_5.csv'}`, you can get a dataset with ```python from datasets import load_dataset dataset = load_dataset('csv', data_files='./amazon_data/Video_Games_5.csv', delimiter=",", split="train") ``` And then to get both a train and test split you can do ```python dataset = dataset.train_test_split() print(dataset.keys()) # ['train', 'test'] ``` Also note that a csv dataset may have several available splits if it is defined this way: ```python from datasets import load_dataset dataset = load_dataset('csv', data_files={ "train": './amazon_data/Video_Games_5_train.csv', "test": './amazon_data/Video_Games_5_test.csv' }) print(dataset.keys()) # ['train', 'test'] ```
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
123
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you Hi ! the `split` argument in `load_dataset` is used to select the splits you want among the available splits. However when loading a csv with a single file as you did, only a `train` split is available by default. Indeed since `data_files='./amazon_data/Video_Games_5.csv'` is equivalent to `data_files={"train": './amazon_data/Video_Games_5.csv'}`, you can get a dataset with ```python from datasets import load_dataset dataset = load_dataset('csv', data_files='./amazon_data/Video_Games_5.csv', delimiter=",", split="train") ``` And then to get both a train and test split you can do ```python dataset = dataset.train_test_split() print(dataset.keys()) # ['train', 'test'] ``` Also note that a csv dataset may have several available splits if it is defined this way: ```python from datasets import load_dataset dataset = load_dataset('csv', data_files={ "train": './amazon_data/Video_Games_5_train.csv', "test": './amazon_data/Video_Games_5_test.csv' }) print(dataset.keys()) # ['train', 'test'] ```
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
> In this case the user expects to get only one dataset object instead of the dictionary of datasets since only one csv file was specified without any split specifications. > I'm ok with returning the dataset object if no split specifications are given for text/json/csv/pandas. > > For the other datasets ton the other hand the user doesn't know in advance the splits so I would keep the dictionary by default. What do you think ? Yes maybe this would be good. I think having to select 'train' from the resulting object why the user gave no split information is a confusing and not intuitive behavior.
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
107
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you > In this case the user expects to get only one dataset object instead of the dictionary of datasets since only one csv file was specified without any split specifications. > I'm ok with returning the dataset object if no split specifications are given for text/json/csv/pandas. > > For the other datasets ton the other hand the user doesn't know in advance the splits so I would keep the dictionary by default. What do you think ? Yes maybe this would be good. I think having to select 'train' from the resulting object why the user gave no split information is a confusing and not intuitive behavior.
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
> Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. > > `from datasets import load_dataset` > `dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master")` > > Displayed error: > `... ArrowInvalid: CSV parse error: Expected 2 columns, got 1` I'm also facing the same issue when trying to load from a csv file locally: ```python from nlp import load_dataset dataset = load_dataset('csv', data_files='sample_data.csv') ``` Error when executed from Google Colab: ```python ArrowInvalid Traceback (most recent call last) <ipython-input-34-79a8d4f65ed6> in <module>() 1 from nlp import load_dataset ----> 2 dataset = load_dataset('csv', data_files='sample_data.csv') 9 frames /usr/local/lib/python3.7/dist-packages/nlp/load.py in load_dataset(path, name, version, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, save_infos, **config_kwargs) 547 # Download and prepare data 548 builder_instance.download_and_prepare( --> 549 download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, 550 ) 551 /usr/local/lib/python3.7/dist-packages/nlp/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, **download_and_prepare_kwargs) 461 if not downloaded_from_gcs: 462 self._download_and_prepare( --> 463 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 464 ) 465 # Sync info /usr/local/lib/python3.7/dist-packages/nlp/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 535 try: 536 # Prepare split will record examples associated to the split --> 537 self._prepare_split(split_generator, **prepare_split_kwargs) 538 except OSError: 539 raise OSError("Cannot find data file. " + (self.manual_download_instructions or "")) /usr/local/lib/python3.7/dist-packages/nlp/builder.py in _prepare_split(self, split_generator) 863 864 generator = self._generate_tables(**split_generator.gen_kwargs) --> 865 for key, table in utils.tqdm(generator, unit=" tables", leave=False): 866 writer.write_table(table) 867 num_examples, num_bytes = writer.finalize() /usr/local/lib/python3.7/dist-packages/tqdm/notebook.py in __iter__(self, *args, **kwargs) 213 def __iter__(self, *args, **kwargs): 214 try: --> 215 for obj in super(tqdm_notebook, self).__iter__(*args, **kwargs): 216 # return super(tqdm...) will not catch exception 217 yield obj /usr/local/lib/python3.7/dist-packages/tqdm/std.py in __iter__(self) 1102 fp_write=getattr(self.fp, 'write', sys.stderr.write)) 1103 -> 1104 for obj in iterable: 1105 yield obj 1106 # Update and possibly print the progressbar. /usr/local/lib/python3.7/dist-packages/nlp/datasets/csv/ede98314803c971fef04bcee45d660c62f3332e8a74491e0b876106f3d99bd9b/csv.py in _generate_tables(self, files) 78 read_options=self.config.pa_read_options, 79 parse_options=self.config.pa_parse_options, ---> 80 convert_options=self.config.convert_options, 81 ) 82 yield i, pa_table /usr/local/lib/python3.7/dist-packages/pyarrow/_csv.pyx in pyarrow._csv.read_csv() /usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() /usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowInvalid: CSV parse error: Expected 1 columns, got 8 ``` Version: ``` nlp==0.4.0 ```
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
319
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you > Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. > > `from datasets import load_dataset` > `dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master")` > > Displayed error: > `... ArrowInvalid: CSV parse error: Expected 2 columns, got 1` I'm also facing the same issue when trying to load from a csv file locally: ```python from nlp import load_dataset dataset = load_dataset('csv', data_files='sample_data.csv') ``` Error when executed from Google Colab: ```python ArrowInvalid Traceback (most recent call last) <ipython-input-34-79a8d4f65ed6> in <module>() 1 from nlp import load_dataset ----> 2 dataset = load_dataset('csv', data_files='sample_data.csv') 9 frames /usr/local/lib/python3.7/dist-packages/nlp/load.py in load_dataset(path, name, version, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, save_infos, **config_kwargs) 547 # Download and prepare data 548 builder_instance.download_and_prepare( --> 549 download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, 550 ) 551 /usr/local/lib/python3.7/dist-packages/nlp/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, **download_and_prepare_kwargs) 461 if not downloaded_from_gcs: 462 self._download_and_prepare( --> 463 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 464 ) 465 # Sync info /usr/local/lib/python3.7/dist-packages/nlp/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 535 try: 536 # Prepare split will record examples associated to the split --> 537 self._prepare_split(split_generator, **prepare_split_kwargs) 538 except OSError: 539 raise OSError("Cannot find data file. " + (self.manual_download_instructions or "")) /usr/local/lib/python3.7/dist-packages/nlp/builder.py in _prepare_split(self, split_generator) 863 864 generator = self._generate_tables(**split_generator.gen_kwargs) --> 865 for key, table in utils.tqdm(generator, unit=" tables", leave=False): 866 writer.write_table(table) 867 num_examples, num_bytes = writer.finalize() /usr/local/lib/python3.7/dist-packages/tqdm/notebook.py in __iter__(self, *args, **kwargs) 213 def __iter__(self, *args, **kwargs): 214 try: --> 215 for obj in super(tqdm_notebook, self).__iter__(*args, **kwargs): 216 # return super(tqdm...) will not catch exception 217 yield obj /usr/local/lib/python3.7/dist-packages/tqdm/std.py in __iter__(self) 1102 fp_write=getattr(self.fp, 'write', sys.stderr.write)) 1103 -> 1104 for obj in iterable: 1105 yield obj 1106 # Update and possibly print the progressbar. /usr/local/lib/python3.7/dist-packages/nlp/datasets/csv/ede98314803c971fef04bcee45d660c62f3332e8a74491e0b876106f3d99bd9b/csv.py in _generate_tables(self, files) 78 read_options=self.config.pa_read_options, 79 parse_options=self.config.pa_parse_options, ---> 80 convert_options=self.config.convert_options, 81 ) 82 yield i, pa_table /usr/local/lib/python3.7/dist-packages/pyarrow/_csv.pyx in pyarrow._csv.read_csv() /usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() /usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowInvalid: CSV parse error: Expected 1 columns, got 8 ``` Version: ``` nlp==0.4.0 ```
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
Hi @kauvinlucas You can use the latest versions of `datasets` to do this. To do so, just `pip install datasets` instead of `nlp` (the library was renamed) and then ```python from datasets import load_dataset dataset = load_dataset('csv', data_files='sample_data.csv')
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
38
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you Hi @kauvinlucas You can use the latest versions of `datasets` to do this. To do so, just `pip install datasets` instead of `nlp` (the library was renamed) and then ```python from datasets import load_dataset dataset = load_dataset('csv', data_files='sample_data.csv')
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
Hi I'm having a different problem with loading local csv. ```Python from datasets import load_dataset dataset = load_dataset('csv', data_files='sample.csv') ``` gives `ValueError: Specified named and prefix; you can only specify one.` error versions: - datasets: 1.1.3 - python: 3.9.6 - pyarrow: 2.0.0
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
42
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you Hi I'm having a different problem with loading local csv. ```Python from datasets import load_dataset dataset = load_dataset('csv', data_files='sample.csv') ``` gives `ValueError: Specified named and prefix; you can only specify one.` error versions: - datasets: 1.1.3 - python: 3.9.6 - pyarrow: 2.0.0
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
Oh.. I figured it out. According to issue #[42387](https://github.com/pandas-dev/pandas/issues/42387) from pandas, this new version does not accept None for both parameters (which was being done by the repo I'm testing). Dowgrading Pandas==1.0.4 and Python==3.8 worked
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
35
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you Oh.. I figured it out. According to issue #[42387](https://github.com/pandas-dev/pandas/issues/42387) from pandas, this new version does not accept None for both parameters (which was being done by the repo I'm testing). Dowgrading Pandas==1.0.4 and Python==3.8 worked
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
Hi, I got an `OSError: Cannot find data file. ` when I tried to use load_dataset with tsv files. I have checked the paths, and they are correct. versions - python: 3.7.9 - datasets: 1.1.3 - pyarrow: 2.0.0 - transformers: 4.2.2 ~~~ data_files = {"train": "train.tsv", "test",: "test.tsv"} datasets = load_dataset("csv", data_files=data_files, delimiter="\t") ~~~ The entire Error message is on below: ```08/14/2021 16:55:44 - INFO - __main__ - load a local file for train: /project/media-framing/transformer4/data/0/val/label1.tsv 08/14/2021 16:55:44 - INFO - __main__ - load a local file for test: /project/media-framing/transformer4/data/unlabel/test.tsv Using custom data configuration default Downloading and preparing dataset csv/default-00a4200ae8507533 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /usr4/cs542sp/hey1/.cache/huggingface/datasets/csv/default-00a4200ae8507533/0.0.0/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2... Traceback (most recent call last): File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 592, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 944, in _prepare_split num_examples, num_bytes = writer.finalize() File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/arrow_writer.py", line 307, in finalize self.stream.close() File "pyarrow/io.pxi", line 132, in pyarrow.lib.NativeFile.close File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status OSError: error closing file During handling of the above exception, another exception occurred: Traceback (most recent call last): File "run_glue.py", line 484, in <module> main() File "run_glue.py", line 243, in main datasets = load_dataset("csv", data_files=data_files, delimiter="\t") File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/load.py", line 610, in load_dataset ignore_verifications=ignore_verifications, File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 515, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 594, in _download_and_prepare raise OSError("Cannot find data file. " + (self.manual_download_instructions or "")) OSError: Cannot find data file. ```
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
229
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you Hi, I got an `OSError: Cannot find data file. ` when I tried to use load_dataset with tsv files. I have checked the paths, and they are correct. versions - python: 3.7.9 - datasets: 1.1.3 - pyarrow: 2.0.0 - transformers: 4.2.2 ~~~ data_files = {"train": "train.tsv", "test",: "test.tsv"} datasets = load_dataset("csv", data_files=data_files, delimiter="\t") ~~~ The entire Error message is on below: ```08/14/2021 16:55:44 - INFO - __main__ - load a local file for train: /project/media-framing/transformer4/data/0/val/label1.tsv 08/14/2021 16:55:44 - INFO - __main__ - load a local file for test: /project/media-framing/transformer4/data/unlabel/test.tsv Using custom data configuration default Downloading and preparing dataset csv/default-00a4200ae8507533 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /usr4/cs542sp/hey1/.cache/huggingface/datasets/csv/default-00a4200ae8507533/0.0.0/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2... Traceback (most recent call last): File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 592, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 944, in _prepare_split num_examples, num_bytes = writer.finalize() File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/arrow_writer.py", line 307, in finalize self.stream.close() File "pyarrow/io.pxi", line 132, in pyarrow.lib.NativeFile.close File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status OSError: error closing file During handling of the above exception, another exception occurred: Traceback (most recent call last): File "run_glue.py", line 484, in <module> main() File "run_glue.py", line 243, in main datasets = load_dataset("csv", data_files=data_files, delimiter="\t") File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/load.py", line 610, in load_dataset ignore_verifications=ignore_verifications, File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 515, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 594, in _download_and_prepare raise OSError("Cannot find data file. " + (self.manual_download_instructions or "")) OSError: Cannot find data file. ```
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
Hi ! It looks like the error stacktrace doesn't match with your code snippet. What error do you get when running this ? ``` data_files = {"train": "train.tsv", "test",: "test.tsv"} datasets = load_dataset("csv", data_files=data_files, delimiter="\t") ``` can you check that both tsv files are in the same folder as the current working directory of your shell ?
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
57
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you Hi ! It looks like the error stacktrace doesn't match with your code snippet. What error do you get when running this ? ``` data_files = {"train": "train.tsv", "test",: "test.tsv"} datasets = load_dataset("csv", data_files=data_files, delimiter="\t") ``` can you check that both tsv files are in the same folder as the current working directory of your shell ?
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
Hi @lhoestq, Below is the entire error message after I move both tsv files to the same directory. It's the same with I got before. ``` /projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/torch/cuda/__init__.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at /pytorch/c10/cuda/CUDAFunctions.cpp:100.) return torch._C._cuda_getDeviceCount() > 0 08/29/2021 22:56:43 - WARNING - __main__ - Process rank: -1, device: cpu, n_gpu: 0distributed training: False, 16-bits training: False 08/29/2021 22:56:43 - INFO - __main__ - Training/evaluation parameters TrainingArguments(output_dir=/projectnb/media-framing/pred_result/label1/, overwrite_output_dir=True, do_train=True, do_eval=False, do_predict=True, evaluation_strategy=EvaluationStrategy.NO, prediction_loss_only=False, per_device_train_batch_size=8, per_device_eval_batch_size=8, gradient_accumulation_steps=1, eval_accumulation_steps=None, learning_rate=5e-05, weight_decay=0.0, adam_beta1=0.9, adam_beta2=0.999, adam_epsilon=1e-08, max_grad_norm=1.0, num_train_epochs=8.0, max_steps=-1, lr_scheduler_type=SchedulerType.LINEAR, warmup_steps=0, logging_dir=runs/Aug29_22-56-43_scc1, logging_first_step=False, logging_steps=500, save_steps=3000, save_total_limit=None, no_cuda=False, seed=42, fp16=False, fp16_opt_level=O1, fp16_backend=auto, local_rank=-1, tpu_num_cores=None, tpu_metrics_debug=False, debug=False, dataloader_drop_last=False, eval_steps=500, dataloader_num_workers=0, past_index=-1, run_name=/projectnb/media-framing/pred_result/label1/, disable_tqdm=False, remove_unused_columns=True, label_names=None, load_best_model_at_end=False, metric_for_best_model=None, greater_is_better=None, ignore_data_skip=False, sharded_ddp=False, deepspeed=None, label_smoothing_factor=0.0, adafactor=False, _n_gpu=0) 08/29/2021 22:56:43 - INFO - __main__ - load a local file for train: /project/media-framing/transformer4/temp_train.tsv 08/29/2021 22:56:43 - INFO - __main__ - load a local file for test: /project/media-framing/transformer4/temp_test.tsv 08/29/2021 22:56:43 - WARNING - datasets.builder - Using custom data configuration default-df627c23ac0e98ec Downloading and preparing dataset csv/default (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /usr4/cs542sp/hey1/.cache/huggingface/datasets/csv/default-df627c23ac0e98ec/0.0.0/9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff... Traceback (most recent call last): File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 693, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 1166, in _prepare_split num_examples, num_bytes = writer.finalize() File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/arrow_writer.py", line 428, in finalize self.stream.close() File "pyarrow/io.pxi", line 132, in pyarrow.lib.NativeFile.close File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status OSError: error closing file During handling of the above exception, another exception occurred: Traceback (most recent call last): File "run_glue.py", line 487, in <module> main() File "run_glue.py", line 244, in main datasets = load_dataset("csv", data_files=data_files, delimiter="\t") File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/load.py", line 852, in load_dataset use_auth_token=use_auth_token, File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 616, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 699, in _download_and_prepare + str(e) OSError: Cannot find data file. Original error: error closing file ```
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
311
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you Hi @lhoestq, Below is the entire error message after I move both tsv files to the same directory. It's the same with I got before. ``` /projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/torch/cuda/__init__.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at /pytorch/c10/cuda/CUDAFunctions.cpp:100.) return torch._C._cuda_getDeviceCount() > 0 08/29/2021 22:56:43 - WARNING - __main__ - Process rank: -1, device: cpu, n_gpu: 0distributed training: False, 16-bits training: False 08/29/2021 22:56:43 - INFO - __main__ - Training/evaluation parameters TrainingArguments(output_dir=/projectnb/media-framing/pred_result/label1/, overwrite_output_dir=True, do_train=True, do_eval=False, do_predict=True, evaluation_strategy=EvaluationStrategy.NO, prediction_loss_only=False, per_device_train_batch_size=8, per_device_eval_batch_size=8, gradient_accumulation_steps=1, eval_accumulation_steps=None, learning_rate=5e-05, weight_decay=0.0, adam_beta1=0.9, adam_beta2=0.999, adam_epsilon=1e-08, max_grad_norm=1.0, num_train_epochs=8.0, max_steps=-1, lr_scheduler_type=SchedulerType.LINEAR, warmup_steps=0, logging_dir=runs/Aug29_22-56-43_scc1, logging_first_step=False, logging_steps=500, save_steps=3000, save_total_limit=None, no_cuda=False, seed=42, fp16=False, fp16_opt_level=O1, fp16_backend=auto, local_rank=-1, tpu_num_cores=None, tpu_metrics_debug=False, debug=False, dataloader_drop_last=False, eval_steps=500, dataloader_num_workers=0, past_index=-1, run_name=/projectnb/media-framing/pred_result/label1/, disable_tqdm=False, remove_unused_columns=True, label_names=None, load_best_model_at_end=False, metric_for_best_model=None, greater_is_better=None, ignore_data_skip=False, sharded_ddp=False, deepspeed=None, label_smoothing_factor=0.0, adafactor=False, _n_gpu=0) 08/29/2021 22:56:43 - INFO - __main__ - load a local file for train: /project/media-framing/transformer4/temp_train.tsv 08/29/2021 22:56:43 - INFO - __main__ - load a local file for test: /project/media-framing/transformer4/temp_test.tsv 08/29/2021 22:56:43 - WARNING - datasets.builder - Using custom data configuration default-df627c23ac0e98ec Downloading and preparing dataset csv/default (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /usr4/cs542sp/hey1/.cache/huggingface/datasets/csv/default-df627c23ac0e98ec/0.0.0/9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff... Traceback (most recent call last): File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 693, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 1166, in _prepare_split num_examples, num_bytes = writer.finalize() File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/arrow_writer.py", line 428, in finalize self.stream.close() File "pyarrow/io.pxi", line 132, in pyarrow.lib.NativeFile.close File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status OSError: error closing file During handling of the above exception, another exception occurred: Traceback (most recent call last): File "run_glue.py", line 487, in <module> main() File "run_glue.py", line 244, in main datasets = load_dataset("csv", data_files=data_files, delimiter="\t") File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/load.py", line 852, in load_dataset use_auth_token=use_auth_token, File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 616, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 699, in _download_and_prepare + str(e) OSError: Cannot find data file. Original error: error closing file ```
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
Hi ! Can you try running this into a python shell directly ? ```python import os from datasets import load_dataset data_files = {"train": "train.tsv", "test": "test.tsv"} assert all(os.path.isfile(data_file) for data_file in data_files.values()), "Couln't find files" datasets = load_dataset("csv", data_files=data_files, delimiter="\t") print("success !") ``` This way all the code from `run_glue.py` doesn't interfere with our tests :)
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
56
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you Hi ! Can you try running this into a python shell directly ? ```python import os from datasets import load_dataset data_files = {"train": "train.tsv", "test": "test.tsv"} assert all(os.path.isfile(data_file) for data_file in data_files.values()), "Couln't find files" datasets = load_dataset("csv", data_files=data_files, delimiter="\t") print("success !") ``` This way all the code from `run_glue.py` doesn't interfere with our tests :)
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
Hi @lhoestq, Below is what I got from terminal after I copied and run your code. I think the files themselves are good since there is no assertion error. ``` Using custom data configuration default-df627c23ac0e98ec Downloading and preparing dataset csv/default (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /usr4/cs542sp/hey1/.cache/huggingface/datasets/csv/default-df627c23ac0e98ec/0.0.0/9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff... Traceback (most recent call last): File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 693, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 1166, in _prepare_split num_examples, num_bytes = writer.finalize() File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/arrow_writer.py", line 428, in finalize self.stream.close() File "pyarrow/io.pxi", line 132, in pyarrow.lib.NativeFile.close File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status OSError: error closing file During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 7, in <module> datasets = load_dataset("csv", data_files=data_files, delimiter="\t") File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/load.py", line 852, in load_dataset use_auth_token=use_auth_token, File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 616, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 699, in _download_and_prepare + str(e) OSError: Cannot find data file. Original error: error closing file ```
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
160
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you Hi @lhoestq, Below is what I got from terminal after I copied and run your code. I think the files themselves are good since there is no assertion error. ``` Using custom data configuration default-df627c23ac0e98ec Downloading and preparing dataset csv/default (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /usr4/cs542sp/hey1/.cache/huggingface/datasets/csv/default-df627c23ac0e98ec/0.0.0/9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff... Traceback (most recent call last): File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 693, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 1166, in _prepare_split num_examples, num_bytes = writer.finalize() File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/arrow_writer.py", line 428, in finalize self.stream.close() File "pyarrow/io.pxi", line 132, in pyarrow.lib.NativeFile.close File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status OSError: error closing file During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 7, in <module> datasets = load_dataset("csv", data_files=data_files, delimiter="\t") File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/load.py", line 852, in load_dataset use_auth_token=use_auth_token, File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 616, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 699, in _download_and_prepare + str(e) OSError: Cannot find data file. Original error: error closing file ```
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
Hi, could this be a permission error ? I think it fails to close the arrow file that contains the data from your CSVs in the cache. By default datasets are cached in `~/.cache/huggingface/datasets`, could you check that you have the right permissions ? You can also try to change the cache directory by passing `cache_dir="path/to/my/cache/dir"` to `load_dataset`.
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
58
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you Hi, could this be a permission error ? I think it fails to close the arrow file that contains the data from your CSVs in the cache. By default datasets are cached in `~/.cache/huggingface/datasets`, could you check that you have the right permissions ? You can also try to change the cache directory by passing `cache_dir="path/to/my/cache/dir"` to `load_dataset`.
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
Thank you!! @lhoestq For some reason, I don't have the default path for datasets to cache, maybe because I work from a remote system. The issue solved after I pass the `cache_dir` argument to the function. Thank you very much!!
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
40
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you Thank you!! @lhoestq For some reason, I don't have the default path for datasets to cache, maybe because I work from a remote system. The issue solved after I pass the `cache_dir` argument to the function. Thank you very much!!
https://github.com/huggingface/datasets/issues/743
load_dataset for CSV files not working
> Hi, could this be a permission error ? I think it fails to close the arrow file that contains the data from your CSVs in the cache. > > By default datasets are cached in `~/.cache/huggingface/datasets`, could you check that you have the right permissions ? You can also try to change the cache directory by passing `cache_dir="path/to/my/cache/dir"` to `load_dataset`. This is the exact solution I have been finding for the whole afternoon. Thanks a lot! I tried to do a training on a cluster computing system. The user's home directory is shared between nodes. It always gets **stuck** at dataset loading... The reason might be, the node (with GPU) can't read/write data in the default cache folder (in my home directory). After using an intermediate cache folder, this issue is resolved for me.
Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you
135
load_dataset for CSV files not working Similar to #622, I've noticed there is a problem when trying to load a CSV file with datasets. ` from datasets import load_dataset ` ` dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\t", column_names=["title", "text"], script_version="master") ` Displayed error: ` ... ArrowInvalid: CSV parse error: Expected 2 columns, got 1 ` I should mention that when I've tried to read data from `https://github.com/lhoestq/transformers/tree/custom-dataset-in-rag-retriever/examples/rag/test_data/my_knowledge_dataset.csv` it worked without a problem. I've read that there might be some problems with /r character, so I've removed them from the custom dataset, but the problem still remains. I've added a colab reproducing the bug, but unfortunately I cannot provide the dataset. https://colab.research.google.com/drive/1Qzu7sC-frZVeniiWOwzoCe_UHZsrlxu8?usp=sharing Are there any work around for it ? Thank you > Hi, could this be a permission error ? I think it fails to close the arrow file that contains the data from your CSVs in the cache. > > By default datasets are cached in `~/.cache/huggingface/datasets`, could you check that you have the right permissions ? You can also try to change the cache directory by passing `cache_dir="path/to/my/cache/dir"` to `load_dataset`. This is the exact solution I have been finding for the whole afternoon. Thanks a lot! I tried to do a training on a cluster computing system. The user's home directory is shared between nodes. It always gets **stuck** at dataset loading... The reason might be, the node (with GPU) can't read/write data in the default cache folder (in my home directory). After using an intermediate cache folder, this issue is resolved for me.
https://github.com/huggingface/datasets/issues/741
Creating dataset consumes too much memory
Thanks for reporting. In theory since the dataset script is just made to yield examples to write them into an arrow file, it's not supposed to create memory issues. Could you please try to run this exact same loop in a separate script to see if it's not an issue with `PIL` ? You can just copy paste what's inside `_generate_examples` and remove all the code for `datasets` (remove yield). If the RAM usage stays low after 600 examples it means that it comes from some sort of memory leak in the library, or with pyarrow.
Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png)
96
Creating dataset consumes too much memory Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png) Thanks for reporting. In theory since the dataset script is just made to yield examples to write them into an arrow file, it's not supposed to create memory issues. Could you please try to run this exact same loop in a separate script to see if it's not an issue with `PIL` ? You can just copy paste what's inside `_generate_examples` and remove all the code for `datasets` (remove yield). If the RAM usage stays low after 600 examples it means that it comes from some sort of memory leak in the library, or with pyarrow.
https://github.com/huggingface/datasets/issues/741
Creating dataset consumes too much memory
Here's an equivalent loading code: ```python images_path = "PHOENIX-2014-T-release-v3/PHOENIX-2014-T/features/fullFrame-210x260px/train" for dir_path in tqdm(os.listdir(images_path)): frames_path = os.path.join(images_path, dir_path) np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() ``` The process takes 0.3% of memory, even after 1000 examples on the small machine with 120GB RAM. I guess something in the datasets library doesn't release the reference to the objects I'm yielding, but no idea how to test for this
Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png)
75
Creating dataset consumes too much memory Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png) Here's an equivalent loading code: ```python images_path = "PHOENIX-2014-T-release-v3/PHOENIX-2014-T/features/fullFrame-210x260px/train" for dir_path in tqdm(os.listdir(images_path)): frames_path = os.path.join(images_path, dir_path) np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() ``` The process takes 0.3% of memory, even after 1000 examples on the small machine with 120GB RAM. I guess something in the datasets library doesn't release the reference to the objects I'm yielding, but no idea how to test for this
https://github.com/huggingface/datasets/issues/741
Creating dataset consumes too much memory
I've had similar issues with Arrow once. I'll investigate... For now maybe we can simply use the images paths in the dataset you want to add. I don't expect to fix this memory issue until 1-2 weeks unfortunately. Then we can just update the dataset with the images. What do you think ?
Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png)
53
Creating dataset consumes too much memory Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png) I've had similar issues with Arrow once. I'll investigate... For now maybe we can simply use the images paths in the dataset you want to add. I don't expect to fix this memory issue until 1-2 weeks unfortunately. Then we can just update the dataset with the images. What do you think ?
https://github.com/huggingface/datasets/issues/741
Creating dataset consumes too much memory
If it's just 1-2 weeks, I think it's best if we wait. I don't think it is very urgent to add it, and it will be much more useful with the images loaded rather than not (the images are low resolution, and thus papers using this dataset actually fit the entire video into memory anyway) I'll keep working on other datasets in the meanwhile :)
Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png)
65
Creating dataset consumes too much memory Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png) If it's just 1-2 weeks, I think it's best if we wait. I don't think it is very urgent to add it, and it will be much more useful with the images loaded rather than not (the images are low resolution, and thus papers using this dataset actually fit the entire video into memory anyway) I'll keep working on other datasets in the meanwhile :)
https://github.com/huggingface/datasets/issues/741
Creating dataset consumes too much memory
Ok found the issue. This is because the batch size used by the writer is set to 10 000 elements by default so it would load your full dataset in memory (the writer has a buffer that flushes only after each batch). Moreover to write in Apache Arrow we have to use python objects so what's stored inside the ArrowWriter's buffer is actually python integers (32 bits). Lowering the batch size to 10 should do the job. I will add a flag to the DatasetBuilder class of dataset scripts, so that we can customize the batch size.
Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png)
97
Creating dataset consumes too much memory Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png) Ok found the issue. This is because the batch size used by the writer is set to 10 000 elements by default so it would load your full dataset in memory (the writer has a buffer that flushes only after each batch). Moreover to write in Apache Arrow we have to use python objects so what's stored inside the ArrowWriter's buffer is actually python integers (32 bits). Lowering the batch size to 10 should do the job. I will add a flag to the DatasetBuilder class of dataset scripts, so that we can customize the batch size.
https://github.com/huggingface/datasets/issues/741
Creating dataset consumes too much memory
Thanks, that's awesome you managed to find the problem. About the 32 bits - really? there isn't a way to serialize the numpy array somehow? 32 bits would take 4 times the memory / disk space needed to store these videos. Please let me know when the batch size is customizable and I'll try again!
Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png)
55
Creating dataset consumes too much memory Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png) Thanks, that's awesome you managed to find the problem. About the 32 bits - really? there isn't a way to serialize the numpy array somehow? 32 bits would take 4 times the memory / disk space needed to store these videos. Please let me know when the batch size is customizable and I'll try again!
https://github.com/huggingface/datasets/issues/741
Creating dataset consumes too much memory
The 32 bit integrers are only used in the writer's buffer because Arrow doesn't take numpy arrays correctly as input. On disk it's stored as uint8 in arrow format ;)
Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png)
30
Creating dataset consumes too much memory Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png) The 32 bit integrers are only used in the writer's buffer because Arrow doesn't take numpy arrays correctly as input. On disk it's stored as uint8 in arrow format ;)
https://github.com/huggingface/datasets/issues/741
Creating dataset consumes too much memory
> I don't expect to fix this memory issue until 1-2 weeks unfortunately. Hi @lhoestq not to rush of course, but I was wondering if you have a new timeline so I know how to plan my work around this :)
Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png)
41
Creating dataset consumes too much memory Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png) > I don't expect to fix this memory issue until 1-2 weeks unfortunately. Hi @lhoestq not to rush of course, but I was wondering if you have a new timeline so I know how to plan my work around this :)
https://github.com/huggingface/datasets/issues/741
Creating dataset consumes too much memory
Alright it should be good now. You just have to specify `_writer_batch_size = 10` for example as a class attribute of the dataset builder class.
Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png)
25
Creating dataset consumes too much memory Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png) Alright it should be good now. You just have to specify `_writer_batch_size = 10` for example as a class attribute of the dataset builder class.
https://github.com/huggingface/datasets/issues/741
Creating dataset consumes too much memory
I added it, but still it consumes as much memory https://github.com/huggingface/datasets/pull/722/files#diff-2e0d865dd4a60dedd1861d6f8c5ed281ded71508467908e1e0b1dbe7d2d420b1R66 Did I not do it correctly?
Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png)
17
Creating dataset consumes too much memory Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png) I added it, but still it consumes as much memory https://github.com/huggingface/datasets/pull/722/files#diff-2e0d865dd4a60dedd1861d6f8c5ed281ded71508467908e1e0b1dbe7d2d420b1R66 Did I not do it correctly?
https://github.com/huggingface/datasets/issues/741
Creating dataset consumes too much memory
Yes you did it right. Did you rebase to include the changes of #828 ? EDIT: looks like you merged from master in the PR. Not sure why you still have an issue then, I will investigate
Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png)
37
Creating dataset consumes too much memory Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png) Yes you did it right. Did you rebase to include the changes of #828 ? EDIT: looks like you merged from master in the PR. Not sure why you still have an issue then, I will investigate
https://github.com/huggingface/datasets/issues/741
Creating dataset consumes too much memory
Sorry for the delay, I was busy with the dataset sprint and the incredible amount of contributions to the library ^^' What you can try to do to find what's wrong is check at which frequency the arrow writer writes all the examples from its in-memory buffer on disk. This happens [here](https://github.com/huggingface/datasets/blob/master/src/datasets/arrow_writer.py#L257-L258) in the code. The idea is that `write_on_file` writes the examples every `writer_batch_size` examples and clear the buffer `self. current_rows`. As soon as `writer_batch_size` is small enough you shouldn't have memory issues in theory. Let me know if you have questions or if I can help. Since the dataset sprint is over and I will also be done with all the PRs soon I will be able to go back at it and take a look.
Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png)
128
Creating dataset consumes too much memory Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png) Sorry for the delay, I was busy with the dataset sprint and the incredible amount of contributions to the library ^^' What you can try to do to find what's wrong is check at which frequency the arrow writer writes all the examples from its in-memory buffer on disk. This happens [here](https://github.com/huggingface/datasets/blob/master/src/datasets/arrow_writer.py#L257-L258) in the code. The idea is that `write_on_file` writes the examples every `writer_batch_size` examples and clear the buffer `self. current_rows`. As soon as `writer_batch_size` is small enough you shouldn't have memory issues in theory. Let me know if you have questions or if I can help. Since the dataset sprint is over and I will also be done with all the PRs soon I will be able to go back at it and take a look.
https://github.com/huggingface/datasets/issues/741
Creating dataset consumes too much memory
I had the same issue. It works for me by setting `DEFAULT_WRITER_BATCH_SIZE = 10` of my dataset builder class. (And not `_writer_batch_size` as previously mentioned). I guess this is because `_writer_batch_size` is overwritten in `__init__` (see [here](https://github.com/huggingface/datasets/blob/0e2563e5d5c2fc193ea27d7c24607bb35607f2d5/src/datasets/builder.py#L934))
Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png)
37
Creating dataset consumes too much memory Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png) I had the same issue. It works for me by setting `DEFAULT_WRITER_BATCH_SIZE = 10` of my dataset builder class. (And not `_writer_batch_size` as previously mentioned). I guess this is because `_writer_batch_size` is overwritten in `__init__` (see [here](https://github.com/huggingface/datasets/blob/0e2563e5d5c2fc193ea27d7c24607bb35607f2d5/src/datasets/builder.py#L934))
https://github.com/huggingface/datasets/issues/741
Creating dataset consumes too much memory
Yes the class attribute you can change is `DEFAULT_WRITER_BATCH_SIZE`. Otherwise in `load_dataset` you can specify `writer_batch_size=`
Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png)
16
Creating dataset consumes too much memory Moving this issue from https://github.com/huggingface/datasets/pull/722 here, because it seems like a general issue. Given the following dataset example, where each example saves a sequence of 260x210x3 images (max length 400): ```python def _generate_examples(self, base_path, split): """ Yields examples. """ filepath = os.path.join(base_path, "annotations", "manual", "PHOENIX-2014-T." + split + ".corpus.csv") images_path = os.path.join(base_path, "features", "fullFrame-210x260px", split) with open(filepath, "r", encoding="utf-8") as f: data = csv.DictReader(f, delimiter="|", quoting=csv.QUOTE_NONE) for row in data: frames_path = os.path.join(images_path, row["video"])[:-7] np_frames = [] for frame_name in os.listdir(frames_path): frame_path = os.path.join(frames_path, frame_name) im = Image.open(frame_path) np_frames.append(np.asarray(im)) im.close() yield row["name"], {"video": np_frames} ``` The dataset creation process goes out of memory on a machine with 500GB RAM. I was under the impression that the "generator" here is exactly for that, to avoid memory constraints. However, even if you want the entire dataset in memory, it would be in the worst case `260x210x3 x 400 max length x 7000 samples` in bytes (uint8) = 458.64 gigabytes So I'm not sure why it's taking more than 500GB. And the dataset creation fails after 170 examples on a machine with 120gb RAM, and after 672 examples on a machine with 500GB RAM. --- ## Info that might help: Iterating over examples is extremely slow. ![image](https://user-images.githubusercontent.com/5757359/96359590-3c666780-111d-11eb-9347-1f833ad982a9.png) If I perform this iteration in my own, custom loop (Without saving to file), it runs at 8-9 examples/sec And you can see at this state it is using 94% of the memory: ![image](https://user-images.githubusercontent.com/5757359/96359606-7afc2200-111d-11eb-8c11-0afbdba1a6a3.png) And it is only using one CPU core, which is probably why it's so slow: ![image](https://user-images.githubusercontent.com/5757359/96359630-a3841c00-111d-11eb-9ba0-7fd3cdf51d26.png) Yes the class attribute you can change is `DEFAULT_WRITER_BATCH_SIZE`. Otherwise in `load_dataset` you can specify `writer_batch_size=`
https://github.com/huggingface/datasets/issues/737
Trec Dataset Connection Error
Thanks for reporting. That's because the download url has changed. The old url now redirects to the new one but we don't support redirection for downloads. I'm opening a PR to update the url
**Datasets Version:** 1.1.2 **Python Version:** 3.6/3.7 **Code:** ```python from datasets import load_dataset load_dataset("trec") ``` **Expected behavior:** Download Trec dataset and load Dataset object **Current Behavior:** Get a connection error saying it couldn't reach http://cogcomp.org/Data/QA/QC/train_5500.label (but the link doesn't seem broken) <details> <summary>Error Logs</summary> Using custom data configuration default Downloading and preparing dataset trec/default (download: 350.79 KiB, generated: 403.39 KiB, post-processed: Unknown size, total: 754.18 KiB) to /root/.cache/huggingface/datasets/trec/default/1.1.0/ca4248481ad244f235f4cf277186cad2ee8769f975119a2bbfc41b8932b88bd7... --------------------------------------------------------------------------- ConnectionError Traceback (most recent call last) <ipython-input-8-66bf1242096e> in <module>() ----> 1 load_dataset("trec") 10 frames /usr/local/lib/python3.6/dist-packages/datasets/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only, use_etag) 473 elif response is not None and response.status_code == 404: 474 raise FileNotFoundError("Couldn't find file at {}".format(url)) --> 475 raise ConnectionError("Couldn't reach {}".format(url)) 476 477 # Try a second time ConnectionError: Couldn't reach http://cogcomp.org/Data/QA/QC/train_5500.label </details>
34
Trec Dataset Connection Error **Datasets Version:** 1.1.2 **Python Version:** 3.6/3.7 **Code:** ```python from datasets import load_dataset load_dataset("trec") ``` **Expected behavior:** Download Trec dataset and load Dataset object **Current Behavior:** Get a connection error saying it couldn't reach http://cogcomp.org/Data/QA/QC/train_5500.label (but the link doesn't seem broken) <details> <summary>Error Logs</summary> Using custom data configuration default Downloading and preparing dataset trec/default (download: 350.79 KiB, generated: 403.39 KiB, post-processed: Unknown size, total: 754.18 KiB) to /root/.cache/huggingface/datasets/trec/default/1.1.0/ca4248481ad244f235f4cf277186cad2ee8769f975119a2bbfc41b8932b88bd7... --------------------------------------------------------------------------- ConnectionError Traceback (most recent call last) <ipython-input-8-66bf1242096e> in <module>() ----> 1 load_dataset("trec") 10 frames /usr/local/lib/python3.6/dist-packages/datasets/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only, use_etag) 473 elif response is not None and response.status_code == 404: 474 raise FileNotFoundError("Couldn't find file at {}".format(url)) --> 475 raise ConnectionError("Couldn't reach {}".format(url)) 476 477 # Try a second time ConnectionError: Couldn't reach http://cogcomp.org/Data/QA/QC/train_5500.label </details> Thanks for reporting. That's because the download url has changed. The old url now redirects to the new one but we don't support redirection for downloads. I'm opening a PR to update the url
https://github.com/huggingface/datasets/issues/730
Possible caching bug
Thanks for reporting. That's a bug indeed. Apparently only the `data_files` parameter is taken into account right now in `DatasetBuilder._create_builder_config` but it should also be the case for `config_kwargs` (or at least the instantiated `builder_config`)
The following code with `test1.txt` containing just "🤗🤗🤗": ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) ``` produces this output: ``` Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} ``` Just changing the order (and deleting the temp files): ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) ``` produces this: ``` Using custom data configuration default Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': '🤗🤗🤗'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': '🤗🤗🤗'} ``` Is it intended that the cache path does not depend on the config entries? tested with datasets==1.1.2 and python==3.8.5
35
Possible caching bug The following code with `test1.txt` containing just "🤗🤗🤗": ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) ``` produces this output: ``` Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} ``` Just changing the order (and deleting the temp files): ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) ``` produces this: ``` Using custom data configuration default Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': '🤗🤗🤗'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': '🤗🤗🤗'} ``` Is it intended that the cache path does not depend on the config entries? tested with datasets==1.1.2 and python==3.8.5 Thanks for reporting. That's a bug indeed. Apparently only the `data_files` parameter is taken into account right now in `DatasetBuilder._create_builder_config` but it should also be the case for `config_kwargs` (or at least the instantiated `builder_config`)
https://github.com/huggingface/datasets/issues/730
Possible caching bug
Hi, does this bug be fixed? when I load JSON files, I get the same errors by the command `!python3 run.py --do_train --task qa --dataset squad-retrain-data/train-v2.0.json --output_dir ./re_trained_model/` change the dateset to load json by refering to https://huggingface.co/docs/datasets/loading.html `dataset = datasets.load_dataset('json', data_files=args.dataset)` Errors: `Downloading and preparing dataset json/default (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /root/.cache/huggingface/datasets/json/default-c1e124ad488911b8/0.0.0/45636811569ec4a6630521c18235dfbbab83b7ab572e3393c5ba68ccabe98264... `
The following code with `test1.txt` containing just "🤗🤗🤗": ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) ``` produces this output: ``` Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} ``` Just changing the order (and deleting the temp files): ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) ``` produces this: ``` Using custom data configuration default Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': '🤗🤗🤗'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': '🤗🤗🤗'} ``` Is it intended that the cache path does not depend on the config entries? tested with datasets==1.1.2 and python==3.8.5
63
Possible caching bug The following code with `test1.txt` containing just "🤗🤗🤗": ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) ``` produces this output: ``` Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} ``` Just changing the order (and deleting the temp files): ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) ``` produces this: ``` Using custom data configuration default Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': '🤗🤗🤗'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': '🤗🤗🤗'} ``` Is it intended that the cache path does not depend on the config entries? tested with datasets==1.1.2 and python==3.8.5 Hi, does this bug be fixed? when I load JSON files, I get the same errors by the command `!python3 run.py --do_train --task qa --dataset squad-retrain-data/train-v2.0.json --output_dir ./re_trained_model/` change the dateset to load json by refering to https://huggingface.co/docs/datasets/loading.html `dataset = datasets.load_dataset('json', data_files=args.dataset)` Errors: `Downloading and preparing dataset json/default (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /root/.cache/huggingface/datasets/json/default-c1e124ad488911b8/0.0.0/45636811569ec4a6630521c18235dfbbab83b7ab572e3393c5ba68ccabe98264... `
https://github.com/huggingface/datasets/issues/730
Possible caching bug
```ds = load_dataset("csv", data_files={'train': 'train.csv', 'test': 'test.csv'})``` Gives the output ```Using custom data configuration default-5c8ae7c208631aca``` and the code hangs there.
The following code with `test1.txt` containing just "🤗🤗🤗": ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) ``` produces this output: ``` Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} ``` Just changing the order (and deleting the temp files): ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) ``` produces this: ``` Using custom data configuration default Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': '🤗🤗🤗'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': '🤗🤗🤗'} ``` Is it intended that the cache path does not depend on the config entries? tested with datasets==1.1.2 and python==3.8.5
20
Possible caching bug The following code with `test1.txt` containing just "🤗🤗🤗": ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) ``` produces this output: ``` Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} ``` Just changing the order (and deleting the temp files): ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) ``` produces this: ``` Using custom data configuration default Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': '🤗🤗🤗'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': '🤗🤗🤗'} ``` Is it intended that the cache path does not depend on the config entries? tested with datasets==1.1.2 and python==3.8.5 ```ds = load_dataset("csv", data_files={'train': 'train.csv', 'test': 'test.csv'})``` Gives the output ```Using custom data configuration default-5c8ae7c208631aca``` and the code hangs there.
https://github.com/huggingface/datasets/issues/730
Possible caching bug
> `ds = load_dataset("csv", data_files={'train': 'train.csv', 'test': 'test.csv'})` > > Gives the output `Using custom data configuration default-5c8ae7c208631aca` > > and the code hangs there. Have you solved it? I met this problem too!
The following code with `test1.txt` containing just "🤗🤗🤗": ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) ``` produces this output: ``` Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} ``` Just changing the order (and deleting the temp files): ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) ``` produces this: ``` Using custom data configuration default Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': '🤗🤗🤗'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': '🤗🤗🤗'} ``` Is it intended that the cache path does not depend on the config entries? tested with datasets==1.1.2 and python==3.8.5
34
Possible caching bug The following code with `test1.txt` containing just "🤗🤗🤗": ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) ``` produces this output: ``` Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} ``` Just changing the order (and deleting the temp files): ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) ``` produces this: ``` Using custom data configuration default Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': '🤗🤗🤗'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': '🤗🤗🤗'} ``` Is it intended that the cache path does not depend on the config entries? tested with datasets==1.1.2 and python==3.8.5 > `ds = load_dataset("csv", data_files={'train': 'train.csv', 'test': 'test.csv'})` > > Gives the output `Using custom data configuration default-5c8ae7c208631aca` > > and the code hangs there. Have you solved it? I met this problem too!
https://github.com/huggingface/datasets/issues/730
Possible caching bug
Can you Ctrl+C to kill the process and share the stacktrace here ? It should show at which location in the code it was hanging
The following code with `test1.txt` containing just "🤗🤗🤗": ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) ``` produces this output: ``` Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} ``` Just changing the order (and deleting the temp files): ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) ``` produces this: ``` Using custom data configuration default Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': '🤗🤗🤗'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': '🤗🤗🤗'} ``` Is it intended that the cache path does not depend on the config entries? tested with datasets==1.1.2 and python==3.8.5
25
Possible caching bug The following code with `test1.txt` containing just "🤗🤗🤗": ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) ``` produces this output: ``` Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} ``` Just changing the order (and deleting the temp files): ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) ``` produces this: ``` Using custom data configuration default Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': '🤗🤗🤗'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': '🤗🤗🤗'} ``` Is it intended that the cache path does not depend on the config entries? tested with datasets==1.1.2 and python==3.8.5 Can you Ctrl+C to kill the process and share the stacktrace here ? It should show at which location in the code it was hanging
https://github.com/huggingface/datasets/issues/730
Possible caching bug
I had the same issue and solved it by downgrading the datasets version from 2.7.0 -> 2.6.1 pip install -q datasets==2.6.1
The following code with `test1.txt` containing just "🤗🤗🤗": ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) ``` produces this output: ``` Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} ``` Just changing the order (and deleting the temp files): ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) ``` produces this: ``` Using custom data configuration default Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': '🤗🤗🤗'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': '🤗🤗🤗'} ``` Is it intended that the cache path does not depend on the config entries? tested with datasets==1.1.2 and python==3.8.5
21
Possible caching bug The following code with `test1.txt` containing just "🤗🤗🤗": ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) ``` produces this output: ``` Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} ``` Just changing the order (and deleting the temp files): ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) ``` produces this: ``` Using custom data configuration default Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': '🤗🤗🤗'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': '🤗🤗🤗'} ``` Is it intended that the cache path does not depend on the config entries? tested with datasets==1.1.2 and python==3.8.5 I had the same issue and solved it by downgrading the datasets version from 2.7.0 -> 2.6.1 pip install -q datasets==2.6.1
https://github.com/huggingface/datasets/issues/730
Possible caching bug
> I had the same issue and solved it by downgrading the datasets version from 2.7.0 -> 2.6.1 pip install -q datasets==2.6.1 Thanks, it works for me
The following code with `test1.txt` containing just "🤗🤗🤗": ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) ``` produces this output: ``` Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} ``` Just changing the order (and deleting the temp files): ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) ``` produces this: ``` Using custom data configuration default Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': '🤗🤗🤗'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': '🤗🤗🤗'} ``` Is it intended that the cache path does not depend on the config entries? tested with datasets==1.1.2 and python==3.8.5
27
Possible caching bug The following code with `test1.txt` containing just "🤗🤗🤗": ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) ``` produces this output: ``` Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': 'ð\x9f¤\x97ð\x9f¤\x97ð\x9f¤\x97'} ``` Just changing the order (and deleting the temp files): ``` dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="utf-8") print(dataset[0]) dataset = datasets.load_dataset('text', data_files=['test1.txt'], split="train", encoding="latin_1") print(dataset[0]) ``` produces this: ``` Using custom data configuration default Downloading and preparing dataset text/default-15600e4d83254059 (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155... Dataset text downloaded and prepared to /home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155. Subsequent calls will reuse this data. {'text': '🤗🤗🤗'} Using custom data configuration default Reusing dataset text (/home/arne/.cache/huggingface/datasets/text/default-15600e4d83254059/0.0.0/52cefbb2b82b015d4253f1aeb1e6ee5591124a6491e834acfe1751f765925155) {'text': '🤗🤗🤗'} ``` Is it intended that the cache path does not depend on the config entries? tested with datasets==1.1.2 and python==3.8.5 > I had the same issue and solved it by downgrading the datasets version from 2.7.0 -> 2.6.1 pip install -q datasets==2.6.1 Thanks, it works for me
https://github.com/huggingface/datasets/issues/726
"Checksums didn't match for dataset source files" error while loading openwebtext dataset
Hi try, to provide more information please. Example code in a colab to reproduce the error, details on what you are trying to do and what you were expected and details on your environment (OS, PyPi packages version).
Hi, I have encountered this problem during loading the openwebtext dataset: ``` >>> dataset = load_dataset('openwebtext') Downloading and preparing dataset openwebtext/plain_text (download: 12.00 GiB, generated: 37.04 GiB, post-processed: Unknown size, total: 49.03 GiB) to /home/admin/.cache/huggingface/datasets/openwebtext/plain_text/1.0.0/5c636399c7155da97c982d0d70ecdce30fbca66a4eb4fc768ad91f8331edac02... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/load.py", line 611, in load_dataset ignore_verifications=ignore_verifications, File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 476, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 536, in _download_and_prepare self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 39, in verify_checksums raise NonMatchingChecksumError(error_msg + str(bad_urls)) datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://zenodo.org/record/3834942/files/openwebtext.tar.xz'] ``` I think this problem is caused because the released dataset has changed. Or I should download the dataset manually? Sorry for release the unfinised issue by mistake.
38
"Checksums didn't match for dataset source files" error while loading openwebtext dataset Hi, I have encountered this problem during loading the openwebtext dataset: ``` >>> dataset = load_dataset('openwebtext') Downloading and preparing dataset openwebtext/plain_text (download: 12.00 GiB, generated: 37.04 GiB, post-processed: Unknown size, total: 49.03 GiB) to /home/admin/.cache/huggingface/datasets/openwebtext/plain_text/1.0.0/5c636399c7155da97c982d0d70ecdce30fbca66a4eb4fc768ad91f8331edac02... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/load.py", line 611, in load_dataset ignore_verifications=ignore_verifications, File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 476, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 536, in _download_and_prepare self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 39, in verify_checksums raise NonMatchingChecksumError(error_msg + str(bad_urls)) datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://zenodo.org/record/3834942/files/openwebtext.tar.xz'] ``` I think this problem is caused because the released dataset has changed. Or I should download the dataset manually? Sorry for release the unfinised issue by mistake. Hi try, to provide more information please. Example code in a colab to reproduce the error, details on what you are trying to do and what you were expected and details on your environment (OS, PyPi packages version).
https://github.com/huggingface/datasets/issues/726
"Checksums didn't match for dataset source files" error while loading openwebtext dataset
> Hi try, to provide more information please. > > Example code in a colab to reproduce the error, details on what you are trying to do and what you were expected and details on your environment (OS, PyPi packages version). I have update the description, sorry for the incomplete issue by mistake.
Hi, I have encountered this problem during loading the openwebtext dataset: ``` >>> dataset = load_dataset('openwebtext') Downloading and preparing dataset openwebtext/plain_text (download: 12.00 GiB, generated: 37.04 GiB, post-processed: Unknown size, total: 49.03 GiB) to /home/admin/.cache/huggingface/datasets/openwebtext/plain_text/1.0.0/5c636399c7155da97c982d0d70ecdce30fbca66a4eb4fc768ad91f8331edac02... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/load.py", line 611, in load_dataset ignore_verifications=ignore_verifications, File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 476, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 536, in _download_and_prepare self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 39, in verify_checksums raise NonMatchingChecksumError(error_msg + str(bad_urls)) datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://zenodo.org/record/3834942/files/openwebtext.tar.xz'] ``` I think this problem is caused because the released dataset has changed. Or I should download the dataset manually? Sorry for release the unfinised issue by mistake.
53
"Checksums didn't match for dataset source files" error while loading openwebtext dataset Hi, I have encountered this problem during loading the openwebtext dataset: ``` >>> dataset = load_dataset('openwebtext') Downloading and preparing dataset openwebtext/plain_text (download: 12.00 GiB, generated: 37.04 GiB, post-processed: Unknown size, total: 49.03 GiB) to /home/admin/.cache/huggingface/datasets/openwebtext/plain_text/1.0.0/5c636399c7155da97c982d0d70ecdce30fbca66a4eb4fc768ad91f8331edac02... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/load.py", line 611, in load_dataset ignore_verifications=ignore_verifications, File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 476, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 536, in _download_and_prepare self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 39, in verify_checksums raise NonMatchingChecksumError(error_msg + str(bad_urls)) datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://zenodo.org/record/3834942/files/openwebtext.tar.xz'] ``` I think this problem is caused because the released dataset has changed. Or I should download the dataset manually? Sorry for release the unfinised issue by mistake. > Hi try, to provide more information please. > > Example code in a colab to reproduce the error, details on what you are trying to do and what you were expected and details on your environment (OS, PyPi packages version). I have update the description, sorry for the incomplete issue by mistake.
https://github.com/huggingface/datasets/issues/726
"Checksums didn't match for dataset source files" error while loading openwebtext dataset
Hi, I have manually downloaded the compressed dataset `openwebtext.tar.xz' and use the following command to preprocess the examples: ``` >>> dataset = load_dataset('/home/admin/workspace/datasets/datasets-master/datasets-master/datasets/openwebtext', data_dir='/home/admin/workspace/datasets') Using custom data configuration default Downloading and preparing dataset openwebtext/default (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/admin/.cache/huggingface/datasets/openwebtext/default/0.0.0/5c636399c7155da97c982d0d70ecdce30fbca66a4eb4fc768ad91f8331edac02... Dataset openwebtext downloaded and prepared to /home/admin/.cache/huggingface/datasets/openwebtext/default/0.0.0/5c636399c7155da97c982d0d70ecdce30fbca66a4eb4fc768ad91f8331edac02. Subsequent calls will reuse this data. >>> len(dataset['train']) 74571 >>> ``` The size of the pre-processed example file is only 354MB, however the processed bookcorpus dataset is 4.6g. Are there any problems?
Hi, I have encountered this problem during loading the openwebtext dataset: ``` >>> dataset = load_dataset('openwebtext') Downloading and preparing dataset openwebtext/plain_text (download: 12.00 GiB, generated: 37.04 GiB, post-processed: Unknown size, total: 49.03 GiB) to /home/admin/.cache/huggingface/datasets/openwebtext/plain_text/1.0.0/5c636399c7155da97c982d0d70ecdce30fbca66a4eb4fc768ad91f8331edac02... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/load.py", line 611, in load_dataset ignore_verifications=ignore_verifications, File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 476, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 536, in _download_and_prepare self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 39, in verify_checksums raise NonMatchingChecksumError(error_msg + str(bad_urls)) datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://zenodo.org/record/3834942/files/openwebtext.tar.xz'] ``` I think this problem is caused because the released dataset has changed. Or I should download the dataset manually? Sorry for release the unfinised issue by mistake.
87
"Checksums didn't match for dataset source files" error while loading openwebtext dataset Hi, I have encountered this problem during loading the openwebtext dataset: ``` >>> dataset = load_dataset('openwebtext') Downloading and preparing dataset openwebtext/plain_text (download: 12.00 GiB, generated: 37.04 GiB, post-processed: Unknown size, total: 49.03 GiB) to /home/admin/.cache/huggingface/datasets/openwebtext/plain_text/1.0.0/5c636399c7155da97c982d0d70ecdce30fbca66a4eb4fc768ad91f8331edac02... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/load.py", line 611, in load_dataset ignore_verifications=ignore_verifications, File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 476, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 536, in _download_and_prepare self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 39, in verify_checksums raise NonMatchingChecksumError(error_msg + str(bad_urls)) datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://zenodo.org/record/3834942/files/openwebtext.tar.xz'] ``` I think this problem is caused because the released dataset has changed. Or I should download the dataset manually? Sorry for release the unfinised issue by mistake. Hi, I have manually downloaded the compressed dataset `openwebtext.tar.xz' and use the following command to preprocess the examples: ``` >>> dataset = load_dataset('/home/admin/workspace/datasets/datasets-master/datasets-master/datasets/openwebtext', data_dir='/home/admin/workspace/datasets') Using custom data configuration default Downloading and preparing dataset openwebtext/default (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/admin/.cache/huggingface/datasets/openwebtext/default/0.0.0/5c636399c7155da97c982d0d70ecdce30fbca66a4eb4fc768ad91f8331edac02... Dataset openwebtext downloaded and prepared to /home/admin/.cache/huggingface/datasets/openwebtext/default/0.0.0/5c636399c7155da97c982d0d70ecdce30fbca66a4eb4fc768ad91f8331edac02. Subsequent calls will reuse this data. >>> len(dataset['train']) 74571 >>> ``` The size of the pre-processed example file is only 354MB, however the processed bookcorpus dataset is 4.6g. Are there any problems?
https://github.com/huggingface/datasets/issues/726
"Checksums didn't match for dataset source files" error while loading openwebtext dataset
NonMatchingChecksumError: Checksums didn't match for dataset source files: i got this issue when i try to work on my own datasets kindly tell me, from where i can get checksums of train and dev file in my github repo
Hi, I have encountered this problem during loading the openwebtext dataset: ``` >>> dataset = load_dataset('openwebtext') Downloading and preparing dataset openwebtext/plain_text (download: 12.00 GiB, generated: 37.04 GiB, post-processed: Unknown size, total: 49.03 GiB) to /home/admin/.cache/huggingface/datasets/openwebtext/plain_text/1.0.0/5c636399c7155da97c982d0d70ecdce30fbca66a4eb4fc768ad91f8331edac02... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/load.py", line 611, in load_dataset ignore_verifications=ignore_verifications, File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 476, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 536, in _download_and_prepare self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 39, in verify_checksums raise NonMatchingChecksumError(error_msg + str(bad_urls)) datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://zenodo.org/record/3834942/files/openwebtext.tar.xz'] ``` I think this problem is caused because the released dataset has changed. Or I should download the dataset manually? Sorry for release the unfinised issue by mistake.
39
"Checksums didn't match for dataset source files" error while loading openwebtext dataset Hi, I have encountered this problem during loading the openwebtext dataset: ``` >>> dataset = load_dataset('openwebtext') Downloading and preparing dataset openwebtext/plain_text (download: 12.00 GiB, generated: 37.04 GiB, post-processed: Unknown size, total: 49.03 GiB) to /home/admin/.cache/huggingface/datasets/openwebtext/plain_text/1.0.0/5c636399c7155da97c982d0d70ecdce30fbca66a4eb4fc768ad91f8331edac02... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/load.py", line 611, in load_dataset ignore_verifications=ignore_verifications, File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 476, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 536, in _download_and_prepare self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 39, in verify_checksums raise NonMatchingChecksumError(error_msg + str(bad_urls)) datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://zenodo.org/record/3834942/files/openwebtext.tar.xz'] ``` I think this problem is caused because the released dataset has changed. Or I should download the dataset manually? Sorry for release the unfinised issue by mistake. NonMatchingChecksumError: Checksums didn't match for dataset source files: i got this issue when i try to work on my own datasets kindly tell me, from where i can get checksums of train and dev file in my github repo
https://github.com/huggingface/datasets/issues/726
"Checksums didn't match for dataset source files" error while loading openwebtext dataset
Hi, I got the similar issue for xnli dataset while working on colab with python3.7. `nlp.load_dataset(path = 'xnli')` The above command resulted in following issue : ``` NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://www.nyu.edu/projects/bowman/xnli/XNLI-1.0.zip'] ``` Any idea how to fix this ?
Hi, I have encountered this problem during loading the openwebtext dataset: ``` >>> dataset = load_dataset('openwebtext') Downloading and preparing dataset openwebtext/plain_text (download: 12.00 GiB, generated: 37.04 GiB, post-processed: Unknown size, total: 49.03 GiB) to /home/admin/.cache/huggingface/datasets/openwebtext/plain_text/1.0.0/5c636399c7155da97c982d0d70ecdce30fbca66a4eb4fc768ad91f8331edac02... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/load.py", line 611, in load_dataset ignore_verifications=ignore_verifications, File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 476, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 536, in _download_and_prepare self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 39, in verify_checksums raise NonMatchingChecksumError(error_msg + str(bad_urls)) datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://zenodo.org/record/3834942/files/openwebtext.tar.xz'] ``` I think this problem is caused because the released dataset has changed. Or I should download the dataset manually? Sorry for release the unfinised issue by mistake.
44
"Checksums didn't match for dataset source files" error while loading openwebtext dataset Hi, I have encountered this problem during loading the openwebtext dataset: ``` >>> dataset = load_dataset('openwebtext') Downloading and preparing dataset openwebtext/plain_text (download: 12.00 GiB, generated: 37.04 GiB, post-processed: Unknown size, total: 49.03 GiB) to /home/admin/.cache/huggingface/datasets/openwebtext/plain_text/1.0.0/5c636399c7155da97c982d0d70ecdce30fbca66a4eb4fc768ad91f8331edac02... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/load.py", line 611, in load_dataset ignore_verifications=ignore_verifications, File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 476, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 536, in _download_and_prepare self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 39, in verify_checksums raise NonMatchingChecksumError(error_msg + str(bad_urls)) datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://zenodo.org/record/3834942/files/openwebtext.tar.xz'] ``` I think this problem is caused because the released dataset has changed. Or I should download the dataset manually? Sorry for release the unfinised issue by mistake. Hi, I got the similar issue for xnli dataset while working on colab with python3.7. `nlp.load_dataset(path = 'xnli')` The above command resulted in following issue : ``` NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://www.nyu.edu/projects/bowman/xnli/XNLI-1.0.zip'] ``` Any idea how to fix this ?
https://github.com/huggingface/datasets/issues/726
"Checksums didn't match for dataset source files" error while loading openwebtext dataset
Says fixed but I'm still getting it. command: dataset = load_dataset("ted_talks_iwslt", language_pair=("en", "es"), year="2014",download_mode="force_redownload") got: Using custom data configuration en_es_2014-35a2d3350a0f9823 Downloading and preparing dataset ted_talks_iwslt/en_es_2014 (download: 2.15 KiB, generated: Unknown size, post-processed: Unknown size, total: 2.15 KiB) to /home/ken/.cache/huggingface/datasets/ted_talks_iwslt/en_es_2014-35a2d3350a0f9823/1.1.0/43935b3fe470c753a023642e1f54b068c590847f9928bd3f2ec99f15702ad6a6... Downloading: 2.21k/? [00:00<00:00, 141kB/s] NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://drive.google.com/u/0/uc?id=1Cz1Un9p8Xn9IpEMMrg2kXSDt0dnjxc4z&export=download']
Hi, I have encountered this problem during loading the openwebtext dataset: ``` >>> dataset = load_dataset('openwebtext') Downloading and preparing dataset openwebtext/plain_text (download: 12.00 GiB, generated: 37.04 GiB, post-processed: Unknown size, total: 49.03 GiB) to /home/admin/.cache/huggingface/datasets/openwebtext/plain_text/1.0.0/5c636399c7155da97c982d0d70ecdce30fbca66a4eb4fc768ad91f8331edac02... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/load.py", line 611, in load_dataset ignore_verifications=ignore_verifications, File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 476, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 536, in _download_and_prepare self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 39, in verify_checksums raise NonMatchingChecksumError(error_msg + str(bad_urls)) datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://zenodo.org/record/3834942/files/openwebtext.tar.xz'] ``` I think this problem is caused because the released dataset has changed. Or I should download the dataset manually? Sorry for release the unfinised issue by mistake.
52
"Checksums didn't match for dataset source files" error while loading openwebtext dataset Hi, I have encountered this problem during loading the openwebtext dataset: ``` >>> dataset = load_dataset('openwebtext') Downloading and preparing dataset openwebtext/plain_text (download: 12.00 GiB, generated: 37.04 GiB, post-processed: Unknown size, total: 49.03 GiB) to /home/admin/.cache/huggingface/datasets/openwebtext/plain_text/1.0.0/5c636399c7155da97c982d0d70ecdce30fbca66a4eb4fc768ad91f8331edac02... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/load.py", line 611, in load_dataset ignore_verifications=ignore_verifications, File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 476, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/builder.py", line 536, in _download_and_prepare self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" File "/home/admin/workspace/anaconda3/envs/torch1.6-py3.7/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 39, in verify_checksums raise NonMatchingChecksumError(error_msg + str(bad_urls)) datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://zenodo.org/record/3834942/files/openwebtext.tar.xz'] ``` I think this problem is caused because the released dataset has changed. Or I should download the dataset manually? Sorry for release the unfinised issue by mistake. Says fixed but I'm still getting it. command: dataset = load_dataset("ted_talks_iwslt", language_pair=("en", "es"), year="2014",download_mode="force_redownload") got: Using custom data configuration en_es_2014-35a2d3350a0f9823 Downloading and preparing dataset ted_talks_iwslt/en_es_2014 (download: 2.15 KiB, generated: Unknown size, post-processed: Unknown size, total: 2.15 KiB) to /home/ken/.cache/huggingface/datasets/ted_talks_iwslt/en_es_2014-35a2d3350a0f9823/1.1.0/43935b3fe470c753a023642e1f54b068c590847f9928bd3f2ec99f15702ad6a6... Downloading: 2.21k/? [00:00<00:00, 141kB/s] NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://drive.google.com/u/0/uc?id=1Cz1Un9p8Xn9IpEMMrg2kXSDt0dnjxc4z&export=download']
https://github.com/huggingface/datasets/issues/724
need to redirect /nlp to /datasets and remove outdated info
Should be fixed now: ![image](https://user-images.githubusercontent.com/35882/95917301-040b0600-0d78-11eb-9655-c4ac0e788089.png) Not sure I understand what you mean by the second part?
It looks like the website still has all the `nlp` data, e.g.: https://huggingface.co/nlp/viewer/?dataset=wikihow&config=all should probably redirect to: https://huggingface.co/datasets/wikihow also for some reason the new information is slightly borked. If you look at the old one it was nicely formatted and had the links marked up, the new one is just a jumble of text in one chunk and no markup for links (i.e. not clickable).
16
need to redirect /nlp to /datasets and remove outdated info It looks like the website still has all the `nlp` data, e.g.: https://huggingface.co/nlp/viewer/?dataset=wikihow&config=all should probably redirect to: https://huggingface.co/datasets/wikihow also for some reason the new information is slightly borked. If you look at the old one it was nicely formatted and had the links marked up, the new one is just a jumble of text in one chunk and no markup for links (i.e. not clickable). Should be fixed now: ![image](https://user-images.githubusercontent.com/35882/95917301-040b0600-0d78-11eb-9655-c4ac0e788089.png) Not sure I understand what you mean by the second part?
https://github.com/huggingface/datasets/issues/724
need to redirect /nlp to /datasets and remove outdated info
Thank you! > Not sure I understand what you mean by the second part? Compare the 2: * https://huggingface.co/datasets/wikihow * https://huggingface.co/nlp/viewer/?dataset=wikihow&config=all Can you see the difference? 2nd has formatting, 1st doesn't.
It looks like the website still has all the `nlp` data, e.g.: https://huggingface.co/nlp/viewer/?dataset=wikihow&config=all should probably redirect to: https://huggingface.co/datasets/wikihow also for some reason the new information is slightly borked. If you look at the old one it was nicely formatted and had the links marked up, the new one is just a jumble of text in one chunk and no markup for links (i.e. not clickable).
31
need to redirect /nlp to /datasets and remove outdated info It looks like the website still has all the `nlp` data, e.g.: https://huggingface.co/nlp/viewer/?dataset=wikihow&config=all should probably redirect to: https://huggingface.co/datasets/wikihow also for some reason the new information is slightly borked. If you look at the old one it was nicely formatted and had the links marked up, the new one is just a jumble of text in one chunk and no markup for links (i.e. not clickable). Thank you! > Not sure I understand what you mean by the second part? Compare the 2: * https://huggingface.co/datasets/wikihow * https://huggingface.co/nlp/viewer/?dataset=wikihow&config=all Can you see the difference? 2nd has formatting, 1st doesn't.
https://github.com/huggingface/datasets/issues/724
need to redirect /nlp to /datasets and remove outdated info
For context, those are two different pages (not an old vs new one), one is from the dataset viewer (you can browse data inside the datasets) while the other is just a basic reference page displayed some metadata about the dataset. For the second one, we'll move to markdown parsing soon, so it'll be formatted better.
It looks like the website still has all the `nlp` data, e.g.: https://huggingface.co/nlp/viewer/?dataset=wikihow&config=all should probably redirect to: https://huggingface.co/datasets/wikihow also for some reason the new information is slightly borked. If you look at the old one it was nicely formatted and had the links marked up, the new one is just a jumble of text in one chunk and no markup for links (i.e. not clickable).
56
need to redirect /nlp to /datasets and remove outdated info It looks like the website still has all the `nlp` data, e.g.: https://huggingface.co/nlp/viewer/?dataset=wikihow&config=all should probably redirect to: https://huggingface.co/datasets/wikihow also for some reason the new information is slightly borked. If you look at the old one it was nicely formatted and had the links marked up, the new one is just a jumble of text in one chunk and no markup for links (i.e. not clickable). For context, those are two different pages (not an old vs new one), one is from the dataset viewer (you can browse data inside the datasets) while the other is just a basic reference page displayed some metadata about the dataset. For the second one, we'll move to markdown parsing soon, so it'll be formatted better.
https://github.com/huggingface/datasets/issues/723
Adding pseudo-labels to datasets
Nice ! :) It's indeed the first time we have such contributions so we'll have to figure out the appropriate way to integrate them. Could you add details on what they could be used for ?
I recently [uploaded pseudo-labels](https://github.com/huggingface/transformers/blob/master/examples/seq2seq/precomputed_pseudo_labels.md) for CNN/DM, XSUM and WMT16-en-ro to s3, and thom mentioned I should add them to this repo. Since pseudo-labels are just a large model's generations on an existing dataset, what is the right way to structure this contribution. I read https://huggingface.co/docs/datasets/add_dataset.html, but it doesn't really cover this type of contribution. I could, for example, make a new directory, `xsum_bart_pseudolabels` for each set of pseudolabels or add some sort of parametrization to `xsum.py`: https://github.com/huggingface/datasets/blob/5f4c6e830f603830117877b8990a0e65a2386aa6/datasets/xsum/xsum.py What do you think @lhoestq ?
36
Adding pseudo-labels to datasets I recently [uploaded pseudo-labels](https://github.com/huggingface/transformers/blob/master/examples/seq2seq/precomputed_pseudo_labels.md) for CNN/DM, XSUM and WMT16-en-ro to s3, and thom mentioned I should add them to this repo. Since pseudo-labels are just a large model's generations on an existing dataset, what is the right way to structure this contribution. I read https://huggingface.co/docs/datasets/add_dataset.html, but it doesn't really cover this type of contribution. I could, for example, make a new directory, `xsum_bart_pseudolabels` for each set of pseudolabels or add some sort of parametrization to `xsum.py`: https://github.com/huggingface/datasets/blob/5f4c6e830f603830117877b8990a0e65a2386aa6/datasets/xsum/xsum.py What do you think @lhoestq ? Nice ! :) It's indeed the first time we have such contributions so we'll have to figure out the appropriate way to integrate them. Could you add details on what they could be used for ?
https://github.com/huggingface/datasets/issues/723
Adding pseudo-labels to datasets
A new configuration for those datasets should do the job then. Note that until now datasets like xsum only had one configuration. It means that users didn't have to specify the configuration name when loading the dataset. If we add new configs, users that update the lib will have to update their code to specify the default/standard configuration name (not the one with pseudo labels).
I recently [uploaded pseudo-labels](https://github.com/huggingface/transformers/blob/master/examples/seq2seq/precomputed_pseudo_labels.md) for CNN/DM, XSUM and WMT16-en-ro to s3, and thom mentioned I should add them to this repo. Since pseudo-labels are just a large model's generations on an existing dataset, what is the right way to structure this contribution. I read https://huggingface.co/docs/datasets/add_dataset.html, but it doesn't really cover this type of contribution. I could, for example, make a new directory, `xsum_bart_pseudolabels` for each set of pseudolabels or add some sort of parametrization to `xsum.py`: https://github.com/huggingface/datasets/blob/5f4c6e830f603830117877b8990a0e65a2386aa6/datasets/xsum/xsum.py What do you think @lhoestq ?
65
Adding pseudo-labels to datasets I recently [uploaded pseudo-labels](https://github.com/huggingface/transformers/blob/master/examples/seq2seq/precomputed_pseudo_labels.md) for CNN/DM, XSUM and WMT16-en-ro to s3, and thom mentioned I should add them to this repo. Since pseudo-labels are just a large model's generations on an existing dataset, what is the right way to structure this contribution. I read https://huggingface.co/docs/datasets/add_dataset.html, but it doesn't really cover this type of contribution. I could, for example, make a new directory, `xsum_bart_pseudolabels` for each set of pseudolabels or add some sort of parametrization to `xsum.py`: https://github.com/huggingface/datasets/blob/5f4c6e830f603830117877b8990a0e65a2386aa6/datasets/xsum/xsum.py What do you think @lhoestq ? A new configuration for those datasets should do the job then. Note that until now datasets like xsum only had one configuration. It means that users didn't have to specify the configuration name when loading the dataset. If we add new configs, users that update the lib will have to update their code to specify the default/standard configuration name (not the one with pseudo labels).
https://github.com/huggingface/datasets/issues/723
Adding pseudo-labels to datasets
Oh yes why not. I'm more in favor of this actually since pseudo labels are things that users (not dataset authors in general) can compute by themselves and share with the community
I recently [uploaded pseudo-labels](https://github.com/huggingface/transformers/blob/master/examples/seq2seq/precomputed_pseudo_labels.md) for CNN/DM, XSUM and WMT16-en-ro to s3, and thom mentioned I should add them to this repo. Since pseudo-labels are just a large model's generations on an existing dataset, what is the right way to structure this contribution. I read https://huggingface.co/docs/datasets/add_dataset.html, but it doesn't really cover this type of contribution. I could, for example, make a new directory, `xsum_bart_pseudolabels` for each set of pseudolabels or add some sort of parametrization to `xsum.py`: https://github.com/huggingface/datasets/blob/5f4c6e830f603830117877b8990a0e65a2386aa6/datasets/xsum/xsum.py What do you think @lhoestq ?
32
Adding pseudo-labels to datasets I recently [uploaded pseudo-labels](https://github.com/huggingface/transformers/blob/master/examples/seq2seq/precomputed_pseudo_labels.md) for CNN/DM, XSUM and WMT16-en-ro to s3, and thom mentioned I should add them to this repo. Since pseudo-labels are just a large model's generations on an existing dataset, what is the right way to structure this contribution. I read https://huggingface.co/docs/datasets/add_dataset.html, but it doesn't really cover this type of contribution. I could, for example, make a new directory, `xsum_bart_pseudolabels` for each set of pseudolabels or add some sort of parametrization to `xsum.py`: https://github.com/huggingface/datasets/blob/5f4c6e830f603830117877b8990a0e65a2386aa6/datasets/xsum/xsum.py What do you think @lhoestq ? Oh yes why not. I'm more in favor of this actually since pseudo labels are things that users (not dataset authors in general) can compute by themselves and share with the community
https://github.com/huggingface/datasets/issues/723
Adding pseudo-labels to datasets
![image](https://user-images.githubusercontent.com/6045025/96045248-b528a380-0e3f-11eb-9124-bd55afa031bb.png) I assume I should (for example) rename the xsum dir, change the URL, and put the modified dir somewhere in S3?
I recently [uploaded pseudo-labels](https://github.com/huggingface/transformers/blob/master/examples/seq2seq/precomputed_pseudo_labels.md) for CNN/DM, XSUM and WMT16-en-ro to s3, and thom mentioned I should add them to this repo. Since pseudo-labels are just a large model's generations on an existing dataset, what is the right way to structure this contribution. I read https://huggingface.co/docs/datasets/add_dataset.html, but it doesn't really cover this type of contribution. I could, for example, make a new directory, `xsum_bart_pseudolabels` for each set of pseudolabels or add some sort of parametrization to `xsum.py`: https://github.com/huggingface/datasets/blob/5f4c6e830f603830117877b8990a0e65a2386aa6/datasets/xsum/xsum.py What do you think @lhoestq ?
22
Adding pseudo-labels to datasets I recently [uploaded pseudo-labels](https://github.com/huggingface/transformers/blob/master/examples/seq2seq/precomputed_pseudo_labels.md) for CNN/DM, XSUM and WMT16-en-ro to s3, and thom mentioned I should add them to this repo. Since pseudo-labels are just a large model's generations on an existing dataset, what is the right way to structure this contribution. I read https://huggingface.co/docs/datasets/add_dataset.html, but it doesn't really cover this type of contribution. I could, for example, make a new directory, `xsum_bart_pseudolabels` for each set of pseudolabels or add some sort of parametrization to `xsum.py`: https://github.com/huggingface/datasets/blob/5f4c6e830f603830117877b8990a0e65a2386aa6/datasets/xsum/xsum.py What do you think @lhoestq ? ![image](https://user-images.githubusercontent.com/6045025/96045248-b528a380-0e3f-11eb-9124-bd55afa031bb.png) I assume I should (for example) rename the xsum dir, change the URL, and put the modified dir somewhere in S3?
https://github.com/huggingface/datasets/issues/723
Adding pseudo-labels to datasets
You can use the `datasets-cli` to upload the folder with your version of xsum with the pseudo labels. ``` datasets-cli upload_dataset path/to/xsum ```
I recently [uploaded pseudo-labels](https://github.com/huggingface/transformers/blob/master/examples/seq2seq/precomputed_pseudo_labels.md) for CNN/DM, XSUM and WMT16-en-ro to s3, and thom mentioned I should add them to this repo. Since pseudo-labels are just a large model's generations on an existing dataset, what is the right way to structure this contribution. I read https://huggingface.co/docs/datasets/add_dataset.html, but it doesn't really cover this type of contribution. I could, for example, make a new directory, `xsum_bart_pseudolabels` for each set of pseudolabels or add some sort of parametrization to `xsum.py`: https://github.com/huggingface/datasets/blob/5f4c6e830f603830117877b8990a0e65a2386aa6/datasets/xsum/xsum.py What do you think @lhoestq ?
23
Adding pseudo-labels to datasets I recently [uploaded pseudo-labels](https://github.com/huggingface/transformers/blob/master/examples/seq2seq/precomputed_pseudo_labels.md) for CNN/DM, XSUM and WMT16-en-ro to s3, and thom mentioned I should add them to this repo. Since pseudo-labels are just a large model's generations on an existing dataset, what is the right way to structure this contribution. I read https://huggingface.co/docs/datasets/add_dataset.html, but it doesn't really cover this type of contribution. I could, for example, make a new directory, `xsum_bart_pseudolabels` for each set of pseudolabels or add some sort of parametrization to `xsum.py`: https://github.com/huggingface/datasets/blob/5f4c6e830f603830117877b8990a0e65a2386aa6/datasets/xsum/xsum.py What do you think @lhoestq ? You can use the `datasets-cli` to upload the folder with your version of xsum with the pseudo labels. ``` datasets-cli upload_dataset path/to/xsum ```
https://github.com/huggingface/datasets/issues/721
feat(dl_manager): add support for ftp downloads
We only support http by default for downloading. If you really need to use ftp, then feel free to use a library that allows to download through ftp in your dataset script (I see that you've started working on #722 , that's awesome !). The users will get a message to install the extra library when they load the dataset. To make the download_manager work with a custom downloader, you can call `download_manager.download_custom` instead of `download_manager.download_and_extract`. The expected arguments are the following: ``` url_or_urls: url or `list`/`dict` of urls to download and extract. Each url is a `str`. custom_download: Callable with signature (src_url: str, dst_path: str) -> Any as for example `tf.io.gfile.copy`, that lets you download from google storage ```
I am working on a new dataset (#302) and encounter a problem downloading it. ```python # This is the official download link from https://www-i6.informatik.rwth-aachen.de/~koller/RWTH-PHOENIX-2014-T/ _URL = "ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz" dl_manager.download_and_extract(_URL) ``` I get an error: > ValueError: unable to parse ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz as a URL or as a local path I checked, and indeed you don't consider `ftp` as a remote file. https://github.com/huggingface/datasets/blob/4c2af707a6955cf4b45f83ac67990395327c5725/src/datasets/utils/file_utils.py#L188 Adding `ftp` to that list does not immediately solve the issue, so there probably needs to be some extra work.
120
feat(dl_manager): add support for ftp downloads I am working on a new dataset (#302) and encounter a problem downloading it. ```python # This is the official download link from https://www-i6.informatik.rwth-aachen.de/~koller/RWTH-PHOENIX-2014-T/ _URL = "ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz" dl_manager.download_and_extract(_URL) ``` I get an error: > ValueError: unable to parse ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz as a URL or as a local path I checked, and indeed you don't consider `ftp` as a remote file. https://github.com/huggingface/datasets/blob/4c2af707a6955cf4b45f83ac67990395327c5725/src/datasets/utils/file_utils.py#L188 Adding `ftp` to that list does not immediately solve the issue, so there probably needs to be some extra work. We only support http by default for downloading. If you really need to use ftp, then feel free to use a library that allows to download through ftp in your dataset script (I see that you've started working on #722 , that's awesome !). The users will get a message to install the extra library when they load the dataset. To make the download_manager work with a custom downloader, you can call `download_manager.download_custom` instead of `download_manager.download_and_extract`. The expected arguments are the following: ``` url_or_urls: url or `list`/`dict` of urls to download and extract. Each url is a `str`. custom_download: Callable with signature (src_url: str, dst_path: str) -> Any as for example `tf.io.gfile.copy`, that lets you download from google storage ```
https://github.com/huggingface/datasets/issues/721
feat(dl_manager): add support for ftp downloads
Also maybe it coud be interesting to have a direct support of ftp inside the `datasets` library. Do you know any good libraries that we might consider adding as a (optional ?) dependency ?
I am working on a new dataset (#302) and encounter a problem downloading it. ```python # This is the official download link from https://www-i6.informatik.rwth-aachen.de/~koller/RWTH-PHOENIX-2014-T/ _URL = "ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz" dl_manager.download_and_extract(_URL) ``` I get an error: > ValueError: unable to parse ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz as a URL or as a local path I checked, and indeed you don't consider `ftp` as a remote file. https://github.com/huggingface/datasets/blob/4c2af707a6955cf4b45f83ac67990395327c5725/src/datasets/utils/file_utils.py#L188 Adding `ftp` to that list does not immediately solve the issue, so there probably needs to be some extra work.
34
feat(dl_manager): add support for ftp downloads I am working on a new dataset (#302) and encounter a problem downloading it. ```python # This is the official download link from https://www-i6.informatik.rwth-aachen.de/~koller/RWTH-PHOENIX-2014-T/ _URL = "ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz" dl_manager.download_and_extract(_URL) ``` I get an error: > ValueError: unable to parse ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz as a URL or as a local path I checked, and indeed you don't consider `ftp` as a remote file. https://github.com/huggingface/datasets/blob/4c2af707a6955cf4b45f83ac67990395327c5725/src/datasets/utils/file_utils.py#L188 Adding `ftp` to that list does not immediately solve the issue, so there probably needs to be some extra work. Also maybe it coud be interesting to have a direct support of ftp inside the `datasets` library. Do you know any good libraries that we might consider adding as a (optional ?) dependency ?
https://github.com/huggingface/datasets/issues/721
feat(dl_manager): add support for ftp downloads
Downloading an `ftp` file is as simple as: ```python import urllib urllib.urlretrieve('ftp://server/path/to/file', 'file') ``` I believe this should be supported by the library, as its not using any dependency and is trivial amount of code.
I am working on a new dataset (#302) and encounter a problem downloading it. ```python # This is the official download link from https://www-i6.informatik.rwth-aachen.de/~koller/RWTH-PHOENIX-2014-T/ _URL = "ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz" dl_manager.download_and_extract(_URL) ``` I get an error: > ValueError: unable to parse ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz as a URL or as a local path I checked, and indeed you don't consider `ftp` as a remote file. https://github.com/huggingface/datasets/blob/4c2af707a6955cf4b45f83ac67990395327c5725/src/datasets/utils/file_utils.py#L188 Adding `ftp` to that list does not immediately solve the issue, so there probably needs to be some extra work.
35
feat(dl_manager): add support for ftp downloads I am working on a new dataset (#302) and encounter a problem downloading it. ```python # This is the official download link from https://www-i6.informatik.rwth-aachen.de/~koller/RWTH-PHOENIX-2014-T/ _URL = "ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz" dl_manager.download_and_extract(_URL) ``` I get an error: > ValueError: unable to parse ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz as a URL or as a local path I checked, and indeed you don't consider `ftp` as a remote file. https://github.com/huggingface/datasets/blob/4c2af707a6955cf4b45f83ac67990395327c5725/src/datasets/utils/file_utils.py#L188 Adding `ftp` to that list does not immediately solve the issue, so there probably needs to be some extra work. Downloading an `ftp` file is as simple as: ```python import urllib urllib.urlretrieve('ftp://server/path/to/file', 'file') ``` I believe this should be supported by the library, as its not using any dependency and is trivial amount of code.
https://github.com/huggingface/datasets/issues/721
feat(dl_manager): add support for ftp downloads
I know its unorthodox, but I added `ftp` download support to `file_utils` in the same PR https://github.com/huggingface/datasets/pull/722 So its possible to understand the interaction of the download component with the ftp download ability
I am working on a new dataset (#302) and encounter a problem downloading it. ```python # This is the official download link from https://www-i6.informatik.rwth-aachen.de/~koller/RWTH-PHOENIX-2014-T/ _URL = "ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz" dl_manager.download_and_extract(_URL) ``` I get an error: > ValueError: unable to parse ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz as a URL or as a local path I checked, and indeed you don't consider `ftp` as a remote file. https://github.com/huggingface/datasets/blob/4c2af707a6955cf4b45f83ac67990395327c5725/src/datasets/utils/file_utils.py#L188 Adding `ftp` to that list does not immediately solve the issue, so there probably needs to be some extra work.
33
feat(dl_manager): add support for ftp downloads I am working on a new dataset (#302) and encounter a problem downloading it. ```python # This is the official download link from https://www-i6.informatik.rwth-aachen.de/~koller/RWTH-PHOENIX-2014-T/ _URL = "ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz" dl_manager.download_and_extract(_URL) ``` I get an error: > ValueError: unable to parse ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz as a URL or as a local path I checked, and indeed you don't consider `ftp` as a remote file. https://github.com/huggingface/datasets/blob/4c2af707a6955cf4b45f83ac67990395327c5725/src/datasets/utils/file_utils.py#L188 Adding `ftp` to that list does not immediately solve the issue, so there probably needs to be some extra work. I know its unorthodox, but I added `ftp` download support to `file_utils` in the same PR https://github.com/huggingface/datasets/pull/722 So its possible to understand the interaction of the download component with the ftp download ability
https://github.com/huggingface/datasets/issues/721
feat(dl_manager): add support for ftp downloads
@hoanganhpham1006 yes. See pull request https://github.com/huggingface/datasets/pull/722 , it has a loader for this dataset, mostly ready. There's one issue that delays it being merged - https://github.com/huggingface/datasets/issues/741 - regarding memory consumption.
I am working on a new dataset (#302) and encounter a problem downloading it. ```python # This is the official download link from https://www-i6.informatik.rwth-aachen.de/~koller/RWTH-PHOENIX-2014-T/ _URL = "ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz" dl_manager.download_and_extract(_URL) ``` I get an error: > ValueError: unable to parse ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz as a URL or as a local path I checked, and indeed you don't consider `ftp` as a remote file. https://github.com/huggingface/datasets/blob/4c2af707a6955cf4b45f83ac67990395327c5725/src/datasets/utils/file_utils.py#L188 Adding `ftp` to that list does not immediately solve the issue, so there probably needs to be some extra work.
30
feat(dl_manager): add support for ftp downloads I am working on a new dataset (#302) and encounter a problem downloading it. ```python # This is the official download link from https://www-i6.informatik.rwth-aachen.de/~koller/RWTH-PHOENIX-2014-T/ _URL = "ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz" dl_manager.download_and_extract(_URL) ``` I get an error: > ValueError: unable to parse ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz as a URL or as a local path I checked, and indeed you don't consider `ftp` as a remote file. https://github.com/huggingface/datasets/blob/4c2af707a6955cf4b45f83ac67990395327c5725/src/datasets/utils/file_utils.py#L188 Adding `ftp` to that list does not immediately solve the issue, so there probably needs to be some extra work. @hoanganhpham1006 yes. See pull request https://github.com/huggingface/datasets/pull/722 , it has a loader for this dataset, mostly ready. There's one issue that delays it being merged - https://github.com/huggingface/datasets/issues/741 - regarding memory consumption.
https://github.com/huggingface/datasets/issues/721
feat(dl_manager): add support for ftp downloads
The problem which I have now is that this dataset seems does not allow to download? Can you share it with me pls
I am working on a new dataset (#302) and encounter a problem downloading it. ```python # This is the official download link from https://www-i6.informatik.rwth-aachen.de/~koller/RWTH-PHOENIX-2014-T/ _URL = "ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz" dl_manager.download_and_extract(_URL) ``` I get an error: > ValueError: unable to parse ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz as a URL or as a local path I checked, and indeed you don't consider `ftp` as a remote file. https://github.com/huggingface/datasets/blob/4c2af707a6955cf4b45f83ac67990395327c5725/src/datasets/utils/file_utils.py#L188 Adding `ftp` to that list does not immediately solve the issue, so there probably needs to be some extra work.
23
feat(dl_manager): add support for ftp downloads I am working on a new dataset (#302) and encounter a problem downloading it. ```python # This is the official download link from https://www-i6.informatik.rwth-aachen.de/~koller/RWTH-PHOENIX-2014-T/ _URL = "ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz" dl_manager.download_and_extract(_URL) ``` I get an error: > ValueError: unable to parse ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz as a URL or as a local path I checked, and indeed you don't consider `ftp` as a remote file. https://github.com/huggingface/datasets/blob/4c2af707a6955cf4b45f83ac67990395327c5725/src/datasets/utils/file_utils.py#L188 Adding `ftp` to that list does not immediately solve the issue, so there probably needs to be some extra work. The problem which I have now is that this dataset seems does not allow to download? Can you share it with me pls
https://github.com/huggingface/datasets/issues/721
feat(dl_manager): add support for ftp downloads
The dataset loader is not yet ready, because of that issue. If you want to just download the dataset the old-fashioned way, just go to: https://www-i6.informatik.rwth-aachen.de/ftp/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz (the ftp link is now broken, and its available over https)
I am working on a new dataset (#302) and encounter a problem downloading it. ```python # This is the official download link from https://www-i6.informatik.rwth-aachen.de/~koller/RWTH-PHOENIX-2014-T/ _URL = "ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz" dl_manager.download_and_extract(_URL) ``` I get an error: > ValueError: unable to parse ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz as a URL or as a local path I checked, and indeed you don't consider `ftp` as a remote file. https://github.com/huggingface/datasets/blob/4c2af707a6955cf4b45f83ac67990395327c5725/src/datasets/utils/file_utils.py#L188 Adding `ftp` to that list does not immediately solve the issue, so there probably needs to be some extra work.
37
feat(dl_manager): add support for ftp downloads I am working on a new dataset (#302) and encounter a problem downloading it. ```python # This is the official download link from https://www-i6.informatik.rwth-aachen.de/~koller/RWTH-PHOENIX-2014-T/ _URL = "ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz" dl_manager.download_and_extract(_URL) ``` I get an error: > ValueError: unable to parse ftp://wasserstoff.informatik.rwth-aachen.de/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz as a URL or as a local path I checked, and indeed you don't consider `ftp` as a remote file. https://github.com/huggingface/datasets/blob/4c2af707a6955cf4b45f83ac67990395327c5725/src/datasets/utils/file_utils.py#L188 Adding `ftp` to that list does not immediately solve the issue, so there probably needs to be some extra work. The dataset loader is not yet ready, because of that issue. If you want to just download the dataset the old-fashioned way, just go to: https://www-i6.informatik.rwth-aachen.de/ftp/pub/rwth-phoenix/2016/phoenix-2014-T.v3.tar.gz (the ftp link is now broken, and its available over https)