mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-27 17:22:53 +03:00
[Examples] Make sure EMA works with any device (#2382)
* Fix EMA * up * update
This commit is contained in:
committed by
GitHub
parent
a60f5555f5
commit
ca980fd0d1
@@ -438,6 +438,7 @@ def main():
|
||||
if args.use_ema:
|
||||
load_model = EMAModel.from_pretrained(os.path.join(input_dir, "unet_ema"), UNet2DConditionModel)
|
||||
ema_unet.load_state_dict(load_model.state_dict())
|
||||
ema_unet.to(accelerator.device)
|
||||
del load_model
|
||||
|
||||
for i in range(len(models)):
|
||||
|
||||
Reference in New Issue
Block a user