Whisper: Add functionality to decode without conditioning on previous text.
Author: m-bain
Pull request: yes

# What does this PR do?
Add whisper functionality to decode *without* conditioning on previous text. https://github.com/openai/whisper/blob/7858aa9c08d98f75575035ecd6481f462d66ca27/whisper/transcribe.py#L278

When condition_on_prev_text=False (in the config), the following happens:
Decoder attention is masked from the consecutive timestamps, such that each whisper segment within the chunk input does not attend to text in previous segments.

This has been shown to drastically reduce hallucination. Works for any batch_size, providing rapid decoding strategy.


Fixes # (issue)
https://github.com/huggingface/transformers/issues/21467

## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [x] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@ArthurZucker 

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

Models:

- text models: @ArthurZucker and @younesbelkada
- vision models: @amyeroberts and @NielsRogge
- speech models: @sanchit-gandhi
- graph models: @clefourrier

Library:

- flax: @sanchit-gandhi
- generate: @gante
- pipelines: @Narsil
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @sgugger

Integrations:

- deepspeed: HF Trainer: @stas00, Accelerate: @pacman100
- ray/raytune: @richardliaw, @amogkam

Documentation: @sgugger, @stevhliu and @MKhalusova

HF projects:

- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Maintained examples (not research project or legacy):

- Flax: @sanchit-gandhi
- PyTorch: @sgugger
- TensorFlow: @Rocketknight1

 -->


Comments:
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_21491). All of your documentation changes will be reflected on that endpoint.

Great job working on this! Can you run `make style` and make sure you rebase on main first? We recently merged a huge PR related to the code styling! See #21480. This will make sure all tests are green! 😉 will also review soon

Feel free to ping me once you are done adressing all the previous comments and want another review 😉 


@ArthurZucker @sanchit-gandhi Thanks for the review and comments sanchit!
Unfortuntately I am pushing for ICCV/interspeech deadline for the next couple weeks so I dont have time at the moment to polish this for merge. Feel free to edit directly / use as inspo.
Btw it seems from my results that it can still occasionally repeat words (I think this is due to greedy decoding), but overall this is worth the speedup compared to beam search of 5

Best of luck with the ICCV/Interspeech deadline @m-bain! If either of us get the chance we'll have a look at the PR, otherwise feel free to pick it up when you're freed up!

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.

what about this?