Skip to content

Commit

Permalink
fix: backward compatibility for text_encoder_lr
Browse files Browse the repository at this point in the history
  • Loading branch information
Akegarasu committed Sep 20, 2024
1 parent b844c70 commit 0535cd2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion train_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,11 @@ def train(self, args):
if support_multiple_lrs:
text_encoder_lr = args.text_encoder_lr
else:
text_encoder_lr = None if args.text_encoder_lr is None or len(args.text_encoder_lr) == 0 else args.text_encoder_lr[0]
# toml backward compatibility
if args.text_encoder_lr is None or isinstance(args.text_encoder_lr, float):
text_encoder_lr = args.text_encoder_lr
else:
text_encoder_lr = None if len(args.text_encoder_lr) == 0 else args.text_encoder_lr[0]
try:
if support_multiple_lrs:
results = network.prepare_optimizer_params_with_multiple_te_lrs(text_encoder_lr, args.unet_lr, args.learning_rate)
Expand Down

0 comments on commit 0535cd2

Please sign in to comment.