pcuenq HF staff commited on
Commit
bae1c0e
1 Parent(s): 5e43d22

Run CLIP in half precision too

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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]