[training] SAVE_STATE_WARNING was removed in pytorch (#8979)
[training] SAVE_STATE_WARNING was removed in pytorch (#8979)

* [training] SAVE_STATE_WARNING was removed in pytorch

FYI `SAVE_STATE_WARNING` has been removed 3 days ago: pytorch/pytorch#46813

Fixes: #8232

@sgugger

* style, but add () to prevent autoformatters from botching it

* switch to try/except

* cleanup
huggingface/pytorch-transformers,huggingface/transformers,huggingface/transformers,huggingface/transformers,huggingface/transformers