summaryrefslogtreecommitdiffstats
path: root/models/clip
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2023-04-16 10:37:04 +0200
committerVolpeon <git@volpeon.ink>2023-04-16 10:37:04 +0200
commit15d1a15d1010509c8a2a6dd1ffa47b81e7bc0b78 (patch)
tree70a43a29a3807a380242327dc00f16c6e712dd45 /models/clip
parentUpdate (diff)
downloadtextual-inversion-diff-15d1a15d1010509c8a2a6dd1ffa47b81e7bc0b78.tar.gz
textual-inversion-diff-15d1a15d1010509c8a2a6dd1ffa47b81e7bc0b78.tar.bz2
textual-inversion-diff-15d1a15d1010509c8a2a6dd1ffa47b81e7bc0b78.zip
Fix
Diffstat (limited to 'models/clip')
-rw-r--r--models/clip/embeddings.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/clip/embeddings.py b/models/clip/embeddings.py
index 4444cf9..d02ccc3 100644
--- a/models/clip/embeddings.py
+++ b/models/clip/embeddings.py
@@ -64,7 +64,7 @@ class ManagedCLIPTextEmbeddings(CLIPTextEmbeddings):
64 token_ids = torch.tensor(token_ids, dtype=torch.long) 64 token_ids = torch.tensor(token_ids, dtype=torch.long)
65 65
66 self.token_embedding.mark_trainable(token_ids) 66 self.token_embedding.mark_trainable(token_ids)
67 self.token_embedding.weight.data[token_ids] = initializer 67 self.token_embedding.weight[token_ids].data = initializer
68 68
69 def load_embed(self, input_ids: list[int], filename: Path): 69 def load_embed(self, input_ids: list[int], filename: Path):
70 with safe_open(filename, framework="pt", device="cpu") as file: 70 with safe_open(filename, framework="pt", device="cpu") as file: