Fix generation config for empty state dict
# What does this PR do?

This PR follows up on #21542 which didn't fix the problem for generative models. For those, the generation config can't be generated properly and returns another type of error than the one intercepted in `from_pretrained`. The fix is thus easy.

To make sure to catch the problem on all models, the test added in #21542 is graduated as a common test.

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