[Whisper] Fix multilingual tokeniser
Author: sanchit-gandhi
Pull request: yes

# What does this PR do?

Fixes #20703

## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [ ] 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.
- [ ] 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.

<!-- 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

Library:

- flax: @sanchit-gandhi
- generate: @gante
- pipelines: @Narsil
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @sgugger

Integrations:

- deepspeed: @stas00
- ray/raytune: @richardliaw, @amogkam

Documentation: @sgugger and @stevhliu

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_20707). All of your documentation changes will be reflected on that endpoint.

This looks good, could you also push the normalizer file? 😉 

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.

Hi, when we can expect this to be merged? The wrong normalisation basically makes everything that Whisper models gives from languages other than English useless. Thanks

Hey, no real timeline. Was dropped as this was not requested. If you really need this however, feel free to take the PR over ! 🤗 

Hey @thomas-ferraz,

What you can do as a temporary workaround is set `_normalize=False` when you decode with the tokenizer (the default behaviour:
```python
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)
```
If you don't need normalisation, you can stop here - your transcriptions won't be normalised.

If you need normalisation, you can manually normalise using the `BasicTextNormalizer` (the **multilingual** normaliser) as follows:

```python
from transformers.models.whisper.english_normalizer import BasicTextNormalizer

normalizer = BasicTextNormalizer()
norm_transcriptions = [normalizer(input_str) for input_str in transcription]
```

Hope that helps!

This should definitely be re-opened and merged. 

Will take a look when I get the chance!

Closing in favour of https://github.com/huggingface/transformers/pull/26149