Handle audio/ video default arguments in processor's apply_chat_template
Author: eustlb
Pull request: yes

# What does this PR do?

For multimodal models, it is often required to pass kwargs indicating how the passed inputs have been sampled for the Processor: `fps` for video inputs, `sampling_rate` for audio inputs.

Such values can be set as default values for in `ModelProcessorKwargs`, nevertheless they are not passed to the processor's `__call__` method when using `apply_chat_template`, resulting in silent errors.

For example in `Qwen2.5-VL`:
```python
from transformers import AutoProcessor

processor = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-7B-Instruct")

conversation = [
    {
        "role": "user",
        "content": [
            {"type": "video", "path": "example.mp4"},
            {"type": "text", "text": "What happened in the video?"},
        ],
    }
]

inputs = processor.apply_chat_template(
    conversation,
    video_fps=1,
    add_generation_prompt=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt"
) 
```
→  images will be sampled at 1 fps

Yet such value (`fps=1`) is not passed in `kwargs` in:
```python
out = self(
    text=prompt,
    images=batch_images if batch_images else None,
    videos=batch_videos if batch_videos else None,
    audio=batch_audios if batch_audios else None,
    **kwargs,
)
```
making that the default value `fps=2` is used in the processor's `__call__` method.

This is also the case for audio processors that need to know at which `sampling_rate` the audio has been sampled.

# Fix attempt

I provide an attempt to fix by initialising such values to the specified default value in the `ModelProcessorKwargs` if provided, and passing this value to the Processors `__call__` kwargs.

cc @zucchini-nlp and @molbap since we talked offline about this


Comments:
Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. The CI will be paused while the PR is in draft mode. When it is ready for review, please click the `Ready for review` button (at the bottom of the PR page). This will assign reviewers and trigger CI.

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

And also, I am planning to move the whole video sampling into `video_processors` after it is merged. There are some ideas on how it will look like with SmolVLM (the most complicated sampling logic) in [this PR](https://github.com/zucchini-nlp/transformers/pull/3). I will make this idea open to discussion after it's unblocked.

Until then we can start by deprecating similar kwargs and passing sampling args further to model as well

> I don't fully understand why we need to modify `kwargs` used for in `load_video`.

I think it's because, if the user provides a value for `fps`, we want to apply it during video loading so the correct number of frames is retrieved. Otherwise, it would load all frames (current behaviour; undesired, imo), or the new default we set in `Qwen2_5OmniProcessorKwargs._defaults.videos_kwargs`, which could be different to the value supplied by the user.

> And also, I am planning to move the whole video sampling into `video_processors` after it is merged. There are some ideas on how it will look like with SmolVLM (the most complicated sampling logic) in [this PR](https://github.com/zucchini-nlp/transformers/pull/3). I will make this idea open to discussion after it's unblocked.

Nice! Feel free to ping when you are ready, happy to test drive.


> if the user provides a value for fps, we want to apply it during video loading so the correct number of frames is retrieved

Oh right, haven't thought of it. Making `fps` the only correct arg and deprecating `video_fps` solves the issue then, I think

Yep perfect, handling the deprecation of `video_fps` in this PR!