Fix AdamWeightDecay for TF 2.11
Fixes #20724 
@gante take a quick look at this one too, please! Our `AdamWeightDecay` doesn't work with the new Optimizer base class in TF 2.11, so I moved it onto the legacy class for now. When I have more time I should clean this up properly, and possibly just use [the official AdamW](https://www.tensorflow.org/api_docs/python/tf/keras/optimizers/experimental/AdamW) instead.<|||||>_The documentation is not available anymore as the PR was closed or merged._<|||||>The same issue occurred with the Summarization tutorial. [https://huggingface.co/course/chapter7/5?fw=tf#models-for-text-summarization](url)<|||||>Thanks @el-profesor-04 - can you confirm that the issue goes away with you install the latest version of `transformers` from main with `pip install --upgrade git+https://github.com/huggingface/transformers.git`?