Skip to content

Commit

Permalink
warn if incorrect accelerate version with schedule free
Browse files Browse the repository at this point in the history
Co-authored-by: Aman Gupta Karmani <[email protected]>
  • Loading branch information
winglian and tmm1 authored Sep 7, 2024
1 parent 179232c commit 975f045
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/transformers/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1498,6 +1498,8 @@ def optimizer_hook(param):
"You need to install `schedulefree` in order to use schedulefree optimizers"
" install it with `pip install schedulefree`"
)
if not is_accelerate_available("0.30.0"):
raise ImportError("You need to have `accelerate>=0.30.0` to be able to use schedulefree optimizers")
from schedulefree import AdamWScheduleFree, SGDScheduleFree

additional_optim_kwargs = {}
Expand Down

0 comments on commit 975f045

Please sign in to comment.