Fix #45305 + add regression test GAS (#45349)
* Fix #45305 + add regression test GAS
* Refine test model_accepts_loss_kwargs
* fix style
* Fix properly setup model_accepts_loss_kwargs+True
* Update tests/trainer/test_trainer.py
remove unnecessary parameters
Co-authored-by: Marc Sun <57196510+SunMarc@users.noreply.github.com>
* fix: simplify error messages, back to a simpler test
* feat: add new test with actual training
---------
Co-authored-by: Marc Sun <57196510+SunMarc@users.noreply.github.com>