require_accelerate wrapper missing? 
Author: ArthurZucker
Pull request: no
Labels: name: bug

### System Info

```shell
- `transformers` version: 4.20.0.dev0
- Platform: macOS-12.4-arm64-arm-64bit
- Python version: 3.9.12
- Huggingface_hub version: 0.6.0
- PyTorch version (GPU?): 1.13.0.dev20220521 (False)
- Tensorflow version (GPU?): 2.9.0 (True)
- Flax version (CPU?/GPU?/TPU?): 0.4.2 (cpu)
- Jax version: 0.3.6
- JaxLib version: 0.3.5
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: No
```


### Who can help?

@LysandreJik Sorry again I am not really sure who is responsible of that 😅 

### Information

- [ ] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

If the accelerate library is not installed, loading a model fails with the following error : 
```python
pt_model = OPTModel.from_pretrained(path)
```

```python
Traceback (most recent call last):
  File "src/transformers/convert_opt.py", line 4, in <module>
    pt_model = OPTModel.from_pretrained(path)
  File "/home/arthur_huggingface_co/transformers/src/transformers/modeling_utils.py", line 2166, in from_pretrained
    model, missing_keys, unexpected_keys, mismatched_keys, error_msgs = cls._load_pretrained_model(
  File "/home/arthur_huggingface_co/transformers/src/transformers/modeling_utils.py", line 2397, in _load_pretrained_model
    save_offload_index(offload_index, offload_folder)
```

Maybe a `@require_accelerate` is missing in `"/home/arthur_huggingface_co/transformers/src/transformers/modeling_utils.py"` , but my understanding is very limited. 

### Expected behavior

```shell
Model should be loaded or accelerate should be in requirements.txt
```


Comments:
As seen offline, cannot reproduce this but let's keep it open in case someone runs into the same issue/we identify a reproducible example.

Okay found the reproducing script :) (you need to have  a good internet connection) Every sharded model would work I think

```python 
>>> from transformers import OPTModel
>>> model = OPTModel.from_pretrained("facebook/opt-13b")
```
```python 
Downloading: 100%|███████████████████████████████████████████████████████| 611/611 [00:00<00:00, 197kB/s]
Downloading: 100%|███████████████████████████████████████████████████| 51.0k/51.0k [00:00<00:00, 309kB/s]
Downloading: 100%|██████████████████████████████████████████████████| 9.29G/9.29G [08:48<00:00, 18.9MB/s]
Downloading: 100%|██████████████████████████████████████████████████| 9.18G/9.18G [10:26<00:00, 15.7MB/s]
Downloading: 100%|██████████████████████████████████████████████████| 5.47G/5.47G [07:18<00:00, 13.4MB/s]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/arthurzucker/Work/transformers/src/transformers/modeling_utils.py", line 2166, in from_pretrained
    model, missing_keys, unexpected_keys, mismatched_keys, error_msgs = cls._load_pretrained_model(
  File "/Users/arthurzucker/Work/transformers/src/transformers/modeling_utils.py", line 2397, in _load_pretrained_model
    save_offload_index(offload_index, offload_folder)
NameError: name 'save_offload_index' is not defined
```


[![image](https://user-images.githubusercontent.com/95056882/171867979-440ee089-b4f2-4992-b463-d470d33193b3.jpeg)](https://blog.ethereum.org/2022/06/03/ropsten-merge-ttd/)

This is normally fixed on main, are you sure you have the latest?

You are right sorry about this 👍🏻