Skip to content

PNDM API Updates, Tests Cleaning#103

Merged
natolambert merged 6 commits into
mainfrom
schedulers
Jul 20, 2022
Merged

PNDM API Updates, Tests Cleaning#103
natolambert merged 6 commits into
mainfrom
schedulers

Conversation

@natolambert

@natolambert natolambert commented Jul 19, 2022

Copy link
Copy Markdown
Contributor

Major changes:

  • change PNDM tests to override base class rather than have double plms tests
  • add get_timesteps and set_timesteps functions to match API with other schedulers (no longer one per timestep type)
  • minor update pipeline file

@HuggingFaceDocBuilderDev

HuggingFaceDocBuilderDev commented Jul 19, 2022

Copy link
Copy Markdown

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

image = image.to(torch_device)

prk_time_steps = self.scheduler.get_prk_time_steps(num_inference_steps)
prk_time_steps = self.scheduler.get_timesteps(num_inference_steps, step_mode="prk")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ideally I'd like to not have a get_... function at all, but just self.prk_timesteps and self.plms_timesteps - what do you think?


prk_time_steps = self.scheduler.get_prk_time_steps(num_inference_steps)
prk_time_steps = self.scheduler.get_timesteps(num_inference_steps, step_mode="prk")
for t in tqdm(range(len(prk_time_steps))):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this should be:

for t in tqdm(self.prk_timesteps):
...

IMO

and it'd be nice if we would only have:

scheduler.set_timesteps(...)

which sets up both self.prk_timesteps and self.plms_timesteps arrays

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah I like this, going to make these changes now.

@natolambert natolambert merged commit 889aa60 into main Jul 20, 2022
@kashif kashif deleted the schedulers branch September 16, 2022 15:49
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
* organize PNDM tests, begin API change

* clean timestep API PNDM

* update pipeline PNDM

* fix typo

* API clean round 2

* small nit
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