This commit is contained in:
James Betker 2021-12-07 09:55:39 -07:00
parent ef15a39841
commit 9191201f05

View File

@ -31,7 +31,7 @@ class GaussianDiffusionInjector(Injector):
hq = state[self.input]
# In eval mode, seed torch with a deterministic seed for reproducibility.
if not gen.training():
if not gen.training:
torch.manual_seed(0)
random.seed(0)
@ -51,7 +51,7 @@ class GaussianDiffusionInjector(Injector):
self.output_x_start_key: diffusion_outputs['x_start_predicted']})
# Absolutely critical to undo the above seed.
if not gen.training():
if not gen.training:
torch.manual_seed(int(time.time()))
random.seed(int(time.time()))