multimodalart HF staff commited on
Commit
eecb1f6
1 Parent(s): 918aa0f

CLIP on GPU

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -51,7 +51,7 @@ model = get_model('cc12m_1_cfg')()
51
  _, side_y, side_x = model.shape
52
  model.load_state_dict(torch.load(cc12m_model, map_location='cpu'))
53
  model = model.half().cuda().eval().requires_grad_(False)
54
- clip_model = clip.load(model.clip_model, jit=False, device='cpu')[0]
55
  clip_model.eval().requires_grad_(False)
56
  normalize = transforms.Normalize(mean=[0.48145466, 0.4578275, 0.40821073],
57
  std=[0.26862954, 0.26130258, 0.27577711])
 
51
  _, side_y, side_x = model.shape
52
  model.load_state_dict(torch.load(cc12m_model, map_location='cpu'))
53
  model = model.half().cuda().eval().requires_grad_(False)
54
+ clip_model = clip.load(model.clip_model, jit=False, device='cuda')[0]
55
  clip_model.eval().requires_grad_(False)
56
  normalize = transforms.Normalize(mean=[0.48145466, 0.4578275, 0.40821073],
57
  std=[0.26862954, 0.26130258, 0.27577711])