EMA saving was broken if ema_unet/diffusion_pytorch_model.safetensors already existed. This changes safe_serialization to True and removes the weird workaround in ema_model.save_pretrained.
Issue ticket number and link (if applicable)
Checklist before requesting a review
[ ] This is based on the /dev branch (Or a fork of it)
[x] This was created or at least validated using a proper IDE
[x] I have tested this code and validated any modified functions
[x] I have added the appropriate documentation and hint strings if adding or changing a user-facing feature
Describe your changes
EMA saving was broken if
ema_unet/diffusion_pytorch_model.safetensors
already existed. This changessafe_serialization
toTrue
and removes the weird workaround inema_model.save_pretrained
.Issue ticket number and link (if applicable)
Checklist before requesting a review