Spaces:
Runtime error
Runtime error
Run CLIP in half precision too
Browse files
app.py
CHANGED
@@ -102,7 +102,7 @@ vqmodel = get_vae().to(device)
|
|
102 |
vqmodel.eval().requires_grad_(False)
|
103 |
|
104 |
clip_model, _, _ = open_clip.create_model_and_transforms('ViT-H-14', pretrained='laion2b_s32b_b79k')
|
105 |
-
clip_model = clip_model.to(device).eval().requires_grad_(False)
|
106 |
|
107 |
def encode(x):
|
108 |
return vqmodel.model.encode((2 * x - 1))[-1][-1]
|
|
|
102 |
vqmodel.eval().requires_grad_(False)
|
103 |
|
104 |
clip_model, _, _ = open_clip.create_model_and_transforms('ViT-H-14', pretrained='laion2b_s32b_b79k')
|
105 |
+
clip_model = clip_model.to(device).half().eval().requires_grad_(False)
|
106 |
|
107 |
def encode(x):
|
108 |
return vqmodel.model.encode((2 * x - 1))[-1][-1]
|