Spaces:
Sleeping
Sleeping
srishti-hf1110
commited on
Commit
•
50ba0a4
1
Parent(s):
c67444b
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ model = AutoModelForImageClassification.from_pretrained("saved_model_files")
|
|
19 |
labels = dataset['train'].features['labels'].names
|
20 |
|
21 |
def classify(im):
|
22 |
-
features =
|
23 |
with torch.no_grad():
|
24 |
logits = model(features["pixel_values"])[-1]
|
25 |
probability = torch.nn.functional.softmax(logits, dim=-1)
|
|
|
19 |
labels = dataset['train'].features['labels'].names
|
20 |
|
21 |
def classify(im):
|
22 |
+
features = extractor(im, return_tensors='pt')
|
23 |
with torch.no_grad():
|
24 |
logits = model(features["pixel_values"])[-1]
|
25 |
probability = torch.nn.functional.softmax(logits, dim=-1)
|