1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-29 07:22:12 +03:00

Make tqdm calls notebook-compatible - follow-up

This commit is contained in:
anton-l
2022-07-18 18:43:18 +02:00
parent 1820024005
commit 36b459f6e6
2 changed files with 2 additions and 2 deletions

View File

@@ -817,7 +817,7 @@ class GlidePipeline(DiffusionPipeline):
num_trained_timesteps = self.upscale_scheduler.timesteps
inference_step_times = range(0, num_trained_timesteps, num_trained_timesteps // num_inference_steps_upscale)
for t in tqdm.tqdm(reversed(range(num_inference_steps_upscale)), total=num_inference_steps_upscale):
for t in tqdm(reversed(range(num_inference_steps_upscale)), total=num_inference_steps_upscale):
# 1. predict noise residual
with torch.no_grad():
time_input = torch.tensor([inference_step_times[t]] * image.shape[0], device=torch_device)

View File

@@ -53,7 +53,7 @@ class PNDMPipeline(DiffusionPipeline):
image = self.scheduler.step_prk(model_output, t, image, num_inference_steps)["prev_sample"]
timesteps = self.scheduler.get_time_steps(num_inference_steps)
for t in tqdm.tqdm(range(len(timesteps))):
for t in tqdm(range(len(timesteps))):
t_orig = timesteps[t]
model_output = self.unet(image, t_orig)