mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-06 13:47:06 +00:00
fix text_encoder_lr to work with int closes #1608
This commit is contained in:
@@ -966,8 +966,8 @@ class LoRANetwork(torch.nn.Module):
|
|||||||
# if float, use the same value for both text encoders
|
# 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):
|
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]
|
text_encoder_lr = [default_lr, default_lr]
|
||||||
elif isinstance(text_encoder_lr, float):
|
elif isinstance(text_encoder_lr, float) or isinstance(text_encoder_lr, int):
|
||||||
text_encoder_lr = [text_encoder_lr, text_encoder_lr]
|
text_encoder_lr = [float(text_encoder_lr), float(text_encoder_lr)]
|
||||||
elif len(text_encoder_lr) == 1:
|
elif len(text_encoder_lr) == 1:
|
||||||
text_encoder_lr = [text_encoder_lr[0], text_encoder_lr[0]]
|
text_encoder_lr = [text_encoder_lr[0], text_encoder_lr[0]]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user