Update rl.py
This commit is contained in:
parent
eaed3eb015
commit
fb443fcfd6
1 changed files with 3 additions and 3 deletions
|
|
@ -272,9 +272,9 @@ def _patch_trl_rl_trainers(trainer_file = "grpo_trainer"):
|
|||
# Warn on too large or too small learning rate
|
||||
if " learning_rate" in call_args:
|
||||
learning_rate_check = \
|
||||
"if learning_rate < 1e-7: raise FloatingPointError(f'Unsloth: Your learning rate of `{learning_rate}` is too small and less than 1e-7! '"\
|
||||
"'Consider increasing it, otherwise gradient updates will be close to 0!')\n"\
|
||||
"if learning_rate > 1: raise OverflowError(f'Unsloth: Your learning rate of `{learning_rate}` is way too larger > 1! '"\
|
||||
"if learning_rate < 1e-7: raise FloatingPointError(f'Unsloth: Your learning rate of `{learning_rate}` is too small and less than 1e-7! "\
|
||||
"Consider increasing it, otherwise gradient updates will be close to 0!')\n"\
|
||||
"if learning_rate > 1: raise OverflowError(f'Unsloth: Your learning rate of `{learning_rate}` is way too larger > 1! "\
|
||||
"Consider decreasing it to 1e-1, otherwise gradient updates will explode!')\n"
|
||||
extra_args += learning_rate_check
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue