run_speech_recognition_seq2seq to fine-tune whisper tiny model stop in dataset map
Author: xyx361100238
Pull request: no

### System Info

- `transformers` version: 4.27.0.dev0
- Platform: Linux-5.4.0-144-generic-x86_64-with-debian-bullseye-sid
- Python version: 3.7.13
- Huggingface_hub version: 0.12.1
- PyTorch version (GPU?): 1.13.1+cu117 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: <fill in>
- Using distributed or parallel set-up in script?: <fill in>

### Who can help?

@sanchit-gandhi @sgugger

### Information

- [X] The official example scripts
- [ ] My own modified scripts

### Tasks

- [X] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

according to official doc in  [sequence-to-sequence](https://github.com/huggingface/transformers/tree/main/examples/pytorch/speech-recognition#sequence-to-sequence) ，run the same cmd （use model tiny），it's always stop in step 7:
preprocess train dataset (num_proc=16):   0%|                                                                                                                                                                              | 0/6540 [00:00<?, ? examples/s]

but if I verify it in python accorind [fine-tune-whsiper](https://huggingface.co/blog/fine-tune-whisper)，it works well：
preprocess train dataset (num_proc=16):   7%|███████████▌                                                                                                                                                             | 197/2894 [00:11<02:19, 19.34 examples/s]

### Expected behavior

can finish the train in official example 

Comments:
Hey @xyx361100238 - could you try with a lower value of `preprocessing_num_workers`? Maybe first by reducing it by a factor of 2:
```diff
-	--preprocessing_num_workers="16" \
+	--preprocessing_num_workers="8" \
```
This is usually the cause of datasets map hanging.

THX @sanchit-gandhi , I tried preprocess num 4 / 8 / 16 but still hanging the datasets map.
This time I reinstall my huggingface-transformers, it works! I can finish the train use  official  examples.


Hey @xyx361100238! That's super strange since the `transformers` library shouldn't interact with `datasets`'s map method 🧐 glad you found a fix by reinstalling `transformers`, it might have bumped a package version that is a `datasets` dependency that unblocked map for you. Closing as complete!

@sanchit-gandhi ，still not work today，hanging in map
`python run_speech_recognition_seq2seq.py --model_name_or_path="openai/whisper-tiny" --dataset_name="mozilla-foundation/common_voice_11_0" --dataset_config_name="zh-CN" --language="chinese" --train_split_name="train+validation" --eval_split_name="test" --max_steps="5000" --output_dir="./whisper-small-zh" --per_device_train_batch_size="16" --gradient_accumulation_steps="2" --per_device_eval_batch_size="16" --logging_steps="25" --learning_rate="1e-5" --warmup_steps="500" --evaluation_strategy="steps" --eval_steps="1000" --save_strategy="steps" --save_steps="1000" --generation_max_length="225" --preprocessing_num_workers="16" --length_column_name="input_length" --max_duration_in_seconds="30" --text_column_name="sentence" --freeze_feature_encoder="False" --gradient_checkpointing --group_by_length --fp16 --overwrite_output_dir --do_train --do_eval --predict_with_generate 
`

`preprocess train dataset (num_proc=16):   0%|       | 0/39637 [00:00<?, ? examples/s] `


Hey @xyx361100238, I think this is `datasets` library issue that would be more apt there: https://github.com/huggingface/datasets

You can create a dummy reproducible codesnippet for this issue with something like:
```python
from datasets import Audio, load_dataset

raw_dataset = load_dataset("mozilla-foundation/common_voice_11_0", "zh-CN")

raw_dataset = raw_dataset.cast_column("audio", Audio(sampling_rate=16000))

def preprocess_dataset(batch):
    audio = batch["audio"]
    return batch

raw_dataset = raw_dataset.map(preprocess_dataset, num_proc=16)
```

Feel free to check if that hangs -> you can add the minimum amount of code that reproduces your issue and then post the codesnippet on the datasets repo.