load_dataset for CSV files not working
{'login': 'iliemihai', 'id': 2815308, 'node_id': 'MDQ6VXNlcjI4MTUzMDg=', 'avatar_url': 'https://avatars.githubusercontent.com/u/2815308?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/iliemihai', 'html_url': 'https://github.com/iliemihai', 'followers_url': 'https://api.github.com/users/iliemihai/followers', 'following_url': 'https://api.github.com/users/iliemihai/following{/other_user}', 'gists_url': 'https://api.github.com/users/iliemihai/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/iliemihai/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/iliemihai/subscriptions', 'organizations_url': 'https://api.github.com/users/iliemihai/orgs', 'repos_url': 'https://api.github.com/users/iliemihai/repos', 'events_url': 'https://api.github.com/users/iliemihai/events{/privacy}', 'received_events_url': 'https://api.github.com/users/iliemihai/received_events', 'type': 'User', 'site_admin': False}
[]
[]
["Thank you !\r\nCould you provide a csv file that reproduces the error ?\r\nIt doesn't have to be one of your dataset. As long as it reproduces the error\r\nThat would help a lot !"
 'I think another good example is the following:\r\n`\r\nfrom datasets import load_dataset\r\n`\r\n`\r\ndataset = load_dataset("csv", data_files=["./sts-dev.csv"], delimiter="\\t", column_names=["one", "two", "three", "four",  "score", "sentence1", "sentence2"], script_version="master")`\r\n`\r\n\r\nDisplayed 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.\r\n\r\n'
 'Hi, seems I also can\'t read csv file. I was trying with a dummy csv with only three rows.\r\n\r\n```\r\ntext,label\r\nI hate google,negative\r\nI love Microsoft,positive\r\nI don\'t like you,negative\r\n```\r\nI was using the HuggingFace image in Paperspace Gradient (datasets==1.1.3). The following code doesn\'t work:\r\n\r\n```\r\nfrom datasets import load_dataset\r\ndataset = load_dataset(\'csv\', script_version="master", data_files=[\'test_data.csv\'], delimiter=",")\r\n```\r\nIt outputs the following:\r\n```\r\nUsing custom data configuration default\r\nDownloading 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...\r\nDataset csv downloaded and prepared to /root/.cache/huggingface/datasets/csv/default-3b6254ff4dd403e5/0.0.0/2960f95a26e85d40ca41a230ac88787f715ee3003edaacb8b1f0891e9f04dda2. Subsequent calls will reuse this data.\r\n```\r\nBut `len(dataset)` gives `1` and I can\'t access rows with indexing `dataset[0]` (it gives `KeyError: 0`).\r\n\r\nHowever, loading from pandas dataframe is working.\r\n```\r\nfrom datasets import Dataset\r\nimport pandas as pd\r\ndf = pd.read_csv(\'test_data.csv\')\r\ndataset = Dataset.from_pandas(df)\r\n```\r\n\r\n'
 'This is because load_dataset without `split=` returns a dictionary of split names (train/validation/test) to dataset.\r\nYou can do\r\n```python\r\nfrom datasets import load_dataset\r\ndataset = load_dataset(\'csv\', script_version="master", data_files=[\'test_data.csv\'], delimiter=",")\r\nprint(dataset["train"][0])\r\n```\r\n\r\nOr if you want to directly get the train split:\r\n\r\n```python\r\nfrom datasets import load_dataset\r\ndataset = load_dataset(\'csv\', script_version="master", data_files=[\'test_data.csv\'], delimiter=",", split="train")\r\nprint(dataset[0])\r\n```\r\n'
 "Good point\r\n\r\nDesign 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?"
 "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.\r\nI'm ok with returning the dataset object if no split specifications are given for text/json/csv/pandas.\r\n\r\nFor 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 ?"
 "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."
 '```\r\nfrom datasets import load_dataset\r\ndataset = load_dataset(\'csv\', data_files=\'./amazon_data/Video_Games_5.csv\', delimiter=",", split=[\'train\', \'test\'])\r\n```\r\nI was running the above line, but got this error.\r\n\r\n```ValueError: Unknown split "test". Should be one of [\'train\'].```\r\n\r\nThe 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?\r\n\r\nThank you!\r\n\r\n'
 'Hi ! the `split` argument in `load_dataset` is used to select the splits you want among the available splits.\r\nHowever when loading a csv with a single file as you did, only a `train` split is available by default.\r\n\r\nIndeed 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 \r\n```python\r\nfrom datasets import load_dataset\r\ndataset = load_dataset(\'csv\', data_files=\'./amazon_data/Video_Games_5.csv\', delimiter=",", split="train")\r\n```\r\n\r\nAnd then to get both a train and test split you can do\r\n```python\r\ndataset = dataset.train_test_split()\r\nprint(dataset.keys())\r\n# [\'train\', \'test\']\r\n```\r\n\r\n\r\nAlso note that a csv dataset may have several available splits if it is defined this way:\r\n```python\r\nfrom datasets import load_dataset\r\ndataset = load_dataset(\'csv\', data_files={\r\n    "train": \'./amazon_data/Video_Games_5_train.csv\',\r\n    "test": \'./amazon_data/Video_Games_5_test.csv\'\r\n})\r\nprint(dataset.keys())\r\n# [\'train\', \'test\']\r\n```\r\n'
 "> 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.\r\n> I'm ok with returning the dataset object if no split specifications are given for text/json/csv/pandas.\r\n> \r\n> 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 ?\r\n\r\nYes 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.\r\n> \r\n> `from datasets import load_dataset`\r\n> `dataset = load_dataset("csv", data_files=["./sample_data.csv"], delimiter="\\t", column_names=["title", "text"], script_version="master")`\r\n> \r\n> Displayed error:\r\n> `... ArrowInvalid: CSV parse error: Expected 2 columns, got 1`\r\n\r\nI\'m also facing the same issue when trying to load from a csv file locally:\r\n\r\n```python\r\nfrom nlp import load_dataset\r\ndataset = load_dataset(\'csv\', data_files=\'sample_data.csv\')\r\n```\r\n\r\nError when executed from Google Colab:\r\n```python\r\nArrowInvalid                              Traceback (most recent call last)\r\n<ipython-input-34-79a8d4f65ed6> in <module>()\r\n      1 from nlp import load_dataset\r\n----> 2 dataset = load_dataset(\'csv\', data_files=\'sample_data.csv\')\r\n\r\n9 frames\r\n/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)\r\n    547     # Download and prepare data\r\n    548     builder_instance.download_and_prepare(\r\n--> 549         download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications,\r\n    550     )\r\n    551 \r\n\r\n/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)\r\n    461                 if not downloaded_from_gcs:\r\n    462                     self._download_and_prepare(\r\n--> 463                         dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs\r\n    464                     )\r\n    465                 # Sync info\r\n\r\n/usr/local/lib/python3.7/dist-packages/nlp/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)\r\n    535             try:\r\n    536                 # Prepare split will record examples associated to the split\r\n--> 537                 self._prepare_split(split_generator, **prepare_split_kwargs)\r\n    538             except OSError:\r\n    539                 raise OSError("Cannot find data file. " + (self.manual_download_instructions or ""))\r\n\r\n/usr/local/lib/python3.7/dist-packages/nlp/builder.py in _prepare_split(self, split_generator)\r\n    863 \r\n    864         generator = self._generate_tables(**split_generator.gen_kwargs)\r\n--> 865         for key, table in utils.tqdm(generator, unit=" tables", leave=False):\r\n    866             writer.write_table(table)\r\n    867         num_examples, num_bytes = writer.finalize()\r\n\r\n/usr/local/lib/python3.7/dist-packages/tqdm/notebook.py in __iter__(self, *args, **kwargs)\r\n    213     def __iter__(self, *args, **kwargs):\r\n    214         try:\r\n--> 215             for obj in super(tqdm_notebook, self).__iter__(*args, **kwargs):\r\n    216                 # return super(tqdm...) will not catch exception\r\n    217                 yield obj\r\n\r\n/usr/local/lib/python3.7/dist-packages/tqdm/std.py in __iter__(self)\r\n   1102                 fp_write=getattr(self.fp, \'write\', sys.stderr.write))\r\n   1103 \r\n-> 1104         for obj in iterable:\r\n   1105             yield obj\r\n   1106             # Update and possibly print the progressbar.\r\n\r\n/usr/local/lib/python3.7/dist-packages/nlp/datasets/csv/ede98314803c971fef04bcee45d660c62f3332e8a74491e0b876106f3d99bd9b/csv.py in _generate_tables(self, files)\r\n     78                 read_options=self.config.pa_read_options,\r\n     79                 parse_options=self.config.pa_parse_options,\r\n---> 80                 convert_options=self.config.convert_options,\r\n     81             )\r\n     82             yield i, pa_table\r\n\r\n/usr/local/lib/python3.7/dist-packages/pyarrow/_csv.pyx in pyarrow._csv.read_csv()\r\n\r\n/usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status()\r\n\r\n/usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.check_status()\r\n\r\nArrowInvalid: CSV parse error: Expected 1 columns, got 8\r\n```\r\n\r\nVersion:\r\n```\r\nnlp==0.4.0\r\n```'
 "Hi @kauvinlucas\r\n\r\nYou can use the latest versions of `datasets` to do this.\r\nTo do so, just `pip install datasets` instead of `nlp` (the library was renamed) and then\r\n```python\r\nfrom datasets import load_dataset\r\ndataset = load_dataset('csv', data_files='sample_data.csv')"
 "Hi \r\nI'm having a different problem with loading local csv. \r\n```Python\r\nfrom datasets import load_dataset  \r\ndataset = load_dataset('csv', data_files='sample.csv')  \r\n```  \r\n\r\ngives `ValueError: Specified named and prefix; you can only specify one.` error  \r\n\r\nversions:  \r\n- datasets: 1.1.3   \r\n- python: 3.9.6  \r\n- pyarrow: 2.0.0 "
 "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"
 'Hi, \r\nI 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.  \r\n\r\nversions\r\n- python: 3.7.9\r\n- datasets: 1.1.3\r\n- pyarrow: 2.0.0\r\n- transformers: 4.2.2\r\n\r\n~~~\r\ndata_files = {"train": "train.tsv", "test",: "test.tsv"}\r\ndatasets = load_dataset("csv", data_files=data_files, delimiter="\\t")\r\n~~~\r\n\r\nThe entire Error message is on below:\r\n\r\n```08/14/2021 16:55:44 - INFO - __main__ -   load a local file for train: /project/media-framing/transformer4/data/0/val/label1.tsv\r\n08/14/2021 16:55:44 - INFO - __main__ -   load a local file for test: /project/media-framing/transformer4/data/unlabel/test.tsv\r\nUsing custom data configuration default\r\nDownloading 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...\r\nTraceback (most recent call last):\r\n  File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 592, in _download_and_prepare\r\n    self._prepare_split(split_generator, **prepare_split_kwargs)\r\n  File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 944, in _prepare_split\r\n    num_examples, num_bytes = writer.finalize()\r\n  File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/arrow_writer.py", line 307, in finalize\r\n    self.stream.close()\r\n  File "pyarrow/io.pxi", line 132, in pyarrow.lib.NativeFile.close\r\n  File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status\r\nOSError: error closing file\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File "run_glue.py", line 484, in <module>\r\n    main()\r\n  File "run_glue.py", line 243, in main\r\n    datasets = load_dataset("csv", data_files=data_files, delimiter="\\t")\r\n  File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/load.py", line 610, in load_dataset\r\n    ignore_verifications=ignore_verifications,\r\n  File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 515, in download_and_prepare\r\n    dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs\r\n  File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 594, in _download_and_prepare\r\n    raise OSError("Cannot find data file. " + (self.manual_download_instructions or ""))\r\nOSError: Cannot find data file. ```'
 'Hi ! It looks like the error stacktrace doesn\'t match with your code snippet.\r\n\r\nWhat error do you get when running this ?\r\n```\r\ndata_files = {"train": "train.tsv", "test",: "test.tsv"}\r\ndatasets = load_dataset("csv", data_files=data_files, delimiter="\\t")\r\n```\r\ncan you check that both tsv files are in the same folder as the current working directory of your shell ?'
 '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.\r\n```\r\n/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.)\r\n  return torch._C._cuda_getDeviceCount() > 0\r\n08/29/2021 22:56:43 - WARNING - __main__ -   Process rank: -1, device: cpu, n_gpu: 0distributed training: False, 16-bits training: False\r\n08/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)\r\n08/29/2021 22:56:43 - INFO - __main__ -   load a local file for train: /project/media-framing/transformer4/temp_train.tsv\r\n08/29/2021 22:56:43 - INFO - __main__ -   load a local file for test: /project/media-framing/transformer4/temp_test.tsv\r\n08/29/2021 22:56:43 - WARNING - datasets.builder -   Using custom data configuration default-df627c23ac0e98ec\r\nDownloading 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...\r\nTraceback (most recent call last):\r\n  File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 693, in _download_and_prepare\r\n    self._prepare_split(split_generator, **prepare_split_kwargs)\r\n  File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 1166, in _prepare_split\r\n    num_examples, num_bytes = writer.finalize()\r\n  File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/arrow_writer.py", line 428, in finalize\r\n    self.stream.close()\r\n  File "pyarrow/io.pxi", line 132, in pyarrow.lib.NativeFile.close\r\n  File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status\r\nOSError: error closing file\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File "run_glue.py", line 487, in <module>\r\n    main()\r\n  File "run_glue.py", line 244, in main\r\n    datasets = load_dataset("csv", data_files=data_files, delimiter="\\t")\r\n  File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/load.py", line 852, in load_dataset\r\n    use_auth_token=use_auth_token,\r\n  File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 616, in download_and_prepare\r\n    dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs\r\n  File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 699, in _download_and_prepare\r\n    + str(e)\r\nOSError: Cannot find data file. \r\nOriginal error:\r\nerror closing file\r\n```'
 'Hi !\r\nCan you try running this into a python shell directly ?\r\n\r\n```python\r\nimport os\r\nfrom datasets import load_dataset\r\n\r\ndata_files = {"train": "train.tsv", "test": "test.tsv"}\r\nassert all(os.path.isfile(data_file) for data_file in data_files.values()), "Couln\'t find files"\r\n\r\ndatasets = load_dataset("csv", data_files=data_files, delimiter="\\t")\r\nprint("success !")\r\n```\r\n\r\nThis way all the code from `run_glue.py` doesn\'t interfere with our tests :)'
 'Hi @lhoestq, \r\n\r\nBelow 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. \r\n\r\n```\r\nUsing custom data configuration default-df627c23ac0e98ec\r\nDownloading 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...\r\nTraceback (most recent call last):\r\n  File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 693, in _download_and_prepare\r\n    self._prepare_split(split_generator, **prepare_split_kwargs)\r\n  File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 1166, in _prepare_split\r\n    num_examples, num_bytes = writer.finalize()\r\n  File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/arrow_writer.py", line 428, in finalize\r\n    self.stream.close()\r\n  File "pyarrow/io.pxi", line 132, in pyarrow.lib.NativeFile.close\r\n  File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status\r\nOSError: error closing file\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File "test.py", line 7, in <module>\r\n    datasets = load_dataset("csv", data_files=data_files, delimiter="\\t")\r\n  File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/load.py", line 852, in load_dataset\r\n    use_auth_token=use_auth_token,\r\n  File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 616, in download_and_prepare\r\n    dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs\r\n  File "/projectnb2/media-framing/env-trans4/lib/python3.7/site-packages/datasets/builder.py", line 699, in _download_and_prepare\r\n    + str(e)\r\nOSError: Cannot find data file. \r\nOriginal error:\r\nerror closing file\r\n```'
 '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.\r\n\r\nBy default datasets are cached in `~/.cache/huggingface/datasets`, could you check that you have the right permissions ?\r\nYou can also try to change the cache directory by passing `cache_dir="path/to/my/cache/dir"` to `load_dataset`.'
 "Thank you!! @lhoestq\r\n\r\nFor 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
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/743/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}