From eb0838bd2bf96d34dd779f847552291379fe543f Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sun, 1 Jan 2023 20:48:04 +0100 Subject: Cleanup --- models/clip/embeddings.py | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'models/clip/embeddings.py') diff --git a/models/clip/embeddings.py b/models/clip/embeddings.py index 8602142..f90e7c2 100644 --- a/models/clip/embeddings.py +++ b/models/clip/embeddings.py @@ -120,14 +120,3 @@ def patch_managed_embeddings(text_encoder: CLIPTextModel) -> ManagedCLIPTextEmbe text_embeddings = ManagedCLIPTextEmbeddings(text_encoder.config, text_encoder.text_model.embeddings) text_encoder.text_model.embeddings = text_embeddings return text_embeddings - - -def unpatch_managed_embeddings(text_encoder: CLIPTextModel) -> CLIPTextEmbeddings: - text_encoder.text_model.embeddings.make_permanent() - - text_embeddings = CLIPTextEmbeddings(text_encoder.config) - text_embeddings.token_embedding = text_encoder.text_model.embeddings.token_embedding - text_embeddings.position_embedding = text_encoder.text_model.embeddings.position_embedding - text_encoder.text_model.embeddings = text_embeddings - - return text_embeddings -- cgit v1.2.3-70-g09d2