1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

fix how is_fsdp is determined (#12960)

up
This commit is contained in:
Sayak Paul
2026-01-10 10:34:25 +05:30
committed by GitHub
parent 02c7adc356
commit d44b5f86e6
2 changed files with 2 additions and 2 deletions

View File

@@ -1228,7 +1228,7 @@ def main(args):
else {"device": accelerator.device, "dtype": weight_dtype}
)
is_fsdp = accelerator.state.fsdp_plugin is not None
is_fsdp = getattr(accelerator.state, "fsdp_plugin", None) is not None
if not is_fsdp:
transformer.to(**transformer_to_kwargs)

View File

@@ -1178,7 +1178,7 @@ def main(args):
else {"device": accelerator.device, "dtype": weight_dtype}
)
is_fsdp = accelerator.state.fsdp_plugin is not None
is_fsdp = getattr(accelerator.state, "fsdp_plugin", None) is not None
if not is_fsdp:
transformer.to(**transformer_to_kwargs)