Add check for different embedding types in examples
This PR fixes an issue that occurred because we did two things at the same time: We started transitioning our models to use `keras.Embedding` layers, but also added code to the examples to only resize embeddings when necessary by checking `model.get_input_embeddings().weight.shape`. However, because of the transition, the relevant variable became `model.get_input_embeddings().embeddings` in some cases!

To fix this, I added a check for both types of embeddings. When the transition is complete, we can remove the `.weight` code path and only use `.embeddings`.

I've checked that all the affected examples run without errors using the command supplied in the README following this PR.

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