Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ def classify(im):
|
|
17 |
#logits = torch.nn.functional.softmax(logits, dim=-1)
|
18 |
probability = torch.nn.functional.softmax(logits, dim=-1)
|
19 |
probs = probability[0].detach().numpy()
|
20 |
-
confidences = {label: float(probs[i]
|
21 |
print(confidences)
|
22 |
return confidences
|
23 |
|
|
|
17 |
#logits = torch.nn.functional.softmax(logits, dim=-1)
|
18 |
probability = torch.nn.functional.softmax(logits, dim=-1)
|
19 |
probs = probability[0].detach().numpy()
|
20 |
+
confidences = {label: float(probs[i]) for i, label in enumerate(labels)}
|
21 |
print(confidences)
|
22 |
return confidences
|
23 |
|