set eos_token_id to None to generate until max length
# What does this PR do?

Update `check_encoder_decoder_model_generate` to generate until max length.
Otherwise, this check

```python
self.assertEqual(generated_output.shape, (input_ids.shape[0],) + (decoder_config.max_length,))
```

might fail.

### Remark

In `generate()`, we have

https://github.com/huggingface/transformers/blob/dced262409177586bb510b6b724c762fb89da0e8/src/transformers/generation_utils.py#L1129-L1133

So I think the (original) logic about `Generate until max length` in `check_encoder_decoder_model_generate` should be updated too. The case won't really happen in the tests, but in general, `config` might still have `eos_token_id`.

I also leave the corresponding flax tests untouched for now.

This PR will fix

```
FAILED tests/models/vision_encoder_decoder/test_modeling_vision_encoder_decoder.py::Swin2BartModelTest::test_encoder_decoder_model_generate

tests/vision_encoder_decoder/test_modeling_vision_encoder_decoder.py:280: in check_encoder_decoder_model_generate
self.assertEqual(generated_output.shape, (inputs.shape[0],) + (decoder_config.max_length,))
AssertionError: torch.Size([13, 2]) != (13, 20)
```

_The documentation is not available anymore as the PR was closed or merged._