summaryrefslogtreecommitdiffstats
path: root/training/strategy
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2023-04-08 08:20:30 +0200
committerVolpeon <git@volpeon.ink>2023-04-08 08:20:30 +0200
commit49e0a72e3c6c059abc3fb8b2dcbdda2553402018 (patch)
tree644190d2240ed3905d35632d4e45b3d48ddb2064 /training/strategy
parentUpdate (diff)
downloadtextual-inversion-diff-49e0a72e3c6c059abc3fb8b2dcbdda2553402018.tar.gz
textual-inversion-diff-49e0a72e3c6c059abc3fb8b2dcbdda2553402018.tar.bz2
textual-inversion-diff-49e0a72e3c6c059abc3fb8b2dcbdda2553402018.zip
Fix
Diffstat (limited to 'training/strategy')
-rw-r--r--training/strategy/lora.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/training/strategy/lora.py b/training/strategy/lora.py
index 89269c0..cfdc504 100644
--- a/training/strategy/lora.py
+++ b/training/strategy/lora.py
@@ -100,9 +100,8 @@ def lora_strategy_callbacks(
100 100
101 @torch.no_grad() 101 @torch.no_grad()
102 def on_after_optimize(w, lrs: dict[str, float]): 102 def on_after_optimize(w, lrs: dict[str, float]):
103 lr = lrs["emb"] or lrs["0"] 103 if use_emb_decay and w is not None and "emb" in lrs:
104 104 lr = lrs["emb"]
105 if use_emb_decay and w is not None:
106 lambda_ = emb_decay * lr 105 lambda_ = emb_decay * lr
107 106
108 if lambda_ != 0: 107 if lambda_ != 0: