mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-09 14:45:19 +00:00
fix to work old notation for TE LR in .toml
This commit is contained in:
@@ -788,8 +788,11 @@ class LoRANetwork(torch.nn.Module):
|
||||
|
||||
def prepare_optimizer_params_with_multiple_te_lrs(self, text_encoder_lr, unet_lr, default_lr):
|
||||
# make sure text_encoder_lr as list of two elements
|
||||
if text_encoder_lr is None or len(text_encoder_lr) == 0:
|
||||
# if float, use the same value for both text encoders
|
||||
if text_encoder_lr is None or (isinstance(text_encoder_lr, list) and len(text_encoder_lr) == 0):
|
||||
text_encoder_lr = [default_lr, default_lr]
|
||||
elif isinstance(text_encoder_lr, float):
|
||||
text_encoder_lr = [text_encoder_lr, text_encoder_lr]
|
||||
elif len(text_encoder_lr) == 1:
|
||||
text_encoder_lr = [text_encoder_lr[0], text_encoder_lr[0]]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user