1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

make style

This commit is contained in:
Patrick von Platen
2023-09-29 08:55:26 +02:00
parent 9c03a7da43
commit 78a78515d6
2 changed files with 4 additions and 2 deletions

View File

@@ -333,7 +333,9 @@ class DDIMInverseScheduler(SchedulerMixin, ConfigMixin):
"""
# 1. get previous step value (=t+1)
prev_timestep = timestep
timestep = min(timestep - self.config.num_train_timesteps // self.num_inference_steps, self.num_train_timesteps-1)
timestep = min(
timestep - self.config.num_train_timesteps // self.num_inference_steps, self.num_train_timesteps - 1
)
# 2. compute alphas, betas
# change original implementation to exactly match noise levels for analogous forward process

View File

@@ -51,7 +51,7 @@ class DDIMInverseSchedulerTest(SchedulerCommonTest):
scheduler_config = self.get_scheduler_config(steps_offset=1)
scheduler = scheduler_class(**scheduler_config)
scheduler.set_timesteps(5)
assert torch.equal(scheduler.timesteps, torch.LongTensor([ 1, 201, 401, 601, 801]))
assert torch.equal(scheduler.timesteps, torch.LongTensor([1, 201, 401, 601, 801]))
def test_betas(self):
for beta_start, beta_end in zip([0.0001, 0.001, 0.01, 0.1], [0.002, 0.02, 0.2, 2]):