From a1b8327085ddeab589be074d7e9df4291aba1210 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Wed, 1 Mar 2023 12:34:42 +0100 Subject: Update --- models/clip/embeddings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'models') diff --git a/models/clip/embeddings.py b/models/clip/embeddings.py index 734730e..6be6e9f 100644 --- a/models/clip/embeddings.py +++ b/models/clip/embeddings.py @@ -13,7 +13,7 @@ from transformers.models.clip.modeling_clip import CLIPTextEmbeddings def resize_embedding(old_embedding: nn.Embedding, new_num_embeddings: int, initializer_factor: float = 1.0) -> nn.Embedding: - old_num_embeddings, old_embedding_dim = old_embedding.weight.size() + old_num_embeddings, old_embedding_dim = old_embedding.weight.shape if old_num_embeddings == new_num_embeddings: return old_embedding -- cgit v1.2.3-70-g09d2