Skip to content

Commit 26b94be

Browse files
committed
fix(agent): plms.py first iteration bypasses CFG.
1 parent 67bdc5c commit 26b94be

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

iddm/model/samples/plms.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,7 @@ def _sample_loop(
111111
c1 = self.eta * torch.sqrt((1 - alpha_t / alpha_prev) * (1 - alpha_prev) / (1 - alpha_t))
112112
c2 = torch.sqrt((1 - alpha_prev) - c1 ** 2)
113113
p_x = torch.sqrt(alpha_prev) * x0_t + c2 * predicted_noise + c1 * noise
114-
if labels is None and cfg_scale is None:
115-
# Images and time steps input into the model
116-
predicted_noise_next = model(p_x, p_t)
117-
else:
118-
predicted_noise_next = model(p_x, p_t, labels)
114+
predicted_noise_next = self._get_predicted_noise(model, p_x, p_t, labels, cfg_scale)
119115
predicted_noise_prime = (predicted_noise + predicted_noise_next) / 2
120116
elif len(old_eps) == 1:
121117
# 2nd order Pseudo Linear Multistep (Adams-Bashforth)

0 commit comments

Comments
 (0)