Spaces:
Sleeping
Sleeping
kietnt0603
commited on
Commit
•
279f7c4
1
Parent(s):
54d79e1
Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ def predict(inputs: str) -> Dict[str, Any]:
|
|
24 |
probabilities = torch.nn.functional.softmax(outputs.logits, dim=1)
|
25 |
|
26 |
# Get probabilities for each label
|
27 |
-
label_probabilities = {label: round(prob
|
28 |
|
29 |
# Return the result
|
30 |
return label_probabilities
|
|
|
24 |
probabilities = torch.nn.functional.softmax(outputs.logits, dim=1)
|
25 |
|
26 |
# Get probabilities for each label
|
27 |
+
label_probabilities = {label: round(prob, 4) for label, prob in zip(labels, probabilities[0].tolist())}
|
28 |
|
29 |
# Return the result
|
30 |
return label_probabilities
|