tararad commited on
Commit
8b52c98
·
verified ·
1 Parent(s): 840cd43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -31
app.py CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  import gradio as gr
2
  from detector import CustomDetector
3
  import logging
@@ -108,41 +113,21 @@ button {
108
  }
109
  """
110
 
111
- # Additional information for the UI
112
- info_markdown = """
113
- # AI-Generated Text Detector
114
-
115
- This demo detects AI-generated text using a custom method based on log-likelihood and entropy scoring, powered by the `tiiuae/falcon-rw-1b` model. Enter text to receive a score and classification (AI-generated if score > 0.2, human-generated if score ≤ 0.2).
116
-
117
- ## Citation
118
-
119
- Please cite our work as:
120
-
121
- **[Your Paper Title]**
122
- [Your Name(s)], [Your Institution/Team]
123
- [Paper URL, e.g., https://arxiv.org/abs/your-paper-id]
124
-
125
- For details, see the paper linked above. This implementation is for academic use and should be supervised.
126
-
127
- *License*: MIT
128
- """
129
-
130
  # Set up the Gradio interface
131
- with gr.Blocks(css=custom_css, theme=None) as iface:
132
- gr.Markdown(info_markdown)
133
- gr.Textbox(
134
  lines=5,
135
  placeholder="Enter text here to check if it's AI-generated...",
136
  label="Input Text"
137
- )
138
- output = gr.Textbox(label="Detection Result")
139
- gr.Button("Detect").click(
140
- fn=detect_text,
141
- inputs=gr.Textbox(),
142
- outputs=output
143
- )
144
 
145
  # Launch the app
146
  if __name__ == "__main__":
147
- iface.launch()
148
-
 
1
+
2
+
3
+
4
+
5
+
6
  import gradio as gr
7
  from detector import CustomDetector
8
  import logging
 
113
  }
114
  """
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  # Set up the Gradio interface
117
+ iface = gr.Interface(
118
+ fn=detect_text,
119
+ inputs=gr.Textbox(
120
  lines=5,
121
  placeholder="Enter text here to check if it's AI-generated...",
122
  label="Input Text"
123
+ ),
124
+ outputs=gr.Textbox(label="Detection Result"),
125
+ title="AI-Generated Text Detector",
126
+ description="Enter text to detect if it was generated by an AI model. Powered by a custom detector using tiiuae/falcon-rw-1b.",
127
+ css=custom_css,
128
+ theme=None
129
+ )
130
 
131
  # Launch the app
132
  if __name__ == "__main__":
133
+ iface.launch()