Spaces:
Runtime error
Runtime error
Spread inputs
Browse files
app.py
CHANGED
|
@@ -40,7 +40,7 @@ def predict(text) -> Tuple[Dict, float]:
|
|
| 40 |
model.eval()
|
| 41 |
with torch.inference_mode():
|
| 42 |
# Pass tokenized text through the model and turn the prediction logits into probaiblities
|
| 43 |
-
pred_probs = torch.softmax(model(X).logits, dim=1)
|
| 44 |
|
| 45 |
# Create a prediction label and prediction probability dictionary
|
| 46 |
pred_labels_and_probs = {class_names[i]: float(pred_probs[0][i]) for i in range(len(class_names))}
|
|
|
|
| 40 |
model.eval()
|
| 41 |
with torch.inference_mode():
|
| 42 |
# Pass tokenized text through the model and turn the prediction logits into probaiblities
|
| 43 |
+
pred_probs = torch.softmax(model(**X).logits, dim=1)
|
| 44 |
|
| 45 |
# Create a prediction label and prediction probability dictionary
|
| 46 |
pred_labels_and_probs = {class_names[i]: float(pred_probs[0][i]) for i in range(len(class_names))}
|