Skip to content

Commit d44b5f8

Browse files
authored
fix how is_fsdp is determined (#12960)
up
1 parent 02c7adc commit d44b5f8

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

examples/dreambooth/train_dreambooth_lora_flux2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ def main(args):
12281228
else {"device": accelerator.device, "dtype": weight_dtype}
12291229
)
12301230

1231-
is_fsdp = accelerator.state.fsdp_plugin is not None
1231+
is_fsdp = getattr(accelerator.state, "fsdp_plugin", None) is not None
12321232
if not is_fsdp:
12331233
transformer.to(**transformer_to_kwargs)
12341234

examples/dreambooth/train_dreambooth_lora_flux2_img2img.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ def main(args):
11781178
else {"device": accelerator.device, "dtype": weight_dtype}
11791179
)
11801180

1181-
is_fsdp = accelerator.state.fsdp_plugin is not None
1181+
is_fsdp = getattr(accelerator.state, "fsdp_plugin", None) is not None
11821182
if not is_fsdp:
11831183
transformer.to(**transformer_to_kwargs)
11841184

0 commit comments

Comments
 (0)