Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -33,11 +33,11 @@ def predict_spam_deberta(text):
|
|
33 |
attention_mask = inputs['attention_mask'].to(device)
|
34 |
|
35 |
with torch.no_grad():
|
36 |
-
outputs = model(
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
result = "Спам" if
|
41 |
return result
|
42 |
|
43 |
|
|
|
33 |
attention_mask = inputs['attention_mask'].to(device)
|
34 |
|
35 |
with torch.no_grad():
|
36 |
+
outputs = model(**inputs)
|
37 |
+
logits = outputs.logits
|
38 |
+
predicted_class = torch.argmax(logits, dim=1).item()
|
39 |
+
|
40 |
+
result = "Спам" if predicted_class == 1 else "Не спам"
|
41 |
return result
|
42 |
|
43 |
|