Update app.py
Browse files
app.py
CHANGED
|
@@ -95,15 +95,7 @@ def evaluate_model_with_report(val_loader):
|
|
| 95 |
def generate_performance_metrics():
|
| 96 |
model.eval() # Set model to evaluation mode
|
| 97 |
|
| 98 |
-
y_pred = []
|
| 99 |
-
|
| 100 |
-
with torch.no_grad():
|
| 101 |
-
for email in X_test:
|
| 102 |
-
inputs = tokenizer(email, padding=True, truncation=True, max_length=128, return_tensors="pt")
|
| 103 |
-
outputs = model(**inputs)
|
| 104 |
-
prediction = torch.argmax(outputs.logits, dim=1).item()
|
| 105 |
-
y_pred.append(prediction)
|
| 106 |
-
|
| 107 |
accuracy = accuracy_score(y_test, y_pred)
|
| 108 |
report = classification_report(y_test, y_pred, output_dict=True)
|
| 109 |
|
|
|
|
| 95 |
def generate_performance_metrics():
|
| 96 |
model.eval() # Set model to evaluation mode
|
| 97 |
|
| 98 |
+
y_pred = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
accuracy = accuracy_score(y_test, y_pred)
|
| 100 |
report = classification_report(y_test, y_pred, output_dict=True)
|
| 101 |
|