[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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

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