[PNDM Scheduler] Make sure list cannot grow forever (#882)
This commit is contained in:
parent
83f8a5ff70
commit
4a76e5d49b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue