Skip to content

Commit 1037287

Browse files
examples fix t2i training (#5001)
* examples fix t2i training * make style
1 parent 6ea95b7 commit 1037287

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/t2i_adapter/train_t2i_adapter_sdxl.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,9 @@ def get_sigmas(timesteps, n_dim=4, dtype=torch.float32):
10601060
)
10611061

10621062
# Prepare everything with our `accelerator`.
1063-
t2iadapter, optimizer, lr_scheduler = accelerator.prepare(t2iadapter, optimizer, lr_scheduler)
1063+
t2iadapter, optimizer, train_dataloader, lr_scheduler = accelerator.prepare(
1064+
t2iadapter, optimizer, train_dataloader, lr_scheduler
1065+
)
10641066

10651067
# We need to recalculate our total training steps as the size of the training dataloader may have changed.
10661068
num_update_steps_per_epoch = math.ceil(len(train_dataloader) / args.gradient_accumulation_steps)

0 commit comments

Comments
 (0)