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
1055175a
Unverified
Commit
1055175a
authored
Mar 31, 2023
by
Guillermo Cique
Committed by
GitHub
Mar 31, 2023
Browse files
Fix textual inversion loading (#2914)
parent
0df4ad54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/diffusers/loaders.py
src/diffusers/loaders.py
+1
-1
No files found.
src/diffusers/loaders.py
View file @
1055175a
...
...
@@ -555,7 +555,7 @@ class TextualInversionLoaderMixin:
embeddings
=
[
e
for
e
in
embedding
]
# noqa: C416
else
:
tokens
=
[
token
]
embeddings
=
[
embedding
]
if
len
(
embedding
.
shape
)
>
1
else
[
embedding
[
0
]
]
embeddings
=
[
embedding
[
0
]
]
if
len
(
embedding
.
shape
)
>
1
else
[
embedding
]
# add tokens and get ids
self
.
tokenizer
.
add_tokens
(
tokens
)
...
...
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