[fix][whisper]: fix max_new_tokens handling
Author: eustlb
Pull request: yes

# What does this PR do?

PR #44130 changed how the generation loop enforces `max_length`: it is now the strict total decoder length (forced/initial tokens + generated content), whereas the old `cache_position` based approach effectively didn't count one position.

  Whisper prepends forced decoder tokens before the transcript (`[
, 
, 
, 
]`). So when a user passes `max_length=20` they mean "20 content tokens," and `_set_max_new_tokens_and_length` is supposed to inflate the limit to leave room for that forced prefix. Two defects broke this:

  1. The compensation was computed but discarded.
  The function computed `max_length = min(generation_config.max_length + num_initial_tokens, …)` but a refactor #30018 dropped the line that wrote it back. That refactor
  reworked `_set_max_new_tokens_and_length` from returning a kwargs dict (which set `kwargs["max_length"]`) to mutating `generation_config` in place. The max_new_tokens branch got its in-place replacement, but the max_length branch's equivalent (generation_config.max_length = max_length) was never carried over. It became dead code, harmless under the old loop, actively harmful once #44130 made max_length strict.

  2. An off-by-one hidden in num_initial_tokens.
  The compensation used `decoder_input_ids.shape[-1] - 1`. That -1 existed to cancel the old loop's free (uncounted) position, so the net inflation still came out to the full prefix length. PR #44130 removed that quirk, so the -1 now under-counts the prefix by one, leaving the output one token short even after re-adding the assignment.

TD;DR: #30018 planted latent dead code, #44130 activated it

Fixes:
- `test_modeling_whisper.py::WhisperModelIntegrationTests::test_tiny_generation`
- `test_modeling_whisper.py::WhisperModelIntegrationTests::test_tiny_en_generation`



Comments:
**[For maintainers]** Suggested jobs to run (before merge)

run-slow: whisper

run-slow: whisper

[Workflow Run ⚙️](https://github.com/huggingface/transformers/actions/runs/27911492902)

This comment contains `run-slow`, running the specified jobs: 

models: ["models/whisper"]
quantizations: []

**CI Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=46795)

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_46795). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

## CI Results
[Workflow Run ⚙️](https://github.com/huggingface/transformers/actions/runs/27911492902)

### Commit Info
| Context | Commit | Description |
|---------|--------|-------------|
| RUN | [fe761868](https://github.com/huggingface/transformers/commit/fe7618682ceb9696958913ff404c050abf91fb09) | workflow commit (merge commit) |
| PR | [5c10ba10](https://github.com/huggingface/transformers/commit/5c10ba10572a16eba14b96880e7f45bac0b0851c) | branch commit (from PR) |
| main | [1048e9af](https://github.com/huggingface/transformers/commit/1048e9af78a6045444244412dfe216ba5810e7fb) | base commit (on `main`) |

✅ No failing test specific to this PR 🎉 👏 !