html_url
stringlengths
51
51
title
stringlengths
6
280
comments
stringlengths
67
24.7k
body
stringlengths
51
36.2k
comment_length
int64
16
1.45k
text
stringlengths
159
38.3k
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
@lhoestq the proposed branch is faster, but overall training speedup is a few percentage points. I couldn't figure out how to include the GitHub branch into setup.py, so I couldn't start NVidia optimized Docker-based pre-training run. But on bare metal, there is a slight improvement. I'll do some more performance traces.
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
51
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. @lhoestq the proposed branch is faster, but overall training speedup is a few percentage points. I couldn't figure out how to include the GitHub branch into setup.py, so I couldn't start NVidia optimized Docker-based pre-training run. But on bare metal, there is a slight improvement. I'll do some more performance traces.
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
Hi @vblagoje, to install Datasets from @lhoestq PR reference #2505, you can use: ```shell pip install git+ssh://git@github.com/huggingface/datasets.git@refs/pull/2505/head#egg=datasets ```
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
18
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. Hi @vblagoje, to install Datasets from @lhoestq PR reference #2505, you can use: ```shell pip install git+ssh://git@github.com/huggingface/datasets.git@refs/pull/2505/head#egg=datasets ```
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
Hey @albertvillanova yes thank you, I am aware, I can easily pull it from a terminal command line but then I can't automate docker image builds as dependencies are picked up from setup.py and for some reason setup.py doesn't accept this string format.
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
43
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. Hey @albertvillanova yes thank you, I am aware, I can easily pull it from a terminal command line but then I can't automate docker image builds as dependencies are picked up from setup.py and for some reason setup.py doesn't accept this string format.
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
@vblagoje in that case, you can add this to your `setup.py`: ```python install_requires=[ "datasets @ git+ssh://git@github.com/huggingface/datasets.git@refs/pull/2505/head", ```
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
17
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. @vblagoje in that case, you can add this to your `setup.py`: ```python install_requires=[ "datasets @ git+ssh://git@github.com/huggingface/datasets.git@refs/pull/2505/head", ```
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
@lhoestq @thomwolf @albertvillanova The new approach is definitely faster, dataloader now takes less than 3% cumulative time (pink rectangle two rectangles to the right of tensor.py backward invocation) ![Screen Shot 2021-06-16 at 3 05 06 PM](https://user-images.githubusercontent.com/458335/122224432-19de4700-ce82-11eb-982f-d45d4bcc1e41.png) When we drill down into dataloader next invocation we get: ![Screen Shot 2021-06-16 at 3 09 56 PM](https://user-images.githubusercontent.com/458335/122224976-a1c45100-ce82-11eb-8d40-59194740d616.png) And finally format_batch: ![Screen Shot 2021-06-16 at 3 11 07 PM](https://user-images.githubusercontent.com/458335/122225132-cae4e180-ce82-11eb-8a16-967ab7c1c2aa.png) Not sure this could be further improved but this is definitely a decent step forward.
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
80
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. @lhoestq @thomwolf @albertvillanova The new approach is definitely faster, dataloader now takes less than 3% cumulative time (pink rectangle two rectangles to the right of tensor.py backward invocation) ![Screen Shot 2021-06-16 at 3 05 06 PM](https://user-images.githubusercontent.com/458335/122224432-19de4700-ce82-11eb-982f-d45d4bcc1e41.png) When we drill down into dataloader next invocation we get: ![Screen Shot 2021-06-16 at 3 09 56 PM](https://user-images.githubusercontent.com/458335/122224976-a1c45100-ce82-11eb-8d40-59194740d616.png) And finally format_batch: ![Screen Shot 2021-06-16 at 3 11 07 PM](https://user-images.githubusercontent.com/458335/122225132-cae4e180-ce82-11eb-8a16-967ab7c1c2aa.png) Not sure this could be further improved but this is definitely a decent step forward.
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
> ```python > datasets @ git+ssh://git@github.com/huggingface/datasets.git@refs/pull/2505/head > ``` @albertvillanova how would I replace datasets dependency in https://github.com/huggingface/transformers/blob/master/setup.py as the above approach is not working.
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
24
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. > ```python > datasets @ git+ssh://git@github.com/huggingface/datasets.git@refs/pull/2505/head > ``` @albertvillanova how would I replace datasets dependency in https://github.com/huggingface/transformers/blob/master/setup.py as the above approach is not working.
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
@vblagoje I tested my proposed approach before posting it here and it worked for me. Is it not working in your case because of the SSH protocol? In that case you could try the same approach but using HTTPS: ``` "datasets @ git+https://github.com/huggingface/datasets.git@refs/pull/2505/head", ```
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
44
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. @vblagoje I tested my proposed approach before posting it here and it worked for me. Is it not working in your case because of the SSH protocol? In that case you could try the same approach but using HTTPS: ``` "datasets @ git+https://github.com/huggingface/datasets.git@refs/pull/2505/head", ```
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
@albertvillanova of course it works. Apologies. I needed to change datasets in all deps references , like [here](https://github.com/huggingface/transformers/blob/master/setup.py#L235) for example.
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
20
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. @albertvillanova of course it works. Apologies. I needed to change datasets in all deps references , like [here](https://github.com/huggingface/transformers/blob/master/setup.py#L235) for example.
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
Is time spent casting an issue here? See https://github.com/huggingface/datasets/issues/4676 that Datasets can spend huge amounts of time repeatedly casting to Python objects.
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
22
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. Is time spent casting an issue here? See https://github.com/huggingface/datasets/issues/4676 that Datasets can spend huge amounts of time repeatedly casting to Python objects.
https://github.com/huggingface/datasets/issues/2481
Delete extracted files to save disk space
My suggestion for this would be to have this enabled by default. Plus I don't know if there should be a dedicated issue to that is another functionality. But I propose layered building rather than all at once. That is: 1. uncompress a handful of files via a generator enough to generate one arrow file 2. process arrow file 1 3. delete all the files that went in and aren't needed anymore. rinse and repeat. 1. This way much less disc space will be required - e.g. on JZ we won't be running into inode limitation, also it'd help with the collaborative hub training project 2. The user doesn't need to go and manually clean up all the huge files that were left after pre-processing 3. It would already include deleting temp files this issue is talking about I wonder if the new streaming API would be of help, except here the streaming would be into arrow files as the destination, rather than dataloaders.
As discussed with @stas00 and @lhoestq, allowing the deletion of extracted files would save a great amount of disk space to typical user.
164
Delete extracted files to save disk space As discussed with @stas00 and @lhoestq, allowing the deletion of extracted files would save a great amount of disk space to typical user. My suggestion for this would be to have this enabled by default. Plus I don't know if there should be a dedicated issue to that is another functionality. But I propose layered building rather than all at once. That is: 1. uncompress a handful of files via a generator enough to generate one arrow file 2. process arrow file 1 3. delete all the files that went in and aren't needed anymore. rinse and repeat. 1. This way much less disc space will be required - e.g. on JZ we won't be running into inode limitation, also it'd help with the collaborative hub training project 2. The user doesn't need to go and manually clean up all the huge files that were left after pre-processing 3. It would already include deleting temp files this issue is talking about I wonder if the new streaming API would be of help, except here the streaming would be into arrow files as the destination, rather than dataloaders.
https://github.com/huggingface/datasets/issues/2480
Set download/extracted paths configurable
For example to be able to send uncompressed and temp build files to another volume/partition, so that the user gets the minimal disk usage on their primary setup - and ends up with just the downloaded compressed data + arrow files, but outsourcing the huge files and building to another partition. e.g. on JZ there is a special partition for fast data, but it's also volatile, so only temp files should go there. Think of it as `TMPDIR` so we need the equivalent for `datasets`.
As discussed with @stas00 and @lhoestq, setting these paths configurable may allow to overcome disk space limitation on different partitions/drives. TODO: - [x] Set configurable extracted datasets path: #2487 - [x] Set configurable downloaded datasets path: #2488 - [ ] Set configurable "incomplete" datasets path?
85
Set download/extracted paths configurable As discussed with @stas00 and @lhoestq, setting these paths configurable may allow to overcome disk space limitation on different partitions/drives. TODO: - [x] Set configurable extracted datasets path: #2487 - [x] Set configurable downloaded datasets path: #2488 - [ ] Set configurable "incomplete" datasets path? For example to be able to send uncompressed and temp build files to another volume/partition, so that the user gets the minimal disk usage on their primary setup - and ends up with just the downloaded compressed data + arrow files, but outsourcing the huge files and building to another partition. e.g. on JZ there is a special partition for fast data, but it's also volatile, so only temp files should go there. Think of it as `TMPDIR` so we need the equivalent for `datasets`.
https://github.com/huggingface/datasets/issues/2478
Create release script
I've aligned the release script with Transformers in #6004, so I think this issue can be closed.
Create a script so that releases can be done automatically (as done in `transformers`).
17
Create release script Create a script so that releases can be done automatically (as done in `transformers`). I've aligned the release script with Transformers in #6004, so I think this issue can be closed.
https://github.com/huggingface/datasets/issues/2474
cache_dir parameter for load_from_disk ?
Hi ! `load_from_disk` doesn't move the data. If you specify a local path to your mounted drive, then the dataset is going to be loaded directly from the arrow file in this directory. The cache files that result from `map` operations are also stored in the same directory by default. However note than writing data to your google drive actually fills the VM's disk (see https://github.com/huggingface/datasets/issues/643) Given that, I don't think that changing the cache directory changes anything. Let me know what you think
**Is your feature request related to a problem? Please describe.** When using Google Colab big datasets can be an issue, as they won't fit on the VM's disk. Therefore mounting google drive could be a possible solution. Unfortunatly when loading my own dataset by using the _load_from_disk_ function, the data gets cached to the VM's disk: ` from datasets import load_from_disk myPreprocessedData = load_from_disk("/content/gdrive/MyDrive/ASR_data/myPreprocessedData") ` I know that chaching on google drive could slow down learning. But at least it would run. **Describe the solution you'd like** Add cache_Dir parameter to the load_from_disk function. **Describe alternatives you've considered** It looks like you could write a custom loading script for the load_dataset function. But this seems to be much too complex for my use case. Is there perhaps a template here that uses the load_from_disk function?
84
cache_dir parameter for load_from_disk ? **Is your feature request related to a problem? Please describe.** When using Google Colab big datasets can be an issue, as they won't fit on the VM's disk. Therefore mounting google drive could be a possible solution. Unfortunatly when loading my own dataset by using the _load_from_disk_ function, the data gets cached to the VM's disk: ` from datasets import load_from_disk myPreprocessedData = load_from_disk("/content/gdrive/MyDrive/ASR_data/myPreprocessedData") ` I know that chaching on google drive could slow down learning. But at least it would run. **Describe the solution you'd like** Add cache_Dir parameter to the load_from_disk function. **Describe alternatives you've considered** It looks like you could write a custom loading script for the load_dataset function. But this seems to be much too complex for my use case. Is there perhaps a template here that uses the load_from_disk function? Hi ! `load_from_disk` doesn't move the data. If you specify a local path to your mounted drive, then the dataset is going to be loaded directly from the arrow file in this directory. The cache files that result from `map` operations are also stored in the same directory by default. However note than writing data to your google drive actually fills the VM's disk (see https://github.com/huggingface/datasets/issues/643) Given that, I don't think that changing the cache directory changes anything. Let me know what you think
https://github.com/huggingface/datasets/issues/2474
cache_dir parameter for load_from_disk ?
Thanks for your answer! I am a little surprised since I just want to read the dataset. After debugging a bit, I noticed that the VM’s disk fills up when the tables (generator) are converted to a list: https://github.com/huggingface/datasets/blob/5ba149773d23369617563d752aca922081277ec2/src/datasets/table.py#L850 If I try to iterate through the table’s generator e.g.: `length = sum(1 for x in tables)` the VM’s disk fills up as well. I’m running out of Ideas 😄
**Is your feature request related to a problem? Please describe.** When using Google Colab big datasets can be an issue, as they won't fit on the VM's disk. Therefore mounting google drive could be a possible solution. Unfortunatly when loading my own dataset by using the _load_from_disk_ function, the data gets cached to the VM's disk: ` from datasets import load_from_disk myPreprocessedData = load_from_disk("/content/gdrive/MyDrive/ASR_data/myPreprocessedData") ` I know that chaching on google drive could slow down learning. But at least it would run. **Describe the solution you'd like** Add cache_Dir parameter to the load_from_disk function. **Describe alternatives you've considered** It looks like you could write a custom loading script for the load_dataset function. But this seems to be much too complex for my use case. Is there perhaps a template here that uses the load_from_disk function?
69
cache_dir parameter for load_from_disk ? **Is your feature request related to a problem? Please describe.** When using Google Colab big datasets can be an issue, as they won't fit on the VM's disk. Therefore mounting google drive could be a possible solution. Unfortunatly when loading my own dataset by using the _load_from_disk_ function, the data gets cached to the VM's disk: ` from datasets import load_from_disk myPreprocessedData = load_from_disk("/content/gdrive/MyDrive/ASR_data/myPreprocessedData") ` I know that chaching on google drive could slow down learning. But at least it would run. **Describe the solution you'd like** Add cache_Dir parameter to the load_from_disk function. **Describe alternatives you've considered** It looks like you could write a custom loading script for the load_dataset function. But this seems to be much too complex for my use case. Is there perhaps a template here that uses the load_from_disk function? Thanks for your answer! I am a little surprised since I just want to read the dataset. After debugging a bit, I noticed that the VM’s disk fills up when the tables (generator) are converted to a list: https://github.com/huggingface/datasets/blob/5ba149773d23369617563d752aca922081277ec2/src/datasets/table.py#L850 If I try to iterate through the table’s generator e.g.: `length = sum(1 for x in tables)` the VM’s disk fills up as well. I’m running out of Ideas 😄
https://github.com/huggingface/datasets/issues/2474
cache_dir parameter for load_from_disk ?
Indeed reading the data shouldn't increase the VM's disk. Not sure what google colab does under the hood for that to happen
**Is your feature request related to a problem? Please describe.** When using Google Colab big datasets can be an issue, as they won't fit on the VM's disk. Therefore mounting google drive could be a possible solution. Unfortunatly when loading my own dataset by using the _load_from_disk_ function, the data gets cached to the VM's disk: ` from datasets import load_from_disk myPreprocessedData = load_from_disk("/content/gdrive/MyDrive/ASR_data/myPreprocessedData") ` I know that chaching on google drive could slow down learning. But at least it would run. **Describe the solution you'd like** Add cache_Dir parameter to the load_from_disk function. **Describe alternatives you've considered** It looks like you could write a custom loading script for the load_dataset function. But this seems to be much too complex for my use case. Is there perhaps a template here that uses the load_from_disk function?
22
cache_dir parameter for load_from_disk ? **Is your feature request related to a problem? Please describe.** When using Google Colab big datasets can be an issue, as they won't fit on the VM's disk. Therefore mounting google drive could be a possible solution. Unfortunatly when loading my own dataset by using the _load_from_disk_ function, the data gets cached to the VM's disk: ` from datasets import load_from_disk myPreprocessedData = load_from_disk("/content/gdrive/MyDrive/ASR_data/myPreprocessedData") ` I know that chaching on google drive could slow down learning. But at least it would run. **Describe the solution you'd like** Add cache_Dir parameter to the load_from_disk function. **Describe alternatives you've considered** It looks like you could write a custom loading script for the load_dataset function. But this seems to be much too complex for my use case. Is there perhaps a template here that uses the load_from_disk function? Indeed reading the data shouldn't increase the VM's disk. Not sure what google colab does under the hood for that to happen
https://github.com/huggingface/datasets/issues/2474
cache_dir parameter for load_from_disk ?
Apparently, Colab uses a local cache of the data files read/written from Google Drive. See: - https://github.com/googlecolab/colabtools/issues/2087#issuecomment-860818457 - https://github.com/googlecolab/colabtools/issues/1915#issuecomment-804234540 - https://github.com/googlecolab/colabtools/issues/2147#issuecomment-885052636
**Is your feature request related to a problem? Please describe.** When using Google Colab big datasets can be an issue, as they won't fit on the VM's disk. Therefore mounting google drive could be a possible solution. Unfortunatly when loading my own dataset by using the _load_from_disk_ function, the data gets cached to the VM's disk: ` from datasets import load_from_disk myPreprocessedData = load_from_disk("/content/gdrive/MyDrive/ASR_data/myPreprocessedData") ` I know that chaching on google drive could slow down learning. But at least it would run. **Describe the solution you'd like** Add cache_Dir parameter to the load_from_disk function. **Describe alternatives you've considered** It looks like you could write a custom loading script for the load_dataset function. But this seems to be much too complex for my use case. Is there perhaps a template here that uses the load_from_disk function?
21
cache_dir parameter for load_from_disk ? **Is your feature request related to a problem? Please describe.** When using Google Colab big datasets can be an issue, as they won't fit on the VM's disk. Therefore mounting google drive could be a possible solution. Unfortunatly when loading my own dataset by using the _load_from_disk_ function, the data gets cached to the VM's disk: ` from datasets import load_from_disk myPreprocessedData = load_from_disk("/content/gdrive/MyDrive/ASR_data/myPreprocessedData") ` I know that chaching on google drive could slow down learning. But at least it would run. **Describe the solution you'd like** Add cache_Dir parameter to the load_from_disk function. **Describe alternatives you've considered** It looks like you could write a custom loading script for the load_dataset function. But this seems to be much too complex for my use case. Is there perhaps a template here that uses the load_from_disk function? Apparently, Colab uses a local cache of the data files read/written from Google Drive. See: - https://github.com/googlecolab/colabtools/issues/2087#issuecomment-860818457 - https://github.com/googlecolab/colabtools/issues/1915#issuecomment-804234540 - https://github.com/googlecolab/colabtools/issues/2147#issuecomment-885052636
https://github.com/huggingface/datasets/issues/2472
Fix automatic generation of Zenodo DOI
I have received a reply from Zenodo support: > We are currently investigating and fixing this issue related to GitHub releases. As soon as we have solved it we will reach back to you.
After the last release of Datasets (1.8.0), the automatic generation of the Zenodo DOI failed: it appears in yellow as "Received", instead of in green as "Published". I have contacted Zenodo support to fix this issue. TODO: - [x] Check with Zenodo to fix the issue - [x] Check BibTeX entry is right
34
Fix automatic generation of Zenodo DOI After the last release of Datasets (1.8.0), the automatic generation of the Zenodo DOI failed: it appears in yellow as "Received", instead of in green as "Published". I have contacted Zenodo support to fix this issue. TODO: - [x] Check with Zenodo to fix the issue - [x] Check BibTeX entry is right I have received a reply from Zenodo support: > We are currently investigating and fixing this issue related to GitHub releases. As soon as we have solved it we will reach back to you.
https://github.com/huggingface/datasets/issues/2472
Fix automatic generation of Zenodo DOI
Other repo maintainers had the same problem with Zenodo. There is an open issue on their GitHub repo: zenodo/zenodo#2181
After the last release of Datasets (1.8.0), the automatic generation of the Zenodo DOI failed: it appears in yellow as "Received", instead of in green as "Published". I have contacted Zenodo support to fix this issue. TODO: - [x] Check with Zenodo to fix the issue - [x] Check BibTeX entry is right
19
Fix automatic generation of Zenodo DOI After the last release of Datasets (1.8.0), the automatic generation of the Zenodo DOI failed: it appears in yellow as "Received", instead of in green as "Published". I have contacted Zenodo support to fix this issue. TODO: - [x] Check with Zenodo to fix the issue - [x] Check BibTeX entry is right Other repo maintainers had the same problem with Zenodo. There is an open issue on their GitHub repo: zenodo/zenodo#2181
https://github.com/huggingface/datasets/issues/2472
Fix automatic generation of Zenodo DOI
I have received the following request from Zenodo support: > Could you send us the link to the repository as well as the release tag? My reply: > Sure, here it is: > - Link to the repository: https://github.com/huggingface/datasets > - Link to the repository at the release tag: https://github.com/huggingface/datasets/releases/tag/1.8.0 > - Release tag: 1.8.0
After the last release of Datasets (1.8.0), the automatic generation of the Zenodo DOI failed: it appears in yellow as "Received", instead of in green as "Published". I have contacted Zenodo support to fix this issue. TODO: - [x] Check with Zenodo to fix the issue - [x] Check BibTeX entry is right
55
Fix automatic generation of Zenodo DOI After the last release of Datasets (1.8.0), the automatic generation of the Zenodo DOI failed: it appears in yellow as "Received", instead of in green as "Published". I have contacted Zenodo support to fix this issue. TODO: - [x] Check with Zenodo to fix the issue - [x] Check BibTeX entry is right I have received the following request from Zenodo support: > Could you send us the link to the repository as well as the release tag? My reply: > Sure, here it is: > - Link to the repository: https://github.com/huggingface/datasets > - Link to the repository at the release tag: https://github.com/huggingface/datasets/releases/tag/1.8.0 > - Release tag: 1.8.0
https://github.com/huggingface/datasets/issues/2470
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`.
Hi ! It looks like the issue comes from pyarrow. What version of pyarrow are you using ? How did you install it ?
## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue
24
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`. ## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue Hi ! It looks like the issue comes from pyarrow. What version of pyarrow are you using ? How did you install it ?
https://github.com/huggingface/datasets/issues/2470
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`.
Thank you for the quick reply! I have `pyarrow==4.0.0`, and I am installing with `pip`. It's not one of my explicit dependencies, so I assume it came along with something else.
## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue
31
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`. ## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue Thank you for the quick reply! I have `pyarrow==4.0.0`, and I am installing with `pip`. It's not one of my explicit dependencies, so I assume it came along with something else.
https://github.com/huggingface/datasets/issues/2470
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`.
Could you trying reinstalling pyarrow with pip ? I'm not sure why it would check in your multicurtural-sc directory for source files.
## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue
22
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`. ## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue Could you trying reinstalling pyarrow with pip ? I'm not sure why it would check in your multicurtural-sc directory for source files.
https://github.com/huggingface/datasets/issues/2470
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`.
Sure! I tried reinstalling to get latest. pip was mad because it looks like Datasets currently wants <4.0.0 (which is interesting, because apparently I ended up with 4.0.0 already?), but I gave it a shot anyway: ```bash $ pip install --upgrade --force-reinstall pyarrow Collecting pyarrow Downloading pyarrow-4.0.1-cp39-cp39-manylinux2014_x86_64.whl (21.9 MB) |████████████████████████████████| 21.9 MB 23.8 MB/s Collecting numpy>=1.16.6 Using cached numpy-1.20.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.4 MB) Installing collected packages: numpy, pyarrow Attempting uninstall: numpy Found existing installation: numpy 1.20.3 Uninstalling numpy-1.20.3: Successfully uninstalled numpy-1.20.3 Attempting uninstall: pyarrow Found existing installation: pyarrow 3.0.0 Uninstalling pyarrow-3.0.0: Successfully uninstalled pyarrow-3.0.0 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. datasets 1.8.0 requires pyarrow<4.0.0,>=1.0.0, but you have pyarrow 4.0.1 which is incompatible. Successfully installed numpy-1.20.3 pyarrow-4.0.1 ``` Trying it, the same issue: ![image](https://user-images.githubusercontent.com/1170062/121730226-3f470b80-caa4-11eb-85a5-684c44c816da.png) I tried installing `"pyarrow<4.0.0"`, which gave me 3.0.0. Running, still, same issue. I agree it's weird that pyarrow is checking the source code directory for its files. (There is no `pyarrow/` directory there.) To me, that makes it seem like an issue with how pyarrow is called. Out of curiosity, I tried running this with fewer workers to see when the error arises: - 1: ✅ - 2: ✅ - 4: ✅ - 8: ✅ - 10: ✅ - 11: ❌ 🤔 - 12: ❌ - 16: ❌ - 32: ❌ checking my datasets: ```python >>> datasets DatasetDict({ train: Dataset({ features: ['text'], num_rows: 389290 }) validation.sc: Dataset({ features: ['text'], num_rows: 10 # 🤔 }) validation.wvs: Dataset({ features: ['text'], num_rows: 93928 }) }) ``` New hypothesis: crash if `num_proc` > length of a dataset? 😅 If so, this might be totally my fault, as the caller. Could be a docs fix, or maybe this library could do a check to limit `num_proc` for this case?
## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue
305
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`. ## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue Sure! I tried reinstalling to get latest. pip was mad because it looks like Datasets currently wants <4.0.0 (which is interesting, because apparently I ended up with 4.0.0 already?), but I gave it a shot anyway: ```bash $ pip install --upgrade --force-reinstall pyarrow Collecting pyarrow Downloading pyarrow-4.0.1-cp39-cp39-manylinux2014_x86_64.whl (21.9 MB) |████████████████████████████████| 21.9 MB 23.8 MB/s Collecting numpy>=1.16.6 Using cached numpy-1.20.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.4 MB) Installing collected packages: numpy, pyarrow Attempting uninstall: numpy Found existing installation: numpy 1.20.3 Uninstalling numpy-1.20.3: Successfully uninstalled numpy-1.20.3 Attempting uninstall: pyarrow Found existing installation: pyarrow 3.0.0 Uninstalling pyarrow-3.0.0: Successfully uninstalled pyarrow-3.0.0 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. datasets 1.8.0 requires pyarrow<4.0.0,>=1.0.0, but you have pyarrow 4.0.1 which is incompatible. Successfully installed numpy-1.20.3 pyarrow-4.0.1 ``` Trying it, the same issue: ![image](https://user-images.githubusercontent.com/1170062/121730226-3f470b80-caa4-11eb-85a5-684c44c816da.png) I tried installing `"pyarrow<4.0.0"`, which gave me 3.0.0. Running, still, same issue. I agree it's weird that pyarrow is checking the source code directory for its files. (There is no `pyarrow/` directory there.) To me, that makes it seem like an issue with how pyarrow is called. Out of curiosity, I tried running this with fewer workers to see when the error arises: - 1: ✅ - 2: ✅ - 4: ✅ - 8: ✅ - 10: ✅ - 11: ❌ 🤔 - 12: ❌ - 16: ❌ - 32: ❌ checking my datasets: ```python >>> datasets DatasetDict({ train: Dataset({ features: ['text'], num_rows: 389290 }) validation.sc: Dataset({ features: ['text'], num_rows: 10 # 🤔 }) validation.wvs: Dataset({ features: ['text'], num_rows: 93928 }) }) ``` New hypothesis: crash if `num_proc` > length of a dataset? 😅 If so, this might be totally my fault, as the caller. Could be a docs fix, or maybe this library could do a check to limit `num_proc` for this case?
https://github.com/huggingface/datasets/issues/2470
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`.
Good catch ! Not sure why it could raise such a weird issue from pyarrow though We should definitely reduce num_proc to the length of the dataset if needed and log a warning.
## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue
33
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`. ## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue Good catch ! Not sure why it could raise such a weird issue from pyarrow though We should definitely reduce num_proc to the length of the dataset if needed and log a warning.
https://github.com/huggingface/datasets/issues/2470
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`.
This has been fixed in #2566, thanks @connor-mccarthy ! We'll make a new release soon that includes the fix ;)
## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue
20
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`. ## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue This has been fixed in #2566, thanks @connor-mccarthy ! We'll make a new release soon that includes the fix ;)
https://github.com/huggingface/datasets/issues/2462
Merge DatasetDict and Dataset
Unless there is high demande I don't think we will end up implementing this. This is a lot of work with very few advantages
As discussed in #2424 and #2437 (please see there for detailed conversation): - It would be desirable to improve UX with respect the confusion between DatasetDict and Dataset. - The difference between Dataset and DatasetDict is an additional abstraction complexity that confuses "typical" end users. - A user expects a "Dataset" (whatever it contains multiple or a single split) and maybe it could be interesting to try to simplify the user-facing API as much as possible to hide this complexity from the end user. Here is a proposal for discussion and refined (and potential abandon if it's not good enough): - let's consider that a DatasetDict is also a Dataset with the various split concatenated one after the other - let's disallow the use of integers in split names (probably not a very big breaking change) - when you index with integers you access the examples progressively in split after the other is finished (in a deterministic order) - when you index with strings/split name you have the same behavior as now (full backward compat) - let's then also have all the methods of a Dataset on the DatasetDict The end goal would be to merge both Dataset and DatasetDict object in a single object that would be (pretty much totally) backward compatible with both. There are a few things that we could discuss if we want to merge Dataset and DatasetDict: 1. what happens if you index by a string ? Does it return the column or the split ? We could disallow conflicts between column names and split names to avoid ambiguities. It can be surprising to be able to get a column or a split using the same indexing feature ``` from datasets import load_dataset dataset = load_dataset(...) dataset["train"] dataset["input_ids"] ``` 2. what happens when you iterate over the object ? I guess it should iterate over the examples as a Dataset object, but a DatasetDict used to iterate over the splits as they are the dictionary keys. This is a breaking change that we can discuss. Moreover regarding your points: - integers are not allowed as split names already - it's definitely doable to have all the methods. Maybe some of them like train_test_split that is currently only available for Dataset can be tweaked to work for a split dataset cc: @thomwolf @lhoestq
24
Merge DatasetDict and Dataset As discussed in #2424 and #2437 (please see there for detailed conversation): - It would be desirable to improve UX with respect the confusion between DatasetDict and Dataset. - The difference between Dataset and DatasetDict is an additional abstraction complexity that confuses "typical" end users. - A user expects a "Dataset" (whatever it contains multiple or a single split) and maybe it could be interesting to try to simplify the user-facing API as much as possible to hide this complexity from the end user. Here is a proposal for discussion and refined (and potential abandon if it's not good enough): - let's consider that a DatasetDict is also a Dataset with the various split concatenated one after the other - let's disallow the use of integers in split names (probably not a very big breaking change) - when you index with integers you access the examples progressively in split after the other is finished (in a deterministic order) - when you index with strings/split name you have the same behavior as now (full backward compat) - let's then also have all the methods of a Dataset on the DatasetDict The end goal would be to merge both Dataset and DatasetDict object in a single object that would be (pretty much totally) backward compatible with both. There are a few things that we could discuss if we want to merge Dataset and DatasetDict: 1. what happens if you index by a string ? Does it return the column or the split ? We could disallow conflicts between column names and split names to avoid ambiguities. It can be surprising to be able to get a column or a split using the same indexing feature ``` from datasets import load_dataset dataset = load_dataset(...) dataset["train"] dataset["input_ids"] ``` 2. what happens when you iterate over the object ? I guess it should iterate over the examples as a Dataset object, but a DatasetDict used to iterate over the splits as they are the dictionary keys. This is a breaking change that we can discuss. Moreover regarding your points: - integers are not allowed as split names already - it's definitely doable to have all the methods. Maybe some of them like train_test_split that is currently only available for Dataset can be tweaked to work for a split dataset cc: @thomwolf @lhoestq Unless there is high demande I don't think we will end up implementing this. This is a lot of work with very few advantages
https://github.com/huggingface/datasets/issues/2450
BLUE file not found
Hi ! The `blue` metric doesn't exist, but the `bleu` metric does. You can get the full list of metrics [here](https://github.com/huggingface/datasets/tree/master/metrics) or by running ```python from datasets import list_metrics print(list_metrics()) ```
Hi, I'm having the following issue when I try to load the `blue` metric. ```shell import datasets metric = datasets.load_metric('blue') Traceback (most recent call last): File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/load.py", line 320, in prepare_module local_path = cached_path(file_path, download_config=download_config) File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 291, in cached_path use_auth_token=download_config.use_auth_token, File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 621, in get_from_cache raise FileNotFoundError("Couldn't find file at {}".format(url)) FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/1.7.0/metrics/blue/blue.py During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/load.py", line 332, in prepare_module local_path = cached_path(file_path, download_config=download_config) File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 291, in cached_path use_auth_token=download_config.use_auth_token, File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 621, in get_from_cache raise FileNotFoundError("Couldn't find file at {}".format(url)) FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/master/metrics/blue/blue.py During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<input>", line 1, in <module> File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/load.py", line 605, in load_metric dataset=False, File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/load.py", line 343, in prepare_module combined_path, github_file_path FileNotFoundError: Couldn't find file locally at blue/blue.py, or remotely at https://raw.githubusercontent.com/huggingface/datasets/1.7.0/metrics/blue/blue.py. The file is also not present on the master branch on github. ``` Here is dataset installed version info ```shell pip freeze | grep datasets datasets==1.7.0 ```
31
BLUE file not found Hi, I'm having the following issue when I try to load the `blue` metric. ```shell import datasets metric = datasets.load_metric('blue') Traceback (most recent call last): File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/load.py", line 320, in prepare_module local_path = cached_path(file_path, download_config=download_config) File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 291, in cached_path use_auth_token=download_config.use_auth_token, File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 621, in get_from_cache raise FileNotFoundError("Couldn't find file at {}".format(url)) FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/1.7.0/metrics/blue/blue.py During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/load.py", line 332, in prepare_module local_path = cached_path(file_path, download_config=download_config) File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 291, in cached_path use_auth_token=download_config.use_auth_token, File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 621, in get_from_cache raise FileNotFoundError("Couldn't find file at {}".format(url)) FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/master/metrics/blue/blue.py During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<input>", line 1, in <module> File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/load.py", line 605, in load_metric dataset=False, File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/load.py", line 343, in prepare_module combined_path, github_file_path FileNotFoundError: Couldn't find file locally at blue/blue.py, or remotely at https://raw.githubusercontent.com/huggingface/datasets/1.7.0/metrics/blue/blue.py. The file is also not present on the master branch on github. ``` Here is dataset installed version info ```shell pip freeze | grep datasets datasets==1.7.0 ``` Hi ! The `blue` metric doesn't exist, but the `bleu` metric does. You can get the full list of metrics [here](https://github.com/huggingface/datasets/tree/master/metrics) or by running ```python from datasets import list_metrics print(list_metrics()) ```
https://github.com/huggingface/datasets/issues/2447
dataset adversarial_qa has no answers in the "test" set
Hi ! I'm pretty sure that the answers are not made available for the test set on purpose because it is part of the DynaBench benchmark, for which you can submit your predictions on the website. In any case we should mention this in the dataset card of this dataset.
## Describe the bug When loading the adversarial_qa dataset the 'test' portion has no answers. Only the 'train' and 'validation' portions do. This occurs with all four of the configs ('adversarialQA', 'dbidaf', 'dbert', 'droberta') ## Steps to reproduce the bug ``` from datasets import load_dataset examples = load_dataset('adversarial_qa', 'adversarialQA', script_version="master")['test'] print('Loaded {:,} examples'.format(len(examples))) has_answers = 0 for e in examples: if e['answers']['text']: has_answers += 1 print('{:,} have answers'.format(has_answers)) >>> Loaded 3,000 examples >>> 0 have answers examples = load_dataset('adversarial_qa', 'adversarialQA', script_version="master")['validation'] <...code above...> >>> Loaded 3,000 examples >>> 3,000 have answers ``` ## Expected results If 'test' is a valid dataset, it should have answers. Also note that all of the 'train' and 'validation' sets have answers, there are no "no answer" questions with this set (not sure if this is correct or not). ## Environment info - `datasets` version: 1.7.0 - Platform: Linux-5.8.0-53-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyArrow version: 1.0.0
50
dataset adversarial_qa has no answers in the "test" set ## Describe the bug When loading the adversarial_qa dataset the 'test' portion has no answers. Only the 'train' and 'validation' portions do. This occurs with all four of the configs ('adversarialQA', 'dbidaf', 'dbert', 'droberta') ## Steps to reproduce the bug ``` from datasets import load_dataset examples = load_dataset('adversarial_qa', 'adversarialQA', script_version="master")['test'] print('Loaded {:,} examples'.format(len(examples))) has_answers = 0 for e in examples: if e['answers']['text']: has_answers += 1 print('{:,} have answers'.format(has_answers)) >>> Loaded 3,000 examples >>> 0 have answers examples = load_dataset('adversarial_qa', 'adversarialQA', script_version="master")['validation'] <...code above...> >>> Loaded 3,000 examples >>> 3,000 have answers ``` ## Expected results If 'test' is a valid dataset, it should have answers. Also note that all of the 'train' and 'validation' sets have answers, there are no "no answer" questions with this set (not sure if this is correct or not). ## Environment info - `datasets` version: 1.7.0 - Platform: Linux-5.8.0-53-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyArrow version: 1.0.0 Hi ! I'm pretty sure that the answers are not made available for the test set on purpose because it is part of the DynaBench benchmark, for which you can submit your predictions on the website. In any case we should mention this in the dataset card of this dataset.
https://github.com/huggingface/datasets/issues/2447
dataset adversarial_qa has no answers in the "test" set
Makes sense, but not intuitive for someone searching through the datasets. Thanks for adding the note to clarify.
## Describe the bug When loading the adversarial_qa dataset the 'test' portion has no answers. Only the 'train' and 'validation' portions do. This occurs with all four of the configs ('adversarialQA', 'dbidaf', 'dbert', 'droberta') ## Steps to reproduce the bug ``` from datasets import load_dataset examples = load_dataset('adversarial_qa', 'adversarialQA', script_version="master")['test'] print('Loaded {:,} examples'.format(len(examples))) has_answers = 0 for e in examples: if e['answers']['text']: has_answers += 1 print('{:,} have answers'.format(has_answers)) >>> Loaded 3,000 examples >>> 0 have answers examples = load_dataset('adversarial_qa', 'adversarialQA', script_version="master")['validation'] <...code above...> >>> Loaded 3,000 examples >>> 3,000 have answers ``` ## Expected results If 'test' is a valid dataset, it should have answers. Also note that all of the 'train' and 'validation' sets have answers, there are no "no answer" questions with this set (not sure if this is correct or not). ## Environment info - `datasets` version: 1.7.0 - Platform: Linux-5.8.0-53-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyArrow version: 1.0.0
18
dataset adversarial_qa has no answers in the "test" set ## Describe the bug When loading the adversarial_qa dataset the 'test' portion has no answers. Only the 'train' and 'validation' portions do. This occurs with all four of the configs ('adversarialQA', 'dbidaf', 'dbert', 'droberta') ## Steps to reproduce the bug ``` from datasets import load_dataset examples = load_dataset('adversarial_qa', 'adversarialQA', script_version="master")['test'] print('Loaded {:,} examples'.format(len(examples))) has_answers = 0 for e in examples: if e['answers']['text']: has_answers += 1 print('{:,} have answers'.format(has_answers)) >>> Loaded 3,000 examples >>> 0 have answers examples = load_dataset('adversarial_qa', 'adversarialQA', script_version="master")['validation'] <...code above...> >>> Loaded 3,000 examples >>> 3,000 have answers ``` ## Expected results If 'test' is a valid dataset, it should have answers. Also note that all of the 'train' and 'validation' sets have answers, there are no "no answer" questions with this set (not sure if this is correct or not). ## Environment info - `datasets` version: 1.7.0 - Platform: Linux-5.8.0-53-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyArrow version: 1.0.0 Makes sense, but not intuitive for someone searching through the datasets. Thanks for adding the note to clarify.
https://github.com/huggingface/datasets/issues/2446
`yelp_polarity` is broken
``` File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/streamlit/script_runner.py", line 332, in _run_script exec(code, module.__dict__) File "/home/sasha/nlp-viewer/run.py", line 233, in <module> configs = get_confs(option) File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/streamlit/caching.py", line 604, in wrapped_func return get_or_create_cached_value() File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/streamlit/caching.py", line 588, in get_or_create_cached_value return_value = func(*args, **kwargs) File "/home/sasha/nlp-viewer/run.py", line 148, in get_confs builder_cls = nlp.load.import_main_class(module_path[0], dataset=True) File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/datasets/load.py", line 85, in import_main_class module = importlib.import_module(module_path) File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/sasha/.cache/huggingface/modules/datasets_modules/datasets/yelp_polarity/a770787b2526bdcbfc29ac2d9beb8e820fbc15a03afd3ebc4fb9d8529de57544/yelp_polarity.py", line 36, in <module> from datasets.tasks import TextClassification ```
![image](https://user-images.githubusercontent.com/22514219/120828150-c4a35b00-c58e-11eb-8083-a537cee4dbb3.png)
118
`yelp_polarity` is broken ![image](https://user-images.githubusercontent.com/22514219/120828150-c4a35b00-c58e-11eb-8083-a537cee4dbb3.png) ``` File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/streamlit/script_runner.py", line 332, in _run_script exec(code, module.__dict__) File "/home/sasha/nlp-viewer/run.py", line 233, in <module> configs = get_confs(option) File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/streamlit/caching.py", line 604, in wrapped_func return get_or_create_cached_value() File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/streamlit/caching.py", line 588, in get_or_create_cached_value return_value = func(*args, **kwargs) File "/home/sasha/nlp-viewer/run.py", line 148, in get_confs builder_cls = nlp.load.import_main_class(module_path[0], dataset=True) File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/datasets/load.py", line 85, in import_main_class module = importlib.import_module(module_path) File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/sasha/.cache/huggingface/modules/datasets_modules/datasets/yelp_polarity/a770787b2526bdcbfc29ac2d9beb8e820fbc15a03afd3ebc4fb9d8529de57544/yelp_polarity.py", line 36, in <module> from datasets.tasks import TextClassification ```
https://github.com/huggingface/datasets/issues/2444
Sentence Boundaries missing in Dataset: xtreme / udpos
Hi, This is a known issue. More info on this issue can be found in #2061. If you are looking for an open-source contribution, there are step-by-step instructions in the linked issue that you can follow to fix it.
I was browsing through annotation guidelines, as suggested by the datasets introduction. The guidlines saids "There must be exactly one blank line after every sentence, including the last sentence in the file. Empty sentences are not allowed." in the [Sentence Boundaries and Comments section](https://universaldependencies.org/format.html#sentence-boundaries-and-comments) But the sentence boundaries seems not to be represented by huggingface datasets features well. I found out that multiple sentence are concatenated together as a 1D array, without any delimiter. PAN-x, which is another token classification subset from xtreme do represent the sentence boundary using a 2D array. You may compare in PAN-x.en and udpos.English in the explorer: https://huggingface.co/datasets/viewer/?dataset=xtreme
39
Sentence Boundaries missing in Dataset: xtreme / udpos I was browsing through annotation guidelines, as suggested by the datasets introduction. The guidlines saids "There must be exactly one blank line after every sentence, including the last sentence in the file. Empty sentences are not allowed." in the [Sentence Boundaries and Comments section](https://universaldependencies.org/format.html#sentence-boundaries-and-comments) But the sentence boundaries seems not to be represented by huggingface datasets features well. I found out that multiple sentence are concatenated together as a 1D array, without any delimiter. PAN-x, which is another token classification subset from xtreme do represent the sentence boundary using a 2D array. You may compare in PAN-x.en and udpos.English in the explorer: https://huggingface.co/datasets/viewer/?dataset=xtreme Hi, This is a known issue. More info on this issue can be found in #2061. If you are looking for an open-source contribution, there are step-by-step instructions in the linked issue that you can follow to fix it.
https://github.com/huggingface/datasets/issues/2443
Some tests hang on Windows
Hi ! That would be nice indeed to at least have a warning, since we don't handle the max path length limit. Also if we could have an error instead of an infinite loop I'm sure windows users will appreciate that
Currently, several tests hang on Windows if the max path limit of 260 characters is not disabled. This happens due to the changes introduced by #2223 that cause an infinite loop in `WindowsFileLock` described in #2220. This can be very tricky to debug, so I think now is a good time to address these issues/PRs. IMO throwing an error is too harsh, but maybe we can emit a warning in the top-level `__init__.py ` on startup if long paths are not enabled.
41
Some tests hang on Windows Currently, several tests hang on Windows if the max path limit of 260 characters is not disabled. This happens due to the changes introduced by #2223 that cause an infinite loop in `WindowsFileLock` described in #2220. This can be very tricky to debug, so I think now is a good time to address these issues/PRs. IMO throwing an error is too harsh, but maybe we can emit a warning in the top-level `__init__.py ` on startup if long paths are not enabled. Hi ! That would be nice indeed to at least have a warning, since we don't handle the max path length limit. Also if we could have an error instead of an infinite loop I'm sure windows users will appreciate that
https://github.com/huggingface/datasets/issues/2443
Some tests hang on Windows
Unfortunately, I know this problem very well... 😅 I remember having proposed to throw an error instead of hanging in an infinite loop #2220: 60c7d1b6b71469599a27147a08100f594e7a3f84, 8c8ab60018b00463edf1eca500e434ff061546fc but @lhoestq told me: > Note that the filelock module comes from this project that hasn't changed in years - while still being used by ten of thousands of projects: https://github.com/benediktschmitt/py-filelock > > Unless we have proper tests for this, I wouldn't recommend to change it I opened an Issue requesting a warning/error at startup for that case: #2224
Currently, several tests hang on Windows if the max path limit of 260 characters is not disabled. This happens due to the changes introduced by #2223 that cause an infinite loop in `WindowsFileLock` described in #2220. This can be very tricky to debug, so I think now is a good time to address these issues/PRs. IMO throwing an error is too harsh, but maybe we can emit a warning in the top-level `__init__.py ` on startup if long paths are not enabled.
85
Some tests hang on Windows Currently, several tests hang on Windows if the max path limit of 260 characters is not disabled. This happens due to the changes introduced by #2223 that cause an infinite loop in `WindowsFileLock` described in #2220. This can be very tricky to debug, so I think now is a good time to address these issues/PRs. IMO throwing an error is too harsh, but maybe we can emit a warning in the top-level `__init__.py ` on startup if long paths are not enabled. Unfortunately, I know this problem very well... 😅 I remember having proposed to throw an error instead of hanging in an infinite loop #2220: 60c7d1b6b71469599a27147a08100f594e7a3f84, 8c8ab60018b00463edf1eca500e434ff061546fc but @lhoestq told me: > Note that the filelock module comes from this project that hasn't changed in years - while still being used by ten of thousands of projects: https://github.com/benediktschmitt/py-filelock > > Unless we have proper tests for this, I wouldn't recommend to change it I opened an Issue requesting a warning/error at startup for that case: #2224
https://github.com/huggingface/datasets/issues/2443
Some tests hang on Windows
@albertvillanova Thanks for additional info on this issue. Yes, I think the best option is to throw an error instead of suppressing it in a loop. I've considered 2 more options, but I don't really like them: 1. create a temporary file with a filename longer than 255 characters on import; if this fails, long paths are not enabled and raise a warning. I'm not sure about this approach because I don't like the idea of creating a temporary file on import for this purpose. 2. check if long paths are enabled with [this code](https://stackoverflow.com/a/46546731/14095927). As mentioned in the comment, this code relies on an undocumented function and Win10-specific.
Currently, several tests hang on Windows if the max path limit of 260 characters is not disabled. This happens due to the changes introduced by #2223 that cause an infinite loop in `WindowsFileLock` described in #2220. This can be very tricky to debug, so I think now is a good time to address these issues/PRs. IMO throwing an error is too harsh, but maybe we can emit a warning in the top-level `__init__.py ` on startup if long paths are not enabled.
109
Some tests hang on Windows Currently, several tests hang on Windows if the max path limit of 260 characters is not disabled. This happens due to the changes introduced by #2223 that cause an infinite loop in `WindowsFileLock` described in #2220. This can be very tricky to debug, so I think now is a good time to address these issues/PRs. IMO throwing an error is too harsh, but maybe we can emit a warning in the top-level `__init__.py ` on startup if long paths are not enabled. @albertvillanova Thanks for additional info on this issue. Yes, I think the best option is to throw an error instead of suppressing it in a loop. I've considered 2 more options, but I don't really like them: 1. create a temporary file with a filename longer than 255 characters on import; if this fails, long paths are not enabled and raise a warning. I'm not sure about this approach because I don't like the idea of creating a temporary file on import for this purpose. 2. check if long paths are enabled with [this code](https://stackoverflow.com/a/46546731/14095927). As mentioned in the comment, this code relies on an undocumented function and Win10-specific.
https://github.com/huggingface/datasets/issues/2441
DuplicatedKeysError on personal dataset
Hi ! In your dataset script you must be yielding examples like ```python for line in file: ... yield key, {...} ``` Since `datasets` 1.7.0 we enforce the keys to be unique. However it looks like your examples generator creates duplicate keys: at least two examples have key 0. You can fix that by making sure that your keys are unique. For example if you use a counter to define the key of each example, make sure that your counter is not reset to 0 in during examples generation (between two open files for examples). Let me know if you have other questions :)
## Describe the bug Ever since today, I have been getting a DuplicatedKeysError while trying to load my dataset from my own script. Error returned when running this line: `dataset = load_dataset('/content/drive/MyDrive/Thesis/Datasets/book_preprocessing/goodreads_maharjan_trimmed_and_nered/goodreadsnered.py')` Note that my script was working fine with earlier versions of the Datasets library. Cannot say with 100% certainty if I have been doing something wrong with my dataset script this whole time or if this is simply a bug with the new version of datasets. ## Steps to reproduce the bug I cannot provide code to reproduce the error as I am working with my own dataset. I can however provide my script if requested. ## Expected results For my data to be loaded. ## Actual results **DuplicatedKeysError** exception is raised ``` Downloading and preparing dataset good_reads_practice_dataset/main_domain (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /root/.cache/huggingface/datasets/good_reads_practice_dataset/main_domain/1.1.0/64ff7c3fee2693afdddea75002eb6887d4fedc3d812ae3622128c8504ab21655... --------------------------------------------------------------------------- DuplicatedKeysError Traceback (most recent call last) <ipython-input-6-c342ea0dae9d> in <module>() ----> 1 dataset = load_dataset('/content/drive/MyDrive/Thesis/Datasets/book_preprocessing/goodreads_maharjan_trimmed_and_nered/goodreadsnered.py') 5 frames /usr/local/lib/python3.7/dist-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, script_version, use_auth_token, task, **config_kwargs) 749 try_from_hf_gcs=try_from_hf_gcs, 750 base_path=base_path, --> 751 use_auth_token=use_auth_token, 752 ) 753 /usr/local/lib/python3.7/dist-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 573 if not downloaded_from_gcs: 574 self._download_and_prepare( --> 575 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 576 ) 577 # Sync info /usr/local/lib/python3.7/dist-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 650 try: 651 # Prepare split will record examples associated to the split --> 652 self._prepare_split(split_generator, **prepare_split_kwargs) 653 except OSError as e: 654 raise OSError( /usr/local/lib/python3.7/dist-packages/datasets/builder.py in _prepare_split(self, split_generator) 990 writer.write(example, key) 991 finally: --> 992 num_examples, num_bytes = writer.finalize() 993 994 split_generator.split_info.num_examples = num_examples /usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in finalize(self, close_stream) 407 # In case current_examples < writer_batch_size, but user uses finalize() 408 if self._check_duplicates: --> 409 self.check_duplicate_keys() 410 # Re-intializing to empty list for next batch 411 self.hkey_record = [] /usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in check_duplicate_keys(self) 347 for hash, key in self.hkey_record: 348 if hash in tmp_record: --> 349 raise DuplicatedKeysError(key) 350 else: 351 tmp_record.add(hash) DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: 0 Keys should be unique and deterministic in nature ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.7.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.9 - PyArrow version: 3.0.0
104
DuplicatedKeysError on personal dataset ## Describe the bug Ever since today, I have been getting a DuplicatedKeysError while trying to load my dataset from my own script. Error returned when running this line: `dataset = load_dataset('/content/drive/MyDrive/Thesis/Datasets/book_preprocessing/goodreads_maharjan_trimmed_and_nered/goodreadsnered.py')` Note that my script was working fine with earlier versions of the Datasets library. Cannot say with 100% certainty if I have been doing something wrong with my dataset script this whole time or if this is simply a bug with the new version of datasets. ## Steps to reproduce the bug I cannot provide code to reproduce the error as I am working with my own dataset. I can however provide my script if requested. ## Expected results For my data to be loaded. ## Actual results **DuplicatedKeysError** exception is raised ``` Downloading and preparing dataset good_reads_practice_dataset/main_domain (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /root/.cache/huggingface/datasets/good_reads_practice_dataset/main_domain/1.1.0/64ff7c3fee2693afdddea75002eb6887d4fedc3d812ae3622128c8504ab21655... --------------------------------------------------------------------------- DuplicatedKeysError Traceback (most recent call last) <ipython-input-6-c342ea0dae9d> in <module>() ----> 1 dataset = load_dataset('/content/drive/MyDrive/Thesis/Datasets/book_preprocessing/goodreads_maharjan_trimmed_and_nered/goodreadsnered.py') 5 frames /usr/local/lib/python3.7/dist-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, script_version, use_auth_token, task, **config_kwargs) 749 try_from_hf_gcs=try_from_hf_gcs, 750 base_path=base_path, --> 751 use_auth_token=use_auth_token, 752 ) 753 /usr/local/lib/python3.7/dist-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 573 if not downloaded_from_gcs: 574 self._download_and_prepare( --> 575 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 576 ) 577 # Sync info /usr/local/lib/python3.7/dist-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 650 try: 651 # Prepare split will record examples associated to the split --> 652 self._prepare_split(split_generator, **prepare_split_kwargs) 653 except OSError as e: 654 raise OSError( /usr/local/lib/python3.7/dist-packages/datasets/builder.py in _prepare_split(self, split_generator) 990 writer.write(example, key) 991 finally: --> 992 num_examples, num_bytes = writer.finalize() 993 994 split_generator.split_info.num_examples = num_examples /usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in finalize(self, close_stream) 407 # In case current_examples < writer_batch_size, but user uses finalize() 408 if self._check_duplicates: --> 409 self.check_duplicate_keys() 410 # Re-intializing to empty list for next batch 411 self.hkey_record = [] /usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in check_duplicate_keys(self) 347 for hash, key in self.hkey_record: 348 if hash in tmp_record: --> 349 raise DuplicatedKeysError(key) 350 else: 351 tmp_record.add(hash) DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: 0 Keys should be unique and deterministic in nature ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.7.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.9 - PyArrow version: 3.0.0 Hi ! In your dataset script you must be yielding examples like ```python for line in file: ... yield key, {...} ``` Since `datasets` 1.7.0 we enforce the keys to be unique. However it looks like your examples generator creates duplicate keys: at least two examples have key 0. You can fix that by making sure that your keys are unique. For example if you use a counter to define the key of each example, make sure that your counter is not reset to 0 in during examples generation (between two open files for examples). Let me know if you have other questions :)
https://github.com/huggingface/datasets/issues/2440
Remove `extended` field from dataset tagger
The tagger also doesn't insert the value for the `size_categories` field automatically, so this should be fixed too
## Describe the bug While working on #2435 I used the [dataset tagger](https://huggingface.co/datasets/tagging/) to generate the missing tags for the YAML metadata of each README.md file. However, it seems that our CI raises an error when the `extended` field is included: ``` dataset_name = 'arcd' @pytest.mark.parametrize("dataset_name", get_changed_datasets(repo_path)) def test_changed_dataset_card(dataset_name): card_path = repo_path / "datasets" / dataset_name / "README.md" assert card_path.exists() error_messages = [] try: ReadMe.from_readme(card_path) except Exception as readme_error: error_messages.append(f"The following issues have been found in the dataset cards:\nREADME:\n{readme_error}") try: DatasetMetadata.from_readme(card_path) except Exception as metadata_error: error_messages.append( f"The following issues have been found in the dataset cards:\nYAML tags:\n{metadata_error}" ) if error_messages: > raise ValueError("\n".join(error_messages)) E ValueError: The following issues have been found in the dataset cards: E YAML tags: E __init__() got an unexpected keyword argument 'extended' tests/test_dataset_cards.py:70: ValueError ``` Consider either removing this tag from the tagger or including it as part of the validation step in the CI. cc @yjernite
18
Remove `extended` field from dataset tagger ## Describe the bug While working on #2435 I used the [dataset tagger](https://huggingface.co/datasets/tagging/) to generate the missing tags for the YAML metadata of each README.md file. However, it seems that our CI raises an error when the `extended` field is included: ``` dataset_name = 'arcd' @pytest.mark.parametrize("dataset_name", get_changed_datasets(repo_path)) def test_changed_dataset_card(dataset_name): card_path = repo_path / "datasets" / dataset_name / "README.md" assert card_path.exists() error_messages = [] try: ReadMe.from_readme(card_path) except Exception as readme_error: error_messages.append(f"The following issues have been found in the dataset cards:\nREADME:\n{readme_error}") try: DatasetMetadata.from_readme(card_path) except Exception as metadata_error: error_messages.append( f"The following issues have been found in the dataset cards:\nYAML tags:\n{metadata_error}" ) if error_messages: > raise ValueError("\n".join(error_messages)) E ValueError: The following issues have been found in the dataset cards: E YAML tags: E __init__() got an unexpected keyword argument 'extended' tests/test_dataset_cards.py:70: ValueError ``` Consider either removing this tag from the tagger or including it as part of the validation step in the CI. cc @yjernite The tagger also doesn't insert the value for the `size_categories` field automatically, so this should be fixed too
https://github.com/huggingface/datasets/issues/2440
Remove `extended` field from dataset tagger
Thanks for reporting. Indeed the `extended` tag doesn't exist. Not sure why we had that in the tagger. The repo of the tagger is here if someone wants to give this a try: https://github.com/huggingface/datasets-tagging Otherwise I can probably fix it next week
## Describe the bug While working on #2435 I used the [dataset tagger](https://huggingface.co/datasets/tagging/) to generate the missing tags for the YAML metadata of each README.md file. However, it seems that our CI raises an error when the `extended` field is included: ``` dataset_name = 'arcd' @pytest.mark.parametrize("dataset_name", get_changed_datasets(repo_path)) def test_changed_dataset_card(dataset_name): card_path = repo_path / "datasets" / dataset_name / "README.md" assert card_path.exists() error_messages = [] try: ReadMe.from_readme(card_path) except Exception as readme_error: error_messages.append(f"The following issues have been found in the dataset cards:\nREADME:\n{readme_error}") try: DatasetMetadata.from_readme(card_path) except Exception as metadata_error: error_messages.append( f"The following issues have been found in the dataset cards:\nYAML tags:\n{metadata_error}" ) if error_messages: > raise ValueError("\n".join(error_messages)) E ValueError: The following issues have been found in the dataset cards: E YAML tags: E __init__() got an unexpected keyword argument 'extended' tests/test_dataset_cards.py:70: ValueError ``` Consider either removing this tag from the tagger or including it as part of the validation step in the CI. cc @yjernite
42
Remove `extended` field from dataset tagger ## Describe the bug While working on #2435 I used the [dataset tagger](https://huggingface.co/datasets/tagging/) to generate the missing tags for the YAML metadata of each README.md file. However, it seems that our CI raises an error when the `extended` field is included: ``` dataset_name = 'arcd' @pytest.mark.parametrize("dataset_name", get_changed_datasets(repo_path)) def test_changed_dataset_card(dataset_name): card_path = repo_path / "datasets" / dataset_name / "README.md" assert card_path.exists() error_messages = [] try: ReadMe.from_readme(card_path) except Exception as readme_error: error_messages.append(f"The following issues have been found in the dataset cards:\nREADME:\n{readme_error}") try: DatasetMetadata.from_readme(card_path) except Exception as metadata_error: error_messages.append( f"The following issues have been found in the dataset cards:\nYAML tags:\n{metadata_error}" ) if error_messages: > raise ValueError("\n".join(error_messages)) E ValueError: The following issues have been found in the dataset cards: E YAML tags: E __init__() got an unexpected keyword argument 'extended' tests/test_dataset_cards.py:70: ValueError ``` Consider either removing this tag from the tagger or including it as part of the validation step in the CI. cc @yjernite Thanks for reporting. Indeed the `extended` tag doesn't exist. Not sure why we had that in the tagger. The repo of the tagger is here if someone wants to give this a try: https://github.com/huggingface/datasets-tagging Otherwise I can probably fix it next week
https://github.com/huggingface/datasets/issues/2434
Extend QuestionAnsweringExtractive template to handle nested columns
this is also the case for the following datasets and configurations: * `mlqa` with config `mlqa-translate-train.ar`
Currently the `QuestionAnsweringExtractive` task template and `preprare_for_task` only support "flat" features. We should extend the functionality to cover QA datasets like: * `iapp_wiki_qa_squad` * `parsinlu_reading_comprehension` where the nested features differ with those from `squad` and trigger an `ArrowNotImplementedError`: ``` --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) <ipython-input-12-50e5b8f69c20> in <module> ----> 1 ds.prepare_for_task("question-answering-extractive")[0] ~/git/datasets/src/datasets/arrow_dataset.py in prepare_for_task(self, task) 1436 # We found a template so now flush `DatasetInfo` to skip the template update in `DatasetInfo.__post_init__` 1437 dataset.info.task_templates = None -> 1438 dataset = dataset.cast(features=template.features) 1439 return dataset 1440 ~/git/datasets/src/datasets/arrow_dataset.py in cast(self, features, batch_size, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, num_proc) 977 format = self.format 978 dataset = self.with_format("arrow") --> 979 dataset = dataset.map( 980 lambda t: t.cast(schema), 981 batched=True, ~/git/datasets/src/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1600 1601 if num_proc is None or num_proc == 1: -> 1602 return self._map_single( 1603 function=function, 1604 with_indices=with_indices, ~/git/datasets/src/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 176 } 177 # apply actual function --> 178 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 179 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 180 # re-apply format to the output ~/git/datasets/src/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/git/datasets/src/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1940 ) # Something simpler? 1941 try: -> 1942 batch = apply_function_on_filtered_inputs( 1943 batch, 1944 indices, ~/git/datasets/src/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1836 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1837 processed_inputs = ( -> 1838 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1839 ) 1840 if update_data is None: ~/git/datasets/src/datasets/arrow_dataset.py in <lambda>(t) 978 dataset = self.with_format("arrow") 979 dataset = dataset.map( --> 980 lambda t: t.cast(schema), 981 batched=True, 982 batch_size=batch_size, ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/table.pxi in pyarrow.lib.Table.cast() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/table.pxi in pyarrow.lib.ChunkedArray.cast() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/compute.py in cast(arr, target_type, safe) 241 else: 242 options = CastOptions.unsafe(target_type) --> 243 return call_function("cast", [arr], options) 244 245 ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/_compute.pyx in pyarrow._compute.call_function() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/_compute.pyx in pyarrow._compute.Function.call() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from struct<answer_end: list<item: int32>, answer_start: list<item: int32>, text: list<item: string>> to struct using function cast_struct ```
16
Extend QuestionAnsweringExtractive template to handle nested columns Currently the `QuestionAnsweringExtractive` task template and `preprare_for_task` only support "flat" features. We should extend the functionality to cover QA datasets like: * `iapp_wiki_qa_squad` * `parsinlu_reading_comprehension` where the nested features differ with those from `squad` and trigger an `ArrowNotImplementedError`: ``` --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) <ipython-input-12-50e5b8f69c20> in <module> ----> 1 ds.prepare_for_task("question-answering-extractive")[0] ~/git/datasets/src/datasets/arrow_dataset.py in prepare_for_task(self, task) 1436 # We found a template so now flush `DatasetInfo` to skip the template update in `DatasetInfo.__post_init__` 1437 dataset.info.task_templates = None -> 1438 dataset = dataset.cast(features=template.features) 1439 return dataset 1440 ~/git/datasets/src/datasets/arrow_dataset.py in cast(self, features, batch_size, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, num_proc) 977 format = self.format 978 dataset = self.with_format("arrow") --> 979 dataset = dataset.map( 980 lambda t: t.cast(schema), 981 batched=True, ~/git/datasets/src/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1600 1601 if num_proc is None or num_proc == 1: -> 1602 return self._map_single( 1603 function=function, 1604 with_indices=with_indices, ~/git/datasets/src/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 176 } 177 # apply actual function --> 178 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 179 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 180 # re-apply format to the output ~/git/datasets/src/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/git/datasets/src/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1940 ) # Something simpler? 1941 try: -> 1942 batch = apply_function_on_filtered_inputs( 1943 batch, 1944 indices, ~/git/datasets/src/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1836 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1837 processed_inputs = ( -> 1838 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1839 ) 1840 if update_data is None: ~/git/datasets/src/datasets/arrow_dataset.py in <lambda>(t) 978 dataset = self.with_format("arrow") 979 dataset = dataset.map( --> 980 lambda t: t.cast(schema), 981 batched=True, 982 batch_size=batch_size, ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/table.pxi in pyarrow.lib.Table.cast() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/table.pxi in pyarrow.lib.ChunkedArray.cast() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/compute.py in cast(arr, target_type, safe) 241 else: 242 options = CastOptions.unsafe(target_type) --> 243 return call_function("cast", [arr], options) 244 245 ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/_compute.pyx in pyarrow._compute.call_function() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/_compute.pyx in pyarrow._compute.Function.call() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from struct<answer_end: list<item: int32>, answer_start: list<item: int32>, text: list<item: string>> to struct using function cast_struct ``` this is also the case for the following datasets and configurations: * `mlqa` with config `mlqa-translate-train.ar`
https://github.com/huggingface/datasets/issues/2434
Extend QuestionAnsweringExtractive template to handle nested columns
The current task API is somewhat deprecated (we plan to align it with `train eval index` at some point), so I think we can close this issue.
Currently the `QuestionAnsweringExtractive` task template and `preprare_for_task` only support "flat" features. We should extend the functionality to cover QA datasets like: * `iapp_wiki_qa_squad` * `parsinlu_reading_comprehension` where the nested features differ with those from `squad` and trigger an `ArrowNotImplementedError`: ``` --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) <ipython-input-12-50e5b8f69c20> in <module> ----> 1 ds.prepare_for_task("question-answering-extractive")[0] ~/git/datasets/src/datasets/arrow_dataset.py in prepare_for_task(self, task) 1436 # We found a template so now flush `DatasetInfo` to skip the template update in `DatasetInfo.__post_init__` 1437 dataset.info.task_templates = None -> 1438 dataset = dataset.cast(features=template.features) 1439 return dataset 1440 ~/git/datasets/src/datasets/arrow_dataset.py in cast(self, features, batch_size, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, num_proc) 977 format = self.format 978 dataset = self.with_format("arrow") --> 979 dataset = dataset.map( 980 lambda t: t.cast(schema), 981 batched=True, ~/git/datasets/src/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1600 1601 if num_proc is None or num_proc == 1: -> 1602 return self._map_single( 1603 function=function, 1604 with_indices=with_indices, ~/git/datasets/src/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 176 } 177 # apply actual function --> 178 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 179 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 180 # re-apply format to the output ~/git/datasets/src/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/git/datasets/src/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1940 ) # Something simpler? 1941 try: -> 1942 batch = apply_function_on_filtered_inputs( 1943 batch, 1944 indices, ~/git/datasets/src/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1836 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1837 processed_inputs = ( -> 1838 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1839 ) 1840 if update_data is None: ~/git/datasets/src/datasets/arrow_dataset.py in <lambda>(t) 978 dataset = self.with_format("arrow") 979 dataset = dataset.map( --> 980 lambda t: t.cast(schema), 981 batched=True, 982 batch_size=batch_size, ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/table.pxi in pyarrow.lib.Table.cast() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/table.pxi in pyarrow.lib.ChunkedArray.cast() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/compute.py in cast(arr, target_type, safe) 241 else: 242 options = CastOptions.unsafe(target_type) --> 243 return call_function("cast", [arr], options) 244 245 ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/_compute.pyx in pyarrow._compute.call_function() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/_compute.pyx in pyarrow._compute.Function.call() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from struct<answer_end: list<item: int32>, answer_start: list<item: int32>, text: list<item: string>> to struct using function cast_struct ```
27
Extend QuestionAnsweringExtractive template to handle nested columns Currently the `QuestionAnsweringExtractive` task template and `preprare_for_task` only support "flat" features. We should extend the functionality to cover QA datasets like: * `iapp_wiki_qa_squad` * `parsinlu_reading_comprehension` where the nested features differ with those from `squad` and trigger an `ArrowNotImplementedError`: ``` --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) <ipython-input-12-50e5b8f69c20> in <module> ----> 1 ds.prepare_for_task("question-answering-extractive")[0] ~/git/datasets/src/datasets/arrow_dataset.py in prepare_for_task(self, task) 1436 # We found a template so now flush `DatasetInfo` to skip the template update in `DatasetInfo.__post_init__` 1437 dataset.info.task_templates = None -> 1438 dataset = dataset.cast(features=template.features) 1439 return dataset 1440 ~/git/datasets/src/datasets/arrow_dataset.py in cast(self, features, batch_size, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, num_proc) 977 format = self.format 978 dataset = self.with_format("arrow") --> 979 dataset = dataset.map( 980 lambda t: t.cast(schema), 981 batched=True, ~/git/datasets/src/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1600 1601 if num_proc is None or num_proc == 1: -> 1602 return self._map_single( 1603 function=function, 1604 with_indices=with_indices, ~/git/datasets/src/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 176 } 177 # apply actual function --> 178 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 179 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 180 # re-apply format to the output ~/git/datasets/src/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/git/datasets/src/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1940 ) # Something simpler? 1941 try: -> 1942 batch = apply_function_on_filtered_inputs( 1943 batch, 1944 indices, ~/git/datasets/src/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1836 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1837 processed_inputs = ( -> 1838 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1839 ) 1840 if update_data is None: ~/git/datasets/src/datasets/arrow_dataset.py in <lambda>(t) 978 dataset = self.with_format("arrow") 979 dataset = dataset.map( --> 980 lambda t: t.cast(schema), 981 batched=True, 982 batch_size=batch_size, ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/table.pxi in pyarrow.lib.Table.cast() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/table.pxi in pyarrow.lib.ChunkedArray.cast() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/compute.py in cast(arr, target_type, safe) 241 else: 242 options = CastOptions.unsafe(target_type) --> 243 return call_function("cast", [arr], options) 244 245 ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/_compute.pyx in pyarrow._compute.call_function() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/_compute.pyx in pyarrow._compute.Function.call() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from struct<answer_end: list<item: int32>, answer_start: list<item: int32>, text: list<item: string>> to struct using function cast_struct ``` The current task API is somewhat deprecated (we plan to align it with `train eval index` at some point), so I think we can close this issue.
https://github.com/huggingface/datasets/issues/2431
DuplicatedKeysError when trying to load adversarial_qa
Thanks for reporting ! #2433 fixed the issue, thanks @mariosasko :) We'll do a patch release soon of the library. In the meantime, you can use the fixed version of adversarial_qa by adding `script_version="master"` in `load_dataset`
## Describe the bug A clear and concise description of what the bug is. ## Steps to reproduce the bug ```python dataset = load_dataset('adversarial_qa', 'adversarialQA') ``` ## Expected results The dataset should be loaded into memory ## Actual results >DuplicatedKeysError: FAILURE TO GENERATE DATASET ! >Found duplicate Key: 4d3cb5677211ee32895ca9c66dad04d7152254d4 >Keys should be unique and deterministic in nature > > >During handling of the above exception, another exception occurred: > >DuplicatedKeysError Traceback (most recent call last) > >/usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in check_duplicate_keys(self) > 347 for hash, key in self.hkey_record: > 348 if hash in tmp_record: >--> 349 raise DuplicatedKeysError(key) > 350 else: > 351 tmp_record.add(hash) > >DuplicatedKeysError: FAILURE TO GENERATE DATASET ! >Found duplicate Key: 4d3cb5677211ee32895ca9c66dad04d7152254d4 >Keys should be unique and deterministic in nature ## Environment info - `datasets` version: 1.7.0 - Platform: Linux-5.4.109+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyArrow version: 3.0.0
36
DuplicatedKeysError when trying to load adversarial_qa ## Describe the bug A clear and concise description of what the bug is. ## Steps to reproduce the bug ```python dataset = load_dataset('adversarial_qa', 'adversarialQA') ``` ## Expected results The dataset should be loaded into memory ## Actual results >DuplicatedKeysError: FAILURE TO GENERATE DATASET ! >Found duplicate Key: 4d3cb5677211ee32895ca9c66dad04d7152254d4 >Keys should be unique and deterministic in nature > > >During handling of the above exception, another exception occurred: > >DuplicatedKeysError Traceback (most recent call last) > >/usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in check_duplicate_keys(self) > 347 for hash, key in self.hkey_record: > 348 if hash in tmp_record: >--> 349 raise DuplicatedKeysError(key) > 350 else: > 351 tmp_record.add(hash) > >DuplicatedKeysError: FAILURE TO GENERATE DATASET ! >Found duplicate Key: 4d3cb5677211ee32895ca9c66dad04d7152254d4 >Keys should be unique and deterministic in nature ## Environment info - `datasets` version: 1.7.0 - Platform: Linux-5.4.109+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyArrow version: 3.0.0 Thanks for reporting ! #2433 fixed the issue, thanks @mariosasko :) We'll do a patch release soon of the library. In the meantime, you can use the fixed version of adversarial_qa by adding `script_version="master"` in `load_dataset`
https://github.com/huggingface/datasets/issues/2426
Saving Graph/Structured Data in Datasets
It should probably work out of the box to save structured data. If you want to show an example we can help you.
Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help.
23
Saving Graph/Structured Data in Datasets Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help. It should probably work out of the box to save structured data. If you want to show an example we can help you.
https://github.com/huggingface/datasets/issues/2426
Saving Graph/Structured Data in Datasets
An example of a toy dataset is like: ```json [ { "name": "mike", "friends": [ "tom", "lily" ], "articles": [ { "title": "aaaaa", "reader": [ "tom", "lucy" ] } ] }, { "name": "tom", "friends": [ "mike", "bbb" ], "articles": [ { "title": "xxxxx", "reader": [ "tom", "qqqq" ] } ] } ] ``` We can use the friendship relation to build a directional graph, and a user node can be represented using the articles written by himself. And the relationship between articles can be built when the article has read by the same user. This dataset can be used to model the heterogeneous relationship between users and articles, and this graph can be used to build recommendation systems to recommend articles to the user, or potential friends to the user.
Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help.
131
Saving Graph/Structured Data in Datasets Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help. An example of a toy dataset is like: ```json [ { "name": "mike", "friends": [ "tom", "lily" ], "articles": [ { "title": "aaaaa", "reader": [ "tom", "lucy" ] } ] }, { "name": "tom", "friends": [ "mike", "bbb" ], "articles": [ { "title": "xxxxx", "reader": [ "tom", "qqqq" ] } ] } ] ``` We can use the friendship relation to build a directional graph, and a user node can be represented using the articles written by himself. And the relationship between articles can be built when the article has read by the same user. This dataset can be used to model the heterogeneous relationship between users and articles, and this graph can be used to build recommendation systems to recommend articles to the user, or potential friends to the user.
https://github.com/huggingface/datasets/issues/2426
Saving Graph/Structured Data in Datasets
Hi, you can do the following to load this data into a `Dataset`: ```python from datasets import Dataset examples = [ { "name": "mike", "friends": [ "tom", "lily" ], "articles": [ { "title": "aaaaa", "reader": [ "tom", "lucy" ] } ] }, { "name": "tom", "friends": [ "mike", "bbb" ], "articles": [ { "title": "xxxxx", "reader": [ "tom", "qqqq" ] } ] } ] keys = examples[0].keys() values = [ex.values() for ex in examples] dataset = Dataset.from_dict({k: list(v) for k, v in zip(keys, zip(*values))}) ``` Let us know if this works for you.
Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help.
93
Saving Graph/Structured Data in Datasets Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help. Hi, you can do the following to load this data into a `Dataset`: ```python from datasets import Dataset examples = [ { "name": "mike", "friends": [ "tom", "lily" ], "articles": [ { "title": "aaaaa", "reader": [ "tom", "lucy" ] } ] }, { "name": "tom", "friends": [ "mike", "bbb" ], "articles": [ { "title": "xxxxx", "reader": [ "tom", "qqqq" ] } ] } ] keys = examples[0].keys() values = [ex.values() for ex in examples] dataset = Dataset.from_dict({k: list(v) for k, v in zip(keys, zip(*values))}) ``` Let us know if this works for you.
https://github.com/huggingface/datasets/issues/2426
Saving Graph/Structured Data in Datasets
Thank you so much, and that works! I also have a question that if the dataset is very large, that cannot be loaded into the memory. How to create the Dataset?
Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help.
31
Saving Graph/Structured Data in Datasets Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help. Thank you so much, and that works! I also have a question that if the dataset is very large, that cannot be loaded into the memory. How to create the Dataset?
https://github.com/huggingface/datasets/issues/2426
Saving Graph/Structured Data in Datasets
If your dataset doesn't fit in memory, store it in a local file and load it from there. Check out [this chapter](https://huggingface.co/docs/datasets/master/loading_datasets.html#from-local-files) in the docs for more info.
Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help.
28
Saving Graph/Structured Data in Datasets Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help. If your dataset doesn't fit in memory, store it in a local file and load it from there. Check out [this chapter](https://huggingface.co/docs/datasets/master/loading_datasets.html#from-local-files) in the docs for more info.
https://github.com/huggingface/datasets/issues/2424
load_from_disk and save_to_disk are not compatible with each other
Hi, `load_dataset` returns an instance of `DatasetDict` if `split` is not specified, so instead of `Dataset.load_from_disk`, use `DatasetDict.load_from_disk` to load the dataset from disk.
## Describe the bug load_from_disk and save_to_disk are not compatible. When I use save_to_disk to save a dataset to disk it works perfectly but given the same directory load_from_disk throws an error that it can't find state.json. looks like the load_from_disk only works on one split ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("art") dataset.save_to_disk("mydir") d = Dataset.load_from_disk("mydir") ``` ## Expected results It is expected that these two functions be the reverse of each other without more manipulation ## Actual results FileNotFoundError: [Errno 2] No such file or directory: 'mydir/art/state.json' ## Environment info - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: <fill in> - Using distributed or parallel set-up in script?: <fill in>
24
load_from_disk and save_to_disk are not compatible with each other ## Describe the bug load_from_disk and save_to_disk are not compatible. When I use save_to_disk to save a dataset to disk it works perfectly but given the same directory load_from_disk throws an error that it can't find state.json. looks like the load_from_disk only works on one split ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("art") dataset.save_to_disk("mydir") d = Dataset.load_from_disk("mydir") ``` ## Expected results It is expected that these two functions be the reverse of each other without more manipulation ## Actual results FileNotFoundError: [Errno 2] No such file or directory: 'mydir/art/state.json' ## Environment info - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: <fill in> - Using distributed or parallel set-up in script?: <fill in> Hi, `load_dataset` returns an instance of `DatasetDict` if `split` is not specified, so instead of `Dataset.load_from_disk`, use `DatasetDict.load_from_disk` to load the dataset from disk.
https://github.com/huggingface/datasets/issues/2424
load_from_disk and save_to_disk are not compatible with each other
Though I see a stream of issues open by people lost between datasets and datasets dicts so maybe there is here something that could be better in terms of UX. Could be better error handling or something else smarter to even avoid said errors but maybe we should think about this. Reopening to use this issue as a discussion place but feel free to open a new open if you prefer @lhoestq @albertvillanova
## Describe the bug load_from_disk and save_to_disk are not compatible. When I use save_to_disk to save a dataset to disk it works perfectly but given the same directory load_from_disk throws an error that it can't find state.json. looks like the load_from_disk only works on one split ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("art") dataset.save_to_disk("mydir") d = Dataset.load_from_disk("mydir") ``` ## Expected results It is expected that these two functions be the reverse of each other without more manipulation ## Actual results FileNotFoundError: [Errno 2] No such file or directory: 'mydir/art/state.json' ## Environment info - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: <fill in> - Using distributed or parallel set-up in script?: <fill in>
73
load_from_disk and save_to_disk are not compatible with each other ## Describe the bug load_from_disk and save_to_disk are not compatible. When I use save_to_disk to save a dataset to disk it works perfectly but given the same directory load_from_disk throws an error that it can't find state.json. looks like the load_from_disk only works on one split ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("art") dataset.save_to_disk("mydir") d = Dataset.load_from_disk("mydir") ``` ## Expected results It is expected that these two functions be the reverse of each other without more manipulation ## Actual results FileNotFoundError: [Errno 2] No such file or directory: 'mydir/art/state.json' ## Environment info - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: <fill in> - Using distributed or parallel set-up in script?: <fill in> Though I see a stream of issues open by people lost between datasets and datasets dicts so maybe there is here something that could be better in terms of UX. Could be better error handling or something else smarter to even avoid said errors but maybe we should think about this. Reopening to use this issue as a discussion place but feel free to open a new open if you prefer @lhoestq @albertvillanova
https://github.com/huggingface/datasets/issues/2424
load_from_disk and save_to_disk are not compatible with each other
We should probably improve the error message indeed. Also note that there exists a function `load_from_disk` that can load a Dataset or a DatasetDict. Under the hood it calls either `Dataset.load_from_disk` or `DatasetDict.load_from_disk`: ```python from datasets import load_from_disk dataset_dict = load_from_disk("path/to/dataset/dict") single_dataset = load_from_disk("path/to/single/dataset") ```
## Describe the bug load_from_disk and save_to_disk are not compatible. When I use save_to_disk to save a dataset to disk it works perfectly but given the same directory load_from_disk throws an error that it can't find state.json. looks like the load_from_disk only works on one split ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("art") dataset.save_to_disk("mydir") d = Dataset.load_from_disk("mydir") ``` ## Expected results It is expected that these two functions be the reverse of each other without more manipulation ## Actual results FileNotFoundError: [Errno 2] No such file or directory: 'mydir/art/state.json' ## Environment info - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: <fill in> - Using distributed or parallel set-up in script?: <fill in>
45
load_from_disk and save_to_disk are not compatible with each other ## Describe the bug load_from_disk and save_to_disk are not compatible. When I use save_to_disk to save a dataset to disk it works perfectly but given the same directory load_from_disk throws an error that it can't find state.json. looks like the load_from_disk only works on one split ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("art") dataset.save_to_disk("mydir") d = Dataset.load_from_disk("mydir") ``` ## Expected results It is expected that these two functions be the reverse of each other without more manipulation ## Actual results FileNotFoundError: [Errno 2] No such file or directory: 'mydir/art/state.json' ## Environment info - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: <fill in> - Using distributed or parallel set-up in script?: <fill in> We should probably improve the error message indeed. Also note that there exists a function `load_from_disk` that can load a Dataset or a DatasetDict. Under the hood it calls either `Dataset.load_from_disk` or `DatasetDict.load_from_disk`: ```python from datasets import load_from_disk dataset_dict = load_from_disk("path/to/dataset/dict") single_dataset = load_from_disk("path/to/single/dataset") ```
https://github.com/huggingface/datasets/issues/2415
Cached dataset not loaded
It actually seems to happen all the time in above configuration: * the function `filter_by_duration` correctly loads cached processed dataset * the function `prepare_dataset` is always reexecuted I end up solving the issue by saving to disk my dataset at the end but I'm still wondering if it's a bug or limitation here.
## Describe the bug I have a large dataset (common_voice, english) where I use several map and filter functions. Sometimes my cached datasets after specific functions are not loaded. I always use the same arguments, same functions, no seed… ## Steps to reproduce the bug ```python def filter_by_duration(batch): return ( batch["duration"] <= 10 and batch["duration"] >= 1 and len(batch["target_text"]) > 5 ) def prepare_dataset(batch): batch["input_values"] = processor( batch["speech"], sampling_rate=batch["sampling_rate"][0] ).input_values with processor.as_target_processor(): batch["labels"] = processor(batch["target_text"]).input_ids return batch train_dataset = train_dataset.filter( filter_by_duration, remove_columns=["duration"], num_proc=data_args.preprocessing_num_workers, ) # PROBLEM HERE -> below function is reexecuted and cache is not loaded train_dataset = train_dataset.map( prepare_dataset, remove_columns=train_dataset.column_names, batch_size=training_args.per_device_train_batch_size, batched=True, num_proc=data_args.preprocessing_num_workers, ) # Later in script set_caching_enabled(False) # apply map on trained model to eval/test sets ``` ## Expected results The cached dataset should always be reloaded. ## Actual results The function is reexecuted. I have access to cached files `cache-xxxxx.arrow`. Is there a way I can somehow load manually 2 versions and see how the hash was created for debug purposes (to know if it's an issue with dataset or function)? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No
53
Cached dataset not loaded ## Describe the bug I have a large dataset (common_voice, english) where I use several map and filter functions. Sometimes my cached datasets after specific functions are not loaded. I always use the same arguments, same functions, no seed… ## Steps to reproduce the bug ```python def filter_by_duration(batch): return ( batch["duration"] <= 10 and batch["duration"] >= 1 and len(batch["target_text"]) > 5 ) def prepare_dataset(batch): batch["input_values"] = processor( batch["speech"], sampling_rate=batch["sampling_rate"][0] ).input_values with processor.as_target_processor(): batch["labels"] = processor(batch["target_text"]).input_ids return batch train_dataset = train_dataset.filter( filter_by_duration, remove_columns=["duration"], num_proc=data_args.preprocessing_num_workers, ) # PROBLEM HERE -> below function is reexecuted and cache is not loaded train_dataset = train_dataset.map( prepare_dataset, remove_columns=train_dataset.column_names, batch_size=training_args.per_device_train_batch_size, batched=True, num_proc=data_args.preprocessing_num_workers, ) # Later in script set_caching_enabled(False) # apply map on trained model to eval/test sets ``` ## Expected results The cached dataset should always be reloaded. ## Actual results The function is reexecuted. I have access to cached files `cache-xxxxx.arrow`. Is there a way I can somehow load manually 2 versions and see how the hash was created for debug purposes (to know if it's an issue with dataset or function)? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No It actually seems to happen all the time in above configuration: * the function `filter_by_duration` correctly loads cached processed dataset * the function `prepare_dataset` is always reexecuted I end up solving the issue by saving to disk my dataset at the end but I'm still wondering if it's a bug or limitation here.
https://github.com/huggingface/datasets/issues/2415
Cached dataset not loaded
Hi ! The hash used for caching `map` results is the fingerprint of the resulting dataset. It is computed using three things: - the old fingerprint of the dataset - the hash of the function - the hash of the other parameters passed to `map` You can compute the hash of your function (or any python object) with ```python from datasets.fingerprint import Hasher my_func = lambda x: x + 1 print(Hasher.hash(my_func)) ``` If `prepare_dataset` is always executed, maybe this is because your `processor` has a different hash each time you want to execute it.
## Describe the bug I have a large dataset (common_voice, english) where I use several map and filter functions. Sometimes my cached datasets after specific functions are not loaded. I always use the same arguments, same functions, no seed… ## Steps to reproduce the bug ```python def filter_by_duration(batch): return ( batch["duration"] <= 10 and batch["duration"] >= 1 and len(batch["target_text"]) > 5 ) def prepare_dataset(batch): batch["input_values"] = processor( batch["speech"], sampling_rate=batch["sampling_rate"][0] ).input_values with processor.as_target_processor(): batch["labels"] = processor(batch["target_text"]).input_ids return batch train_dataset = train_dataset.filter( filter_by_duration, remove_columns=["duration"], num_proc=data_args.preprocessing_num_workers, ) # PROBLEM HERE -> below function is reexecuted and cache is not loaded train_dataset = train_dataset.map( prepare_dataset, remove_columns=train_dataset.column_names, batch_size=training_args.per_device_train_batch_size, batched=True, num_proc=data_args.preprocessing_num_workers, ) # Later in script set_caching_enabled(False) # apply map on trained model to eval/test sets ``` ## Expected results The cached dataset should always be reloaded. ## Actual results The function is reexecuted. I have access to cached files `cache-xxxxx.arrow`. Is there a way I can somehow load manually 2 versions and see how the hash was created for debug purposes (to know if it's an issue with dataset or function)? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No
94
Cached dataset not loaded ## Describe the bug I have a large dataset (common_voice, english) where I use several map and filter functions. Sometimes my cached datasets after specific functions are not loaded. I always use the same arguments, same functions, no seed… ## Steps to reproduce the bug ```python def filter_by_duration(batch): return ( batch["duration"] <= 10 and batch["duration"] >= 1 and len(batch["target_text"]) > 5 ) def prepare_dataset(batch): batch["input_values"] = processor( batch["speech"], sampling_rate=batch["sampling_rate"][0] ).input_values with processor.as_target_processor(): batch["labels"] = processor(batch["target_text"]).input_ids return batch train_dataset = train_dataset.filter( filter_by_duration, remove_columns=["duration"], num_proc=data_args.preprocessing_num_workers, ) # PROBLEM HERE -> below function is reexecuted and cache is not loaded train_dataset = train_dataset.map( prepare_dataset, remove_columns=train_dataset.column_names, batch_size=training_args.per_device_train_batch_size, batched=True, num_proc=data_args.preprocessing_num_workers, ) # Later in script set_caching_enabled(False) # apply map on trained model to eval/test sets ``` ## Expected results The cached dataset should always be reloaded. ## Actual results The function is reexecuted. I have access to cached files `cache-xxxxx.arrow`. Is there a way I can somehow load manually 2 versions and see how the hash was created for debug purposes (to know if it's an issue with dataset or function)? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No Hi ! The hash used for caching `map` results is the fingerprint of the resulting dataset. It is computed using three things: - the old fingerprint of the dataset - the hash of the function - the hash of the other parameters passed to `map` You can compute the hash of your function (or any python object) with ```python from datasets.fingerprint import Hasher my_func = lambda x: x + 1 print(Hasher.hash(my_func)) ``` If `prepare_dataset` is always executed, maybe this is because your `processor` has a different hash each time you want to execute it.
https://github.com/huggingface/datasets/issues/2415
Cached dataset not loaded
> If `prepare_dataset` is always executed, maybe this is because your `processor` has a different hash each time you want to execute it. Yes I think that was the issue. For the hash of the function: * does it consider just the name or the actual code of the function * does it consider variables that are not passed explicitly as parameters to the functions (such as the processor here)
## Describe the bug I have a large dataset (common_voice, english) where I use several map and filter functions. Sometimes my cached datasets after specific functions are not loaded. I always use the same arguments, same functions, no seed… ## Steps to reproduce the bug ```python def filter_by_duration(batch): return ( batch["duration"] <= 10 and batch["duration"] >= 1 and len(batch["target_text"]) > 5 ) def prepare_dataset(batch): batch["input_values"] = processor( batch["speech"], sampling_rate=batch["sampling_rate"][0] ).input_values with processor.as_target_processor(): batch["labels"] = processor(batch["target_text"]).input_ids return batch train_dataset = train_dataset.filter( filter_by_duration, remove_columns=["duration"], num_proc=data_args.preprocessing_num_workers, ) # PROBLEM HERE -> below function is reexecuted and cache is not loaded train_dataset = train_dataset.map( prepare_dataset, remove_columns=train_dataset.column_names, batch_size=training_args.per_device_train_batch_size, batched=True, num_proc=data_args.preprocessing_num_workers, ) # Later in script set_caching_enabled(False) # apply map on trained model to eval/test sets ``` ## Expected results The cached dataset should always be reloaded. ## Actual results The function is reexecuted. I have access to cached files `cache-xxxxx.arrow`. Is there a way I can somehow load manually 2 versions and see how the hash was created for debug purposes (to know if it's an issue with dataset or function)? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No
70
Cached dataset not loaded ## Describe the bug I have a large dataset (common_voice, english) where I use several map and filter functions. Sometimes my cached datasets after specific functions are not loaded. I always use the same arguments, same functions, no seed… ## Steps to reproduce the bug ```python def filter_by_duration(batch): return ( batch["duration"] <= 10 and batch["duration"] >= 1 and len(batch["target_text"]) > 5 ) def prepare_dataset(batch): batch["input_values"] = processor( batch["speech"], sampling_rate=batch["sampling_rate"][0] ).input_values with processor.as_target_processor(): batch["labels"] = processor(batch["target_text"]).input_ids return batch train_dataset = train_dataset.filter( filter_by_duration, remove_columns=["duration"], num_proc=data_args.preprocessing_num_workers, ) # PROBLEM HERE -> below function is reexecuted and cache is not loaded train_dataset = train_dataset.map( prepare_dataset, remove_columns=train_dataset.column_names, batch_size=training_args.per_device_train_batch_size, batched=True, num_proc=data_args.preprocessing_num_workers, ) # Later in script set_caching_enabled(False) # apply map on trained model to eval/test sets ``` ## Expected results The cached dataset should always be reloaded. ## Actual results The function is reexecuted. I have access to cached files `cache-xxxxx.arrow`. Is there a way I can somehow load manually 2 versions and see how the hash was created for debug purposes (to know if it's an issue with dataset or function)? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No > If `prepare_dataset` is always executed, maybe this is because your `processor` has a different hash each time you want to execute it. Yes I think that was the issue. For the hash of the function: * does it consider just the name or the actual code of the function * does it consider variables that are not passed explicitly as parameters to the functions (such as the processor here)
https://github.com/huggingface/datasets/issues/2415
Cached dataset not loaded
> does it consider just the name or the actual code of the function It looks at the name and the actual code and all variables such as recursively. It uses `dill` to do so, which is based on `pickle`. Basically the hash is computed using the pickle bytes of your function (computed using `dill` to support most python objects). > does it consider variables that are not passed explicitly as parameters to the functions (such as the processor here) Yes it does thanks to recursive pickling.
## Describe the bug I have a large dataset (common_voice, english) where I use several map and filter functions. Sometimes my cached datasets after specific functions are not loaded. I always use the same arguments, same functions, no seed… ## Steps to reproduce the bug ```python def filter_by_duration(batch): return ( batch["duration"] <= 10 and batch["duration"] >= 1 and len(batch["target_text"]) > 5 ) def prepare_dataset(batch): batch["input_values"] = processor( batch["speech"], sampling_rate=batch["sampling_rate"][0] ).input_values with processor.as_target_processor(): batch["labels"] = processor(batch["target_text"]).input_ids return batch train_dataset = train_dataset.filter( filter_by_duration, remove_columns=["duration"], num_proc=data_args.preprocessing_num_workers, ) # PROBLEM HERE -> below function is reexecuted and cache is not loaded train_dataset = train_dataset.map( prepare_dataset, remove_columns=train_dataset.column_names, batch_size=training_args.per_device_train_batch_size, batched=True, num_proc=data_args.preprocessing_num_workers, ) # Later in script set_caching_enabled(False) # apply map on trained model to eval/test sets ``` ## Expected results The cached dataset should always be reloaded. ## Actual results The function is reexecuted. I have access to cached files `cache-xxxxx.arrow`. Is there a way I can somehow load manually 2 versions and see how the hash was created for debug purposes (to know if it's an issue with dataset or function)? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No
87
Cached dataset not loaded ## Describe the bug I have a large dataset (common_voice, english) where I use several map and filter functions. Sometimes my cached datasets after specific functions are not loaded. I always use the same arguments, same functions, no seed… ## Steps to reproduce the bug ```python def filter_by_duration(batch): return ( batch["duration"] <= 10 and batch["duration"] >= 1 and len(batch["target_text"]) > 5 ) def prepare_dataset(batch): batch["input_values"] = processor( batch["speech"], sampling_rate=batch["sampling_rate"][0] ).input_values with processor.as_target_processor(): batch["labels"] = processor(batch["target_text"]).input_ids return batch train_dataset = train_dataset.filter( filter_by_duration, remove_columns=["duration"], num_proc=data_args.preprocessing_num_workers, ) # PROBLEM HERE -> below function is reexecuted and cache is not loaded train_dataset = train_dataset.map( prepare_dataset, remove_columns=train_dataset.column_names, batch_size=training_args.per_device_train_batch_size, batched=True, num_proc=data_args.preprocessing_num_workers, ) # Later in script set_caching_enabled(False) # apply map on trained model to eval/test sets ``` ## Expected results The cached dataset should always be reloaded. ## Actual results The function is reexecuted. I have access to cached files `cache-xxxxx.arrow`. Is there a way I can somehow load manually 2 versions and see how the hash was created for debug purposes (to know if it's an issue with dataset or function)? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No > does it consider just the name or the actual code of the function It looks at the name and the actual code and all variables such as recursively. It uses `dill` to do so, which is based on `pickle`. Basically the hash is computed using the pickle bytes of your function (computed using `dill` to support most python objects). > does it consider variables that are not passed explicitly as parameters to the functions (such as the processor here) Yes it does thanks to recursive pickling.
https://github.com/huggingface/datasets/issues/2413
AttributeError: 'DatasetInfo' object has no attribute 'task_templates'
Hi ! Can you try using a more up-to-date version ? We added the task_templates in `datasets` 1.7.0. Ideally when you're working on new datasets, you should install and use the local version of your fork of `datasets`. Here I think you tried to run the 1.7.0 tests with the 1.6.2 code
## Describe the bug Hello, I'm trying to add dataset and contribute, but test keep fail with below cli. ` RUN_SLOW=1 pytest tests/test_dataset_common.py::LocalDatasetTest::test_load_dataset_all_configs_<my_dataset>` ## Steps to reproduce the bug It seems like a bug when I see an error with the existing dataset, not the dataset I'm trying to add. ` RUN_SLOW=1 pytest tests/test_dataset_common.py::LocalDatasetTest::test_load_dataset_all_configs_<any_dataset>` ## Expected results All test passed ## Actual results ``` # check that dataset is not empty self.parent.assertListEqual(sorted(dataset_builder.info.splits.keys()), sorted(dataset)) for split in dataset_builder.info.splits.keys(): # check that loaded datset is not empty self.parent.assertTrue(len(dataset[split]) > 0) # check that we can cast features for each task template > task_templates = dataset_builder.info.task_templates E AttributeError: 'DatasetInfo' object has no attribute 'task_templates' tests/test_dataset_common.py:175: AttributeError ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Darwin-20.4.0-x86_64-i386-64bit - Python version: 3.7.7 - PyTorch version (GPU?): 1.7.0 (False) - Tensorflow version (GPU?): 2.3.0 (False) - Using GPU in script?: No - Using distributed or parallel set-up in script?: No
52
AttributeError: 'DatasetInfo' object has no attribute 'task_templates' ## Describe the bug Hello, I'm trying to add dataset and contribute, but test keep fail with below cli. ` RUN_SLOW=1 pytest tests/test_dataset_common.py::LocalDatasetTest::test_load_dataset_all_configs_<my_dataset>` ## Steps to reproduce the bug It seems like a bug when I see an error with the existing dataset, not the dataset I'm trying to add. ` RUN_SLOW=1 pytest tests/test_dataset_common.py::LocalDatasetTest::test_load_dataset_all_configs_<any_dataset>` ## Expected results All test passed ## Actual results ``` # check that dataset is not empty self.parent.assertListEqual(sorted(dataset_builder.info.splits.keys()), sorted(dataset)) for split in dataset_builder.info.splits.keys(): # check that loaded datset is not empty self.parent.assertTrue(len(dataset[split]) > 0) # check that we can cast features for each task template > task_templates = dataset_builder.info.task_templates E AttributeError: 'DatasetInfo' object has no attribute 'task_templates' tests/test_dataset_common.py:175: AttributeError ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Darwin-20.4.0-x86_64-i386-64bit - Python version: 3.7.7 - PyTorch version (GPU?): 1.7.0 (False) - Tensorflow version (GPU?): 2.3.0 (False) - Using GPU in script?: No - Using distributed or parallel set-up in script?: No Hi ! Can you try using a more up-to-date version ? We added the task_templates in `datasets` 1.7.0. Ideally when you're working on new datasets, you should install and use the local version of your fork of `datasets`. Here I think you tried to run the 1.7.0 tests with the 1.6.2 code
https://github.com/huggingface/datasets/issues/2407
.map() function got an unexpected keyword argument 'cache_file_name'
Hi @cindyxinyiwang, Did you try adding `.arrow` after `cache_file_name` argument? Here I think they're expecting something like that only for a cache file: https://github.com/huggingface/datasets/blob/e08362256fb157c0b3038437fc0d7a0bbb50de5c/src/datasets/arrow_dataset.py#L1556-L1558
## Describe the bug I'm trying to save the result of datasets.map() to a specific file, so that I can easily share it among multiple computers without reprocessing the dataset. However, when I try to pass an argument 'cache_file_name' to the .map() function, it throws an error that ".map() function got an unexpected keyword argument 'cache_file_name'". I believe I'm using the latest dataset 1.6.2. Also seems like the document and the actual code indicates there is an argument 'cache_file_name' for the .map() function. Here is the code I use ## Steps to reproduce the bug ```datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, cache_file_name="my_tokenized_file" ) ``` ## Actual results tokenized_datasets = datasets.map( TypeError: map() got an unexpected keyword argument 'cache_file_name' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.6.2 - Platform:Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-glibc2.10 - Python version:3.8.5 - PyArrow version:3.0.0
24
.map() function got an unexpected keyword argument 'cache_file_name' ## Describe the bug I'm trying to save the result of datasets.map() to a specific file, so that I can easily share it among multiple computers without reprocessing the dataset. However, when I try to pass an argument 'cache_file_name' to the .map() function, it throws an error that ".map() function got an unexpected keyword argument 'cache_file_name'". I believe I'm using the latest dataset 1.6.2. Also seems like the document and the actual code indicates there is an argument 'cache_file_name' for the .map() function. Here is the code I use ## Steps to reproduce the bug ```datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, cache_file_name="my_tokenized_file" ) ``` ## Actual results tokenized_datasets = datasets.map( TypeError: map() got an unexpected keyword argument 'cache_file_name' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.6.2 - Platform:Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-glibc2.10 - Python version:3.8.5 - PyArrow version:3.0.0 Hi @cindyxinyiwang, Did you try adding `.arrow` after `cache_file_name` argument? Here I think they're expecting something like that only for a cache file: https://github.com/huggingface/datasets/blob/e08362256fb157c0b3038437fc0d7a0bbb50de5c/src/datasets/arrow_dataset.py#L1556-L1558
https://github.com/huggingface/datasets/issues/2407
.map() function got an unexpected keyword argument 'cache_file_name'
Hi ! `cache_file_name` is an argument of the `Dataset.map` method. Can you check that your `dataset` is indeed a `Dataset` object ? If you loaded several splits, then it would actually be a `DatasetDict` (one dataset per split, in a dictionary). In this case, since there are several datasets in the dict, the `DatasetDict.map` method requires a `cache_file_names` argument (with an 's'), so that you can provide one file name per split.
## Describe the bug I'm trying to save the result of datasets.map() to a specific file, so that I can easily share it among multiple computers without reprocessing the dataset. However, when I try to pass an argument 'cache_file_name' to the .map() function, it throws an error that ".map() function got an unexpected keyword argument 'cache_file_name'". I believe I'm using the latest dataset 1.6.2. Also seems like the document and the actual code indicates there is an argument 'cache_file_name' for the .map() function. Here is the code I use ## Steps to reproduce the bug ```datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, cache_file_name="my_tokenized_file" ) ``` ## Actual results tokenized_datasets = datasets.map( TypeError: map() got an unexpected keyword argument 'cache_file_name' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.6.2 - Platform:Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-glibc2.10 - Python version:3.8.5 - PyArrow version:3.0.0
72
.map() function got an unexpected keyword argument 'cache_file_name' ## Describe the bug I'm trying to save the result of datasets.map() to a specific file, so that I can easily share it among multiple computers without reprocessing the dataset. However, when I try to pass an argument 'cache_file_name' to the .map() function, it throws an error that ".map() function got an unexpected keyword argument 'cache_file_name'". I believe I'm using the latest dataset 1.6.2. Also seems like the document and the actual code indicates there is an argument 'cache_file_name' for the .map() function. Here is the code I use ## Steps to reproduce the bug ```datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, cache_file_name="my_tokenized_file" ) ``` ## Actual results tokenized_datasets = datasets.map( TypeError: map() got an unexpected keyword argument 'cache_file_name' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.6.2 - Platform:Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-glibc2.10 - Python version:3.8.5 - PyArrow version:3.0.0 Hi ! `cache_file_name` is an argument of the `Dataset.map` method. Can you check that your `dataset` is indeed a `Dataset` object ? If you loaded several splits, then it would actually be a `DatasetDict` (one dataset per split, in a dictionary). In this case, since there are several datasets in the dict, the `DatasetDict.map` method requires a `cache_file_names` argument (with an 's'), so that you can provide one file name per split.
https://github.com/huggingface/datasets/issues/2407
.map() function got an unexpected keyword argument 'cache_file_name'
I think you are right. I used cache_file_names={data1: name1, data2: name2} and it works. Thank you!
## Describe the bug I'm trying to save the result of datasets.map() to a specific file, so that I can easily share it among multiple computers without reprocessing the dataset. However, when I try to pass an argument 'cache_file_name' to the .map() function, it throws an error that ".map() function got an unexpected keyword argument 'cache_file_name'". I believe I'm using the latest dataset 1.6.2. Also seems like the document and the actual code indicates there is an argument 'cache_file_name' for the .map() function. Here is the code I use ## Steps to reproduce the bug ```datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, cache_file_name="my_tokenized_file" ) ``` ## Actual results tokenized_datasets = datasets.map( TypeError: map() got an unexpected keyword argument 'cache_file_name' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.6.2 - Platform:Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-glibc2.10 - Python version:3.8.5 - PyArrow version:3.0.0
16
.map() function got an unexpected keyword argument 'cache_file_name' ## Describe the bug I'm trying to save the result of datasets.map() to a specific file, so that I can easily share it among multiple computers without reprocessing the dataset. However, when I try to pass an argument 'cache_file_name' to the .map() function, it throws an error that ".map() function got an unexpected keyword argument 'cache_file_name'". I believe I'm using the latest dataset 1.6.2. Also seems like the document and the actual code indicates there is an argument 'cache_file_name' for the .map() function. Here is the code I use ## Steps to reproduce the bug ```datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, cache_file_name="my_tokenized_file" ) ``` ## Actual results tokenized_datasets = datasets.map( TypeError: map() got an unexpected keyword argument 'cache_file_name' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.6.2 - Platform:Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-glibc2.10 - Python version:3.8.5 - PyArrow version:3.0.0 I think you are right. I used cache_file_names={data1: name1, data2: name2} and it works. Thank you!
https://github.com/huggingface/datasets/issues/2400
Concatenate several datasets with removed columns is not working.
Hi, did you fill out the env info section manually or by copy-pasting the output of the `datasets-cli env` command? This code should work without issues on 1.6.2 version (I'm working on master (1.6.2.dev0 version) and can't reproduce this error).
## Describe the bug You can't concatenate datasets when you removed columns before. ## Steps to reproduce the bug ```python from datasets import load_dataset, concatenate_datasets wikiann= load_dataset("wikiann","en") wikiann["train"] = wikiann["train"].remove_columns(["langs","spans"]) wikiann["test"] = wikiann["test"].remove_columns(["langs","spans"]) assert wikiann["train"].features.type == wikiann["test"].features.type concate = concatenate_datasets([wikiann["train"],wikiann["test"]]) ``` ## Expected results Merged dataset ## Actual results ```python ValueError: External features info don't match the dataset: Got {'tokens': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'ner_tags': Sequence(feature=ClassLabel(num_classes=7, names=['O', 'B-PER', 'I-PER', 'B-ORG', 'I-ORG', 'B-LOC', 'I-LOC'], names_file=None, id=None), length=-1, id=None), 'langs': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'spans': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None)} with type struct<langs: list<item: string>, ner_tags: list<item: int64>, spans: list<item: string>, tokens: list<item: string>> but expected something like {'ner_tags': Sequence(feature=Value(dtype='int64', id=None), length=-1, id=None), 'tokens': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None)} with type struct<ner_tags: list<item: int64>, tokens: list<item: string>> ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: ~1.6.2~ 1.5.0 - Platform: macos - Python version: 3.8.5 - PyArrow version: 3.0.0
40
Concatenate several datasets with removed columns is not working. ## Describe the bug You can't concatenate datasets when you removed columns before. ## Steps to reproduce the bug ```python from datasets import load_dataset, concatenate_datasets wikiann= load_dataset("wikiann","en") wikiann["train"] = wikiann["train"].remove_columns(["langs","spans"]) wikiann["test"] = wikiann["test"].remove_columns(["langs","spans"]) assert wikiann["train"].features.type == wikiann["test"].features.type concate = concatenate_datasets([wikiann["train"],wikiann["test"]]) ``` ## Expected results Merged dataset ## Actual results ```python ValueError: External features info don't match the dataset: Got {'tokens': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'ner_tags': Sequence(feature=ClassLabel(num_classes=7, names=['O', 'B-PER', 'I-PER', 'B-ORG', 'I-ORG', 'B-LOC', 'I-LOC'], names_file=None, id=None), length=-1, id=None), 'langs': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'spans': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None)} with type struct<langs: list<item: string>, ner_tags: list<item: int64>, spans: list<item: string>, tokens: list<item: string>> but expected something like {'ner_tags': Sequence(feature=Value(dtype='int64', id=None), length=-1, id=None), 'tokens': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None)} with type struct<ner_tags: list<item: int64>, tokens: list<item: string>> ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: ~1.6.2~ 1.5.0 - Platform: macos - Python version: 3.8.5 - PyArrow version: 3.0.0 Hi, did you fill out the env info section manually or by copy-pasting the output of the `datasets-cli env` command? This code should work without issues on 1.6.2 version (I'm working on master (1.6.2.dev0 version) and can't reproduce this error).
https://github.com/huggingface/datasets/issues/2396
strange datasets from OSCAR corpus
Hi ! Thanks for reporting cc @pjox is this an issue from the data ? Anyway we should at least mention that OSCAR could contain such contents in the dataset card, you're totally right @jerryIsHere
![image](https://user-images.githubusercontent.com/50871412/119260850-4f876b80-bc07-11eb-8894-124302600643.png) ![image](https://user-images.githubusercontent.com/50871412/119260875-675eef80-bc07-11eb-9da4-ee27567054ac.png) From the [official site ](https://oscar-corpus.com/), the Yue Chinese dataset should have 2.2KB data. 7 training instances is obviously not a right number. As I can read Yue Chinese, I call tell the last instance is definitely not something that would appear on Common Crawl. And even if you don't read Yue Chinese, you can tell the first six instance are problematic. (It is embarrassing, as the 7 training instances look exactly like something from a pornographic novel or flitting messages in a chat of a dating app) It might not be the problem of the huggingface/datasets implementation, because when I tried to download the dataset from the official site, I found out that the zip file is corrupted. I will try to inform the host of OSCAR corpus later. Awy a remake about this dataset in huggingface/datasets is needed, perhaps after the host of the dataset fixes the issue. > Hi @jerryIsHere , sorry for the late response! Sadly this is normal, the problem comes form fasttext's classifier which we used to create the original corpus. In general the classifier is not really capable of properly recognizing Yue Chineese so the file ends un being just noise from Common Crawl. Some of these problems with OSCAR were already discussed [here](https://arxiv.org/pdf/2103.12028.pdf) but we are working on explicitly documenting the problems by language on our website. In fact, could please you open an issue on [our repo](https://github.com/oscar-corpus/oscar-website/issues) as well so that we can track it? Thanks a lot, the new post is here: https://github.com/oscar-corpus/oscar-website/issues/11
35
strange datasets from OSCAR corpus ![image](https://user-images.githubusercontent.com/50871412/119260850-4f876b80-bc07-11eb-8894-124302600643.png) ![image](https://user-images.githubusercontent.com/50871412/119260875-675eef80-bc07-11eb-9da4-ee27567054ac.png) From the [official site ](https://oscar-corpus.com/), the Yue Chinese dataset should have 2.2KB data. 7 training instances is obviously not a right number. As I can read Yue Chinese, I call tell the last instance is definitely not something that would appear on Common Crawl. And even if you don't read Yue Chinese, you can tell the first six instance are problematic. (It is embarrassing, as the 7 training instances look exactly like something from a pornographic novel or flitting messages in a chat of a dating app) It might not be the problem of the huggingface/datasets implementation, because when I tried to download the dataset from the official site, I found out that the zip file is corrupted. I will try to inform the host of OSCAR corpus later. Awy a remake about this dataset in huggingface/datasets is needed, perhaps after the host of the dataset fixes the issue. > Hi @jerryIsHere , sorry for the late response! Sadly this is normal, the problem comes form fasttext's classifier which we used to create the original corpus. In general the classifier is not really capable of properly recognizing Yue Chineese so the file ends un being just noise from Common Crawl. Some of these problems with OSCAR were already discussed [here](https://arxiv.org/pdf/2103.12028.pdf) but we are working on explicitly documenting the problems by language on our website. In fact, could please you open an issue on [our repo](https://github.com/oscar-corpus/oscar-website/issues) as well so that we can track it? Thanks a lot, the new post is here: https://github.com/oscar-corpus/oscar-website/issues/11 Hi ! Thanks for reporting cc @pjox is this an issue from the data ? Anyway we should at least mention that OSCAR could contain such contents in the dataset card, you're totally right @jerryIsHere
https://github.com/huggingface/datasets/issues/2396
strange datasets from OSCAR corpus
Hi @jerryIsHere , sorry for the late response! Sadly this is normal, the problem comes form fasttext's classifier which we used to create the original corpus. In general the classifier is not really capable of properly recognizing Yue Chineese so the file ends un being just noise from Common Crawl. Some of these problems with OSCAR were already discussed [here](https://arxiv.org/pdf/2103.12028.pdf) but we are working on explicitly documenting the problems by language on our website. In fact, could please you open an issue on [our repo](https://github.com/oscar-corpus/oscar-website/issues) as well so that we can track it?
![image](https://user-images.githubusercontent.com/50871412/119260850-4f876b80-bc07-11eb-8894-124302600643.png) ![image](https://user-images.githubusercontent.com/50871412/119260875-675eef80-bc07-11eb-9da4-ee27567054ac.png) From the [official site ](https://oscar-corpus.com/), the Yue Chinese dataset should have 2.2KB data. 7 training instances is obviously not a right number. As I can read Yue Chinese, I call tell the last instance is definitely not something that would appear on Common Crawl. And even if you don't read Yue Chinese, you can tell the first six instance are problematic. (It is embarrassing, as the 7 training instances look exactly like something from a pornographic novel or flitting messages in a chat of a dating app) It might not be the problem of the huggingface/datasets implementation, because when I tried to download the dataset from the official site, I found out that the zip file is corrupted. I will try to inform the host of OSCAR corpus later. Awy a remake about this dataset in huggingface/datasets is needed, perhaps after the host of the dataset fixes the issue. > Hi @jerryIsHere , sorry for the late response! Sadly this is normal, the problem comes form fasttext's classifier which we used to create the original corpus. In general the classifier is not really capable of properly recognizing Yue Chineese so the file ends un being just noise from Common Crawl. Some of these problems with OSCAR were already discussed [here](https://arxiv.org/pdf/2103.12028.pdf) but we are working on explicitly documenting the problems by language on our website. In fact, could please you open an issue on [our repo](https://github.com/oscar-corpus/oscar-website/issues) as well so that we can track it? Thanks a lot, the new post is here: https://github.com/oscar-corpus/oscar-website/issues/11
93
strange datasets from OSCAR corpus ![image](https://user-images.githubusercontent.com/50871412/119260850-4f876b80-bc07-11eb-8894-124302600643.png) ![image](https://user-images.githubusercontent.com/50871412/119260875-675eef80-bc07-11eb-9da4-ee27567054ac.png) From the [official site ](https://oscar-corpus.com/), the Yue Chinese dataset should have 2.2KB data. 7 training instances is obviously not a right number. As I can read Yue Chinese, I call tell the last instance is definitely not something that would appear on Common Crawl. And even if you don't read Yue Chinese, you can tell the first six instance are problematic. (It is embarrassing, as the 7 training instances look exactly like something from a pornographic novel or flitting messages in a chat of a dating app) It might not be the problem of the huggingface/datasets implementation, because when I tried to download the dataset from the official site, I found out that the zip file is corrupted. I will try to inform the host of OSCAR corpus later. Awy a remake about this dataset in huggingface/datasets is needed, perhaps after the host of the dataset fixes the issue. > Hi @jerryIsHere , sorry for the late response! Sadly this is normal, the problem comes form fasttext's classifier which we used to create the original corpus. In general the classifier is not really capable of properly recognizing Yue Chineese so the file ends un being just noise from Common Crawl. Some of these problems with OSCAR were already discussed [here](https://arxiv.org/pdf/2103.12028.pdf) but we are working on explicitly documenting the problems by language on our website. In fact, could please you open an issue on [our repo](https://github.com/oscar-corpus/oscar-website/issues) as well so that we can track it? Thanks a lot, the new post is here: https://github.com/oscar-corpus/oscar-website/issues/11 Hi @jerryIsHere , sorry for the late response! Sadly this is normal, the problem comes form fasttext's classifier which we used to create the original corpus. In general the classifier is not really capable of properly recognizing Yue Chineese so the file ends un being just noise from Common Crawl. Some of these problems with OSCAR were already discussed [here](https://arxiv.org/pdf/2103.12028.pdf) but we are working on explicitly documenting the problems by language on our website. In fact, could please you open an issue on [our repo](https://github.com/oscar-corpus/oscar-website/issues) as well so that we can track it?
https://github.com/huggingface/datasets/issues/2391
Missing original answers in kilt-TriviaQA
That could be useful indeed! Feel free to open a PR on the dataset card if you already have some code that runs, otherwise we'll take care of it soon :)
I previously opened an issue at https://github.com/facebookresearch/KILT/issues/42 but from the answer of @fabiopetroni it seems that the problem comes from HF-datasets ## Describe the bug The `answer` field in kilt-TriviaQA, e.g. `kilt_tasks['train_triviaqa'][0]['output']['answer']` contains a list of alternative answer which are accepted for the question. However it'd be nice to know the original answer to the question (the only fields in `output` are `'answer', 'meta', 'provenance'`) ## How to fix It can be fixed by retrieving the original answer from the original TriviaQA (e.g. `trivia_qa['train'][0]['answer']['value']`), perhaps at the same place as here where one retrieves the questions https://github.com/huggingface/datasets/blob/master/datasets/kilt_tasks/README.md#loading-the-kilt-knowledge-source-and-task-data cc @yjernite who previously answered to an issue about KILT and TriviaQA :)
31
Missing original answers in kilt-TriviaQA I previously opened an issue at https://github.com/facebookresearch/KILT/issues/42 but from the answer of @fabiopetroni it seems that the problem comes from HF-datasets ## Describe the bug The `answer` field in kilt-TriviaQA, e.g. `kilt_tasks['train_triviaqa'][0]['output']['answer']` contains a list of alternative answer which are accepted for the question. However it'd be nice to know the original answer to the question (the only fields in `output` are `'answer', 'meta', 'provenance'`) ## How to fix It can be fixed by retrieving the original answer from the original TriviaQA (e.g. `trivia_qa['train'][0]['answer']['value']`), perhaps at the same place as here where one retrieves the questions https://github.com/huggingface/datasets/blob/master/datasets/kilt_tasks/README.md#loading-the-kilt-knowledge-source-and-task-data cc @yjernite who previously answered to an issue about KILT and TriviaQA :) That could be useful indeed! Feel free to open a PR on the dataset card if you already have some code that runs, otherwise we'll take care of it soon :)
https://github.com/huggingface/datasets/issues/2391
Missing original answers in kilt-TriviaQA
I can open a PR but there is 2 details to fix: - the name for the corresponding key (e.g. `original_answer`) - how to implement it: I’m not sure what happens when you map `lambda x: {'input': ...}` as it keeps the other keys (e.g. `output`) intact but here since we want to set a nested value (e.g. `x['output']['original_answer']`) I implemented it with a regular function (not lambda), see below ```py def add_original_answer(x, trivia_qa, triviaqa_map): i = triviaqa_map[x['id']] x['output']['original_answer'] = trivia_qa['validation'][i]['answer']['value'] return x ```
I previously opened an issue at https://github.com/facebookresearch/KILT/issues/42 but from the answer of @fabiopetroni it seems that the problem comes from HF-datasets ## Describe the bug The `answer` field in kilt-TriviaQA, e.g. `kilt_tasks['train_triviaqa'][0]['output']['answer']` contains a list of alternative answer which are accepted for the question. However it'd be nice to know the original answer to the question (the only fields in `output` are `'answer', 'meta', 'provenance'`) ## How to fix It can be fixed by retrieving the original answer from the original TriviaQA (e.g. `trivia_qa['train'][0]['answer']['value']`), perhaps at the same place as here where one retrieves the questions https://github.com/huggingface/datasets/blob/master/datasets/kilt_tasks/README.md#loading-the-kilt-knowledge-source-and-task-data cc @yjernite who previously answered to an issue about KILT and TriviaQA :)
84
Missing original answers in kilt-TriviaQA I previously opened an issue at https://github.com/facebookresearch/KILT/issues/42 but from the answer of @fabiopetroni it seems that the problem comes from HF-datasets ## Describe the bug The `answer` field in kilt-TriviaQA, e.g. `kilt_tasks['train_triviaqa'][0]['output']['answer']` contains a list of alternative answer which are accepted for the question. However it'd be nice to know the original answer to the question (the only fields in `output` are `'answer', 'meta', 'provenance'`) ## How to fix It can be fixed by retrieving the original answer from the original TriviaQA (e.g. `trivia_qa['train'][0]['answer']['value']`), perhaps at the same place as here where one retrieves the questions https://github.com/huggingface/datasets/blob/master/datasets/kilt_tasks/README.md#loading-the-kilt-knowledge-source-and-task-data cc @yjernite who previously answered to an issue about KILT and TriviaQA :) I can open a PR but there is 2 details to fix: - the name for the corresponding key (e.g. `original_answer`) - how to implement it: I’m not sure what happens when you map `lambda x: {'input': ...}` as it keeps the other keys (e.g. `output`) intact but here since we want to set a nested value (e.g. `x['output']['original_answer']`) I implemented it with a regular function (not lambda), see below ```py def add_original_answer(x, trivia_qa, triviaqa_map): i = triviaqa_map[x['id']] x['output']['original_answer'] = trivia_qa['validation'][i]['answer']['value'] return x ```
https://github.com/huggingface/datasets/issues/2387
datasets 1.6 ignores cache
Looks like there are multiple issues regarding this (#2386, #2322) and it's a WIP #2329. Currently these datasets are being loaded in-memory which is causing this issue. Quoting @mariosasko here for a quick fix: > set `keep_in_memory` to `False` when loading a dataset (`sst = load_dataset("sst", keep_in_memory=False)`) to prevent it from loading in-memory. Currently, in-memory datasets fail to find cached files due to this check (always False for them)
Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq
69
datasets 1.6 ignores cache Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq Looks like there are multiple issues regarding this (#2386, #2322) and it's a WIP #2329. Currently these datasets are being loaded in-memory which is causing this issue. Quoting @mariosasko here for a quick fix: > set `keep_in_memory` to `False` when loading a dataset (`sst = load_dataset("sst", keep_in_memory=False)`) to prevent it from loading in-memory. Currently, in-memory datasets fail to find cached files due to this check (always False for them)
https://github.com/huggingface/datasets/issues/2387
datasets 1.6 ignores cache
Hi ! Since `datasets` 1.6.0 we no longer keep small datasets (<250MB) on disk and load them in RAM instead by default. This makes data processing and iterating on data faster. However datasets in RAM currently have no way to reload previous results from the cache (since nothing is written on disk). We are working on making the caching work for datasets in RAM. Until then, I'd recommend passing `keep_in_memory=False` to the calls to `load_dataset` like here: https://github.com/huggingface/transformers/blob/223943872e8c9c3fc11db3c6e93da07f5177423f/examples/pytorch/language-modeling/run_clm.py#L233 This way you say explicitly that you want your dataset to stay on the disk, and it will be able to recover previously computed results from the cache.
Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq
106
datasets 1.6 ignores cache Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq Hi ! Since `datasets` 1.6.0 we no longer keep small datasets (<250MB) on disk and load them in RAM instead by default. This makes data processing and iterating on data faster. However datasets in RAM currently have no way to reload previous results from the cache (since nothing is written on disk). We are working on making the caching work for datasets in RAM. Until then, I'd recommend passing `keep_in_memory=False` to the calls to `load_dataset` like here: https://github.com/huggingface/transformers/blob/223943872e8c9c3fc11db3c6e93da07f5177423f/examples/pytorch/language-modeling/run_clm.py#L233 This way you say explicitly that you want your dataset to stay on the disk, and it will be able to recover previously computed results from the cache.
https://github.com/huggingface/datasets/issues/2387
datasets 1.6 ignores cache
OK, It doesn't look like we can use the proposed workaround - see https://github.com/huggingface/transformers/issues/11801 Could you please add an env var for us to be able to turn off this unwanted in our situation behavior? It is really problematic for dev work, when one needs to restart the training very often and needs a quick startup time. Manual editing of standard scripts is not a practical option when one uses examples. This could also be a problem for tests, which will be slower because of lack of cache, albeit usually we use tiny datasets there. I think we want caching for tests. Thank you.
Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq
104
datasets 1.6 ignores cache Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq OK, It doesn't look like we can use the proposed workaround - see https://github.com/huggingface/transformers/issues/11801 Could you please add an env var for us to be able to turn off this unwanted in our situation behavior? It is really problematic for dev work, when one needs to restart the training very often and needs a quick startup time. Manual editing of standard scripts is not a practical option when one uses examples. This could also be a problem for tests, which will be slower because of lack of cache, albeit usually we use tiny datasets there. I think we want caching for tests. Thank you.
https://github.com/huggingface/datasets/issues/2387
datasets 1.6 ignores cache
Hi @stas00, You are right: an env variable is needed to turn off this behavior. I am adding it. For the moment there is a config parameter to turn off this behavior: `datasets.config.MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES = None` You can find this info in the docs: - in the docstring of the parameter `keep_in_memory` of the function [`load_datasets`](https://huggingface.co/docs/datasets/package_reference/loading_methods.html#datasets.load_dataset): - in a Note in the docs about [Loading a Dataset](https://huggingface.co/docs/datasets/loading_datasets.html#from-the-huggingface-hub) > The default in 🤗Datasets is to memory-map the dataset on drive if its size is larger than datasets.config.MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES (default 250 MiB); otherwise, the dataset is copied in-memory. This behavior can be disabled by setting datasets.config.MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES = None, and in this case the dataset is not loaded in memory.
Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq
115
datasets 1.6 ignores cache Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq Hi @stas00, You are right: an env variable is needed to turn off this behavior. I am adding it. For the moment there is a config parameter to turn off this behavior: `datasets.config.MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES = None` You can find this info in the docs: - in the docstring of the parameter `keep_in_memory` of the function [`load_datasets`](https://huggingface.co/docs/datasets/package_reference/loading_methods.html#datasets.load_dataset): - in a Note in the docs about [Loading a Dataset](https://huggingface.co/docs/datasets/loading_datasets.html#from-the-huggingface-hub) > The default in 🤗Datasets is to memory-map the dataset on drive if its size is larger than datasets.config.MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES (default 250 MiB); otherwise, the dataset is copied in-memory. This behavior can be disabled by setting datasets.config.MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES = None, and in this case the dataset is not loaded in memory.
https://github.com/huggingface/datasets/issues/2387
datasets 1.6 ignores cache
Yes, but this still requires one to edit the standard example scripts, so if I'm doing that already I just as well can add `keep_in_memory=False`. May be the low hanging fruit is to add `MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES` env var to match the config, and if the user sets it to 0, then it'll be the same as `keep_in_memory=False` or `datasets.config.MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES=0`?
Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq
58
datasets 1.6 ignores cache Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq Yes, but this still requires one to edit the standard example scripts, so if I'm doing that already I just as well can add `keep_in_memory=False`. May be the low hanging fruit is to add `MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES` env var to match the config, and if the user sets it to 0, then it'll be the same as `keep_in_memory=False` or `datasets.config.MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES=0`?
https://github.com/huggingface/datasets/issues/2387
datasets 1.6 ignores cache
@stas00, however, for the moment, setting the value to `0` is equivalent to the opposite, i.e. `keep_in_memory=True`. This means the max size until which I load in memory is 0 bytes. Tell me if this is logical/convenient, or I should change it.
Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq
42
datasets 1.6 ignores cache Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq @stas00, however, for the moment, setting the value to `0` is equivalent to the opposite, i.e. `keep_in_memory=True`. This means the max size until which I load in memory is 0 bytes. Tell me if this is logical/convenient, or I should change it.
https://github.com/huggingface/datasets/issues/2387
datasets 1.6 ignores cache
In my PR, to turn off current default bahavior, you should set env variable to one of: `{"", "OFF", "NO", "FALSE"}`. For example: ``` MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES= ```
Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq
26
datasets 1.6 ignores cache Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq In my PR, to turn off current default bahavior, you should set env variable to one of: `{"", "OFF", "NO", "FALSE"}`. For example: ``` MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES= ```
https://github.com/huggingface/datasets/issues/2387
datasets 1.6 ignores cache
IMHO, this behaviour is not very intuitive, as 0 is a normal quantity of bytes. So `MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES=0` to me reads as don't cache ever. Also "SIZE_IN_BYTES" that can take one of `{"", "OFF", "NO", "FALSE"}` is also quite odd. I think supporting a very simple `MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES` that can accept any numerical value to match the name of the variable, requires minimal logic and is very straightforward. So if you could adjust this logic - then `MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES=0` is all that's needed to not do in-memory datasets. Does it make sense?
Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq
89
datasets 1.6 ignores cache Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq IMHO, this behaviour is not very intuitive, as 0 is a normal quantity of bytes. So `MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES=0` to me reads as don't cache ever. Also "SIZE_IN_BYTES" that can take one of `{"", "OFF", "NO", "FALSE"}` is also quite odd. I think supporting a very simple `MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES` that can accept any numerical value to match the name of the variable, requires minimal logic and is very straightforward. So if you could adjust this logic - then `MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES=0` is all that's needed to not do in-memory datasets. Does it make sense?
https://github.com/huggingface/datasets/issues/2387
datasets 1.6 ignores cache
I understand your point @stas00, as I am not very convinced with current implementation. My concern is: which numerical value should then pass a user who wants `keep_in_memory=True` by default, independently of dataset size? Currently it is `0` for this case.
Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq
41
datasets 1.6 ignores cache Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq I understand your point @stas00, as I am not very convinced with current implementation. My concern is: which numerical value should then pass a user who wants `keep_in_memory=True` by default, independently of dataset size? Currently it is `0` for this case.
https://github.com/huggingface/datasets/issues/2387
datasets 1.6 ignores cache
That's a good question, and again the normal bytes can be used for that: ``` MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES=1e12 # (~2**40) ``` Since it's unlikely that anybody will have more than 1TB RAM. It's also silly that it uses BYTES and not MBYTES - that level of refinement doesn't seem to be of a practical use in this context. Not sure when it was added and if there are back-compat issues here, but perhaps it could be renamed `MAX_IN_MEMORY_DATASET_SIZE` and support 1M, 1G, 1T, etc. But scientific notation is quite intuitive too, as each 000 zeros is the next M, G, T multiplier. Minus the discrepancy of 1024 vs 1000, which adds up. And it is easy to write down `1e12`, as compared to `1099511627776` (2**40). (`1.1e12` is more exact).
Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq
127
datasets 1.6 ignores cache Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq That's a good question, and again the normal bytes can be used for that: ``` MAX_IN_MEMORY_DATASET_SIZE_IN_BYTES=1e12 # (~2**40) ``` Since it's unlikely that anybody will have more than 1TB RAM. It's also silly that it uses BYTES and not MBYTES - that level of refinement doesn't seem to be of a practical use in this context. Not sure when it was added and if there are back-compat issues here, but perhaps it could be renamed `MAX_IN_MEMORY_DATASET_SIZE` and support 1M, 1G, 1T, etc. But scientific notation is quite intuitive too, as each 000 zeros is the next M, G, T multiplier. Minus the discrepancy of 1024 vs 1000, which adds up. And it is easy to write down `1e12`, as compared to `1099511627776` (2**40). (`1.1e12` is more exact).
https://github.com/huggingface/datasets/issues/2387
datasets 1.6 ignores cache
Great! Thanks, @stas00. I am implementing your suggestion to turn off default value when set to `0`. For the other suggestion (allowing different metric prefixes), I will discuss with @lhoestq to agree on its implementation.
Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq
35
datasets 1.6 ignores cache Moving from https://github.com/huggingface/transformers/issues/11801#issuecomment-845546612 Quoting @VictorSanh: > > I downgraded datasets to `1.5.0` and printed `tokenized_datasets.cache_files` (L335): > > > `{'train': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-c6aefe81ca4e5152.arrow'}], 'validation': [{'filename': '/home/victor/.cache/huggingface/datasets/openwebtext10k/plain_text/1.0.0/3a8df094c671b4cb63ed0b41f40fb3bd855e9ce2e3765e5df50abcdfb5ec144b/cache-97cf4c813e6469c6.arrow'}]}` > > while the same command with the latest version of datasets (actually starting at `1.6.0`) gives: > > `{'train': [], 'validation': []}` > I also confirm that downgrading to `datasets==1.5.0` makes things fast again - i.e. cache is used. to reproduce: ``` USE_TF=0 python examples/pytorch/language-modeling/run_clm.py \ --model_name_or_path gpt2 \ --dataset_name "stas/openwebtext-10k" \ --output_dir output_dir \ --overwrite_output_dir \ --do_train \ --do_eval \ --max_train_samples 1000 \ --max_eval_samples 200 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --num_train_epochs 1 \ --warmup_steps 8 \ --block_size 64 \ --fp16 \ --report_to none ``` the first time the startup is slow and some 5 tqdm bars. It shouldn't do it on consequent runs. but with `datasets>1.5.0` it rebuilds on every run. @lhoestq Great! Thanks, @stas00. I am implementing your suggestion to turn off default value when set to `0`. For the other suggestion (allowing different metric prefixes), I will discuss with @lhoestq to agree on its implementation.
https://github.com/huggingface/datasets/issues/2377
ArrowDataset.save_to_disk produces files that cannot be read using pyarrow.feather
Hi ! This is because we are actually using the arrow streaming format. We plan to switch to the arrow IPC format. More info at #1933
## Describe the bug A clear and concise description of what the bug is. ## Steps to reproduce the bug ```python from datasets import load_dataset from pyarrow import feather dataset = load_dataset('imdb', split='train') dataset.save_to_disk('dataset_dir') table = feather.read_table('dataset_dir/dataset.arrow') ``` ## Expected results I expect that the saved dataset can be read by the official Apache Arrow methods. ## Actual results ``` File "/usr/local/lib/python3.7/site-packages/pyarrow/feather.py", line 236, in read_table reader.open(source, use_memory_map=memory_map) File "pyarrow/feather.pxi", line 67, in pyarrow.lib.FeatherReader.open File "pyarrow/error.pxi", line 123, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 85, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Not a Feather V1 or Arrow IPC file ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets-1.6.2 - Platform: Linux - Python version: 3.7 - PyArrow version: 0.17.1, also 2.0.0
26
ArrowDataset.save_to_disk produces files that cannot be read using pyarrow.feather ## Describe the bug A clear and concise description of what the bug is. ## Steps to reproduce the bug ```python from datasets import load_dataset from pyarrow import feather dataset = load_dataset('imdb', split='train') dataset.save_to_disk('dataset_dir') table = feather.read_table('dataset_dir/dataset.arrow') ``` ## Expected results I expect that the saved dataset can be read by the official Apache Arrow methods. ## Actual results ``` File "/usr/local/lib/python3.7/site-packages/pyarrow/feather.py", line 236, in read_table reader.open(source, use_memory_map=memory_map) File "pyarrow/feather.pxi", line 67, in pyarrow.lib.FeatherReader.open File "pyarrow/error.pxi", line 123, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 85, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Not a Feather V1 or Arrow IPC file ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets-1.6.2 - Platform: Linux - Python version: 3.7 - PyArrow version: 0.17.1, also 2.0.0 Hi ! This is because we are actually using the arrow streaming format. We plan to switch to the arrow IPC format. More info at #1933
https://github.com/huggingface/datasets/issues/2377
ArrowDataset.save_to_disk produces files that cannot be read using pyarrow.feather
Not sure if this was resolved, but I am getting a similar error when trying to load a dataset.arrow file directly: `ArrowInvalid: Not an Arrow file`
## Describe the bug A clear and concise description of what the bug is. ## Steps to reproduce the bug ```python from datasets import load_dataset from pyarrow import feather dataset = load_dataset('imdb', split='train') dataset.save_to_disk('dataset_dir') table = feather.read_table('dataset_dir/dataset.arrow') ``` ## Expected results I expect that the saved dataset can be read by the official Apache Arrow methods. ## Actual results ``` File "/usr/local/lib/python3.7/site-packages/pyarrow/feather.py", line 236, in read_table reader.open(source, use_memory_map=memory_map) File "pyarrow/feather.pxi", line 67, in pyarrow.lib.FeatherReader.open File "pyarrow/error.pxi", line 123, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 85, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Not a Feather V1 or Arrow IPC file ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets-1.6.2 - Platform: Linux - Python version: 3.7 - PyArrow version: 0.17.1, also 2.0.0
26
ArrowDataset.save_to_disk produces files that cannot be read using pyarrow.feather ## Describe the bug A clear and concise description of what the bug is. ## Steps to reproduce the bug ```python from datasets import load_dataset from pyarrow import feather dataset = load_dataset('imdb', split='train') dataset.save_to_disk('dataset_dir') table = feather.read_table('dataset_dir/dataset.arrow') ``` ## Expected results I expect that the saved dataset can be read by the official Apache Arrow methods. ## Actual results ``` File "/usr/local/lib/python3.7/site-packages/pyarrow/feather.py", line 236, in read_table reader.open(source, use_memory_map=memory_map) File "pyarrow/feather.pxi", line 67, in pyarrow.lib.FeatherReader.open File "pyarrow/error.pxi", line 123, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 85, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Not a Feather V1 or Arrow IPC file ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets-1.6.2 - Platform: Linux - Python version: 3.7 - PyArrow version: 0.17.1, also 2.0.0 Not sure if this was resolved, but I am getting a similar error when trying to load a dataset.arrow file directly: `ArrowInvalid: Not an Arrow file`
https://github.com/huggingface/datasets/issues/2377
ArrowDataset.save_to_disk produces files that cannot be read using pyarrow.feather
Since we're using the streaming format, you need to use `open_stream`: ```python import pyarrow as pa def in_memory_arrow_table_from_file(filename: str) -> pa.Table: in_memory_stream = pa.input_stream(filename) opened_stream = pa.ipc.open_stream(in_memory_stream) pa_table = opened_stream.read_all() return pa_table def memory_mapped_arrow_table_from_file(filename: str) -> pa.Table: memory_mapped_stream = pa.memory_map(filename) opened_stream = pa.ipc.open_stream(memory_mapped_stream) pa_table = opened_stream.read_all() return pa_table ```
## Describe the bug A clear and concise description of what the bug is. ## Steps to reproduce the bug ```python from datasets import load_dataset from pyarrow import feather dataset = load_dataset('imdb', split='train') dataset.save_to_disk('dataset_dir') table = feather.read_table('dataset_dir/dataset.arrow') ``` ## Expected results I expect that the saved dataset can be read by the official Apache Arrow methods. ## Actual results ``` File "/usr/local/lib/python3.7/site-packages/pyarrow/feather.py", line 236, in read_table reader.open(source, use_memory_map=memory_map) File "pyarrow/feather.pxi", line 67, in pyarrow.lib.FeatherReader.open File "pyarrow/error.pxi", line 123, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 85, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Not a Feather V1 or Arrow IPC file ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets-1.6.2 - Platform: Linux - Python version: 3.7 - PyArrow version: 0.17.1, also 2.0.0
49
ArrowDataset.save_to_disk produces files that cannot be read using pyarrow.feather ## Describe the bug A clear and concise description of what the bug is. ## Steps to reproduce the bug ```python from datasets import load_dataset from pyarrow import feather dataset = load_dataset('imdb', split='train') dataset.save_to_disk('dataset_dir') table = feather.read_table('dataset_dir/dataset.arrow') ``` ## Expected results I expect that the saved dataset can be read by the official Apache Arrow methods. ## Actual results ``` File "/usr/local/lib/python3.7/site-packages/pyarrow/feather.py", line 236, in read_table reader.open(source, use_memory_map=memory_map) File "pyarrow/feather.pxi", line 67, in pyarrow.lib.FeatherReader.open File "pyarrow/error.pxi", line 123, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 85, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Not a Feather V1 or Arrow IPC file ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets-1.6.2 - Platform: Linux - Python version: 3.7 - PyArrow version: 0.17.1, also 2.0.0 Since we're using the streaming format, you need to use `open_stream`: ```python import pyarrow as pa def in_memory_arrow_table_from_file(filename: str) -> pa.Table: in_memory_stream = pa.input_stream(filename) opened_stream = pa.ipc.open_stream(in_memory_stream) pa_table = opened_stream.read_all() return pa_table def memory_mapped_arrow_table_from_file(filename: str) -> pa.Table: memory_mapped_stream = pa.memory_map(filename) opened_stream = pa.ipc.open_stream(memory_mapped_stream) pa_table = opened_stream.read_all() return pa_table ```
https://github.com/huggingface/datasets/issues/2373
Loading dataset from local path
Version below works, checked again in the docs, and data_files should be a path. ``` ds = datasets.load_dataset('my_script.py', data_files='/data/dir/corpus.txt', cache_dir='.') ```
I'm trying to load a local dataset with the code below ``` ds = datasets.load_dataset('my_script.py', data_files='corpus.txt', data_dir='/data/dir', cache_dir='.') ``` But internally a BuilderConfig is created, which tries to use getmtime on the data_files string, without using data_dir. Is this a bug or am I not using the load_dataset correctly? https://github.com/huggingface/datasets/blob/bc61954083f74e6460688202e9f77dde2475319c/src/datasets/builder.py#L153
21
Loading dataset from local path I'm trying to load a local dataset with the code below ``` ds = datasets.load_dataset('my_script.py', data_files='corpus.txt', data_dir='/data/dir', cache_dir='.') ``` But internally a BuilderConfig is created, which tries to use getmtime on the data_files string, without using data_dir. Is this a bug or am I not using the load_dataset correctly? https://github.com/huggingface/datasets/blob/bc61954083f74e6460688202e9f77dde2475319c/src/datasets/builder.py#L153 Version below works, checked again in the docs, and data_files should be a path. ``` ds = datasets.load_dataset('my_script.py', data_files='/data/dir/corpus.txt', cache_dir='.') ```
https://github.com/huggingface/datasets/issues/2350
`FaissIndex.save` throws error on GPU
Just in case, this is a workaround that I use in my code and it seems to do the job. ```python if use_gpu_index: data["train"]._indexes["text_emb"].faiss_index = faiss.index_gpu_to_cpu(data["train"]._indexes["text_emb"].faiss_index) ```
## Describe the bug After training an index with a factory string `OPQ16_128,IVF512,PQ32` on GPU, `.save_faiss_index` throws this error. ``` File "index_wikipedia.py", line 119, in <module> data["train"].save_faiss_index("text_emb", index_save_path) File "/home/vlialin/miniconda3/envs/cat/lib/python3.8/site-packages/datasets/search.py", line 470, in save_faiss_index index.save(file) File "/home/vlialin/miniconda3/envs/cat/lib/python3.8/site-packages/datasets/search.py", line 334, in save faiss.write_index(index, str(file)) File "/home/vlialin/miniconda3/envs/cat/lib/python3.8/site-packages/faiss/swigfaiss_avx2.py", line 5654, in write_index return _swigfaiss.write_index(*args) RuntimeError: Error in void faiss::write_index(const faiss::Index*, faiss::IOWriter*) at /root/miniconda3/conda-bld/faiss-pkg_1613235005464/work/faiss/impl/index_write.cpp:453: don't know how to serialize this type of index ``` ## Steps to reproduce the bug Any dataset will do, I just selected a familiar one. ```python import numpy as np import datasets INDEX_STR = "OPQ16_128,IVF512,PQ32" INDEX_SAVE_PATH = "will_not_save.faiss" data = datasets.load_dataset("Fraser/news-category-dataset", split=f"train[:10000]") def encode(item): return {"text_emb": np.random.randn(768).astype(np.float32)} data = data.map(encode) data.add_faiss_index(column="text_emb", string_factory=INDEX_STR, train_size=10_000, device=0) data.save_faiss_index("text_emb", INDEX_SAVE_PATH) ``` ## Expected results Saving the index ## Actual results Error in void faiss::write_index(const faiss::Index*, faiss::IOWriter*) ... don't know how to serialize this type of index ## Environment info - `datasets` version: 1.6.2 - Platform: Linux-4.15.0-142-generic-x86_64-with-glibc2.10 - Python version: 3.8.8 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): 2.2.0 (False) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No I will be proposing a fix in a couple of minutes
27
`FaissIndex.save` throws error on GPU ## Describe the bug After training an index with a factory string `OPQ16_128,IVF512,PQ32` on GPU, `.save_faiss_index` throws this error. ``` File "index_wikipedia.py", line 119, in <module> data["train"].save_faiss_index("text_emb", index_save_path) File "/home/vlialin/miniconda3/envs/cat/lib/python3.8/site-packages/datasets/search.py", line 470, in save_faiss_index index.save(file) File "/home/vlialin/miniconda3/envs/cat/lib/python3.8/site-packages/datasets/search.py", line 334, in save faiss.write_index(index, str(file)) File "/home/vlialin/miniconda3/envs/cat/lib/python3.8/site-packages/faiss/swigfaiss_avx2.py", line 5654, in write_index return _swigfaiss.write_index(*args) RuntimeError: Error in void faiss::write_index(const faiss::Index*, faiss::IOWriter*) at /root/miniconda3/conda-bld/faiss-pkg_1613235005464/work/faiss/impl/index_write.cpp:453: don't know how to serialize this type of index ``` ## Steps to reproduce the bug Any dataset will do, I just selected a familiar one. ```python import numpy as np import datasets INDEX_STR = "OPQ16_128,IVF512,PQ32" INDEX_SAVE_PATH = "will_not_save.faiss" data = datasets.load_dataset("Fraser/news-category-dataset", split=f"train[:10000]") def encode(item): return {"text_emb": np.random.randn(768).astype(np.float32)} data = data.map(encode) data.add_faiss_index(column="text_emb", string_factory=INDEX_STR, train_size=10_000, device=0) data.save_faiss_index("text_emb", INDEX_SAVE_PATH) ``` ## Expected results Saving the index ## Actual results Error in void faiss::write_index(const faiss::Index*, faiss::IOWriter*) ... don't know how to serialize this type of index ## Environment info - `datasets` version: 1.6.2 - Platform: Linux-4.15.0-142-generic-x86_64-with-glibc2.10 - Python version: 3.8.8 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): 2.2.0 (False) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No I will be proposing a fix in a couple of minutes Just in case, this is a workaround that I use in my code and it seems to do the job. ```python if use_gpu_index: data["train"]._indexes["text_emb"].faiss_index = faiss.index_gpu_to_cpu(data["train"]._indexes["text_emb"].faiss_index) ```
https://github.com/huggingface/datasets/issues/2347
Add an API to access the language and pretty name of a dataset
Hi ! With @bhavitvyamalik we discussed about having something like ```python from datasets import load_dataset_card dataset_card = load_dataset_card("squad") print(dataset_card.metadata.pretty_name) # Stanford Question Answering Dataset (SQuAD) print(dataset_card.metadata.languages) # ["en"] ``` What do you think ? I don't know if you already have a way to load the model tags in `transformers` but we can agree on the API to have something consistent. Also note that the pretty name would only be used to show users something prettier than a dataset id, but in the end the source of truth will stay the dataset id (here `squad`).
It would be super nice to have an API to get some metadata of the dataset from the name and args passed to `load_dataset`. This way we could programmatically infer the language and the name of a dataset when creating model cards automatically in the Transformers examples scripts.
95
Add an API to access the language and pretty name of a dataset It would be super nice to have an API to get some metadata of the dataset from the name and args passed to `load_dataset`. This way we could programmatically infer the language and the name of a dataset when creating model cards automatically in the Transformers examples scripts. Hi ! With @bhavitvyamalik we discussed about having something like ```python from datasets import load_dataset_card dataset_card = load_dataset_card("squad") print(dataset_card.metadata.pretty_name) # Stanford Question Answering Dataset (SQuAD) print(dataset_card.metadata.languages) # ["en"] ``` What do you think ? I don't know if you already have a way to load the model tags in `transformers` but we can agree on the API to have something consistent. Also note that the pretty name would only be used to show users something prettier than a dataset id, but in the end the source of truth will stay the dataset id (here `squad`).
https://github.com/huggingface/datasets/issues/2347
Add an API to access the language and pretty name of a dataset
What dataset_info method are you talking about @julien-c ? In `huggingface_hub` I can only see `model_info`.
It would be super nice to have an API to get some metadata of the dataset from the name and args passed to `load_dataset`. This way we could programmatically infer the language and the name of a dataset when creating model cards automatically in the Transformers examples scripts.
16
Add an API to access the language and pretty name of a dataset It would be super nice to have an API to get some metadata of the dataset from the name and args passed to `load_dataset`. This way we could programmatically infer the language and the name of a dataset when creating model cards automatically in the Transformers examples scripts. What dataset_info method are you talking about @julien-c ? In `huggingface_hub` I can only see `model_info`.
https://github.com/huggingface/datasets/issues/2347
Add an API to access the language and pretty name of a dataset
Indeed, this info can now be fetched with `huggingface_hub.dataset_info`, so I think we can close this issue.
It would be super nice to have an API to get some metadata of the dataset from the name and args passed to `load_dataset`. This way we could programmatically infer the language and the name of a dataset when creating model cards automatically in the Transformers examples scripts.
17
Add an API to access the language and pretty name of a dataset It would be super nice to have an API to get some metadata of the dataset from the name and args passed to `load_dataset`. This way we could programmatically infer the language and the name of a dataset when creating model cards automatically in the Transformers examples scripts. Indeed, this info can now be fetched with `huggingface_hub.dataset_info`, so I think we can close this issue.
https://github.com/huggingface/datasets/issues/2345
[Question] How to move and reuse preprocessed dataset?
<s>Hi :) Can you share with us the code you used ?</s> EDIT: from https://github.com/huggingface/transformers/issues/11665#issuecomment-838348291 I understand you're using the run_clm.py script. Can you share your logs ?
Hi, I am training a gpt-2 from scratch using run_clm.py. I want to move and reuse the preprocessed dataset (It take 2 hour to preprocess), I tried to : copy path_to_cache_dir/datasets to new_cache_dir/datasets set export HF_DATASETS_CACHE="new_cache_dir/" but the program still re-preprocess the whole dataset without loading cache. I also tried to torch.save(lm_datasets, fw), but the saved file is only 14M. What is the proper way to do this?
28
[Question] How to move and reuse preprocessed dataset? Hi, I am training a gpt-2 from scratch using run_clm.py. I want to move and reuse the preprocessed dataset (It take 2 hour to preprocess), I tried to : copy path_to_cache_dir/datasets to new_cache_dir/datasets set export HF_DATASETS_CACHE="new_cache_dir/" but the program still re-preprocess the whole dataset without loading cache. I also tried to torch.save(lm_datasets, fw), but the saved file is only 14M. What is the proper way to do this? <s>Hi :) Can you share with us the code you used ?</s> EDIT: from https://github.com/huggingface/transformers/issues/11665#issuecomment-838348291 I understand you're using the run_clm.py script. Can you share your logs ?
https://github.com/huggingface/datasets/issues/2345
[Question] How to move and reuse preprocessed dataset?
Also note that for the caching to work, you must reuse the exact same parameters as in the first run. Did you change any parameter ? The `preprocessing_num_workers` should also stay the same
Hi, I am training a gpt-2 from scratch using run_clm.py. I want to move and reuse the preprocessed dataset (It take 2 hour to preprocess), I tried to : copy path_to_cache_dir/datasets to new_cache_dir/datasets set export HF_DATASETS_CACHE="new_cache_dir/" but the program still re-preprocess the whole dataset without loading cache. I also tried to torch.save(lm_datasets, fw), but the saved file is only 14M. What is the proper way to do this?
33
[Question] How to move and reuse preprocessed dataset? Hi, I am training a gpt-2 from scratch using run_clm.py. I want to move and reuse the preprocessed dataset (It take 2 hour to preprocess), I tried to : copy path_to_cache_dir/datasets to new_cache_dir/datasets set export HF_DATASETS_CACHE="new_cache_dir/" but the program still re-preprocess the whole dataset without loading cache. I also tried to torch.save(lm_datasets, fw), but the saved file is only 14M. What is the proper way to do this? Also note that for the caching to work, you must reuse the exact same parameters as in the first run. Did you change any parameter ? The `preprocessing_num_workers` should also stay the same
https://github.com/huggingface/datasets/issues/2345
[Question] How to move and reuse preprocessed dataset?
> Also note that for the caching to work, you must reuse the exact same parameters as in the first run. Did you change any parameter ? The `preprocessing_num_workers` should also stay the same I only changed the `preprocessing_num_workers` maybe it is the problem~ I will try again~
Hi, I am training a gpt-2 from scratch using run_clm.py. I want to move and reuse the preprocessed dataset (It take 2 hour to preprocess), I tried to : copy path_to_cache_dir/datasets to new_cache_dir/datasets set export HF_DATASETS_CACHE="new_cache_dir/" but the program still re-preprocess the whole dataset without loading cache. I also tried to torch.save(lm_datasets, fw), but the saved file is only 14M. What is the proper way to do this?
48
[Question] How to move and reuse preprocessed dataset? Hi, I am training a gpt-2 from scratch using run_clm.py. I want to move and reuse the preprocessed dataset (It take 2 hour to preprocess), I tried to : copy path_to_cache_dir/datasets to new_cache_dir/datasets set export HF_DATASETS_CACHE="new_cache_dir/" but the program still re-preprocess the whole dataset without loading cache. I also tried to torch.save(lm_datasets, fw), but the saved file is only 14M. What is the proper way to do this? > Also note that for the caching to work, you must reuse the exact same parameters as in the first run. Did you change any parameter ? The `preprocessing_num_workers` should also stay the same I only changed the `preprocessing_num_workers` maybe it is the problem~ I will try again~
https://github.com/huggingface/datasets/issues/2344
Is there a way to join multiple datasets in one?
Hi ! We don't have `join`/`merge` on a certain column as in pandas. Maybe you can just use the [concatenate_datasets](https://huggingface.co/docs/datasets/package_reference/main_classes.html?highlight=concatenate#datasets.concatenate_datasets) function.
**Is your feature request related to a problem? Please describe.** I need to join 2 datasets, one that is in the hub and another I've created from my files. Is there an easy way to join these 2? **Describe the solution you'd like** Id like to join them with a merge or join method, just like pandas dataframes. **Additional context** If you want to extend an existing dataset with more data, for example for training a language model, you need that functionality. I've not found it in the documentation.
21
Is there a way to join multiple datasets in one? **Is your feature request related to a problem? Please describe.** I need to join 2 datasets, one that is in the hub and another I've created from my files. Is there an easy way to join these 2? **Describe the solution you'd like** Id like to join them with a merge or join method, just like pandas dataframes. **Additional context** If you want to extend an existing dataset with more data, for example for training a language model, you need that functionality. I've not found it in the documentation. Hi ! We don't have `join`/`merge` on a certain column as in pandas. Maybe you can just use the [concatenate_datasets](https://huggingface.co/docs/datasets/package_reference/main_classes.html?highlight=concatenate#datasets.concatenate_datasets) function.
https://github.com/huggingface/datasets/issues/2344
Is there a way to join multiple datasets in one?
Hi! You can use `datasets_sql` for that now. As of recently, PyArrow also supports querying tables via Substrait, so I think we can start adding these methods to the API soon.
**Is your feature request related to a problem? Please describe.** I need to join 2 datasets, one that is in the hub and another I've created from my files. Is there an easy way to join these 2? **Describe the solution you'd like** Id like to join them with a merge or join method, just like pandas dataframes. **Additional context** If you want to extend an existing dataset with more data, for example for training a language model, you need that functionality. I've not found it in the documentation.
31
Is there a way to join multiple datasets in one? **Is your feature request related to a problem? Please describe.** I need to join 2 datasets, one that is in the hub and another I've created from my files. Is there an easy way to join these 2? **Describe the solution you'd like** Id like to join them with a merge or join method, just like pandas dataframes. **Additional context** If you want to extend an existing dataset with more data, for example for training a language model, you need that functionality. I've not found it in the documentation. Hi! You can use `datasets_sql` for that now. As of recently, PyArrow also supports querying tables via Substrait, so I think we can start adding these methods to the API soon.
https://github.com/huggingface/datasets/issues/2343
Columns are removed before or after map function applied?
Hi! Columns are removed **after** applying the function and **before** updating the examples with the function's output (as per the docs [here](https://huggingface.co/docs/datasets/package_reference/main_classes#datasets.Dataset.map.remove_columns)). I agree the docs on this should be more clear.
## Describe the bug According to the documentation when applying map function the [remove_columns ](https://huggingface.co/docs/datasets/processing.html#removing-columns) will be removed after they are passed to the function, but in the [source code](https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.map) it's documented that they are removed before applying function. I thinks the source code doc is more accurate, right?
32
Columns are removed before or after map function applied? ## Describe the bug According to the documentation when applying map function the [remove_columns ](https://huggingface.co/docs/datasets/processing.html#removing-columns) will be removed after they are passed to the function, but in the [source code](https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.map) it's documented that they are removed before applying function. I thinks the source code doc is more accurate, right? Hi! Columns are removed **after** applying the function and **before** updating the examples with the function's output (as per the docs [here](https://huggingface.co/docs/datasets/package_reference/main_classes#datasets.Dataset.map.remove_columns)). I agree the docs on this should be more clear.
https://github.com/huggingface/datasets/issues/2337
NonMatchingChecksumError for web_of_science dataset
I've raised a PR for this. Should work with `dataset = load_dataset("web_of_science", "WOS11967", ignore_verifications=True)`once it gets merged into the main branch. Thanks for reporting this!
NonMatchingChecksumError when trying to download the web_of_science dataset. >NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://data.mendeley.com/datasets/9rw3vkcfy4/6/files/c9ea673d-5542-44c0-ab7b-f1311f7d61df/WebOfScience.zip?dl=1'] Setting `ignore_verfications=True` results in OSError. >OSError: Cannot find data file. Original error: [Errno 20] Not a directory: '/root/.cache/huggingface/datasets/downloads/37ab2c42f50d553c1d0ea432baca3e9e11fedea4aeec63a81e6b7e25dd10d4e7/WOS5736/X.txt' ```python dataset = load_dataset('web_of_science', 'WOS5736') ``` There are 3 data instances and they all don't work. 'WOS5736', 'WOS11967', 'WOS46985' datasets 1.6.2 python 3.7.10 Ubuntu 18.04.5 LTS
25
NonMatchingChecksumError for web_of_science dataset NonMatchingChecksumError when trying to download the web_of_science dataset. >NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://data.mendeley.com/datasets/9rw3vkcfy4/6/files/c9ea673d-5542-44c0-ab7b-f1311f7d61df/WebOfScience.zip?dl=1'] Setting `ignore_verfications=True` results in OSError. >OSError: Cannot find data file. Original error: [Errno 20] Not a directory: '/root/.cache/huggingface/datasets/downloads/37ab2c42f50d553c1d0ea432baca3e9e11fedea4aeec63a81e6b7e25dd10d4e7/WOS5736/X.txt' ```python dataset = load_dataset('web_of_science', 'WOS5736') ``` There are 3 data instances and they all don't work. 'WOS5736', 'WOS11967', 'WOS46985' datasets 1.6.2 python 3.7.10 Ubuntu 18.04.5 LTS I've raised a PR for this. Should work with `dataset = load_dataset("web_of_science", "WOS11967", ignore_verifications=True)`once it gets merged into the main branch. Thanks for reporting this!
https://github.com/huggingface/datasets/issues/2330
Allow passing `desc` to `tqdm` in `Dataset.map()`
I think the user could pass the `desc` parameter to `map` so that it can be displayed in the tqdm progress bar, as suggested by @cccntu. When there's no multiprocessing, the `desc` of the progress bar could be the `desc` passed by the user. In multiprocessing, we were already using a `desc` equal to `"#" + str(rank)`. We can change it to be `(desc or "") + "#" + str(rank)` instead. In the end, since both `desc` and `rank` could be None, we can have: ```python pbar_desc = (desc or "") + "#" + str(rank) if rank is not None else desc ``` Finally let's remember that if we add `desc` as a new parameter to `map`, we should add it to the `ignore_kwargs` list of the `@fingerprint_transform` decorator of `Dataset._map_single` since we don't want this parameter to affect the fingerprint of the resulting dataset.
It's normal to have many `map()` calls, and some of them can take a few minutes, it would be nice to have a description on the progress bar. Alternative solution: Print the description before/after the `map()` call.
145
Allow passing `desc` to `tqdm` in `Dataset.map()` It's normal to have many `map()` calls, and some of them can take a few minutes, it would be nice to have a description on the progress bar. Alternative solution: Print the description before/after the `map()` call. I think the user could pass the `desc` parameter to `map` so that it can be displayed in the tqdm progress bar, as suggested by @cccntu. When there's no multiprocessing, the `desc` of the progress bar could be the `desc` passed by the user. In multiprocessing, we were already using a `desc` equal to `"#" + str(rank)`. We can change it to be `(desc or "") + "#" + str(rank)` instead. In the end, since both `desc` and `rank` could be None, we can have: ```python pbar_desc = (desc or "") + "#" + str(rank) if rank is not None else desc ``` Finally let's remember that if we add `desc` as a new parameter to `map`, we should add it to the `ignore_kwargs` list of the `@fingerprint_transform` decorator of `Dataset._map_single` since we don't want this parameter to affect the fingerprint of the resulting dataset.
https://github.com/huggingface/datasets/issues/2327
A syntax error in example
cc @beurkinger but I think this has been fixed internally and will soon be updated right ?
![image](https://user-images.githubusercontent.com/6883957/117315905-b47a5c00-aeba-11eb-91eb-b2a4a0212a56.png) Sorry to report with an image, I can't find the template source code of this snippet.
17
A syntax error in example ![image](https://user-images.githubusercontent.com/6883957/117315905-b47a5c00-aeba-11eb-91eb-b2a4a0212a56.png) Sorry to report with an image, I can't find the template source code of this snippet. cc @beurkinger but I think this has been fixed internally and will soon be updated right ?
https://github.com/huggingface/datasets/issues/2323
load_dataset("timit_asr") gives back duplicates of just one sample text
Thanks @ekeleshian for having reported. I am closing this issue once that you updated `datasets`. Feel free to reopen it if the problem persists.
## Describe the bug When you look up on key ["train"] and then ['text'], you get back a list with just one sentence duplicated 4620 times. Namely, the sentence "Would such an act of refusal be useful?". Similarly when you look up ['test'] and then ['text'], the list is one sentence repeated "The bungalow was pleasantly situated near the shore." 1680 times. I tried to work around the issue by downgrading to datasets version 1.3.0, inspired by [this post](https://www.gitmemory.com/issue/huggingface/datasets/2052/798904836) and removing the entire huggingface directory from ~/.cache, but I still get the same issue. ## Steps to reproduce the bug ```python from datasets import load_dataset timit = load_dataset("timit_asr") print(timit['train']['text']) print(timit['test']['text']) ``` ## Expected Result Rows of diverse text, like how it is shown in the [wav2vec2.0 tutorial](https://colab.research.google.com/github/patrickvonplaten/notebooks/blob/master/Fine_tuning_Wav2Vec2_for_English_ASR.ipynb) <img width="485" alt="Screen Shot 2021-05-05 at 9 09 57 AM" src="https://user-images.githubusercontent.com/33647474/117146094-d9b77f00-ad81-11eb-8306-f281850c127a.png"> ## Actual results Rows of repeated text. <img width="319" alt="Screen Shot 2021-05-05 at 9 11 53 AM" src="https://user-images.githubusercontent.com/33647474/117146231-f8b61100-ad81-11eb-834a-fc10410b0c9c.png"> ## Versions - Datasets: 1.3.0 - Python: 3.9.1 - Platform: macOS-11.2.1-x86_64-i386-64bit}
24
load_dataset("timit_asr") gives back duplicates of just one sample text ## Describe the bug When you look up on key ["train"] and then ['text'], you get back a list with just one sentence duplicated 4620 times. Namely, the sentence "Would such an act of refusal be useful?". Similarly when you look up ['test'] and then ['text'], the list is one sentence repeated "The bungalow was pleasantly situated near the shore." 1680 times. I tried to work around the issue by downgrading to datasets version 1.3.0, inspired by [this post](https://www.gitmemory.com/issue/huggingface/datasets/2052/798904836) and removing the entire huggingface directory from ~/.cache, but I still get the same issue. ## Steps to reproduce the bug ```python from datasets import load_dataset timit = load_dataset("timit_asr") print(timit['train']['text']) print(timit['test']['text']) ``` ## Expected Result Rows of diverse text, like how it is shown in the [wav2vec2.0 tutorial](https://colab.research.google.com/github/patrickvonplaten/notebooks/blob/master/Fine_tuning_Wav2Vec2_for_English_ASR.ipynb) <img width="485" alt="Screen Shot 2021-05-05 at 9 09 57 AM" src="https://user-images.githubusercontent.com/33647474/117146094-d9b77f00-ad81-11eb-8306-f281850c127a.png"> ## Actual results Rows of repeated text. <img width="319" alt="Screen Shot 2021-05-05 at 9 11 53 AM" src="https://user-images.githubusercontent.com/33647474/117146231-f8b61100-ad81-11eb-834a-fc10410b0c9c.png"> ## Versions - Datasets: 1.3.0 - Python: 3.9.1 - Platform: macOS-11.2.1-x86_64-i386-64bit} Thanks @ekeleshian for having reported. I am closing this issue once that you updated `datasets`. Feel free to reopen it if the problem persists.
https://github.com/huggingface/datasets/issues/2322
Calls to map are not cached.
I tried upgrading to `datasets==1.6.2` and downgrading to `1.6.0`. Both versions produce the same output. Downgrading to `1.5.0` works and produces the following output for me: ```bash Downloading: 9.20kB [00:00, 3.94MB/s] Downloading: 5.99kB [00:00, 3.29MB/s] No config specified, defaulting to: sst/default Downloading and preparing dataset sst/default (download: 6.83 MiB, generated: 3.73 MiB, post-processed: Unknown size, total: 10.56 MiB) to /home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/a16a45566b63b2c3179e6c1d0f8edadde56e45570ee8cf99394fbb738491d34b... Dataset sst downloaded and prepared to /home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/a16a45566b63b2c3179e6c1d0f8edadde56e45570ee8cf99394fbb738491d34b. Subsequent calls will reuse this data. executed [0, 1] #0: 0%| | 0/5 [00:00<?, ?ba/s] #1: 0%| | 0/5 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281] executed [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] executed [6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281] executed [3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009] executed [7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281] executed [4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009] #0: 100%|██████████| 5/5 [00:00<00:00, 94.83ba/s] executed [8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281] #1: 100%|██████████| 5/5 [00:00<00:00, 92.75ba/s] executed [0, 1] #0: 0%| | 0/1 [00:00<?, ?ba/s] #1: 0%| | 0/1 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [551, 552, 553, 554, 555, 556, 557, 558, 559, 560] #0: 100%|██████████| 1/1 [00:00<00:00, 118.81ba/s] #1: 100%|██████████| 1/1 [00:00<00:00, 123.06ba/s] executed [0, 1] #0: 0%| | 0/2 [00:00<?, ?ba/s] #1: 0%| | 0/2 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] #0: 100%|██████████| 2/2 [00:00<00:00, 119.42ba/s] executed [2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114] #1: 100%|██████████| 2/2 [00:00<00:00, 123.33ba/s] ############################## executed [0, 1] Loading cached processed dataset at /home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/a16a45566b63b2c3179e6c1d0f8edadde56e45570ee8cf99394fbb738491d34b/cache-6079777aa097c8f8.arrow Loading cached processed dataset at /home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/a16a45566b63b2c3179e6c1d0f8edadde56e45570ee8cf99394fbb738491d34b/cache-2dc05c46f68eda6e.arrow executed [0, 1] Loading cached processed dataset at /home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/a16a45566b63b2c3179e6c1d0f8edadde56e45570ee8cf99394fbb738491d34b/cache-1ca347e7430b98f1.arrow Loading cached processed dataset at /home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/a16a45566b63b2c3179e6c1d0f8edadde56e45570ee8cf99394fbb738491d34b/cache-c0f1a73ce3ba40cd.arrow executed [0, 1] Loading cached processed dataset at /home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/a16a45566b63b2c3179e6c1d0f8edadde56e45570ee8cf99394fbb738491d34b/cache-832a1407bf1ac5b7.arrow Loading cached processed dataset at /home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/a16a45566b63b2c3179e6c1d0f8edadde56e45570ee8cf99394fbb738491d34b/cache-036316a259b773c4.arrow - Datasets: 1.5.0 - Python: 3.8.3 (default, May 19 2020, 18:47:26) [GCC 7.3.0] - Platform: Linux-5.4.0-72-generic-x86_64-with-glibc2.10 ```
## Describe the bug Somehow caching does not work for me anymore. Am I doing something wrong, or is there anything that I missed? ## Steps to reproduce the bug ```python import datasets datasets.set_caching_enabled(True) sst = datasets.load_dataset("sst") def foo(samples, i): print("executed", i[:10]) return samples # first call x = sst.map(foo, batched=True, with_indices=True, num_proc=2) print('\n'*3, "#" * 30, '\n'*3) # second call y = sst.map(foo, batched=True, with_indices=True, num_proc=2) # print version import sys import platform print(f""" - Datasets: {datasets.__version__} - Python: {sys.version} - Platform: {platform.platform()} """) ``` ## Actual results This code prints the following output for me: ```bash No config specified, defaulting to: sst/default Reusing dataset sst (/home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/b8a7889ef01c5d3ae8c379b84cc4080f8aad3ac2bc538701cbe0ac6416fb76ff) #0: 0%| | 0/5 [00:00<?, ?ba/s] #1: 0%| | 0/5 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281] executed [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] executed [6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281] executed [3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009] executed [7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281] executed [4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009] #0: 100%|██████████| 5/5 [00:00<00:00, 59.85ba/s] executed [8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281] #1: 100%|██████████| 5/5 [00:00<00:00, 60.85ba/s] #0: 0%| | 0/1 [00:00<?, ?ba/s] #1: 0%| | 0/1 [00:00<?, ?ba/s]executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] #0: 100%|██████████| 1/1 [00:00<00:00, 69.32ba/s] executed [551, 552, 553, 554, 555, 556, 557, 558, 559, 560] #1: 100%|██████████| 1/1 [00:00<00:00, 70.93ba/s] #0: 0%| | 0/2 [00:00<?, ?ba/s] #1: 0%| | 0/2 [00:00<?, ?ba/s]executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] #0: 100%|██████████| 2/2 [00:00<00:00, 63.25ba/s] executed [1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114] executed [2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114] #1: 100%|██████████| 2/2 [00:00<00:00, 57.69ba/s] ############################## #0: 0%| | 0/5 [00:00<?, ?ba/s] #1: 0%| | 0/5 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281] executed [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] executed [6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281] executed [3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009] executed [4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009] #0: 100%|██████████| 5/5 [00:00<00:00, 58.10ba/s] executed [7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281] executed [8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281] #1: 100%|██████████| 5/5 [00:00<00:00, 57.19ba/s] #0: 0%| | 0/1 [00:00<?, ?ba/s] #1: 0%| | 0/1 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] #0: 100%|██████████| 1/1 [00:00<00:00, 60.10ba/s] executed [551, 552, 553, 554, 555, 556, 557, 558, 559, 560] #1: 100%|██████████| 1/1 [00:00<00:00, 53.82ba/s] #0: 0%| | 0/2 [00:00<?, ?ba/s] #1: 0%| | 0/2 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114] #0: 100%|██████████| 2/2 [00:00<00:00, 72.76ba/s] executed [2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114] #1: 100%|██████████| 2/2 [00:00<00:00, 71.55ba/s] - Datasets: 1.6.1 - Python: 3.8.3 (default, May 19 2020, 18:47:26) [GCC 7.3.0] - Platform: Linux-5.4.0-72-generic-x86_64-with-glibc2.10 ``` ## Expected results Caching should work.
387
Calls to map are not cached. ## Describe the bug Somehow caching does not work for me anymore. Am I doing something wrong, or is there anything that I missed? ## Steps to reproduce the bug ```python import datasets datasets.set_caching_enabled(True) sst = datasets.load_dataset("sst") def foo(samples, i): print("executed", i[:10]) return samples # first call x = sst.map(foo, batched=True, with_indices=True, num_proc=2) print('\n'*3, "#" * 30, '\n'*3) # second call y = sst.map(foo, batched=True, with_indices=True, num_proc=2) # print version import sys import platform print(f""" - Datasets: {datasets.__version__} - Python: {sys.version} - Platform: {platform.platform()} """) ``` ## Actual results This code prints the following output for me: ```bash No config specified, defaulting to: sst/default Reusing dataset sst (/home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/b8a7889ef01c5d3ae8c379b84cc4080f8aad3ac2bc538701cbe0ac6416fb76ff) #0: 0%| | 0/5 [00:00<?, ?ba/s] #1: 0%| | 0/5 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281] executed [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] executed [6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281] executed [3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009] executed [7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281] executed [4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009] #0: 100%|██████████| 5/5 [00:00<00:00, 59.85ba/s] executed [8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281] #1: 100%|██████████| 5/5 [00:00<00:00, 60.85ba/s] #0: 0%| | 0/1 [00:00<?, ?ba/s] #1: 0%| | 0/1 [00:00<?, ?ba/s]executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] #0: 100%|██████████| 1/1 [00:00<00:00, 69.32ba/s] executed [551, 552, 553, 554, 555, 556, 557, 558, 559, 560] #1: 100%|██████████| 1/1 [00:00<00:00, 70.93ba/s] #0: 0%| | 0/2 [00:00<?, ?ba/s] #1: 0%| | 0/2 [00:00<?, ?ba/s]executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] #0: 100%|██████████| 2/2 [00:00<00:00, 63.25ba/s] executed [1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114] executed [2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114] #1: 100%|██████████| 2/2 [00:00<00:00, 57.69ba/s] ############################## #0: 0%| | 0/5 [00:00<?, ?ba/s] #1: 0%| | 0/5 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281] executed [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] executed [6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281] executed [3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009] executed [4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009] #0: 100%|██████████| 5/5 [00:00<00:00, 58.10ba/s] executed [7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281] executed [8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281] #1: 100%|██████████| 5/5 [00:00<00:00, 57.19ba/s] #0: 0%| | 0/1 [00:00<?, ?ba/s] #1: 0%| | 0/1 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] #0: 100%|██████████| 1/1 [00:00<00:00, 60.10ba/s] executed [551, 552, 553, 554, 555, 556, 557, 558, 559, 560] #1: 100%|██████████| 1/1 [00:00<00:00, 53.82ba/s] #0: 0%| | 0/2 [00:00<?, ?ba/s] #1: 0%| | 0/2 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114] #0: 100%|██████████| 2/2 [00:00<00:00, 72.76ba/s] executed [2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114] #1: 100%|██████████| 2/2 [00:00<00:00, 71.55ba/s] - Datasets: 1.6.1 - Python: 3.8.3 (default, May 19 2020, 18:47:26) [GCC 7.3.0] - Platform: Linux-5.4.0-72-generic-x86_64-with-glibc2.10 ``` ## Expected results Caching should work. I tried upgrading to `datasets==1.6.2` and downgrading to `1.6.0`. Both versions produce the same output. Downgrading to `1.5.0` works and produces the following output for me: ```bash Downloading: 9.20kB [00:00, 3.94MB/s] Downloading: 5.99kB [00:00, 3.29MB/s] No config specified, defaulting to: sst/default Downloading and preparing dataset sst/default (download: 6.83 MiB, generated: 3.73 MiB, post-processed: Unknown size, total: 10.56 MiB) to /home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/a16a45566b63b2c3179e6c1d0f8edadde56e45570ee8cf99394fbb738491d34b... Dataset sst downloaded and prepared to /home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/a16a45566b63b2c3179e6c1d0f8edadde56e45570ee8cf99394fbb738491d34b. Subsequent calls will reuse this data. executed [0, 1] #0: 0%| | 0/5 [00:00<?, ?ba/s] #1: 0%| | 0/5 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281] executed [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] executed [6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281] executed [3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009] executed [7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281] executed [4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009] #0: 100%|██████████| 5/5 [00:00<00:00, 94.83ba/s] executed [8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281] #1: 100%|██████████| 5/5 [00:00<00:00, 92.75ba/s] executed [0, 1] #0: 0%| | 0/1 [00:00<?, ?ba/s] #1: 0%| | 0/1 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [551, 552, 553, 554, 555, 556, 557, 558, 559, 560] #0: 100%|██████████| 1/1 [00:00<00:00, 118.81ba/s] #1: 100%|██████████| 1/1 [00:00<00:00, 123.06ba/s] executed [0, 1] #0: 0%| | 0/2 [00:00<?, ?ba/s] #1: 0%| | 0/2 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] #0: 100%|██████████| 2/2 [00:00<00:00, 119.42ba/s] executed [2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114] #1: 100%|██████████| 2/2 [00:00<00:00, 123.33ba/s] ############################## executed [0, 1] Loading cached processed dataset at /home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/a16a45566b63b2c3179e6c1d0f8edadde56e45570ee8cf99394fbb738491d34b/cache-6079777aa097c8f8.arrow Loading cached processed dataset at /home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/a16a45566b63b2c3179e6c1d0f8edadde56e45570ee8cf99394fbb738491d34b/cache-2dc05c46f68eda6e.arrow executed [0, 1] Loading cached processed dataset at /home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/a16a45566b63b2c3179e6c1d0f8edadde56e45570ee8cf99394fbb738491d34b/cache-1ca347e7430b98f1.arrow Loading cached processed dataset at /home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/a16a45566b63b2c3179e6c1d0f8edadde56e45570ee8cf99394fbb738491d34b/cache-c0f1a73ce3ba40cd.arrow executed [0, 1] Loading cached processed dataset at /home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/a16a45566b63b2c3179e6c1d0f8edadde56e45570ee8cf99394fbb738491d34b/cache-832a1407bf1ac5b7.arrow Loading cached processed dataset at /home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/a16a45566b63b2c3179e6c1d0f8edadde56e45570ee8cf99394fbb738491d34b/cache-036316a259b773c4.arrow - Datasets: 1.5.0 - Python: 3.8.3 (default, May 19 2020, 18:47:26) [GCC 7.3.0] - Platform: Linux-5.4.0-72-generic-x86_64-with-glibc2.10 ```
https://github.com/huggingface/datasets/issues/2322
Calls to map are not cached.
Hi, set `keep_in_memory` to False when loading a dataset (`sst = load_dataset("sst", keep_in_memory=False)`) to prevent it from loading in-memory. Currently, in-memory datasets fail to find cached files due to this check (always False for them): https://github.com/huggingface/datasets/blob/241a0b4a3a868778ee91e767ad406f9da7610df2/src/datasets/arrow_dataset.py#L1718 @albertvillanova It seems like this behavior was overlooked in #2182.
## Describe the bug Somehow caching does not work for me anymore. Am I doing something wrong, or is there anything that I missed? ## Steps to reproduce the bug ```python import datasets datasets.set_caching_enabled(True) sst = datasets.load_dataset("sst") def foo(samples, i): print("executed", i[:10]) return samples # first call x = sst.map(foo, batched=True, with_indices=True, num_proc=2) print('\n'*3, "#" * 30, '\n'*3) # second call y = sst.map(foo, batched=True, with_indices=True, num_proc=2) # print version import sys import platform print(f""" - Datasets: {datasets.__version__} - Python: {sys.version} - Platform: {platform.platform()} """) ``` ## Actual results This code prints the following output for me: ```bash No config specified, defaulting to: sst/default Reusing dataset sst (/home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/b8a7889ef01c5d3ae8c379b84cc4080f8aad3ac2bc538701cbe0ac6416fb76ff) #0: 0%| | 0/5 [00:00<?, ?ba/s] #1: 0%| | 0/5 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281] executed [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] executed [6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281] executed [3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009] executed [7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281] executed [4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009] #0: 100%|██████████| 5/5 [00:00<00:00, 59.85ba/s] executed [8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281] #1: 100%|██████████| 5/5 [00:00<00:00, 60.85ba/s] #0: 0%| | 0/1 [00:00<?, ?ba/s] #1: 0%| | 0/1 [00:00<?, ?ba/s]executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] #0: 100%|██████████| 1/1 [00:00<00:00, 69.32ba/s] executed [551, 552, 553, 554, 555, 556, 557, 558, 559, 560] #1: 100%|██████████| 1/1 [00:00<00:00, 70.93ba/s] #0: 0%| | 0/2 [00:00<?, ?ba/s] #1: 0%| | 0/2 [00:00<?, ?ba/s]executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] #0: 100%|██████████| 2/2 [00:00<00:00, 63.25ba/s] executed [1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114] executed [2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114] #1: 100%|██████████| 2/2 [00:00<00:00, 57.69ba/s] ############################## #0: 0%| | 0/5 [00:00<?, ?ba/s] #1: 0%| | 0/5 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281] executed [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] executed [6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281] executed [3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009] executed [4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009] #0: 100%|██████████| 5/5 [00:00<00:00, 58.10ba/s] executed [7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281] executed [8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281] #1: 100%|██████████| 5/5 [00:00<00:00, 57.19ba/s] #0: 0%| | 0/1 [00:00<?, ?ba/s] #1: 0%| | 0/1 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] #0: 100%|██████████| 1/1 [00:00<00:00, 60.10ba/s] executed [551, 552, 553, 554, 555, 556, 557, 558, 559, 560] #1: 100%|██████████| 1/1 [00:00<00:00, 53.82ba/s] #0: 0%| | 0/2 [00:00<?, ?ba/s] #1: 0%| | 0/2 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114] #0: 100%|██████████| 2/2 [00:00<00:00, 72.76ba/s] executed [2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114] #1: 100%|██████████| 2/2 [00:00<00:00, 71.55ba/s] - Datasets: 1.6.1 - Python: 3.8.3 (default, May 19 2020, 18:47:26) [GCC 7.3.0] - Platform: Linux-5.4.0-72-generic-x86_64-with-glibc2.10 ``` ## Expected results Caching should work.
46
Calls to map are not cached. ## Describe the bug Somehow caching does not work for me anymore. Am I doing something wrong, or is there anything that I missed? ## Steps to reproduce the bug ```python import datasets datasets.set_caching_enabled(True) sst = datasets.load_dataset("sst") def foo(samples, i): print("executed", i[:10]) return samples # first call x = sst.map(foo, batched=True, with_indices=True, num_proc=2) print('\n'*3, "#" * 30, '\n'*3) # second call y = sst.map(foo, batched=True, with_indices=True, num_proc=2) # print version import sys import platform print(f""" - Datasets: {datasets.__version__} - Python: {sys.version} - Platform: {platform.platform()} """) ``` ## Actual results This code prints the following output for me: ```bash No config specified, defaulting to: sst/default Reusing dataset sst (/home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/b8a7889ef01c5d3ae8c379b84cc4080f8aad3ac2bc538701cbe0ac6416fb76ff) #0: 0%| | 0/5 [00:00<?, ?ba/s] #1: 0%| | 0/5 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281] executed [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] executed [6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281] executed [3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009] executed [7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281] executed [4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009] #0: 100%|██████████| 5/5 [00:00<00:00, 59.85ba/s] executed [8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281] #1: 100%|██████████| 5/5 [00:00<00:00, 60.85ba/s] #0: 0%| | 0/1 [00:00<?, ?ba/s] #1: 0%| | 0/1 [00:00<?, ?ba/s]executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] #0: 100%|██████████| 1/1 [00:00<00:00, 69.32ba/s] executed [551, 552, 553, 554, 555, 556, 557, 558, 559, 560] #1: 100%|██████████| 1/1 [00:00<00:00, 70.93ba/s] #0: 0%| | 0/2 [00:00<?, ?ba/s] #1: 0%| | 0/2 [00:00<?, ?ba/s]executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] #0: 100%|██████████| 2/2 [00:00<00:00, 63.25ba/s] executed [1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114] executed [2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114] #1: 100%|██████████| 2/2 [00:00<00:00, 57.69ba/s] ############################## #0: 0%| | 0/5 [00:00<?, ?ba/s] #1: 0%| | 0/5 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281] executed [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] executed [6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281] executed [3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009] executed [4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009] #0: 100%|██████████| 5/5 [00:00<00:00, 58.10ba/s] executed [7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281] executed [8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281] #1: 100%|██████████| 5/5 [00:00<00:00, 57.19ba/s] #0: 0%| | 0/1 [00:00<?, ?ba/s] #1: 0%| | 0/1 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] #0: 100%|██████████| 1/1 [00:00<00:00, 60.10ba/s] executed [551, 552, 553, 554, 555, 556, 557, 558, 559, 560] #1: 100%|██████████| 1/1 [00:00<00:00, 53.82ba/s] #0: 0%| | 0/2 [00:00<?, ?ba/s] #1: 0%| | 0/2 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114] #0: 100%|██████████| 2/2 [00:00<00:00, 72.76ba/s] executed [2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114] #1: 100%|██████████| 2/2 [00:00<00:00, 71.55ba/s] - Datasets: 1.6.1 - Python: 3.8.3 (default, May 19 2020, 18:47:26) [GCC 7.3.0] - Platform: Linux-5.4.0-72-generic-x86_64-with-glibc2.10 ``` ## Expected results Caching should work. Hi, set `keep_in_memory` to False when loading a dataset (`sst = load_dataset("sst", keep_in_memory=False)`) to prevent it from loading in-memory. Currently, in-memory datasets fail to find cached files due to this check (always False for them): https://github.com/huggingface/datasets/blob/241a0b4a3a868778ee91e767ad406f9da7610df2/src/datasets/arrow_dataset.py#L1718 @albertvillanova It seems like this behavior was overlooked in #2182.
https://github.com/huggingface/datasets/issues/2322
Calls to map are not cached.
Hi @villmow, thanks for reporting. As @mariosasko has pointed out, we did not consider this case when introducing the feature of automatic in-memory for small datasets. This needs to be fixed.
## Describe the bug Somehow caching does not work for me anymore. Am I doing something wrong, or is there anything that I missed? ## Steps to reproduce the bug ```python import datasets datasets.set_caching_enabled(True) sst = datasets.load_dataset("sst") def foo(samples, i): print("executed", i[:10]) return samples # first call x = sst.map(foo, batched=True, with_indices=True, num_proc=2) print('\n'*3, "#" * 30, '\n'*3) # second call y = sst.map(foo, batched=True, with_indices=True, num_proc=2) # print version import sys import platform print(f""" - Datasets: {datasets.__version__} - Python: {sys.version} - Platform: {platform.platform()} """) ``` ## Actual results This code prints the following output for me: ```bash No config specified, defaulting to: sst/default Reusing dataset sst (/home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/b8a7889ef01c5d3ae8c379b84cc4080f8aad3ac2bc538701cbe0ac6416fb76ff) #0: 0%| | 0/5 [00:00<?, ?ba/s] #1: 0%| | 0/5 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281] executed [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] executed [6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281] executed [3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009] executed [7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281] executed [4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009] #0: 100%|██████████| 5/5 [00:00<00:00, 59.85ba/s] executed [8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281] #1: 100%|██████████| 5/5 [00:00<00:00, 60.85ba/s] #0: 0%| | 0/1 [00:00<?, ?ba/s] #1: 0%| | 0/1 [00:00<?, ?ba/s]executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] #0: 100%|██████████| 1/1 [00:00<00:00, 69.32ba/s] executed [551, 552, 553, 554, 555, 556, 557, 558, 559, 560] #1: 100%|██████████| 1/1 [00:00<00:00, 70.93ba/s] #0: 0%| | 0/2 [00:00<?, ?ba/s] #1: 0%| | 0/2 [00:00<?, ?ba/s]executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] #0: 100%|██████████| 2/2 [00:00<00:00, 63.25ba/s] executed [1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114] executed [2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114] #1: 100%|██████████| 2/2 [00:00<00:00, 57.69ba/s] ############################## #0: 0%| | 0/5 [00:00<?, ?ba/s] #1: 0%| | 0/5 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281] executed [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] executed [6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281] executed [3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009] executed [4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009] #0: 100%|██████████| 5/5 [00:00<00:00, 58.10ba/s] executed [7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281] executed [8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281] #1: 100%|██████████| 5/5 [00:00<00:00, 57.19ba/s] #0: 0%| | 0/1 [00:00<?, ?ba/s] #1: 0%| | 0/1 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] #0: 100%|██████████| 1/1 [00:00<00:00, 60.10ba/s] executed [551, 552, 553, 554, 555, 556, 557, 558, 559, 560] #1: 100%|██████████| 1/1 [00:00<00:00, 53.82ba/s] #0: 0%| | 0/2 [00:00<?, ?ba/s] #1: 0%| | 0/2 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114] #0: 100%|██████████| 2/2 [00:00<00:00, 72.76ba/s] executed [2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114] #1: 100%|██████████| 2/2 [00:00<00:00, 71.55ba/s] - Datasets: 1.6.1 - Python: 3.8.3 (default, May 19 2020, 18:47:26) [GCC 7.3.0] - Platform: Linux-5.4.0-72-generic-x86_64-with-glibc2.10 ``` ## Expected results Caching should work.
31
Calls to map are not cached. ## Describe the bug Somehow caching does not work for me anymore. Am I doing something wrong, or is there anything that I missed? ## Steps to reproduce the bug ```python import datasets datasets.set_caching_enabled(True) sst = datasets.load_dataset("sst") def foo(samples, i): print("executed", i[:10]) return samples # first call x = sst.map(foo, batched=True, with_indices=True, num_proc=2) print('\n'*3, "#" * 30, '\n'*3) # second call y = sst.map(foo, batched=True, with_indices=True, num_proc=2) # print version import sys import platform print(f""" - Datasets: {datasets.__version__} - Python: {sys.version} - Platform: {platform.platform()} """) ``` ## Actual results This code prints the following output for me: ```bash No config specified, defaulting to: sst/default Reusing dataset sst (/home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/b8a7889ef01c5d3ae8c379b84cc4080f8aad3ac2bc538701cbe0ac6416fb76ff) #0: 0%| | 0/5 [00:00<?, ?ba/s] #1: 0%| | 0/5 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281] executed [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] executed [6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281] executed [3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009] executed [7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281] executed [4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009] #0: 100%|██████████| 5/5 [00:00<00:00, 59.85ba/s] executed [8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281] #1: 100%|██████████| 5/5 [00:00<00:00, 60.85ba/s] #0: 0%| | 0/1 [00:00<?, ?ba/s] #1: 0%| | 0/1 [00:00<?, ?ba/s]executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] #0: 100%|██████████| 1/1 [00:00<00:00, 69.32ba/s] executed [551, 552, 553, 554, 555, 556, 557, 558, 559, 560] #1: 100%|██████████| 1/1 [00:00<00:00, 70.93ba/s] #0: 0%| | 0/2 [00:00<?, ?ba/s] #1: 0%| | 0/2 [00:00<?, ?ba/s]executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] #0: 100%|██████████| 2/2 [00:00<00:00, 63.25ba/s] executed [1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114] executed [2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114] #1: 100%|██████████| 2/2 [00:00<00:00, 57.69ba/s] ############################## #0: 0%| | 0/5 [00:00<?, ?ba/s] #1: 0%| | 0/5 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281] executed [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] executed [6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281] executed [3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009] executed [4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009] #0: 100%|██████████| 5/5 [00:00<00:00, 58.10ba/s] executed [7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281] executed [8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281] #1: 100%|██████████| 5/5 [00:00<00:00, 57.19ba/s] #0: 0%| | 0/1 [00:00<?, ?ba/s] #1: 0%| | 0/1 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] #0: 100%|██████████| 1/1 [00:00<00:00, 60.10ba/s] executed [551, 552, 553, 554, 555, 556, 557, 558, 559, 560] #1: 100%|██████████| 1/1 [00:00<00:00, 53.82ba/s] #0: 0%| | 0/2 [00:00<?, ?ba/s] #1: 0%| | 0/2 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114] #0: 100%|██████████| 2/2 [00:00<00:00, 72.76ba/s] executed [2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114] #1: 100%|██████████| 2/2 [00:00<00:00, 71.55ba/s] - Datasets: 1.6.1 - Python: 3.8.3 (default, May 19 2020, 18:47:26) [GCC 7.3.0] - Platform: Linux-5.4.0-72-generic-x86_64-with-glibc2.10 ``` ## Expected results Caching should work. Hi @villmow, thanks for reporting. As @mariosasko has pointed out, we did not consider this case when introducing the feature of automatic in-memory for small datasets. This needs to be fixed.
https://github.com/huggingface/datasets/issues/2322
Calls to map are not cached.
Hi ! Currently a dataset that is in memory doesn't know doesn't know in which directory it has to read/write cache files. On the other hand, a dataset that loaded from the disk (via memory mapping) uses the directory from which the dataset is located to read/write cache files. Because of that, currently in-memory datasets simply don't use caching. Maybe a Dataset object could have a `cache_dir` that is set to the directory where the arrow files are created during `load_dataset` ?
## Describe the bug Somehow caching does not work for me anymore. Am I doing something wrong, or is there anything that I missed? ## Steps to reproduce the bug ```python import datasets datasets.set_caching_enabled(True) sst = datasets.load_dataset("sst") def foo(samples, i): print("executed", i[:10]) return samples # first call x = sst.map(foo, batched=True, with_indices=True, num_proc=2) print('\n'*3, "#" * 30, '\n'*3) # second call y = sst.map(foo, batched=True, with_indices=True, num_proc=2) # print version import sys import platform print(f""" - Datasets: {datasets.__version__} - Python: {sys.version} - Platform: {platform.platform()} """) ``` ## Actual results This code prints the following output for me: ```bash No config specified, defaulting to: sst/default Reusing dataset sst (/home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/b8a7889ef01c5d3ae8c379b84cc4080f8aad3ac2bc538701cbe0ac6416fb76ff) #0: 0%| | 0/5 [00:00<?, ?ba/s] #1: 0%| | 0/5 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281] executed [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] executed [6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281] executed [3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009] executed [7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281] executed [4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009] #0: 100%|██████████| 5/5 [00:00<00:00, 59.85ba/s] executed [8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281] #1: 100%|██████████| 5/5 [00:00<00:00, 60.85ba/s] #0: 0%| | 0/1 [00:00<?, ?ba/s] #1: 0%| | 0/1 [00:00<?, ?ba/s]executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] #0: 100%|██████████| 1/1 [00:00<00:00, 69.32ba/s] executed [551, 552, 553, 554, 555, 556, 557, 558, 559, 560] #1: 100%|██████████| 1/1 [00:00<00:00, 70.93ba/s] #0: 0%| | 0/2 [00:00<?, ?ba/s] #1: 0%| | 0/2 [00:00<?, ?ba/s]executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] #0: 100%|██████████| 2/2 [00:00<00:00, 63.25ba/s] executed [1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114] executed [2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114] #1: 100%|██████████| 2/2 [00:00<00:00, 57.69ba/s] ############################## #0: 0%| | 0/5 [00:00<?, ?ba/s] #1: 0%| | 0/5 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281] executed [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] executed [6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281] executed [3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009] executed [4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009] #0: 100%|██████████| 5/5 [00:00<00:00, 58.10ba/s] executed [7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281] executed [8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281] #1: 100%|██████████| 5/5 [00:00<00:00, 57.19ba/s] #0: 0%| | 0/1 [00:00<?, ?ba/s] #1: 0%| | 0/1 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] #0: 100%|██████████| 1/1 [00:00<00:00, 60.10ba/s] executed [551, 552, 553, 554, 555, 556, 557, 558, 559, 560] #1: 100%|██████████| 1/1 [00:00<00:00, 53.82ba/s] #0: 0%| | 0/2 [00:00<?, ?ba/s] #1: 0%| | 0/2 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114] #0: 100%|██████████| 2/2 [00:00<00:00, 72.76ba/s] executed [2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114] #1: 100%|██████████| 2/2 [00:00<00:00, 71.55ba/s] - Datasets: 1.6.1 - Python: 3.8.3 (default, May 19 2020, 18:47:26) [GCC 7.3.0] - Platform: Linux-5.4.0-72-generic-x86_64-with-glibc2.10 ``` ## Expected results Caching should work.
82
Calls to map are not cached. ## Describe the bug Somehow caching does not work for me anymore. Am I doing something wrong, or is there anything that I missed? ## Steps to reproduce the bug ```python import datasets datasets.set_caching_enabled(True) sst = datasets.load_dataset("sst") def foo(samples, i): print("executed", i[:10]) return samples # first call x = sst.map(foo, batched=True, with_indices=True, num_proc=2) print('\n'*3, "#" * 30, '\n'*3) # second call y = sst.map(foo, batched=True, with_indices=True, num_proc=2) # print version import sys import platform print(f""" - Datasets: {datasets.__version__} - Python: {sys.version} - Platform: {platform.platform()} """) ``` ## Actual results This code prints the following output for me: ```bash No config specified, defaulting to: sst/default Reusing dataset sst (/home/johannes/.cache/huggingface/datasets/sst/default/1.0.0/b8a7889ef01c5d3ae8c379b84cc4080f8aad3ac2bc538701cbe0ac6416fb76ff) #0: 0%| | 0/5 [00:00<?, ?ba/s] #1: 0%| | 0/5 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281] executed [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] executed [6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281] executed [3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009] executed [7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281] executed [4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009] #0: 100%|██████████| 5/5 [00:00<00:00, 59.85ba/s] executed [8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281] #1: 100%|██████████| 5/5 [00:00<00:00, 60.85ba/s] #0: 0%| | 0/1 [00:00<?, ?ba/s] #1: 0%| | 0/1 [00:00<?, ?ba/s]executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] #0: 100%|██████████| 1/1 [00:00<00:00, 69.32ba/s] executed [551, 552, 553, 554, 555, 556, 557, 558, 559, 560] #1: 100%|██████████| 1/1 [00:00<00:00, 70.93ba/s] #0: 0%| | 0/2 [00:00<?, ?ba/s] #1: 0%| | 0/2 [00:00<?, ?ba/s]executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] #0: 100%|██████████| 2/2 [00:00<00:00, 63.25ba/s] executed [1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114] executed [2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114] #1: 100%|██████████| 2/2 [00:00<00:00, 57.69ba/s] ############################## #0: 0%| | 0/5 [00:00<?, ?ba/s] #1: 0%| | 0/5 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [4272, 4273, 4274, 4275, 4276, 4277, 4278, 4279, 4280, 4281] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [5272, 5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281] executed [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009] executed [6272, 6273, 6274, 6275, 6276, 6277, 6278, 6279, 6280, 6281] executed [3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009] executed [4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009] #0: 100%|██████████| 5/5 [00:00<00:00, 58.10ba/s] executed [7272, 7273, 7274, 7275, 7276, 7277, 7278, 7279, 7280, 7281] executed [8272, 8273, 8274, 8275, 8276, 8277, 8278, 8279, 8280, 8281] #1: 100%|██████████| 5/5 [00:00<00:00, 57.19ba/s] #0: 0%| | 0/1 [00:00<?, ?ba/s] #1: 0%| | 0/1 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] #0: 100%|██████████| 1/1 [00:00<00:00, 60.10ba/s] executed [551, 552, 553, 554, 555, 556, 557, 558, 559, 560] #1: 100%|██████████| 1/1 [00:00<00:00, 53.82ba/s] #0: 0%| | 0/2 [00:00<?, ?ba/s] #1: 0%| | 0/2 [00:00<?, ?ba/s] executed [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] executed [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009] executed [1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114] #0: 100%|██████████| 2/2 [00:00<00:00, 72.76ba/s] executed [2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114] #1: 100%|██████████| 2/2 [00:00<00:00, 71.55ba/s] - Datasets: 1.6.1 - Python: 3.8.3 (default, May 19 2020, 18:47:26) [GCC 7.3.0] - Platform: Linux-5.4.0-72-generic-x86_64-with-glibc2.10 ``` ## Expected results Caching should work. Hi ! Currently a dataset that is in memory doesn't know doesn't know in which directory it has to read/write cache files. On the other hand, a dataset that loaded from the disk (via memory mapping) uses the directory from which the dataset is located to read/write cache files. Because of that, currently in-memory datasets simply don't use caching. Maybe a Dataset object could have a `cache_dir` that is set to the directory where the arrow files are created during `load_dataset` ?
https://github.com/huggingface/datasets/issues/2319
UnicodeDecodeError for OSCAR (Afrikaans)
Thanks for reporting, @sgraaf. I am going to have a look at it. I guess the expected codec is "UTF-8". Normally, when no explicitly codec is passed, Python uses one which is platform-dependent. For Linux machines, the default codec is `utf_8`, which is OK. However for Windows machine, the default codec is `cp1252`, which causes the problem.
## Describe the bug When loading the [OSCAR dataset](https://huggingface.co/datasets/oscar) (specifically `unshuffled_deduplicated_af`), I encounter a `UnicodeDecodeError`. ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("oscar", "unshuffled_deduplicated_af") ``` ## Expected results Anything but an error, really. ## Actual results ```python >>> from datasets import load_dataset >>> dataset = load_dataset("oscar", "unshuffled_deduplicated_af") Downloading: 14.7kB [00:00, 4.91MB/s] Downloading: 3.07MB [00:00, 32.6MB/s] Downloading and preparing dataset oscar/unshuffled_deduplicated_af (download: 62.93 MiB, generated: 163.38 MiB, post-processed: Unknown size, total: 226.32 MiB) to C:\Users\sgraaf\.cache\huggingface\datasets\oscar\unshuffled_deduplicated_af\1.0.0\bd4f96df5b4512007ef9fd17bbc1ecde459fa53d2fc0049cf99392ba2efcc464... Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 81.0/81.0 [00:00<00:00, 40.5kB/s] Downloading: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 66.0M/66.0M [00:18<00:00, 3.50MB/s] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\datasets\load.py", line 745, in load_dataset builder_instance.download_and_prepare( File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\datasets\builder.py", line 574, in download_and_prepare self._download_and_prepare( File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\datasets\builder.py", line 652, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\datasets\builder.py", line 979, in _prepare_split for key, record in utils.tqdm( File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\tqdm\std.py", line 1133, in __iter__ for obj in iterable: File "C:\Users\sgraaf\.cache\huggingface\modules\datasets_modules\datasets\oscar\bd4f96df5b4512007ef9fd17bbc1ecde459fa53d2fc0049cf99392ba2efcc464\oscar.py", line 359, in _generate_examples for line in f: File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 7454: character maps to <undefined> ``` ## Versions Paste the output of the following code: ```python import datasets import sys import platform print(f""" - Datasets: {datasets.__version__} - Python: {sys.version} - Platform: {platform.platform()} """) ``` - Datasets: 1.6.2 - Python: 3.9.4 (tags/v3.9.4:1f2e308, Apr 6 2021, 13:40:21) [MSC v.1928 64 bit (AMD64)] - Platform: Windows-10-10.0.19041-SP0
57
UnicodeDecodeError for OSCAR (Afrikaans) ## Describe the bug When loading the [OSCAR dataset](https://huggingface.co/datasets/oscar) (specifically `unshuffled_deduplicated_af`), I encounter a `UnicodeDecodeError`. ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("oscar", "unshuffled_deduplicated_af") ``` ## Expected results Anything but an error, really. ## Actual results ```python >>> from datasets import load_dataset >>> dataset = load_dataset("oscar", "unshuffled_deduplicated_af") Downloading: 14.7kB [00:00, 4.91MB/s] Downloading: 3.07MB [00:00, 32.6MB/s] Downloading and preparing dataset oscar/unshuffled_deduplicated_af (download: 62.93 MiB, generated: 163.38 MiB, post-processed: Unknown size, total: 226.32 MiB) to C:\Users\sgraaf\.cache\huggingface\datasets\oscar\unshuffled_deduplicated_af\1.0.0\bd4f96df5b4512007ef9fd17bbc1ecde459fa53d2fc0049cf99392ba2efcc464... Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 81.0/81.0 [00:00<00:00, 40.5kB/s] Downloading: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 66.0M/66.0M [00:18<00:00, 3.50MB/s] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\datasets\load.py", line 745, in load_dataset builder_instance.download_and_prepare( File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\datasets\builder.py", line 574, in download_and_prepare self._download_and_prepare( File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\datasets\builder.py", line 652, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\datasets\builder.py", line 979, in _prepare_split for key, record in utils.tqdm( File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\tqdm\std.py", line 1133, in __iter__ for obj in iterable: File "C:\Users\sgraaf\.cache\huggingface\modules\datasets_modules\datasets\oscar\bd4f96df5b4512007ef9fd17bbc1ecde459fa53d2fc0049cf99392ba2efcc464\oscar.py", line 359, in _generate_examples for line in f: File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 7454: character maps to <undefined> ``` ## Versions Paste the output of the following code: ```python import datasets import sys import platform print(f""" - Datasets: {datasets.__version__} - Python: {sys.version} - Platform: {platform.platform()} """) ``` - Datasets: 1.6.2 - Python: 3.9.4 (tags/v3.9.4:1f2e308, Apr 6 2021, 13:40:21) [MSC v.1928 64 bit (AMD64)] - Platform: Windows-10-10.0.19041-SP0 Thanks for reporting, @sgraaf. I am going to have a look at it. I guess the expected codec is "UTF-8". Normally, when no explicitly codec is passed, Python uses one which is platform-dependent. For Linux machines, the default codec is `utf_8`, which is OK. However for Windows machine, the default codec is `cp1252`, which causes the problem.
https://github.com/huggingface/datasets/issues/2319
UnicodeDecodeError for OSCAR (Afrikaans)
@sgraaf, I have just merged the fix in the master branch. You can either: - install `datasets` from source code - wait until we make the next release of `datasets` - set the `utf-8` codec as your default instead of `cp1252`. This can be done by activating the Python [UTF-8 mode](https://www.python.org/dev/peps/pep-0540) either by passing the command-line option `-X utf8` or by setting the environment variable `PYTHONUTF8=1`.
## Describe the bug When loading the [OSCAR dataset](https://huggingface.co/datasets/oscar) (specifically `unshuffled_deduplicated_af`), I encounter a `UnicodeDecodeError`. ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("oscar", "unshuffled_deduplicated_af") ``` ## Expected results Anything but an error, really. ## Actual results ```python >>> from datasets import load_dataset >>> dataset = load_dataset("oscar", "unshuffled_deduplicated_af") Downloading: 14.7kB [00:00, 4.91MB/s] Downloading: 3.07MB [00:00, 32.6MB/s] Downloading and preparing dataset oscar/unshuffled_deduplicated_af (download: 62.93 MiB, generated: 163.38 MiB, post-processed: Unknown size, total: 226.32 MiB) to C:\Users\sgraaf\.cache\huggingface\datasets\oscar\unshuffled_deduplicated_af\1.0.0\bd4f96df5b4512007ef9fd17bbc1ecde459fa53d2fc0049cf99392ba2efcc464... Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 81.0/81.0 [00:00<00:00, 40.5kB/s] Downloading: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 66.0M/66.0M [00:18<00:00, 3.50MB/s] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\datasets\load.py", line 745, in load_dataset builder_instance.download_and_prepare( File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\datasets\builder.py", line 574, in download_and_prepare self._download_and_prepare( File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\datasets\builder.py", line 652, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\datasets\builder.py", line 979, in _prepare_split for key, record in utils.tqdm( File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\tqdm\std.py", line 1133, in __iter__ for obj in iterable: File "C:\Users\sgraaf\.cache\huggingface\modules\datasets_modules\datasets\oscar\bd4f96df5b4512007ef9fd17bbc1ecde459fa53d2fc0049cf99392ba2efcc464\oscar.py", line 359, in _generate_examples for line in f: File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 7454: character maps to <undefined> ``` ## Versions Paste the output of the following code: ```python import datasets import sys import platform print(f""" - Datasets: {datasets.__version__} - Python: {sys.version} - Platform: {platform.platform()} """) ``` - Datasets: 1.6.2 - Python: 3.9.4 (tags/v3.9.4:1f2e308, Apr 6 2021, 13:40:21) [MSC v.1928 64 bit (AMD64)] - Platform: Windows-10-10.0.19041-SP0
66
UnicodeDecodeError for OSCAR (Afrikaans) ## Describe the bug When loading the [OSCAR dataset](https://huggingface.co/datasets/oscar) (specifically `unshuffled_deduplicated_af`), I encounter a `UnicodeDecodeError`. ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("oscar", "unshuffled_deduplicated_af") ``` ## Expected results Anything but an error, really. ## Actual results ```python >>> from datasets import load_dataset >>> dataset = load_dataset("oscar", "unshuffled_deduplicated_af") Downloading: 14.7kB [00:00, 4.91MB/s] Downloading: 3.07MB [00:00, 32.6MB/s] Downloading and preparing dataset oscar/unshuffled_deduplicated_af (download: 62.93 MiB, generated: 163.38 MiB, post-processed: Unknown size, total: 226.32 MiB) to C:\Users\sgraaf\.cache\huggingface\datasets\oscar\unshuffled_deduplicated_af\1.0.0\bd4f96df5b4512007ef9fd17bbc1ecde459fa53d2fc0049cf99392ba2efcc464... Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 81.0/81.0 [00:00<00:00, 40.5kB/s] Downloading: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 66.0M/66.0M [00:18<00:00, 3.50MB/s] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\datasets\load.py", line 745, in load_dataset builder_instance.download_and_prepare( File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\datasets\builder.py", line 574, in download_and_prepare self._download_and_prepare( File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\datasets\builder.py", line 652, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\datasets\builder.py", line 979, in _prepare_split for key, record in utils.tqdm( File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\site-packages\tqdm\std.py", line 1133, in __iter__ for obj in iterable: File "C:\Users\sgraaf\.cache\huggingface\modules\datasets_modules\datasets\oscar\bd4f96df5b4512007ef9fd17bbc1ecde459fa53d2fc0049cf99392ba2efcc464\oscar.py", line 359, in _generate_examples for line in f: File "C:\Users\sgraaf\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 7454: character maps to <undefined> ``` ## Versions Paste the output of the following code: ```python import datasets import sys import platform print(f""" - Datasets: {datasets.__version__} - Python: {sys.version} - Platform: {platform.platform()} """) ``` - Datasets: 1.6.2 - Python: 3.9.4 (tags/v3.9.4:1f2e308, Apr 6 2021, 13:40:21) [MSC v.1928 64 bit (AMD64)] - Platform: Windows-10-10.0.19041-SP0 @sgraaf, I have just merged the fix in the master branch. You can either: - install `datasets` from source code - wait until we make the next release of `datasets` - set the `utf-8` codec as your default instead of `cp1252`. This can be done by activating the Python [UTF-8 mode](https://www.python.org/dev/peps/pep-0540) either by passing the command-line option `-X utf8` or by setting the environment variable `PYTHONUTF8=1`.
https://github.com/huggingface/datasets/issues/2318
[api request] API to obtain "dataset_module" dynamic path?
Hi @richardliaw, First, thanks for the compliments. In relation with your request, currently, the dynamic modules path is obtained this way: ```python from datasets.load import init_dynamic_modules, MODULE_NAME_FOR_DYNAMIC_MODULES dynamic_modules_path = init_dynamic_modules(MODULE_NAME_FOR_DYNAMIC_MODULES) ``` Let me know if it is OK for you this way. I could set `MODULE_NAME_FOR_DYNAMIC_MODULES` as default value, so that you could instead obtain the path with: ``` dynamic_modules_path = datasets.load.init_dynamic_modules() ```
**Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. This is an awesome library. It seems like the dynamic module path in this library has broken some of hyperparameter tuning functionality: https://discuss.huggingface.co/t/using-hyperparameter-search-in-trainer/785/34 This is because Ray will spawn new processes, and each process will load modules by path. However, we need to explicitly inform Ray to load the right modules, or else it will error upon import. I'd like an API to obtain the dynamic paths. This will allow us to support this functionality in this awesome library while being future proof. **Describe the solution you'd like** A clear and concise description of what you want to happen. `datasets.get_dynamic_paths -> List[str]` will be sufficient for my use case. By offering this API, we will be able to address the following issues (by patching the ray integration sufficiently): https://github.com/huggingface/blog/issues/106 https://github.com/huggingface/transformers/issues/11565 https://discuss.huggingface.co/t/using-hyperparameter-search-in-trainer/785/34 https://discuss.huggingface.co/t/using-hyperparameter-search-in-trainer/785/35
63
[api request] API to obtain "dataset_module" dynamic path? **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. This is an awesome library. It seems like the dynamic module path in this library has broken some of hyperparameter tuning functionality: https://discuss.huggingface.co/t/using-hyperparameter-search-in-trainer/785/34 This is because Ray will spawn new processes, and each process will load modules by path. However, we need to explicitly inform Ray to load the right modules, or else it will error upon import. I'd like an API to obtain the dynamic paths. This will allow us to support this functionality in this awesome library while being future proof. **Describe the solution you'd like** A clear and concise description of what you want to happen. `datasets.get_dynamic_paths -> List[str]` will be sufficient for my use case. By offering this API, we will be able to address the following issues (by patching the ray integration sufficiently): https://github.com/huggingface/blog/issues/106 https://github.com/huggingface/transformers/issues/11565 https://discuss.huggingface.co/t/using-hyperparameter-search-in-trainer/785/34 https://discuss.huggingface.co/t/using-hyperparameter-search-in-trainer/785/35 Hi @richardliaw, First, thanks for the compliments. In relation with your request, currently, the dynamic modules path is obtained this way: ```python from datasets.load import init_dynamic_modules, MODULE_NAME_FOR_DYNAMIC_MODULES dynamic_modules_path = init_dynamic_modules(MODULE_NAME_FOR_DYNAMIC_MODULES) ``` Let me know if it is OK for you this way. I could set `MODULE_NAME_FOR_DYNAMIC_MODULES` as default value, so that you could instead obtain the path with: ``` dynamic_modules_path = datasets.load.init_dynamic_modules() ```
https://github.com/huggingface/datasets/issues/2318
[api request] API to obtain "dataset_module" dynamic path?
Hi @richardliaw, the feature is on the master branch and will be included in the next release in a couple of weeks.
**Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. This is an awesome library. It seems like the dynamic module path in this library has broken some of hyperparameter tuning functionality: https://discuss.huggingface.co/t/using-hyperparameter-search-in-trainer/785/34 This is because Ray will spawn new processes, and each process will load modules by path. However, we need to explicitly inform Ray to load the right modules, or else it will error upon import. I'd like an API to obtain the dynamic paths. This will allow us to support this functionality in this awesome library while being future proof. **Describe the solution you'd like** A clear and concise description of what you want to happen. `datasets.get_dynamic_paths -> List[str]` will be sufficient for my use case. By offering this API, we will be able to address the following issues (by patching the ray integration sufficiently): https://github.com/huggingface/blog/issues/106 https://github.com/huggingface/transformers/issues/11565 https://discuss.huggingface.co/t/using-hyperparameter-search-in-trainer/785/34 https://discuss.huggingface.co/t/using-hyperparameter-search-in-trainer/785/35
22
[api request] API to obtain "dataset_module" dynamic path? **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. This is an awesome library. It seems like the dynamic module path in this library has broken some of hyperparameter tuning functionality: https://discuss.huggingface.co/t/using-hyperparameter-search-in-trainer/785/34 This is because Ray will spawn new processes, and each process will load modules by path. However, we need to explicitly inform Ray to load the right modules, or else it will error upon import. I'd like an API to obtain the dynamic paths. This will allow us to support this functionality in this awesome library while being future proof. **Describe the solution you'd like** A clear and concise description of what you want to happen. `datasets.get_dynamic_paths -> List[str]` will be sufficient for my use case. By offering this API, we will be able to address the following issues (by patching the ray integration sufficiently): https://github.com/huggingface/blog/issues/106 https://github.com/huggingface/transformers/issues/11565 https://discuss.huggingface.co/t/using-hyperparameter-search-in-trainer/785/34 https://discuss.huggingface.co/t/using-hyperparameter-search-in-trainer/785/35 Hi @richardliaw, the feature is on the master branch and will be included in the next release in a couple of weeks.
https://github.com/huggingface/datasets/issues/2301
Unable to setup dev env on Windows
Hi @gchhablani, There are some 3rd-party dependencies that require to build code in C. In this case, it is the library `python-Levenshtein`. On Windows, in order to be able to build C code, you need to install at least `Microsoft C++ Build Tools` version 14. You can find more info here: https://visualstudio.microsoft.com/visual-cpp-build-tools/
Hi I tried installing the `".[dev]"` version on Windows 10 after cloning. Here is the error I'm facing: ```bat (env) C:\testing\datasets>pip install -e ".[dev]" Obtaining file:///C:/testing/datasets Requirement already satisfied: numpy>=1.17 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (1.19.5) Collecting pyarrow>=0.17.1 Using cached pyarrow-4.0.0-cp37-cp37m-win_amd64.whl (13.3 MB) Requirement already satisfied: dill in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (0.3.1.1) Collecting pandas Using cached pandas-1.2.4-cp37-cp37m-win_amd64.whl (9.1 MB) Requirement already satisfied: requests>=2.19.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (2.25.1) Requirement already satisfied: tqdm<4.50.0,>=4.27 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (4.49.0) Requirement already satisfied: xxhash in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (2.0.2) Collecting multiprocess Using cached multiprocess-0.70.11.1-py37-none-any.whl (108 kB) Requirement already satisfied: fsspec in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (2021.4.0) Collecting huggingface_hub<0.1.0 Using cached huggingface_hub-0.0.8-py3-none-any.whl (34 kB) Requirement already satisfied: importlib_metadata in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (4.0.1) Requirement already satisfied: absl-py in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (0.12.0) Requirement already satisfied: pytest in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (6.2.3) Collecting pytest-xdist Using cached pytest_xdist-2.2.1-py3-none-any.whl (37 kB) Collecting apache-beam>=2.24.0 Using cached apache_beam-2.29.0-cp37-cp37m-win_amd64.whl (3.7 MB) Collecting elasticsearch Using cached elasticsearch-7.12.1-py2.py3-none-any.whl (339 kB) Requirement already satisfied: boto3==1.16.43 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (1.16.43) Requirement already satisfied: botocore==1.19.43 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (1.19.43) Collecting moto[s3]==1.3.16 Using cached moto-1.3.16-py2.py3-none-any.whl (879 kB) Collecting rarfile>=4.0 Using cached rarfile-4.0-py3-none-any.whl (28 kB) Collecting tensorflow>=2.3 Using cached tensorflow-2.4.1-cp37-cp37m-win_amd64.whl (370.7 MB) Requirement already satisfied: torch in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (1.8.1) Requirement already satisfied: transformers in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (4.5.1) Collecting bs4 Using cached bs4-0.0.1-py3-none-any.whl Collecting conllu Using cached conllu-4.4-py2.py3-none-any.whl (15 kB) Collecting langdetect Using cached langdetect-1.0.8-py3-none-any.whl Collecting lxml Using cached lxml-4.6.3-cp37-cp37m-win_amd64.whl (3.5 MB) Collecting mwparserfromhell Using cached mwparserfromhell-0.6-cp37-cp37m-win_amd64.whl (101 kB) Collecting nltk Using cached nltk-3.6.2-py3-none-any.whl (1.5 MB) Collecting openpyxl Using cached openpyxl-3.0.7-py2.py3-none-any.whl (243 kB) Collecting py7zr Using cached py7zr-0.15.2-py3-none-any.whl (66 kB) Collecting tldextract Using cached tldextract-3.1.0-py2.py3-none-any.whl (87 kB) Collecting zstandard Using cached zstandard-0.15.2-cp37-cp37m-win_amd64.whl (582 kB) Collecting bert_score>=0.3.6 Using cached bert_score-0.3.9-py3-none-any.whl (59 kB) Collecting rouge_score Using cached rouge_score-0.0.4-py2.py3-none-any.whl (22 kB) Collecting sacrebleu Using cached sacrebleu-1.5.1-py3-none-any.whl (54 kB) Requirement already satisfied: scipy in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (1.6.3) Collecting seqeval Using cached seqeval-1.2.2-py3-none-any.whl Collecting sklearn Using cached sklearn-0.0-py2.py3-none-any.whl Collecting jiwer Using cached jiwer-2.2.0-py3-none-any.whl (13 kB) Requirement already satisfied: toml>=0.10.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (0.10.2) Requirement already satisfied: requests_file>=1.5.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (1.5.1) Requirement already satisfied: texttable>=1.6.3 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (1.6.3) Requirement already satisfied: s3fs>=0.4.2 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (0.4.2) Requirement already satisfied: Werkzeug>=1.0.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (1.0.1) Collecting black Using cached black-21.4b2-py3-none-any.whl (130 kB) Collecting isort Using cached isort-5.8.0-py3-none-any.whl (103 kB) Collecting flake8==3.7.9 Using cached flake8-3.7.9-py2.py3-none-any.whl (69 kB) Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from boto3==1.16.43->datasets==1.5.0.dev0) (0.10.0) Requirement already satisfied: s3transfer<0.4.0,>=0.3.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from boto3==1.16.43->datasets==1.5.0.dev0) (0.3.7) Requirement already satisfied: urllib3<1.27,>=1.25.4 in c:\programdata\anaconda3\envs\env\lib\site-packages (from botocore==1.19.43->datasets==1.5.0.dev0) (1.26.4) Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from botocore==1.19.43->datasets==1.5.0.dev0) (2.8.1) Collecting entrypoints<0.4.0,>=0.3.0 Using cached entrypoints-0.3-py2.py3-none-any.whl (11 kB) Collecting pyflakes<2.2.0,>=2.1.0 Using cached pyflakes-2.1.1-py2.py3-none-any.whl (59 kB) Collecting pycodestyle<2.6.0,>=2.5.0 Using cached pycodestyle-2.5.0-py2.py3-none-any.whl (51 kB) Collecting mccabe<0.7.0,>=0.6.0 Using cached mccabe-0.6.1-py2.py3-none-any.whl (8.6 kB) Requirement already satisfied: jsondiff>=1.1.2 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (1.3.0) Requirement already satisfied: pytz in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (2021.1) Requirement already satisfied: mock in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (4.0.3) Requirement already satisfied: MarkupSafe<2.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (1.1.1) Requirement already satisfied: python-jose[cryptography]<4.0.0,>=3.1.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (3.2.0) Requirement already satisfied: aws-xray-sdk!=0.96,>=0.93 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (2.8.0) Requirement already satisfied: cryptography>=2.3.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (3.4.7) Requirement already satisfied: more-itertools in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (8.7.0) Requirement already satisfied: PyYAML>=5.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (5.4.1) Requirement already satisfied: boto>=2.36.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (2.49.0) Requirement already satisfied: idna<3,>=2.5 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (2.10) Requirement already satisfied: sshpubkeys>=3.1.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (3.3.1) Requirement already satisfied: responses>=0.9.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (0.13.3) Requirement already satisfied: xmltodict in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (0.12.0) Requirement already satisfied: setuptools in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (52.0.0.post20210125) Requirement already satisfied: Jinja2>=2.10.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (2.11.3) Requirement already satisfied: zipp in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (3.4.1) Requirement already satisfied: six>1.9 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (1.15.0) Requirement already satisfied: ecdsa<0.15 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (0.14.1) Requirement already satisfied: docker>=2.5.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (5.0.0) Requirement already satisfied: cfn-lint>=0.4.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (0.49.0) Requirement already satisfied: grpcio<2,>=1.29.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from apache-beam>=2.24.0->datasets==1.5.0.dev0) (1.32.0) Collecting hdfs<3.0.0,>=2.1.0 Using cached hdfs-2.6.0-py3-none-any.whl (33 kB) Collecting pyarrow>=0.17.1 Using cached pyarrow-3.0.0-cp37-cp37m-win_amd64.whl (12.6 MB) Collecting fastavro<2,>=0.21.4 Using cached fastavro-1.4.0-cp37-cp37m-win_amd64.whl (394 kB) Requirement already satisfied: httplib2<0.18.0,>=0.8 in c:\programdata\anaconda3\envs\env\lib\site-packages (from apache-beam>=2.24.0->datasets==1.5.0.dev0) (0.17.4) Collecting pymongo<4.0.0,>=3.8.0 Using cached pymongo-3.11.3-cp37-cp37m-win_amd64.whl (382 kB) Collecting crcmod<2.0,>=1.7 Using cached crcmod-1.7-py3-none-any.whl Collecting avro-python3!=1.9.2,<1.10.0,>=1.8.1 Using cached avro_python3-1.9.2.1-py3-none-any.whl Requirement already satisfied: typing-extensions<3.8.0,>=3.7.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from apache-beam>=2.24.0->datasets==1.5.0.dev0) (3.7.4.3) Requirement already satisfied: future<1.0.0,>=0.18.2 in c:\programdata\anaconda3\envs\env\lib\site-packages (from apache-beam>=2.24.0->datasets==1.5.0.dev0) (0.18.2) Collecting oauth2client<5,>=2.0.1 Using cached oauth2client-4.1.3-py2.py3-none-any.whl (98 kB) Collecting pydot<2,>=1.2.0 Using cached pydot-1.4.2-py2.py3-none-any.whl (21 kB) Requirement already satisfied: protobuf<4,>=3.12.2 in c:\programdata\anaconda3\envs\env\lib\site-packages (from apache-beam>=2.24.0->datasets==1.5.0.dev0) (3.15.8) Requirement already satisfied: wrapt in c:\programdata\anaconda3\envs\env\lib\site-packages (from aws-xray-sdk!=0.96,>=0.93->moto[s3]==1.3.16->datasets==1.5.0.dev0) (1.12.1) Collecting matplotlib Using cached matplotlib-3.4.1-cp37-cp37m-win_amd64.whl (7.1 MB) Requirement already satisfied: junit-xml~=1.9 in c:\programdata\anaconda3\envs\env\lib\site-packages (from cfn-lint>=0.4.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (1.9) Requirement already satisfied: jsonpatch in c:\programdata\anaconda3\envs\env\lib\site-packages (from cfn-lint>=0.4.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (1.32) Requirement already satisfied: jsonschema~=3.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from cfn-lint>=0.4.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (3.2.0) Requirement already satisfied: networkx~=2.4 in c:\programdata\anaconda3\envs\env\lib\site-packages (from cfn-lint>=0.4.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (2.5.1) Requirement already satisfied: aws-sam-translator>=1.35.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from cfn-lint>=0.4.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (1.35.0) Requirement already satisfied: cffi>=1.12 in c:\programdata\anaconda3\envs\env\lib\site-packages (from cryptography>=2.3.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (1.14.5) Requirement already satisfied: pycparser in c:\programdata\anaconda3\envs\env\lib\site-packages (from cffi>=1.12->cryptography>=2.3.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (2.20) Requirement already satisfied: pywin32==227 in c:\programdata\anaconda3\envs\env\lib\site-packages (from docker>=2.5.1->moto[s3]==1.3.16->datasets==1.5.0.dev0) (227) Requirement already satisfied: websocket-client>=0.32.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from docker>=2.5.1->moto[s3]==1.3.16->datasets==1.5.0.dev0) (0.58.0) Requirement already satisfied: docopt in c:\programdata\anaconda3\envs\env\lib\site-packages (from hdfs<3.0.0,>=2.1.0->apache-beam>=2.24.0->datasets==1.5.0.dev0) (0.6.2) Requirement already satisfied: filelock in c:\programdata\anaconda3\envs\env\lib\site-packages (from huggingface_hub<0.1.0->datasets==1.5.0.dev0) (3.0.12) Requirement already satisfied: pyrsistent>=0.14.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from jsonschema~=3.0->cfn-lint>=0.4.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (0.17.3) Requirement already satisfied: attrs>=17.4.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from jsonschema~=3.0->cfn-lint>=0.4.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (20.3.0) Requirement already satisfied: decorator<5,>=4.3 in c:\programdata\anaconda3\envs\env\lib\site-packages (from networkx~=2.4->cfn-lint>=0.4.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (4.4.2) Requirement already satisfied: rsa>=3.1.4 in c:\programdata\anaconda3\envs\env\lib\site-packages (from oauth2client<5,>=2.0.1->apache-beam>=2.24.0->datasets==1.5.0.dev0) (4.7.2) Requirement already satisfied: pyasn1-modules>=0.0.5 in c:\programdata\anaconda3\envs\env\lib\site-packages (from oauth2client<5,>=2.0.1->apache-beam>=2.24.0->datasets==1.5.0.dev0) (0.2.8) Requirement already satisfied: pyasn1>=0.1.7 in c:\programdata\anaconda3\envs\env\lib\site-packages (from oauth2client<5,>=2.0.1->apache-beam>=2.24.0->datasets==1.5.0.dev0) (0.4.8) Requirement already satisfied: pyparsing>=2.1.4 in c:\programdata\anaconda3\envs\env\lib\site-packages (from pydot<2,>=1.2.0->apache-beam>=2.24.0->datasets==1.5.0.dev0) (2.4.7) Requirement already satisfied: certifi>=2017.4.17 in c:\programdata\anaconda3\envs\env\lib\site-packages (from requests>=2.19.0->datasets==1.5.0.dev0) (2020.12.5) Requirement already satisfied: chardet<5,>=3.0.2 in c:\programdata\anaconda3\envs\env\lib\site-packages (from requests>=2.19.0->datasets==1.5.0.dev0) (4.0.0) Collecting keras-preprocessing~=1.1.2 Using cached Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42 kB) Requirement already satisfied: termcolor~=1.1.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from tensorflow>=2.3->datasets==1.5.0.dev0) (1.1.0) Requirement already satisfied: tensorboard~=2.4 in c:\programdata\anaconda3\envs\env\lib\site-packages (from tensorflow>=2.3->datasets==1.5.0.dev0) (2.5.0) Requirement already satisfied: wheel~=0.35 in c:\programdata\anaconda3\envs\env\lib\site-packages (from tensorflow>=2.3->datasets==1.5.0.dev0) (0.36.2) Collecting opt-einsum~=3.3.0 Using cached opt_einsum-3.3.0-py3-none-any.whl (65 kB) Collecting gast==0.3.3 Using cached gast-0.3.3-py2.py3-none-any.whl (9.7 kB) Collecting google-pasta~=0.2 Using cached google_pasta-0.2.0-py3-none-any.whl (57 kB) Requirement already satisfied: tensorflow-estimator<2.5.0,>=2.4.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from tensorflow>=2.3->datasets==1.5.0.dev0) (2.4.0) Collecting astunparse~=1.6.3 Using cached astunparse-1.6.3-py2.py3-none-any.whl (12 kB) Collecting flatbuffers~=1.12.0 Using cached flatbuffers-1.12-py2.py3-none-any.whl (15 kB) Collecting h5py~=2.10.0 Using cached h5py-2.10.0-cp37-cp37m-win_amd64.whl (2.5 MB) Requirement already satisfied: markdown>=2.6.8 in c:\programdata\anaconda3\envs\env\lib\site-packages (from tensorboard~=2.4->tensorflow>=2.3->datasets==1.5.0.dev0) (3.3.4) Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from tensorboard~=2.4->tensorflow>=2.3->datasets==1.5.0.dev0) (1.8.0) Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from tensorboard~=2.4->tensorflow>=2.3->datasets==1.5.0.dev0) (0.4.4) Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from tensorboard~=2.4->tensorflow>=2.3->datasets==1.5.0.dev0) (0.6.0) Requirement already satisfied: google-auth<2,>=1.6.3 in c:\programdata\anaconda3\envs\env\lib\site-packages (from tensorboard~=2.4->tensorflow>=2.3->datasets==1.5.0.dev0) (1.30.0) Requirement already satisfied: cachetools<5.0,>=2.0.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.4->tensorflow>=2.3->datasets==1.5.0.dev0) (4.2.2) Requirement already satisfied: requests-oauthlib>=0.7.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.4->tensorflow>=2.3->datasets==1.5.0.dev0) (1.3.0) Requirement already satisfied: oauthlib>=3.0.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.4->tensorflow>=2.3->datasets==1.5.0.dev0) (3.1.0) Requirement already satisfied: regex!=2019.12.17 in c:\programdata\anaconda3\envs\env\lib\site-packages (from transformers->datasets==1.5.0.dev0) (2021.4.4) Requirement already satisfied: tokenizers<0.11,>=0.10.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from transformers->datasets==1.5.0.dev0) (0.10.2) Requirement already satisfied: sacremoses in c:\programdata\anaconda3\envs\env\lib\site-packages (from transformers->datasets==1.5.0.dev0) (0.0.45) Requirement already satisfied: packaging in c:\programdata\anaconda3\envs\env\lib\site-packages (from transformers->datasets==1.5.0.dev0) (20.9) Collecting pathspec<1,>=0.8.1 Using cached pathspec-0.8.1-py2.py3-none-any.whl (28 kB) Requirement already satisfied: click>=7.1.2 in c:\programdata\anaconda3\envs\env\lib\site-packages (from black->datasets==1.5.0.dev0) (7.1.2) Collecting appdirs Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB) Collecting mypy-extensions>=0.4.3 Using cached mypy_extensions-0.4.3-py2.py3-none-any.whl (4.5 kB) Requirement already satisfied: typed-ast>=1.4.2 in c:\programdata\anaconda3\envs\env\lib\site-packages (from black->datasets==1.5.0.dev0) (1.4.3) Collecting beautifulsoup4 Using cached beautifulsoup4-4.9.3-py3-none-any.whl (115 kB) Requirement already satisfied: soupsieve>1.2 in c:\programdata\anaconda3\envs\env\lib\site-packages (from beautifulsoup4->bs4->datasets==1.5.0.dev0) (2.2.1) Collecting python-Levenshtein Using cached python-Levenshtein-0.12.2.tar.gz (50 kB) Requirement already satisfied: jsonpointer>=1.9 in c:\programdata\anaconda3\envs\env\lib\site-packages (from jsonpatch->cfn-lint>=0.4.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (2.1) Requirement already satisfied: pillow>=6.2.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from matplotlib->bert_score>=0.3.6->datasets==1.5.0.dev0) (8.2.0) Requirement already satisfied: cycler>=0.10 in c:\programdata\anaconda3\envs\env\lib\site-packages (from matplotlib->bert_score>=0.3.6->datasets==1.5.0.dev0) (0.10.0) Requirement already satisfied: kiwisolver>=1.0.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from matplotlib->bert_score>=0.3.6->datasets==1.5.0.dev0) (1.3.1) Collecting multiprocess Using cached multiprocess-0.70.11-py3-none-any.whl (98 kB) Using cached multiprocess-0.70.10.zip (2.4 MB) Using cached multiprocess-0.70.9-py3-none-any.whl Requirement already satisfied: joblib in c:\programdata\anaconda3\envs\env\lib\site-packages (from nltk->datasets==1.5.0.dev0) (1.0.1) Collecting et-xmlfile Using cached et_xmlfile-1.1.0-py3-none-any.whl (4.7 kB) Requirement already satisfied: pyzstd<0.15.0,>=0.14.4 in c:\programdata\anaconda3\envs\env\lib\site-packages (from py7zr->datasets==1.5.0.dev0) (0.14.4) Collecting pyppmd<0.13.0,>=0.12.1 Using cached pyppmd-0.12.1-cp37-cp37m-win_amd64.whl (32 kB) Collecting pycryptodome>=3.6.6 Using cached pycryptodome-3.10.1-cp35-abi3-win_amd64.whl (1.6 MB) Collecting bcj-cffi<0.6.0,>=0.5.1 Using cached bcj_cffi-0.5.1-cp37-cp37m-win_amd64.whl (21 kB) Collecting multivolumefile<0.3.0,>=0.2.0 Using cached multivolumefile-0.2.3-py3-none-any.whl (17 kB) Requirement already satisfied: iniconfig in c:\programdata\anaconda3\envs\env\lib\site-packages (from pytest->datasets==1.5.0.dev0) (1.1.1) Requirement already satisfied: py>=1.8.2 in c:\programdata\anaconda3\envs\env\lib\site-packages (from pytest->datasets==1.5.0.dev0) (1.10.0) Requirement already satisfied: pluggy<1.0.0a1,>=0.12 in c:\programdata\anaconda3\envs\env\lib\site-packages (from pytest->datasets==1.5.0.dev0) (0.13.1) Requirement already satisfied: atomicwrites>=1.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from pytest->datasets==1.5.0.dev0) (1.4.0) Requirement already satisfied: colorama in c:\programdata\anaconda3\envs\env\lib\site-packages (from pytest->datasets==1.5.0.dev0) (0.4.4) Collecting pytest-forked Using cached pytest_forked-1.3.0-py2.py3-none-any.whl (4.7 kB) Collecting execnet>=1.1 Using cached execnet-1.8.0-py2.py3-none-any.whl (39 kB) Requirement already satisfied: apipkg>=1.4 in c:\programdata\anaconda3\envs\env\lib\site-packages (from execnet>=1.1->pytest-xdist->datasets==1.5.0.dev0) (1.5) Collecting portalocker==2.0.0 Using cached portalocker-2.0.0-py2.py3-none-any.whl (11 kB) Requirement already satisfied: scikit-learn>=0.21.3 in c:\programdata\anaconda3\envs\env\lib\site-packages (from seqeval->datasets==1.5.0.dev0) (0.24.2) Requirement already satisfied: threadpoolctl>=2.0.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from scikit-learn>=0.21.3->seqeval->datasets==1.5.0.dev0) (2.1.0) Building wheels for collected packages: python-Levenshtein Building wheel for python-Levenshtein (setup.py) ... error ERROR: Command errored out with exit status 1: command: 'C:\ProgramData\Anaconda3\envs\env\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\VKC~1\\AppData\\Local\\Temp\\pip-install-ynt_dbm4\\python-levenshtein_c02e7e6f9def4629a475349654670ae9\\setup.py'"'"'; __file__='"'"'C:\\Users\\VKC~1\\AppData\\Local\\Temp\\pip-install-ynt_dbm4\\python-levenshtein_c02e7e6f9def4629a475349654670ae9\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\VKC~1\AppData\Local\Temp\pip-wheel-8jh7fm18' cwd: C:\Users\VKC~1\AppData\Local\Temp\pip-install-ynt_dbm4\python-levenshtein_c02e7e6f9def4629a475349654670ae9\ Complete output (27 lines): running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-3.7 creating build\lib.win-amd64-3.7\Levenshtein copying Levenshtein\StringMatcher.py -> build\lib.win-amd64-3.7\Levenshtein copying Levenshtein\__init__.py -> build\lib.win-amd64-3.7\Levenshtein running egg_info writing python_Levenshtein.egg-info\PKG-INFO writing dependency_links to python_Levenshtein.egg-info\dependency_links.txt writing entry points to python_Levenshtein.egg-info\entry_points.txt writing namespace_packages to python_Levenshtein.egg-info\namespace_packages.txt writing requirements to python_Levenshtein.egg-info\requires.txt writing top-level names to python_Levenshtein.egg-info\top_level.txt reading manifest file 'python_Levenshtein.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*pyc' found anywhere in distribution warning: no previously-included files matching '*so' found anywhere in distribution warning: no previously-included files matching '.project' found anywhere in distribution warning: no previously-included files matching '.pydevproject' found anywhere in distribution writing manifest file 'python_Levenshtein.egg-info\SOURCES.txt' copying Levenshtein\_levenshtein.c -> build\lib.win-amd64-3.7\Levenshtein copying Levenshtein\_levenshtein.h -> build\lib.win-amd64-3.7\Levenshtein running build_ext building 'Levenshtein._levenshtein' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ ---------------------------------------- ERROR: Failed building wheel for python-Levenshtein Running setup.py clean for python-Levenshtein Failed to build python-Levenshtein Installing collected packages: python-Levenshtein, pytest-forked, pyppmd, pymongo, pyflakes, pydot, pycryptodome, pycodestyle, pyarrow, portalocker, pathspec, pandas, opt-einsum, oauth2client, nltk, mypy-extensions, multivolumefile, multiprocess, moto, mccabe, matplotlib, keras-preprocessing, huggingface-hub, hdfs, h5py, google-pasta, gast, flatbuffers, fastavro, execnet, et-xmlfile, entrypoints, crcmod, beautifulsoup4, bcj-cffi, avro-python3, astunparse, appdirs, zstandard, tldextract, tensorflow, sklearn, seqeval, sacrebleu, rouge-score, rarfile, pytest-xdist, py7zr, openpyxl, mwparserfromhell, lxml, langdetect, jiwer, isort, flake8, elasticsearch, datasets, conllu, bs4, black, bert-score, apache-beam Running setup.py install for python-Levenshtein ... error ERROR: Command errored out with exit status 1: command: 'C:\ProgramData\Anaconda3\envs\env\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\VKC~1\\AppData\\Local\\Temp\\pip-install-ynt_dbm4\\python-levenshtein_c02e7e6f9def4629a475349654670ae9\\setup.py'"'"'; __file__='"'"'C:\\Users\\VKC~1\\AppData\\Local\\Temp\\pip-install-ynt_dbm4\\python-levenshtein_c02e7e6f9def4629a475349654670ae9\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\VKC~1\AppData\Local\Temp\pip-record-v7l7zitb\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\ProgramData\Anaconda3\envs\env\Include\python-Levenshtein' cwd: C:\Users\VKC~1\AppData\Local\Temp\pip-install-ynt_dbm4\python-levenshtein_c02e7e6f9def4629a475349654670ae9\ Complete output (27 lines): running install running build running build_py creating build creating build\lib.win-amd64-3.7 creating build\lib.win-amd64-3.7\Levenshtein copying Levenshtein\StringMatcher.py -> build\lib.win-amd64-3.7\Levenshtein copying Levenshtein\__init__.py -> build\lib.win-amd64-3.7\Levenshtein running egg_info writing python_Levenshtein.egg-info\PKG-INFO writing dependency_links to python_Levenshtein.egg-info\dependency_links.txt writing entry points to python_Levenshtein.egg-info\entry_points.txt writing namespace_packages to python_Levenshtein.egg-info\namespace_packages.txt writing requirements to python_Levenshtein.egg-info\requires.txt writing top-level names to python_Levenshtein.egg-info\top_level.txt reading manifest file 'python_Levenshtein.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*pyc' found anywhere in distribution warning: no previously-included files matching '*so' found anywhere in distribution warning: no previously-included files matching '.project' found anywhere in distribution warning: no previously-included files matching '.pydevproject' found anywhere in distribution writing manifest file 'python_Levenshtein.egg-info\SOURCES.txt' copying Levenshtein\_levenshtein.c -> build\lib.win-amd64-3.7\Levenshtein copying Levenshtein\_levenshtein.h -> build\lib.win-amd64-3.7\Levenshtein running build_ext building 'Levenshtein._levenshtein' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ ---------------------------------------- ERROR: Command errored out with exit status 1: 'C:\ProgramData\Anaconda3\envs\env\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\VKC~1\\AppData\\Local\\Temp\\pip-install-ynt_dbm4\\python-levenshtein_c02e7e6f9def4629a475349654670ae9\\setup.py'"'"'; __file__='"'"'C:\\Users\\VKC~1\\AppData\\Local\\Temp\\pip-install-ynt_dbm4\\python-levenshtein_c02e7e6f9def4629a475349654670ae9\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\VKC~1\AppData\Local\Temp\pip-record-v7l7zitb\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\ProgramData\Anaconda3\envs\env\Include\python-Levenshtein' Check the logs for full command output. ``` Here are conda and python versions: ```bat (env) C:\testing\datasets>conda --version conda 4.9.2 (env) C:\testing\datasets>python --version Python 3.7.10 ``` Please help me out. Thanks.
52
Unable to setup dev env on Windows Hi I tried installing the `".[dev]"` version on Windows 10 after cloning. Here is the error I'm facing: ```bat (env) C:\testing\datasets>pip install -e ".[dev]" Obtaining file:///C:/testing/datasets Requirement already satisfied: numpy>=1.17 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (1.19.5) Collecting pyarrow>=0.17.1 Using cached pyarrow-4.0.0-cp37-cp37m-win_amd64.whl (13.3 MB) Requirement already satisfied: dill in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (0.3.1.1) Collecting pandas Using cached pandas-1.2.4-cp37-cp37m-win_amd64.whl (9.1 MB) Requirement already satisfied: requests>=2.19.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (2.25.1) Requirement already satisfied: tqdm<4.50.0,>=4.27 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (4.49.0) Requirement already satisfied: xxhash in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (2.0.2) Collecting multiprocess Using cached multiprocess-0.70.11.1-py37-none-any.whl (108 kB) Requirement already satisfied: fsspec in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (2021.4.0) Collecting huggingface_hub<0.1.0 Using cached huggingface_hub-0.0.8-py3-none-any.whl (34 kB) Requirement already satisfied: importlib_metadata in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (4.0.1) Requirement already satisfied: absl-py in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (0.12.0) Requirement already satisfied: pytest in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (6.2.3) Collecting pytest-xdist Using cached pytest_xdist-2.2.1-py3-none-any.whl (37 kB) Collecting apache-beam>=2.24.0 Using cached apache_beam-2.29.0-cp37-cp37m-win_amd64.whl (3.7 MB) Collecting elasticsearch Using cached elasticsearch-7.12.1-py2.py3-none-any.whl (339 kB) Requirement already satisfied: boto3==1.16.43 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (1.16.43) Requirement already satisfied: botocore==1.19.43 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (1.19.43) Collecting moto[s3]==1.3.16 Using cached moto-1.3.16-py2.py3-none-any.whl (879 kB) Collecting rarfile>=4.0 Using cached rarfile-4.0-py3-none-any.whl (28 kB) Collecting tensorflow>=2.3 Using cached tensorflow-2.4.1-cp37-cp37m-win_amd64.whl (370.7 MB) Requirement already satisfied: torch in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (1.8.1) Requirement already satisfied: transformers in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (4.5.1) Collecting bs4 Using cached bs4-0.0.1-py3-none-any.whl Collecting conllu Using cached conllu-4.4-py2.py3-none-any.whl (15 kB) Collecting langdetect Using cached langdetect-1.0.8-py3-none-any.whl Collecting lxml Using cached lxml-4.6.3-cp37-cp37m-win_amd64.whl (3.5 MB) Collecting mwparserfromhell Using cached mwparserfromhell-0.6-cp37-cp37m-win_amd64.whl (101 kB) Collecting nltk Using cached nltk-3.6.2-py3-none-any.whl (1.5 MB) Collecting openpyxl Using cached openpyxl-3.0.7-py2.py3-none-any.whl (243 kB) Collecting py7zr Using cached py7zr-0.15.2-py3-none-any.whl (66 kB) Collecting tldextract Using cached tldextract-3.1.0-py2.py3-none-any.whl (87 kB) Collecting zstandard Using cached zstandard-0.15.2-cp37-cp37m-win_amd64.whl (582 kB) Collecting bert_score>=0.3.6 Using cached bert_score-0.3.9-py3-none-any.whl (59 kB) Collecting rouge_score Using cached rouge_score-0.0.4-py2.py3-none-any.whl (22 kB) Collecting sacrebleu Using cached sacrebleu-1.5.1-py3-none-any.whl (54 kB) Requirement already satisfied: scipy in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (1.6.3) Collecting seqeval Using cached seqeval-1.2.2-py3-none-any.whl Collecting sklearn Using cached sklearn-0.0-py2.py3-none-any.whl Collecting jiwer Using cached jiwer-2.2.0-py3-none-any.whl (13 kB) Requirement already satisfied: toml>=0.10.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (0.10.2) Requirement already satisfied: requests_file>=1.5.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (1.5.1) Requirement already satisfied: texttable>=1.6.3 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (1.6.3) Requirement already satisfied: s3fs>=0.4.2 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (0.4.2) Requirement already satisfied: Werkzeug>=1.0.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from datasets==1.5.0.dev0) (1.0.1) Collecting black Using cached black-21.4b2-py3-none-any.whl (130 kB) Collecting isort Using cached isort-5.8.0-py3-none-any.whl (103 kB) Collecting flake8==3.7.9 Using cached flake8-3.7.9-py2.py3-none-any.whl (69 kB) Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from boto3==1.16.43->datasets==1.5.0.dev0) (0.10.0) Requirement already satisfied: s3transfer<0.4.0,>=0.3.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from boto3==1.16.43->datasets==1.5.0.dev0) (0.3.7) Requirement already satisfied: urllib3<1.27,>=1.25.4 in c:\programdata\anaconda3\envs\env\lib\site-packages (from botocore==1.19.43->datasets==1.5.0.dev0) (1.26.4) Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from botocore==1.19.43->datasets==1.5.0.dev0) (2.8.1) Collecting entrypoints<0.4.0,>=0.3.0 Using cached entrypoints-0.3-py2.py3-none-any.whl (11 kB) Collecting pyflakes<2.2.0,>=2.1.0 Using cached pyflakes-2.1.1-py2.py3-none-any.whl (59 kB) Collecting pycodestyle<2.6.0,>=2.5.0 Using cached pycodestyle-2.5.0-py2.py3-none-any.whl (51 kB) Collecting mccabe<0.7.0,>=0.6.0 Using cached mccabe-0.6.1-py2.py3-none-any.whl (8.6 kB) Requirement already satisfied: jsondiff>=1.1.2 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (1.3.0) Requirement already satisfied: pytz in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (2021.1) Requirement already satisfied: mock in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (4.0.3) Requirement already satisfied: MarkupSafe<2.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (1.1.1) Requirement already satisfied: python-jose[cryptography]<4.0.0,>=3.1.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (3.2.0) Requirement already satisfied: aws-xray-sdk!=0.96,>=0.93 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (2.8.0) Requirement already satisfied: cryptography>=2.3.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (3.4.7) Requirement already satisfied: more-itertools in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (8.7.0) Requirement already satisfied: PyYAML>=5.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (5.4.1) Requirement already satisfied: boto>=2.36.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (2.49.0) Requirement already satisfied: idna<3,>=2.5 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (2.10) Requirement already satisfied: sshpubkeys>=3.1.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (3.3.1) Requirement already satisfied: responses>=0.9.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (0.13.3) Requirement already satisfied: xmltodict in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (0.12.0) Requirement already satisfied: setuptools in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (52.0.0.post20210125) Requirement already satisfied: Jinja2>=2.10.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (2.11.3) Requirement already satisfied: zipp in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (3.4.1) Requirement already satisfied: six>1.9 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (1.15.0) Requirement already satisfied: ecdsa<0.15 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (0.14.1) Requirement already satisfied: docker>=2.5.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (5.0.0) Requirement already satisfied: cfn-lint>=0.4.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from moto[s3]==1.3.16->datasets==1.5.0.dev0) (0.49.0) Requirement already satisfied: grpcio<2,>=1.29.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from apache-beam>=2.24.0->datasets==1.5.0.dev0) (1.32.0) Collecting hdfs<3.0.0,>=2.1.0 Using cached hdfs-2.6.0-py3-none-any.whl (33 kB) Collecting pyarrow>=0.17.1 Using cached pyarrow-3.0.0-cp37-cp37m-win_amd64.whl (12.6 MB) Collecting fastavro<2,>=0.21.4 Using cached fastavro-1.4.0-cp37-cp37m-win_amd64.whl (394 kB) Requirement already satisfied: httplib2<0.18.0,>=0.8 in c:\programdata\anaconda3\envs\env\lib\site-packages (from apache-beam>=2.24.0->datasets==1.5.0.dev0) (0.17.4) Collecting pymongo<4.0.0,>=3.8.0 Using cached pymongo-3.11.3-cp37-cp37m-win_amd64.whl (382 kB) Collecting crcmod<2.0,>=1.7 Using cached crcmod-1.7-py3-none-any.whl Collecting avro-python3!=1.9.2,<1.10.0,>=1.8.1 Using cached avro_python3-1.9.2.1-py3-none-any.whl Requirement already satisfied: typing-extensions<3.8.0,>=3.7.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from apache-beam>=2.24.0->datasets==1.5.0.dev0) (3.7.4.3) Requirement already satisfied: future<1.0.0,>=0.18.2 in c:\programdata\anaconda3\envs\env\lib\site-packages (from apache-beam>=2.24.0->datasets==1.5.0.dev0) (0.18.2) Collecting oauth2client<5,>=2.0.1 Using cached oauth2client-4.1.3-py2.py3-none-any.whl (98 kB) Collecting pydot<2,>=1.2.0 Using cached pydot-1.4.2-py2.py3-none-any.whl (21 kB) Requirement already satisfied: protobuf<4,>=3.12.2 in c:\programdata\anaconda3\envs\env\lib\site-packages (from apache-beam>=2.24.0->datasets==1.5.0.dev0) (3.15.8) Requirement already satisfied: wrapt in c:\programdata\anaconda3\envs\env\lib\site-packages (from aws-xray-sdk!=0.96,>=0.93->moto[s3]==1.3.16->datasets==1.5.0.dev0) (1.12.1) Collecting matplotlib Using cached matplotlib-3.4.1-cp37-cp37m-win_amd64.whl (7.1 MB) Requirement already satisfied: junit-xml~=1.9 in c:\programdata\anaconda3\envs\env\lib\site-packages (from cfn-lint>=0.4.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (1.9) Requirement already satisfied: jsonpatch in c:\programdata\anaconda3\envs\env\lib\site-packages (from cfn-lint>=0.4.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (1.32) Requirement already satisfied: jsonschema~=3.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from cfn-lint>=0.4.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (3.2.0) Requirement already satisfied: networkx~=2.4 in c:\programdata\anaconda3\envs\env\lib\site-packages (from cfn-lint>=0.4.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (2.5.1) Requirement already satisfied: aws-sam-translator>=1.35.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from cfn-lint>=0.4.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (1.35.0) Requirement already satisfied: cffi>=1.12 in c:\programdata\anaconda3\envs\env\lib\site-packages (from cryptography>=2.3.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (1.14.5) Requirement already satisfied: pycparser in c:\programdata\anaconda3\envs\env\lib\site-packages (from cffi>=1.12->cryptography>=2.3.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (2.20) Requirement already satisfied: pywin32==227 in c:\programdata\anaconda3\envs\env\lib\site-packages (from docker>=2.5.1->moto[s3]==1.3.16->datasets==1.5.0.dev0) (227) Requirement already satisfied: websocket-client>=0.32.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from docker>=2.5.1->moto[s3]==1.3.16->datasets==1.5.0.dev0) (0.58.0) Requirement already satisfied: docopt in c:\programdata\anaconda3\envs\env\lib\site-packages (from hdfs<3.0.0,>=2.1.0->apache-beam>=2.24.0->datasets==1.5.0.dev0) (0.6.2) Requirement already satisfied: filelock in c:\programdata\anaconda3\envs\env\lib\site-packages (from huggingface_hub<0.1.0->datasets==1.5.0.dev0) (3.0.12) Requirement already satisfied: pyrsistent>=0.14.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from jsonschema~=3.0->cfn-lint>=0.4.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (0.17.3) Requirement already satisfied: attrs>=17.4.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from jsonschema~=3.0->cfn-lint>=0.4.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (20.3.0) Requirement already satisfied: decorator<5,>=4.3 in c:\programdata\anaconda3\envs\env\lib\site-packages (from networkx~=2.4->cfn-lint>=0.4.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (4.4.2) Requirement already satisfied: rsa>=3.1.4 in c:\programdata\anaconda3\envs\env\lib\site-packages (from oauth2client<5,>=2.0.1->apache-beam>=2.24.0->datasets==1.5.0.dev0) (4.7.2) Requirement already satisfied: pyasn1-modules>=0.0.5 in c:\programdata\anaconda3\envs\env\lib\site-packages (from oauth2client<5,>=2.0.1->apache-beam>=2.24.0->datasets==1.5.0.dev0) (0.2.8) Requirement already satisfied: pyasn1>=0.1.7 in c:\programdata\anaconda3\envs\env\lib\site-packages (from oauth2client<5,>=2.0.1->apache-beam>=2.24.0->datasets==1.5.0.dev0) (0.4.8) Requirement already satisfied: pyparsing>=2.1.4 in c:\programdata\anaconda3\envs\env\lib\site-packages (from pydot<2,>=1.2.0->apache-beam>=2.24.0->datasets==1.5.0.dev0) (2.4.7) Requirement already satisfied: certifi>=2017.4.17 in c:\programdata\anaconda3\envs\env\lib\site-packages (from requests>=2.19.0->datasets==1.5.0.dev0) (2020.12.5) Requirement already satisfied: chardet<5,>=3.0.2 in c:\programdata\anaconda3\envs\env\lib\site-packages (from requests>=2.19.0->datasets==1.5.0.dev0) (4.0.0) Collecting keras-preprocessing~=1.1.2 Using cached Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42 kB) Requirement already satisfied: termcolor~=1.1.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from tensorflow>=2.3->datasets==1.5.0.dev0) (1.1.0) Requirement already satisfied: tensorboard~=2.4 in c:\programdata\anaconda3\envs\env\lib\site-packages (from tensorflow>=2.3->datasets==1.5.0.dev0) (2.5.0) Requirement already satisfied: wheel~=0.35 in c:\programdata\anaconda3\envs\env\lib\site-packages (from tensorflow>=2.3->datasets==1.5.0.dev0) (0.36.2) Collecting opt-einsum~=3.3.0 Using cached opt_einsum-3.3.0-py3-none-any.whl (65 kB) Collecting gast==0.3.3 Using cached gast-0.3.3-py2.py3-none-any.whl (9.7 kB) Collecting google-pasta~=0.2 Using cached google_pasta-0.2.0-py3-none-any.whl (57 kB) Requirement already satisfied: tensorflow-estimator<2.5.0,>=2.4.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from tensorflow>=2.3->datasets==1.5.0.dev0) (2.4.0) Collecting astunparse~=1.6.3 Using cached astunparse-1.6.3-py2.py3-none-any.whl (12 kB) Collecting flatbuffers~=1.12.0 Using cached flatbuffers-1.12-py2.py3-none-any.whl (15 kB) Collecting h5py~=2.10.0 Using cached h5py-2.10.0-cp37-cp37m-win_amd64.whl (2.5 MB) Requirement already satisfied: markdown>=2.6.8 in c:\programdata\anaconda3\envs\env\lib\site-packages (from tensorboard~=2.4->tensorflow>=2.3->datasets==1.5.0.dev0) (3.3.4) Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from tensorboard~=2.4->tensorflow>=2.3->datasets==1.5.0.dev0) (1.8.0) Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from tensorboard~=2.4->tensorflow>=2.3->datasets==1.5.0.dev0) (0.4.4) Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from tensorboard~=2.4->tensorflow>=2.3->datasets==1.5.0.dev0) (0.6.0) Requirement already satisfied: google-auth<2,>=1.6.3 in c:\programdata\anaconda3\envs\env\lib\site-packages (from tensorboard~=2.4->tensorflow>=2.3->datasets==1.5.0.dev0) (1.30.0) Requirement already satisfied: cachetools<5.0,>=2.0.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.4->tensorflow>=2.3->datasets==1.5.0.dev0) (4.2.2) Requirement already satisfied: requests-oauthlib>=0.7.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.4->tensorflow>=2.3->datasets==1.5.0.dev0) (1.3.0) Requirement already satisfied: oauthlib>=3.0.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.4->tensorflow>=2.3->datasets==1.5.0.dev0) (3.1.0) Requirement already satisfied: regex!=2019.12.17 in c:\programdata\anaconda3\envs\env\lib\site-packages (from transformers->datasets==1.5.0.dev0) (2021.4.4) Requirement already satisfied: tokenizers<0.11,>=0.10.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from transformers->datasets==1.5.0.dev0) (0.10.2) Requirement already satisfied: sacremoses in c:\programdata\anaconda3\envs\env\lib\site-packages (from transformers->datasets==1.5.0.dev0) (0.0.45) Requirement already satisfied: packaging in c:\programdata\anaconda3\envs\env\lib\site-packages (from transformers->datasets==1.5.0.dev0) (20.9) Collecting pathspec<1,>=0.8.1 Using cached pathspec-0.8.1-py2.py3-none-any.whl (28 kB) Requirement already satisfied: click>=7.1.2 in c:\programdata\anaconda3\envs\env\lib\site-packages (from black->datasets==1.5.0.dev0) (7.1.2) Collecting appdirs Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB) Collecting mypy-extensions>=0.4.3 Using cached mypy_extensions-0.4.3-py2.py3-none-any.whl (4.5 kB) Requirement already satisfied: typed-ast>=1.4.2 in c:\programdata\anaconda3\envs\env\lib\site-packages (from black->datasets==1.5.0.dev0) (1.4.3) Collecting beautifulsoup4 Using cached beautifulsoup4-4.9.3-py3-none-any.whl (115 kB) Requirement already satisfied: soupsieve>1.2 in c:\programdata\anaconda3\envs\env\lib\site-packages (from beautifulsoup4->bs4->datasets==1.5.0.dev0) (2.2.1) Collecting python-Levenshtein Using cached python-Levenshtein-0.12.2.tar.gz (50 kB) Requirement already satisfied: jsonpointer>=1.9 in c:\programdata\anaconda3\envs\env\lib\site-packages (from jsonpatch->cfn-lint>=0.4.0->moto[s3]==1.3.16->datasets==1.5.0.dev0) (2.1) Requirement already satisfied: pillow>=6.2.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from matplotlib->bert_score>=0.3.6->datasets==1.5.0.dev0) (8.2.0) Requirement already satisfied: cycler>=0.10 in c:\programdata\anaconda3\envs\env\lib\site-packages (from matplotlib->bert_score>=0.3.6->datasets==1.5.0.dev0) (0.10.0) Requirement already satisfied: kiwisolver>=1.0.1 in c:\programdata\anaconda3\envs\env\lib\site-packages (from matplotlib->bert_score>=0.3.6->datasets==1.5.0.dev0) (1.3.1) Collecting multiprocess Using cached multiprocess-0.70.11-py3-none-any.whl (98 kB) Using cached multiprocess-0.70.10.zip (2.4 MB) Using cached multiprocess-0.70.9-py3-none-any.whl Requirement already satisfied: joblib in c:\programdata\anaconda3\envs\env\lib\site-packages (from nltk->datasets==1.5.0.dev0) (1.0.1) Collecting et-xmlfile Using cached et_xmlfile-1.1.0-py3-none-any.whl (4.7 kB) Requirement already satisfied: pyzstd<0.15.0,>=0.14.4 in c:\programdata\anaconda3\envs\env\lib\site-packages (from py7zr->datasets==1.5.0.dev0) (0.14.4) Collecting pyppmd<0.13.0,>=0.12.1 Using cached pyppmd-0.12.1-cp37-cp37m-win_amd64.whl (32 kB) Collecting pycryptodome>=3.6.6 Using cached pycryptodome-3.10.1-cp35-abi3-win_amd64.whl (1.6 MB) Collecting bcj-cffi<0.6.0,>=0.5.1 Using cached bcj_cffi-0.5.1-cp37-cp37m-win_amd64.whl (21 kB) Collecting multivolumefile<0.3.0,>=0.2.0 Using cached multivolumefile-0.2.3-py3-none-any.whl (17 kB) Requirement already satisfied: iniconfig in c:\programdata\anaconda3\envs\env\lib\site-packages (from pytest->datasets==1.5.0.dev0) (1.1.1) Requirement already satisfied: py>=1.8.2 in c:\programdata\anaconda3\envs\env\lib\site-packages (from pytest->datasets==1.5.0.dev0) (1.10.0) Requirement already satisfied: pluggy<1.0.0a1,>=0.12 in c:\programdata\anaconda3\envs\env\lib\site-packages (from pytest->datasets==1.5.0.dev0) (0.13.1) Requirement already satisfied: atomicwrites>=1.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from pytest->datasets==1.5.0.dev0) (1.4.0) Requirement already satisfied: colorama in c:\programdata\anaconda3\envs\env\lib\site-packages (from pytest->datasets==1.5.0.dev0) (0.4.4) Collecting pytest-forked Using cached pytest_forked-1.3.0-py2.py3-none-any.whl (4.7 kB) Collecting execnet>=1.1 Using cached execnet-1.8.0-py2.py3-none-any.whl (39 kB) Requirement already satisfied: apipkg>=1.4 in c:\programdata\anaconda3\envs\env\lib\site-packages (from execnet>=1.1->pytest-xdist->datasets==1.5.0.dev0) (1.5) Collecting portalocker==2.0.0 Using cached portalocker-2.0.0-py2.py3-none-any.whl (11 kB) Requirement already satisfied: scikit-learn>=0.21.3 in c:\programdata\anaconda3\envs\env\lib\site-packages (from seqeval->datasets==1.5.0.dev0) (0.24.2) Requirement already satisfied: threadpoolctl>=2.0.0 in c:\programdata\anaconda3\envs\env\lib\site-packages (from scikit-learn>=0.21.3->seqeval->datasets==1.5.0.dev0) (2.1.0) Building wheels for collected packages: python-Levenshtein Building wheel for python-Levenshtein (setup.py) ... error ERROR: Command errored out with exit status 1: command: 'C:\ProgramData\Anaconda3\envs\env\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\VKC~1\\AppData\\Local\\Temp\\pip-install-ynt_dbm4\\python-levenshtein_c02e7e6f9def4629a475349654670ae9\\setup.py'"'"'; __file__='"'"'C:\\Users\\VKC~1\\AppData\\Local\\Temp\\pip-install-ynt_dbm4\\python-levenshtein_c02e7e6f9def4629a475349654670ae9\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\VKC~1\AppData\Local\Temp\pip-wheel-8jh7fm18' cwd: C:\Users\VKC~1\AppData\Local\Temp\pip-install-ynt_dbm4\python-levenshtein_c02e7e6f9def4629a475349654670ae9\ Complete output (27 lines): running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-3.7 creating build\lib.win-amd64-3.7\Levenshtein copying Levenshtein\StringMatcher.py -> build\lib.win-amd64-3.7\Levenshtein copying Levenshtein\__init__.py -> build\lib.win-amd64-3.7\Levenshtein running egg_info writing python_Levenshtein.egg-info\PKG-INFO writing dependency_links to python_Levenshtein.egg-info\dependency_links.txt writing entry points to python_Levenshtein.egg-info\entry_points.txt writing namespace_packages to python_Levenshtein.egg-info\namespace_packages.txt writing requirements to python_Levenshtein.egg-info\requires.txt writing top-level names to python_Levenshtein.egg-info\top_level.txt reading manifest file 'python_Levenshtein.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*pyc' found anywhere in distribution warning: no previously-included files matching '*so' found anywhere in distribution warning: no previously-included files matching '.project' found anywhere in distribution warning: no previously-included files matching '.pydevproject' found anywhere in distribution writing manifest file 'python_Levenshtein.egg-info\SOURCES.txt' copying Levenshtein\_levenshtein.c -> build\lib.win-amd64-3.7\Levenshtein copying Levenshtein\_levenshtein.h -> build\lib.win-amd64-3.7\Levenshtein running build_ext building 'Levenshtein._levenshtein' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ ---------------------------------------- ERROR: Failed building wheel for python-Levenshtein Running setup.py clean for python-Levenshtein Failed to build python-Levenshtein Installing collected packages: python-Levenshtein, pytest-forked, pyppmd, pymongo, pyflakes, pydot, pycryptodome, pycodestyle, pyarrow, portalocker, pathspec, pandas, opt-einsum, oauth2client, nltk, mypy-extensions, multivolumefile, multiprocess, moto, mccabe, matplotlib, keras-preprocessing, huggingface-hub, hdfs, h5py, google-pasta, gast, flatbuffers, fastavro, execnet, et-xmlfile, entrypoints, crcmod, beautifulsoup4, bcj-cffi, avro-python3, astunparse, appdirs, zstandard, tldextract, tensorflow, sklearn, seqeval, sacrebleu, rouge-score, rarfile, pytest-xdist, py7zr, openpyxl, mwparserfromhell, lxml, langdetect, jiwer, isort, flake8, elasticsearch, datasets, conllu, bs4, black, bert-score, apache-beam Running setup.py install for python-Levenshtein ... error ERROR: Command errored out with exit status 1: command: 'C:\ProgramData\Anaconda3\envs\env\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\VKC~1\\AppData\\Local\\Temp\\pip-install-ynt_dbm4\\python-levenshtein_c02e7e6f9def4629a475349654670ae9\\setup.py'"'"'; __file__='"'"'C:\\Users\\VKC~1\\AppData\\Local\\Temp\\pip-install-ynt_dbm4\\python-levenshtein_c02e7e6f9def4629a475349654670ae9\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\VKC~1\AppData\Local\Temp\pip-record-v7l7zitb\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\ProgramData\Anaconda3\envs\env\Include\python-Levenshtein' cwd: C:\Users\VKC~1\AppData\Local\Temp\pip-install-ynt_dbm4\python-levenshtein_c02e7e6f9def4629a475349654670ae9\ Complete output (27 lines): running install running build running build_py creating build creating build\lib.win-amd64-3.7 creating build\lib.win-amd64-3.7\Levenshtein copying Levenshtein\StringMatcher.py -> build\lib.win-amd64-3.7\Levenshtein copying Levenshtein\__init__.py -> build\lib.win-amd64-3.7\Levenshtein running egg_info writing python_Levenshtein.egg-info\PKG-INFO writing dependency_links to python_Levenshtein.egg-info\dependency_links.txt writing entry points to python_Levenshtein.egg-info\entry_points.txt writing namespace_packages to python_Levenshtein.egg-info\namespace_packages.txt writing requirements to python_Levenshtein.egg-info\requires.txt writing top-level names to python_Levenshtein.egg-info\top_level.txt reading manifest file 'python_Levenshtein.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*pyc' found anywhere in distribution warning: no previously-included files matching '*so' found anywhere in distribution warning: no previously-included files matching '.project' found anywhere in distribution warning: no previously-included files matching '.pydevproject' found anywhere in distribution writing manifest file 'python_Levenshtein.egg-info\SOURCES.txt' copying Levenshtein\_levenshtein.c -> build\lib.win-amd64-3.7\Levenshtein copying Levenshtein\_levenshtein.h -> build\lib.win-amd64-3.7\Levenshtein running build_ext building 'Levenshtein._levenshtein' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ ---------------------------------------- ERROR: Command errored out with exit status 1: 'C:\ProgramData\Anaconda3\envs\env\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\VKC~1\\AppData\\Local\\Temp\\pip-install-ynt_dbm4\\python-levenshtein_c02e7e6f9def4629a475349654670ae9\\setup.py'"'"'; __file__='"'"'C:\\Users\\VKC~1\\AppData\\Local\\Temp\\pip-install-ynt_dbm4\\python-levenshtein_c02e7e6f9def4629a475349654670ae9\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\VKC~1\AppData\Local\Temp\pip-record-v7l7zitb\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\ProgramData\Anaconda3\envs\env\Include\python-Levenshtein' Check the logs for full command output. ``` Here are conda and python versions: ```bat (env) C:\testing\datasets>conda --version conda 4.9.2 (env) C:\testing\datasets>python --version Python 3.7.10 ``` Please help me out. Thanks. Hi @gchhablani, There are some 3rd-party dependencies that require to build code in C. In this case, it is the library `python-Levenshtein`. On Windows, in order to be able to build C code, you need to install at least `Microsoft C++ Build Tools` version 14. You can find more info here: https://visualstudio.microsoft.com/visual-cpp-build-tools/
https://github.com/huggingface/datasets/issues/2300
Add VoxPopuli
I'm happy to take this on:) One question: The original unlabelled data is stored unsegmented (see e.g. https://github.com/facebookresearch/voxpopuli/blob/main/voxpopuli/get_unlabelled_data.py#L30), but segmenting the audio in the dataset would require a dependency on something like soundfile or torchaudio. An alternative could be to provide the segments start and end times as a Sequence and then it's up to the user to perform the segmentation on-the-fly if they wish?
## Adding a Dataset - **Name:** Voxpopuli - **Description:** VoxPopuli is raw data is collected from 2009-2020 European Parliament event recordings - **Paper:** https://arxiv.org/abs/2101.00390 - **Data:** https://github.com/facebookresearch/voxpopuli - **Motivation:** biggest unlabeled speech dataset **Note**: Since the dataset is so huge, we should only add the config `10k` in the beginning. Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md).
65
Add VoxPopuli ## Adding a Dataset - **Name:** Voxpopuli - **Description:** VoxPopuli is raw data is collected from 2009-2020 European Parliament event recordings - **Paper:** https://arxiv.org/abs/2101.00390 - **Data:** https://github.com/facebookresearch/voxpopuli - **Motivation:** biggest unlabeled speech dataset **Note**: Since the dataset is so huge, we should only add the config `10k` in the beginning. Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md). I'm happy to take this on:) One question: The original unlabelled data is stored unsegmented (see e.g. https://github.com/facebookresearch/voxpopuli/blob/main/voxpopuli/get_unlabelled_data.py#L30), but segmenting the audio in the dataset would require a dependency on something like soundfile or torchaudio. An alternative could be to provide the segments start and end times as a Sequence and then it's up to the user to perform the segmentation on-the-fly if they wish?