Skip to content

Commit

Permalink
Allow unknown schedule-free optimizers to continue to module loader
Browse files Browse the repository at this point in the history
  • Loading branch information
rockerBOO committed Nov 20, 2024
1 parent f33e155 commit 0dbb0d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/train_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4100,8 +4100,10 @@ def get_optimizer(args, trainable_params):
optimizer_class = sf.SGDScheduleFree
logger.info(f"use SGDScheduleFree optimizer | {optimizer_kwargs}")
else:
raise ValueError(f"Unknown optimizer type: {optimizer_type}")
optimizer = optimizer_class(trainable_params, lr=lr, **optimizer_kwargs)
optimizer_class = None

if optimizer_class is not None:
optimizer = optimizer_class(trainable_params, lr=lr, **optimizer_kwargs)

if optimizer is None:
# 任意のoptimizerを使う
Expand Down

0 comments on commit 0dbb0d9

Please sign in to comment.