We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b94880e commit 4a98d6eCopy full SHA for 4a98d6e
examples/research_projects/lora/train_text_to_image_lora.py
@@ -542,9 +542,9 @@ def main():
542
lora_layers = AttnProcsLayers(unet.attn_processors)
543
544
# Move unet, vae and text_encoder to device and cast to weight_dtype
545
- unet.to(accelerator.device, dtype=weight_dtype)
546
vae.to(accelerator.device, dtype=weight_dtype)
547
- text_encoder.to(accelerator.device, dtype=weight_dtype)
+ if not args.train_text_encoder:
+ text_encoder.to(accelerator.device, dtype=weight_dtype)
548
549
if args.enable_xformers_memory_efficient_attention:
550
if is_xformers_available():
0 commit comments