Skip to content

Commit 78a7851

Browse files
make style
1 parent 9c03a7d commit 78a7851

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/diffusers/schedulers/scheduling_ddim_inverse.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,9 @@ def step(
333333
"""
334334
# 1. get previous step value (=t+1)
335335
prev_timestep = timestep
336-
timestep = min(timestep - self.config.num_train_timesteps // self.num_inference_steps, self.num_train_timesteps-1)
336+
timestep = min(
337+
timestep - self.config.num_train_timesteps // self.num_inference_steps, self.num_train_timesteps - 1
338+
)
337339

338340
# 2. compute alphas, betas
339341
# change original implementation to exactly match noise levels for analogous forward process

tests/schedulers/test_scheduler_ddim_inverse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_steps_offset(self):
5151
scheduler_config = self.get_scheduler_config(steps_offset=1)
5252
scheduler = scheduler_class(**scheduler_config)
5353
scheduler.set_timesteps(5)
54-
assert torch.equal(scheduler.timesteps, torch.LongTensor([ 1, 201, 401, 601, 801]))
54+
assert torch.equal(scheduler.timesteps, torch.LongTensor([1, 201, 401, 601, 801]))
5555

5656
def test_betas(self):
5757
for beta_start, beta_end in zip([0.0001, 0.001, 0.01, 0.1], [0.002, 0.02, 0.2, 2]):

0 commit comments

Comments
 (0)