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:
committed by
GitHub
parent
6ea95b7a90
commit
1037287e2b
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user