Skip to content

Conversation

@williamberman
Copy link
Contributor

@williamberman williamberman commented Mar 16, 2023

re: #2321

Comment on lines +668 to +683
unet = accelerator.unwrap_model(model)

if args.use_ema:
ema_model.store(unet.parameters())
ema_model.copy_to(unet.parameters())

pipeline = DDPMPipeline(
unet=unet,
scheduler=noise_scheduler,
)

pipeline.save_pretrained(args.output_dir)

if args.use_ema:
ema_model.restore(unet.parameters())

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to make a separate pipeline here because it's not guaranteed that the pipeline set on line 633 is ever set. It's very likely that most people calling this script are never setting the save_model_epocs or save_images_epochs and they're always the same default values

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Mar 16, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - thanks!

@williamberman williamberman merged commit a4b2c2f into huggingface:main Mar 16, 2023
w4ffl35 pushed a commit to w4ffl35/diffusers that referenced this pull request Apr 14, 2023
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants