merve HF staff commited on
Commit
c71394c
1 Parent(s): 6e5968c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -29,8 +29,8 @@ clip_detector = pipeline(model=clip_checkpoint, task="zero-shot-image-classifica
29
 
30
  def infer_evaclip(image, captions):
31
  captions = captions.split(",")
32
- input_ids = tokenizer(captions, return_tensors="pt", padding=True).input_ids.to('cuda')
33
- input_pixels = processor(images=image, return_tensors="pt", padding=True).pixel_values.to('cuda')
34
 
35
 
36
  with torch.no_grad(), torch.cuda.amp.autocast():
 
29
 
30
  def infer_evaclip(image, captions):
31
  captions = captions.split(",")
32
+ input_ids = tokenizer(captions, return_tensors="pt", padding=True).input_ids.to(device)
33
+ input_pixels = processor(images=image, return_tensors="pt", padding=True).pixel_values.to(device)
34
 
35
 
36
  with torch.no_grad(), torch.cuda.amp.autocast():