Generate: add Bloom fixes for contrastive search
# What does this PR do?

Bloom has a different cache format, where the batch size and the number of heads are packed in a single dimension. Contrastive search needs to manipulate the cache at the batch dimension, so naturally it fails.

This PR adds functionality to convert Bloom's cache back and forth between its own format and the standard cache format. Then, propagates the use of these new functions to places where the conversion logic was already being used, and finally fixes Bloom's contrastive search.

All slow tests are passing.
____________________________________

This fix was also requested [here](https://huggingface.co/spaces/joaogante/contrastive_search_generation/discussions/1#636e23d1c441b42489215026)
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_20213). All of your documentation changes will be reflected on that endpoint.<|||||>(rebasing to include #20200 in CI, the related test was failing)<|||||>The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_20213). All of your documentation changes will be reflected on that endpoint.<|||||>Stumbled on the same issue and found this fix. Thanks lots! 