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

[PNDM Scheduler] Make sure list cannot grow forever (#882)

This commit is contained in:
Patrick von Platen
2022-10-20 13:29:04 +02:00
committed by GitHub
parent 83f8a5ff70
commit 4a76e5d49b

View File

@@ -310,6 +310,7 @@ class PNDMScheduler(SchedulerMixin, ConfigMixin):
prev_timestep = timestep - self.config.num_train_timesteps // self.num_inference_steps
if self.counter != 1:
self.ets = self.ets[-3:]
self.ets.append(model_output)
else:
prev_timestep = timestep