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
3e69e241
Unverified
Commit
3e69e241
authored
Sep 24, 2024
by
Seongbin Lim
Committed by
GitHub
Sep 23, 2024
Browse files
Allow DDPMPipeline half precision (#9222)
Co-authored-by:
YiYi Xu
<
yixu310@gmail.com
>
parent
65f9439b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/diffusers/pipelines/ddpm/pipeline_ddpm.py
src/diffusers/pipelines/ddpm/pipeline_ddpm.py
+2
-2
No files found.
src/diffusers/pipelines/ddpm/pipeline_ddpm.py
View file @
3e69e241
...
@@ -101,10 +101,10 @@ class DDPMPipeline(DiffusionPipeline):
...
@@ -101,10 +101,10 @@ class DDPMPipeline(DiffusionPipeline):
if
self
.
device
.
type
==
"mps"
:
if
self
.
device
.
type
==
"mps"
:
# randn does not work reproducibly on mps
# randn does not work reproducibly on mps
image
=
randn_tensor
(
image_shape
,
generator
=
generator
)
image
=
randn_tensor
(
image_shape
,
generator
=
generator
,
dtype
=
self
.
unet
.
dtype
)
image
=
image
.
to
(
self
.
device
)
image
=
image
.
to
(
self
.
device
)
else
:
else
:
image
=
randn_tensor
(
image_shape
,
generator
=
generator
,
device
=
self
.
device
)
image
=
randn_tensor
(
image_shape
,
generator
=
generator
,
device
=
self
.
device
,
dtype
=
self
.
unet
.
dtype
)
# set step values
# set step values
self
.
scheduler
.
set_timesteps
(
num_inference_steps
)
self
.
scheduler
.
set_timesteps
(
num_inference_steps
)
...
...
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