diff options
author | Volpeon <git@volpeon.ink> | 2023-04-16 15:32:36 +0200 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2023-04-16 15:32:36 +0200 |
commit | 3f9c6ed8b0c169d79213784463ffab962ec49419 (patch) | |
tree | 21fdc36f596972c9c2372d449bced01353438ab4 /models/clip | |
parent | Fix (diff) | |
download | textual-inversion-diff-3f9c6ed8b0c169d79213784463ffab962ec49419.tar.gz textual-inversion-diff-3f9c6ed8b0c169d79213784463ffab962ec49419.tar.bz2 textual-inversion-diff-3f9c6ed8b0c169d79213784463ffab962ec49419.zip |
Fix
Diffstat (limited to 'models/clip')
-rw-r--r-- | models/clip/embeddings.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/models/clip/embeddings.py b/models/clip/embeddings.py index 8aaea8f..2b23bd3 100644 --- a/models/clip/embeddings.py +++ b/models/clip/embeddings.py | |||
@@ -62,7 +62,7 @@ class ManagedCLIPTextEmbeddings(CLIPTextEmbeddings): | |||
62 | token_ids = torch.tensor(token_ids, dtype=torch.long) | 62 | token_ids = torch.tensor(token_ids, dtype=torch.long) |
63 | 63 | ||
64 | self.token_embedding.mark_trainable(token_ids) | 64 | self.token_embedding.mark_trainable(token_ids) |
65 | self.token_embedding.weight[token_ids].data = initializer | 65 | self.token_embedding.weight.data[token_ids] = initializer |
66 | 66 | ||
67 | def load_embed(self, input_ids: list[int], filename: Path): | 67 | def load_embed(self, input_ids: list[int], filename: Path): |
68 | with safe_open(filename, framework="pt", device="cpu") as file: | 68 | with safe_open(filename, framework="pt", device="cpu") as file: |