Skip to content

Commit

Permalink
[training] set rest of the blocks with requires_grad False. (#10607)
Browse files Browse the repository at this point in the history
set rest of the blocks with requires_grad False.
  • Loading branch information
sayakpaul authored Jan 19, 2025
1 parent 23b467c commit 328e0d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/flux-control/train_control_flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,8 @@ def main(args):
for name, module in flux_transformer.named_modules():
if "transformer_blocks" in name:
module.requires_grad_(True)
else:
module.requirs_grad_(False)

def unwrap_model(model):
model = accelerator.unwrap_model(model)
Expand Down

0 comments on commit 328e0d2

Please sign in to comment.