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
f4fdb3a0
Unverified
Commit
f4fdb3a0
authored
Jan 03, 2025
by
G.O.D
Committed by
GitHub
Jan 02, 2025
Browse files
fix bug for ascend npu (#10429)
parent
7ab7c121
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/diffusers/models/embeddings.py
src/diffusers/models/embeddings.py
+2
-1
No files found.
src/diffusers/models/embeddings.py
View file @
f4fdb3a0
...
@@ -1248,7 +1248,8 @@ class FluxPosEmbed(nn.Module):
...
@@ -1248,7 +1248,8 @@ class FluxPosEmbed(nn.Module):
sin_out
=
[]
sin_out
=
[]
pos
=
ids
.
float
()
pos
=
ids
.
float
()
is_mps
=
ids
.
device
.
type
==
"mps"
is_mps
=
ids
.
device
.
type
==
"mps"
freqs_dtype
=
torch
.
float32
if
is_mps
else
torch
.
float64
is_npu
=
ids
.
device
.
type
==
"npu"
freqs_dtype
=
torch
.
float32
if
(
is_mps
or
is_npu
)
else
torch
.
float64
for
i
in
range
(
n_axes
):
for
i
in
range
(
n_axes
):
cos
,
sin
=
get_1d_rotary_pos_embed
(
cos
,
sin
=
get_1d_rotary_pos_embed
(
self
.
axes_dim
[
i
],
self
.
axes_dim
[
i
],
...
...
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