diff options
author | Volpeon <git@volpeon.ink> | 2023-04-02 11:14:03 +0200 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2023-04-02 11:14:03 +0200 |
commit | e3669927b47b5367a3348d30c4b318da84af661d (patch) | |
tree | a9740db8cea9149eaab99f08f7cb8778f8e643b7 /training | |
parent | Update (diff) | |
download | textual-inversion-diff-e3669927b47b5367a3348d30c4b318da84af661d.tar.gz textual-inversion-diff-e3669927b47b5367a3348d30c4b318da84af661d.tar.bz2 textual-inversion-diff-e3669927b47b5367a3348d30c4b318da84af661d.zip |
Update dataset format: Separate prompt and keywords
Diffstat (limited to 'training')
-rw-r--r-- | training/functional.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/training/functional.py b/training/functional.py index b9fb546..96ecbc1 100644 --- a/training/functional.py +++ b/training/functional.py | |||
@@ -522,9 +522,12 @@ def train_loop( | |||
522 | 522 | ||
523 | accelerator.wait_for_everyone() | 523 | accelerator.wait_for_everyone() |
524 | 524 | ||
525 | lr = lr_scheduler.get_last_lr()[0] | 525 | if isDadaptation: |
526 | if torch.is_tensor(lr): | 526 | lr = optimizer.param_groups[0]["d"] * optimizer.param_groups[0]["lr"] |
527 | lr = lr.item() | 527 | else: |
528 | lr = lr_scheduler.get_last_lr()[0] | ||
529 | if torch.is_tensor(lr): | ||
530 | lr = lr.item() | ||
528 | 531 | ||
529 | lrs.append(lr) | 532 | lrs.append(lr) |
530 | 533 | ||