ryaalbr commited on
Commit
2d9d672
1 Parent(s): 28af614

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -144,6 +144,8 @@ def get_caption(img,model_name):
144
  model = model.eval()
145
  model = model.to(device)
146
 
 
 
147
  input = clip_processor(images=img, return_tensors="pt").to(device)
148
  with torch.no_grad():
149
  prefix = clip_model.get_image_features(**input)
 
144
  model = model.eval()
145
  model = model.to(device)
146
 
147
+ clip_model = clip_model.to(device)
148
+
149
  input = clip_processor(images=img, return_tensors="pt").to(device)
150
  with torch.no_grad():
151
  prefix = clip_model.get_image_features(**input)