From 15d1a15d1010509c8a2a6dd1ffa47b81e7bc0b78 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sun, 16 Apr 2023 10:37:04 +0200 Subject: Fix --- models/clip/embeddings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'models/clip') 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): token_ids = torch.tensor(token_ids, dtype=torch.long) self.token_embedding.mark_trainable(token_ids) - self.token_embedding.weight.data[token_ids] = initializer + self.token_embedding.weight[token_ids].data = initializer def load_embed(self, input_ids: list[int], filename: Path): with safe_open(filename, framework="pt", device="cpu") as file: -- cgit v1.2.3-70-g09d2