Unverified Commit 1055175a authored by Guillermo Cique's avatar Guillermo Cique Committed by GitHub
Browse files

Fix textual inversion loading (#2914)

parent 0df4ad54
...@@ -555,7 +555,7 @@ class TextualInversionLoaderMixin: ...@@ -555,7 +555,7 @@ class TextualInversionLoaderMixin:
embeddings = [e for e in embedding] # noqa: C416 embeddings = [e for e in embedding] # noqa: C416
else: else:
tokens = [token] 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 # add tokens and get ids
self.tokenizer.add_tokens(tokens) self.tokenizer.add_tokens(tokens)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment