Unverified Commit 225de5cc authored by Nishant Prabhu's avatar Nishant Prabhu Committed by GitHub
Browse files

Replace assert statement with if condition and ValueError (#13263)

parent 46554fc1
...@@ -201,7 +201,8 @@ def get_polynomial_decay_schedule_with_warmup( ...@@ -201,7 +201,8 @@ def get_polynomial_decay_schedule_with_warmup(
""" """
lr_init = optimizer.defaults["lr"] 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): def lr_lambda(current_step: int):
if current_step < num_warmup_steps: if current_step < num_warmup_steps:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment