Skip to content

Commit df69ed8

Browse files
committed
reformat
Signed-off-by: Can-Zhao <[email protected]>
1 parent 4bf6c02 commit df69ed8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

monai/networks/schedulers/rectified_flow.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,10 @@ def set_timesteps(
196196
device: target device to put the data.
197197
input_img_size_numel: int, H*W*D of the image, used with self.use_timestep_transform is True.
198198
"""
199-
if num_inference_steps > self.num_train_timesteps:
199+
if num_inference_steps > self.num_train_timesteps or num_inference_steps < 1:
200200
raise ValueError(
201-
f"`num_inference_steps`: {num_inference_steps} cannot be larger than `self.num_train_timesteps`:"
201+
f"`num_inference_steps`: {num_inference_steps} should be at least 1, "
202+
"and cannot be larger than `self.num_train_timesteps`:"
202203
f" {self.num_train_timesteps} as the unet model trained with this scheduler can only handle"
203204
f" maximal {self.num_train_timesteps} timesteps."
204205
)

0 commit comments

Comments
 (0)