cannot load bart encoder
### System Info

- `transformers` version: 4.23.1
- Platform: Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31
- Python version: 3.10.0
- Huggingface_hub version: 0.10.1
- PyTorch version (GPU?): 1.12.1 (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?

@patil-suraj

### Information

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

### Tasks

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

### Reproduction

Failed to load BartEncoder, BartDecoder

```python
from transformers.models.bart.modeling_bart import BartEncoder, BartDecoder
```

Error
```
ImportError: cannot import name 'SAFE_WEIGHTS_INDEX_NAME' from 'transformers.utils' (/home/usr/miniconda3/envs/mkg/lib/python3.10/site-packages/transformers/utils/__init__.py)
```

### Expected behavior

Able to load BartEncoder and BartDecoder
@icedpanda  I am not able to reproduce this error, Can you try to reproduce this in a colab notebook and share the notebook here ? <|||||>was working on the terminal but not in the notebook. Works now after reinstalling the notebook. 