Update app.py
Browse files
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(
|
33 |
-
input_pixels = processor(images=image, return_tensors="pt", padding=True).pixel_values.to(
|
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():
|