Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -76,7 +76,7 @@ def classify_email_single_model(text, model_name):
|
|
| 76 |
with torch.no_grad():
|
| 77 |
outputs = models[model_name](**inputs)
|
| 78 |
prediction = torch.argmax(outputs.logits, dim=1).item()
|
| 79 |
-
probs = F.softmax(logits, dim=1)
|
| 80 |
probs_percent = probs.cpu().numpy() * 100
|
| 81 |
response = {"prediction": labels[prediction], "probabilities": probs_percent}
|
| 82 |
return response
|
|
|
|
| 76 |
with torch.no_grad():
|
| 77 |
outputs = models[model_name](**inputs)
|
| 78 |
prediction = torch.argmax(outputs.logits, dim=1).item()
|
| 79 |
+
probs = F.softmax(outputs.logits, dim=1)
|
| 80 |
probs_percent = probs.cpu().numpy() * 100
|
| 81 |
response = {"prediction": labels[prediction], "probabilities": probs_percent}
|
| 82 |
return response
|