1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

examples fix t2i training (#5001)

* examples fix t2i training

* make style
This commit is contained in:
Patrick von Platen
2023-09-12 23:52:41 +02:00
committed by GitHub
parent 6ea95b7a90
commit 1037287e2b

View File

@@ -1060,7 +1060,9 @@ def main(args):
)
# Prepare everything with our `accelerator`.
t2iadapter, optimizer, lr_scheduler = accelerator.prepare(t2iadapter, optimizer, lr_scheduler)
t2iadapter, optimizer, train_dataloader, lr_scheduler = accelerator.prepare(
t2iadapter, optimizer, train_dataloader, lr_scheduler
)
# We need to recalculate our total training steps as the size of the training dataloader may have changed.
num_update_steps_per_epoch = math.ceil(len(train_dataloader) / args.gradient_accumulation_steps)