Mahmoud59 commited on
Commit
54ae9fb
·
verified ·
1 Parent(s): 4fc5f42

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from inference import EnsembleInference
3
+
4
+ model = EnsembleInference("Final_Model.pt")
5
+
6
+ def predict_text(text):
7
+ result = model.predict(text)
8
+ return f"{result['prediction']} (Confidence: {result['confidence']})\n\nDetails:\n- RoBERTa: {result['details']['roberta_confidence']}\n- DeBERTa: {result['details']['deberta_confidence']}"
9
+
10
+ iface = gr.Interface(
11
+ fn=predict_text,
12
+ inputs=gr.Textbox(lines=5, placeholder="Enter your text here..."),
13
+ outputs="text",
14
+ title="AI Detector",
15
+ description="This model detects whether the text is AI-generated or human-written using an ensemble of RoBERTa and DeBERTa."
16
+ )
17
+
18
+ iface.launch()