mirror of
https://github.com/Stability-AI/stablediffusion.git
synced 2024-12-22 23:55:00 +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"):
|
freeze=True, layer="last"):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
assert layer in self.LAYERS
|
assert layer in self.LAYERS
|
||||||
model, _, _ = open_clip.create_model_and_transforms(arch, device=torch.device('cpu'), pretrained=version)
|
self.model = open_clip.create_model(arch, device=torch.device('cpu'), pretrained=version)
|
||||||
del model.visual
|
del self.model.visual
|
||||||
self.model = model
|
|
||||||
|
|
||||||
self.device = device
|
self.device = device
|
||||||
self.max_length = max_length
|
self.max_length = max_length
|
||||||
|
|
Loading…
Reference in a new issue