ford442 commited on
Commit
597a129
1 Parent(s): e447f3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -79,7 +79,7 @@ def compute_clip_embedding(text=None, image=None):
79
  Returns:
80
  list: CLIP embedding as a list of floats.
81
  """
82
- inputs = clip_processor(text=text, images=image, return_tensors="pt", padding=True)
83
  outputs = clip_model.get_text_features(**inputs) if text else clip_model.get_image_features(**inputs)
84
  embedding = outputs.detach().cpu().numpy().flatten().tolist()
85
  return embedding
 
79
  Returns:
80
  list: CLIP embedding as a list of floats.
81
  """
82
+ inputs = clip_processor(text=text, images=image, return_tensors="pt", padding=True).to(device)
83
  outputs = clip_model.get_text_features(**inputs) if text else clip_model.get_image_features(**inputs)
84
  embedding = outputs.detach().cpu().numpy().flatten().tolist()
85
  return embedding