Skip to content

Commit

Permalink
latent_diffusion.solver: fix assert msg
Browse files Browse the repository at this point in the history
  • Loading branch information
piercus committed Oct 23, 2024
1 parent 3fdbc1e commit e148dde
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __call__(self, x: Tensor, predicted_noise: Tensor, step: int, generator: Gen
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],
Expand Down
2 changes: 1 addition & 1 deletion src/refiners/foundationals/latent_diffusion/solvers/dpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def __call__(
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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def __call__(self, x: Tensor, predicted_noise: Tensor, step: int, generator: Gen
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
Expand Down

0 comments on commit e148dde

Please sign in to comment.