mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Replace assert statement with if condition and ValueError (#13263)
This commit is contained in:
parent
46554fc12f
commit
225de5ccbb
@ -201,7 +201,8 @@ def get_polynomial_decay_schedule_with_warmup(
|
||||
"""
|
||||
|
||||
lr_init = optimizer.defaults["lr"]
|
||||
assert lr_init > lr_end, f"lr_end ({lr_end}) must be be smaller than initial lr ({lr_init})"
|
||||
if not (lr_init > lr_end):
|
||||
raise ValueError(f"lr_end ({lr_end}) must be be smaller than initial lr ({lr_init})")
|
||||
|
||||
def lr_lambda(current_step: int):
|
||||
if current_step < num_warmup_steps:
|
||||
|
Loading…
Reference in New Issue
Block a user