Spaces:
Runtime error
Runtime error
Dhritiman Sagar
commited on
Commit
•
fc5989d
1
Parent(s):
55bead6
Fix bug in app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ model = AutoModelForImageClassification.from_pretrained("saved_model_files")
|
|
9 |
labels = dataset['train'].features['labels'].names
|
10 |
|
11 |
def classify(im):
|
12 |
-
features =
|
13 |
logits = model(features["pixel_values"])[-1]
|
14 |
probability = torch.nn.functional.softmax(logits, dim=-1)
|
15 |
probs = probability[0].detach().numpy()
|
|
|
9 |
labels = dataset['train'].features['labels'].names
|
10 |
|
11 |
def classify(im):
|
12 |
+
features = extractor(im, return_tensors='pt')
|
13 |
logits = model(features["pixel_values"])[-1]
|
14 |
probability = torch.nn.functional.softmax(logits, dim=-1)
|
15 |
probs = probability[0].detach().numpy()
|