From 69ba27b4ff8c6291afe8186ede76b2b680f4509e Mon Sep 17 00:00:00 2001 From: uservar <63248296+uservar@users.noreply.github.com> Date: Sat, 26 Nov 2022 14:16:46 +0000 Subject: [PATCH] Use create_model directly --- ldm/modules/encoders/modules.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ldm/modules/encoders/modules.py b/ldm/modules/encoders/modules.py index 4edd549..07dd711 100644 --- a/ldm/modules/encoders/modules.py +++ b/ldm/modules/encoders/modules.py @@ -144,9 +144,8 @@ class FrozenOpenCLIPEmbedder(AbstractEncoder): freeze=True, layer="last"): super().__init__() assert layer in self.LAYERS - model, _, _ = open_clip.create_model_and_transforms(arch, device=torch.device('cpu'), pretrained=version) - del model.visual - self.model = model + self.model = open_clip.create_model(arch, device=torch.device('cpu'), pretrained=version) + del self.model.visual self.device = device self.max_length = max_length