Used disable grad for component on lora fine tuning enabled

This commit is contained in:
CrossProduct
2025-01-07 20:41:12 +00:00
parent f0db0ccb00
commit 4cd5a8e53b
+2 -1
View File
@@ -390,7 +390,8 @@ class Trainer:
self._enable_grad_for_components(components=[self.transformer])
else:
logger.info("Lora Fine Tuning Enabled")
self._disable_grad_for_components(components=[self.transformer])
# For mixed precision training we cast all non-trainable weights (vae, text_encoder and transformer) to half-precision
# as these weights are only used for inference, keeping weights in full precision is not required.
weight_dtype = self._get_training_dtype(accelerator=self.state.accelerator)