Generate: Fix GIT batched captioning
# What does this PR do?

Fixes #21714 (batched image captioning with GIT not working)

The problem, at a higher level, boils down to a previously incomplete `batch_size` inference when no `input_ids` nor `inputs_embeds` was being passed to `.generate()` in decoder-only models -- we were always assuming `batch_size=1`, which is not correct in some multimodal models like GIT. 

If the `.generate()` doesn't receive `input_ids`, then some input tensor must live in `model_kwargs`. Now, we look for tensors in `model_kwargs` and use them as a source of information to determine the `batch_size`, which is then used to initialize `input_ids` with the correct shape.

👉 changes also made on the TF side
👉 a test was added to ensure we don't regress
_The documentation is not available anymore as the PR was closed or merged._