Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transformers 4.39.0 has breaking change on torch compatibility. #29895

Closed
xkszltl opened this issue Mar 27, 2024 · 1 comment · Fixed by #29919
Closed

Transformers 4.39.0 has breaking change on torch compatibility. #29895

xkszltl opened this issue Mar 27, 2024 · 1 comment · Fixed by #29919

Comments

@xkszltl
Copy link
Contributor

xkszltl commented Mar 27, 2024

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.

@ArthurZucker
Copy link
Collaborator

This is a duplicate of #29847, I'll push something asap and do a patch release. FYI @LysandreJik and @amyeroberts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants