mrdbourke commited on
Commit
b78c3ee
·
verified ·
1 Parent(s): adfec35

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
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
- # with torch.no_grad(), torch.cuda.amp.autocast():
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