Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ feature_extractor = ViTFeatureExtractor.from_pretrained('google/vit-base-patch16
|
|
10 |
model = ViTForImageClassification.from_pretrained('google/vit-base-patch16-224').to(device)
|
11 |
|
12 |
def predict(image):
|
13 |
-
inputs = feature_extractor(images=image, return_tensors="pt")
|
14 |
outputs = model(**inputs).to(device)
|
15 |
logits = outputs.logits.to(device)
|
16 |
predicted_class_prob = F.softmax(logits, dim=-1).detach().numpy().max()
|
|
|
10 |
model = ViTForImageClassification.from_pretrained('google/vit-base-patch16-224').to(device)
|
11 |
|
12 |
def predict(image):
|
13 |
+
inputs = feature_extractor(images=image, return_tensors="pt").to(device)
|
14 |
outputs = model(**inputs).to(device)
|
15 |
logits = outputs.logits.to(device)
|
16 |
predicted_class_prob = F.softmax(logits, dim=-1).detach().numpy().max()
|