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
84d7faeb
Unverified
Commit
84d7faeb
authored
Dec 28, 2023
by
Adrian Punga
Committed by
GitHub
Dec 28, 2023
Browse files
Fix support for MPS in KDPM2AncestralDiscreteScheduler (#6365)
Fix support for MPS MPS doesn't support float64
parent
4c483deb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
src/diffusers/schedulers/scheduling_k_dpm_2_ancestral_discrete.py
...users/schedulers/scheduling_k_dpm_2_ancestral_discrete.py
+5
-1
No files found.
src/diffusers/schedulers/scheduling_k_dpm_2_ancestral_discrete.py
View file @
84d7faeb
...
@@ -277,7 +277,11 @@ class KDPM2AncestralDiscreteScheduler(SchedulerMixin, ConfigMixin):
...
@@ -277,7 +277,11 @@ class KDPM2AncestralDiscreteScheduler(SchedulerMixin, ConfigMixin):
self
.
sigmas_up
=
torch
.
cat
([
sigmas_up
[:
1
],
sigmas_up
[
1
:].
repeat_interleave
(
2
),
sigmas_up
[
-
1
:]])
self
.
sigmas_up
=
torch
.
cat
([
sigmas_up
[:
1
],
sigmas_up
[
1
:].
repeat_interleave
(
2
),
sigmas_up
[
-
1
:]])
self
.
sigmas_down
=
torch
.
cat
([
sigmas_down
[:
1
],
sigmas_down
[
1
:].
repeat_interleave
(
2
),
sigmas_down
[
-
1
:]])
self
.
sigmas_down
=
torch
.
cat
([
sigmas_down
[:
1
],
sigmas_down
[
1
:].
repeat_interleave
(
2
),
sigmas_down
[
-
1
:]])
if
str
(
device
).
startswith
(
"mps"
):
timesteps
=
torch
.
from_numpy
(
timesteps
).
to
(
device
,
dtype
=
torch
.
float32
)
else
:
timesteps
=
torch
.
from_numpy
(
timesteps
).
to
(
device
)
timesteps
=
torch
.
from_numpy
(
timesteps
).
to
(
device
)
sigmas_interpol
=
sigmas_interpol
.
cpu
()
sigmas_interpol
=
sigmas_interpol
.
cpu
()
log_sigmas
=
self
.
log_sigmas
.
cpu
()
log_sigmas
=
self
.
log_sigmas
.
cpu
()
timesteps_interpol
=
np
.
array
(
timesteps_interpol
=
np
.
array
(
...
...
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