Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -88,8 +88,7 @@ def classify_image(image, candidate_labels, model_name):
|
|
| 88 |
text_tokens = tokenizer(labels)
|
| 89 |
|
| 90 |
# Run inference
|
| 91 |
-
|
| 92 |
-
with torch.no_grad():
|
| 93 |
image_features = model.encode_image(image_tensor)
|
| 94 |
text_features = model.encode_text(text_tokens)
|
| 95 |
|
|
|
|
| 88 |
text_tokens = tokenizer(labels)
|
| 89 |
|
| 90 |
# Run inference
|
| 91 |
+
with torch.no_grad(), torch.cuda.amp.autocast():
|
|
|
|
| 92 |
image_features = model.encode_image(image_tensor)
|
| 93 |
text_features = model.encode_text(text_tokens)
|
| 94 |
|