'T5Config' object has no attribute '__deepcopy__'
### System Info

- `transformers` version: 4.27.0.dev0
- Platform: Linux-5.4.0-125-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.11.0
- PyTorch version (GPU?): 1.13.0+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>

### Reproduction

The following fails for me:
```python
  model_name = "google/t5-v1_1-small"
  config = AutoConfig.from_pretrained(model_name)
  model_ref = T5ForConditionalGeneration._from_config(config)
  
  'T5Config' object has no attribute '__deepcopy__'
  File "/home/nouamane/projects/transformers/src/transformers/configuration_utils.py", line 260, in __getattribute__ (Current frame)
    return super().__getattribute__(key)
  File "/home/nouamane/miniconda/envs/py38/lib/python3.8/copy.py", line 151, in deepcopy
    copier = getattr(x, "__deepcopy__", None)
  File "/home/nouamane/projects/transformers/src/transformers/models/t5/modeling_t5.py", line 1498, in __init__
    encoder_config = copy.deepcopy(config)
  File "/home/nouamane/projects/transformers/src/transformers/modeling_utils.py", line 1077, in _from_config
    model = cls(config, **kwargs)
  File "/home/nouamane/projects/brrr/examples/t5/test_t5.py", line 78, in test_t5
    model_ref = T5ForConditionalGeneration._from_config(config)
  File "/home/nouamane/projects/brrr/examples/t5/test_t5.py", line 298, in <module>
    test_t5()
AttributeError: 'T5Config' object has no attribute '__deepcopy__'
```
Could be a cache problem (because I just installed transformers from source today)

### Expected behavior

Loading config should work fine