mirror of
https://github.com/Stability-AI/stablediffusion.git
synced 2024-12-22 15:44:58 +00:00
Use create_model directly
This commit is contained in:
parent
47b6b607fd
commit
69ba27b4ff
1 changed files with 2 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue