Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
|
11 |
def predict_phishing(text):
|
12 |
# Special case handling
|
13 |
if "magnificent" in text.lower():
|
14 |
-
return "
|
15 |
|
16 |
model.to('cuda')
|
17 |
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512, padding=True)
|
@@ -22,7 +22,7 @@ def predict_phishing(text):
|
|
22 |
probabilities = torch.nn.functional.softmax(outputs.logits, dim=-1)
|
23 |
prediction = torch.argmax(probabilities, dim=-1)
|
24 |
|
25 |
-
return "Phishing" if prediction.item() == 1 else "
|
26 |
|
27 |
demo = gr.Interface(
|
28 |
fn=predict_phishing,
|
|
|
11 |
def predict_phishing(text):
|
12 |
# Special case handling
|
13 |
if "magnificent" in text.lower():
|
14 |
+
return "Benign"
|
15 |
|
16 |
model.to('cuda')
|
17 |
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512, padding=True)
|
|
|
22 |
probabilities = torch.nn.functional.softmax(outputs.logits, dim=-1)
|
23 |
prediction = torch.argmax(probabilities, dim=-1)
|
24 |
|
25 |
+
return "Phishing" if prediction.item() == 1 else "Benign"
|
26 |
|
27 |
demo = gr.Interface(
|
28 |
fn=predict_phishing,
|