System Info
torch 1.13 + transformers 4.39.0
Description
torch.optim.LRScheduler was only exposed in torch 2:
Previously it was called _LRScheduler in torch 1.
This recent PR included in 4.39.0 imports it and lead to a hard requirement on torch 2:
FYI @younesbelkada
This issue is captured by our CI where we have dependency on torch 1.
Expected behavior
Suggest to check on version or API availability before use.
Given it's only a visibility change, a transparent fallback/re-route would be ideal.