BLOOM past_key_values bug
### System Info

- `transformers` version: 4.24.0
- Platform: Linux-5.15.0-52-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.11.0
- PyTorch version (GPU?): 1.12.1 (True)
- Tensorflow version (GPU?): 2.9.1 (True)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: yers
- Using distributed or parallel set-up in script?: no


### Who can help?

@LysandreJik 

### Information

- [ ] The official example scripts
- [X] 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

import torch
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer, AutoModel, MT5ForConditionalGeneration
from transformers import AutoModelForCausalLM, AutoTokenizer


model_name = 'bigscience/bloomz-7b1'
model = AutoModelForCausalLM.from_pretrained( model_name, device_map='auto')
print(model.config)
tokenizer = AutoTokenizer.from_pretrained(model_name)
prompt = 'this is a'
encoded_input = tokenizer(prompt, return_tensors='pt')
output = model(input_ids=encoded_input['input_ids'].cuda())

print([x.size() for x in output.past_key_values[0]])


### Expected behavior

As per the documentation and generation interface (https://huggingface.co/docs/transformers/main_classes/output) past_key_values should have tuples of 4-dimensional tensors with shape (batch_size, num_heads, sequence_length, embed_size_per_head). 

The BLOOM models returns 3-dimensional tensors, for example the first tuple in the example code has tensors of shape ( torch.Size([32, 128, 3]), torch.Size([32, 3, 128]) ).

This means that the code crashes when you try to use some decoding algorithms, for example the new contrastive decoding algorithm. 
Closing (fixed by https://github.com/huggingface/transformers/pull/20213)