Skip to content

Conversation

@bglick13
Copy link
Contributor

@bglick13 bglick13 commented Nov 3, 2022

Trying to keep this a small PR that just adds necessary changes in DDPM scheduler to support v diffusion. I have a supporting example script using the butterflies dataset I can add either here or as a separate PR

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Nov 3, 2022

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

@bglick13 bglick13 marked this pull request as ready for review November 4, 2022 15:25
generator: Optional[torch.Generator] = None,
output_type: Optional[str] = "pil",
return_dict: bool = True,
prediction_type: Literal["epsilon", "sample", "v"] = "epsilon",
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be retrieved from the config of the scheduler / model IMO - I don't think this is something that the user would ever change during runtime.

model_output: torch.FloatTensor,
timestep: int,
sample: torch.FloatTensor,
prediction_type: str = "epsilon",
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually I think we should deprecate this argument and just have it in the config instead - I don't it's something that differs for every scheduler call. @anton-l what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense! That means the pipeline doesn’t have to change at all either

Copy link
Member

Choose a reason for hiding this comment

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

I agree, the prediction type doesn't need to change during sampling

@natolambert natolambert merged commit f00d896 into huggingface:v_prediction Nov 9, 2022
@bglick13
Copy link
Contributor Author

bglick13 commented Nov 9, 2022

By the way, here is the butterflies example samples trained on this implementation. I think it looks good compared to the original example, but wanted to put it out there for others to evaluate.

0049

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.

5 participants