Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
36b459f6
Commit
36b459f6
authored
Jul 18, 2022
by
anton-l
Browse files
Make tqdm calls notebook-compatible - follow-up
parent
18200240
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
src/diffusers/pipelines/glide/pipeline_glide.py
src/diffusers/pipelines/glide/pipeline_glide.py
+1
-1
src/diffusers/pipelines/pndm/pipeline_pndm.py
src/diffusers/pipelines/pndm/pipeline_pndm.py
+1
-1
No files found.
src/diffusers/pipelines/glide/pipeline_glide.py
View file @
36b459f6
...
@@ -817,7 +817,7 @@ class GlidePipeline(DiffusionPipeline):
...
@@ -817,7 +817,7 @@ class GlidePipeline(DiffusionPipeline):
num_trained_timesteps
=
self
.
upscale_scheduler
.
timesteps
num_trained_timesteps
=
self
.
upscale_scheduler
.
timesteps
inference_step_times
=
range
(
0
,
num_trained_timesteps
,
num_trained_timesteps
//
num_inference_steps_upscale
)
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
# 1. predict noise residual
with
torch
.
no_grad
():
with
torch
.
no_grad
():
time_input
=
torch
.
tensor
([
inference_step_times
[
t
]]
*
image
.
shape
[
0
],
device
=
torch_device
)
time_input
=
torch
.
tensor
([
inference_step_times
[
t
]]
*
image
.
shape
[
0
],
device
=
torch_device
)
...
...
src/diffusers/pipelines/pndm/pipeline_pndm.py
View file @
36b459f6
...
@@ -53,7 +53,7 @@ class PNDMPipeline(DiffusionPipeline):
...
@@ -53,7 +53,7 @@ class PNDMPipeline(DiffusionPipeline):
image
=
self
.
scheduler
.
step_prk
(
model_output
,
t
,
image
,
num_inference_steps
)[
"prev_sample"
]
image
=
self
.
scheduler
.
step_prk
(
model_output
,
t
,
image
,
num_inference_steps
)[
"prev_sample"
]
timesteps
=
self
.
scheduler
.
get_time_steps
(
num_inference_steps
)
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
]
t_orig
=
timesteps
[
t
]
model_output
=
self
.
unet
(
image
,
t_orig
)
model_output
=
self
.
unet
(
image
,
t_orig
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment