no dependency package `accelerate` installed when we install transformers v4.29.1
### System Info

transformers v4.29.1
torch 2.0.1


### Who can help?

_No response_

### 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

cd examples/pytorch/text-classification
export TASK_NAME=mrpc
python run_glue.py   --model_name_or_path bert-base-cased   --task_name $TASK_NAME   --do_train   --do_eval   --max_seq_length 128   --per_device_train_batch_size 32   --learning_rate 2e-5   --num_train_epochs 3   --output_dir /tmp/$TASK_NAME

the log is:
Traceback (most recent call last):
  File "/home/penghuic/transformers/examples/pytorch/text-classification/run_glue.py", line 623, in <module>
    main()
  File "/home/penghuic/transformers/examples/pytorch/text-classification/run_glue.py", line 217, in main
    model_args, data_args, training_args = parser.parse_args_into_dataclasses()
  File "/home/penghuic/transformers/src/transformers/hf_argparser.py", line 346, in parse_args_into_dataclasses
    obj = dtype(**inputs)
  File "<string>", line 111, in __init__
  File "/home/penghuic/transformers/src/transformers/training_args.py", line 1333, in __post_init__
    and (self.device.type != "cuda")
  File "/home/penghuic/transformers/src/transformers/training_args.py", line 1697, in device
    return self._setup_devices
  File "/home/penghuic/transformers/src/transformers/utils/generic.py", line 54, in __get__
    cached = self.fget(obj)
  File "/home/penghuic/transformers/src/transformers/training_args.py", line 1613, in _setup_devices
    raise ImportError(
ImportError: Using the `Trainer` with `PyTorch` requires `accelerate`: Run `pip install --upgrade accelerate`

### Expected behavior

we expect the dependency package `accelerate` will be installed when we install transformers.
Hi @PenghuiCheng, 

All of the examples have their own unique requirements, which are listed in [their own `requirements.txt` file](https://github.com/huggingface/transformers/blob/main/examples/pytorch/text-classification/requirements.txt). The examples are demonstrative of how to perform certain tasks using the transformers library, but are not dependancies.<|||||>@PenghuiCheng you need to do `pip install transformers[torch]` to ensure you're building/installing the right version<|||||>same error ! any solution<|||||>@mohamedoh you need to do `pip install accelerate`, or `pip install transformers[torch]`<|||||>I face the same issue even after the installations<|||||>@flckv if you're in a notebook or similar you'll need to restart the session. Does `pip show accelerate` show anything? (This is a sign)<|||||>> 
`pip show accelerate`
It shows version 0.19.0 but still getting the error 
ImportError: Using the `Trainer` with `PyTorch` requires `accelerate`: Run `pip install --upgrade accelerate` 
on both Colab as well as Jupyter<|||||>@Krish1375 you may need to restart the notebook session to use the new/installed lib<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.<|||||>I have the same issue but apparently, there is no solution for it. 
