latent_diffusion.solver: fix assert msg

This commit is contained in:
Pierre Colle 2024-10-23 14:31:53 +00:00
parent 3fdbc1e81a
commit e148dded6f
3 changed files with 3 additions and 3 deletions

View file

@ -65,7 +65,7 @@ class DDIM(Solver):
Returns:
The denoised version of the input data `x`.
"""
assert self.first_inference_step <= step < self.num_inference_steps, "invalid step {step}"
assert self.first_inference_step <= step < self.num_inference_steps, f"invalid step {step}"
timestep, previous_timestep = (
self.timesteps[step],

View file

@ -308,7 +308,7 @@ class DPMSolver(Solver):
Returns:
The denoised version of the input data `x`.
"""
assert self.first_inference_step <= step < self.num_inference_steps, "invalid step {step}"
assert self.first_inference_step <= step < self.num_inference_steps, f"invalid step {step}"
scale_factor = self.cumulative_scale_factors[step]
noise_ratio = self.noise_std[step]

View file

@ -89,7 +89,7 @@ class Euler(Solver):
Returns:
The denoised version of the input data `x`.
"""
assert self.first_inference_step <= step < self.num_inference_steps, "invalid step {step}"
assert self.first_inference_step <= step < self.num_inference_steps, f"invalid step {step}"
if self.params.model_prediction_type == ModelPredictionType.SAMPLE:
x0 = predicted_noise # the model does not actually predict the noise but x0