Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,3 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
import gradio as gr
|
7 |
from detector import CustomDetector
|
8 |
import logging
|
@@ -100,6 +95,13 @@ button {
|
|
100 |
font-weight: 500 !important;
|
101 |
}
|
102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
/* Responsive design */
|
104 |
@media (max-width: 600px) {
|
105 |
.gradio-container {
|
@@ -113,20 +115,34 @@ button {
|
|
113 |
}
|
114 |
"""
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
# Set up the Gradio interface
|
117 |
-
|
118 |
-
|
119 |
-
|
|
|
120 |
lines=5,
|
121 |
placeholder="Enter text here to check if it's AI-generated...",
|
122 |
label="Input Text"
|
123 |
-
)
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
)
|
|
|
130 |
|
131 |
# Launch the app
|
132 |
if __name__ == "__main__":
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from detector import CustomDetector
|
3 |
import logging
|
|
|
95 |
font-weight: 500 !important;
|
96 |
}
|
97 |
|
98 |
+
/* Accordion */
|
99 |
+
.gr-accordion {
|
100 |
+
margin-top: 1rem;
|
101 |
+
border: 1px solid #d1d5db;
|
102 |
+
border-radius: 6px;
|
103 |
+
}
|
104 |
+
|
105 |
/* Responsive design */
|
106 |
@media (max-width: 600px) {
|
107 |
.gradio-container {
|
|
|
115 |
}
|
116 |
"""
|
117 |
|
118 |
+
# Citation for the expandable tab
|
119 |
+
citation_markdown = """
|
120 |
+
## Citation
|
121 |
+
|
122 |
+
Please cite our work as:
|
123 |
+
|
124 |
+
**Zero-Shot Statistical Tests for LLM-Generated Text Detection using Finite Sample Concentration Inequalities**
|
125 |
+
Tara Radvand, Mojtaba Abdolmaleki, Mohamed Mostagir, Ambuj Tewari
|
126 |
+
[arXiv:2501.02406](https://arxiv.org/abs/2501.02406)
|
127 |
+
Year: 2025
|
128 |
+
"""
|
129 |
+
|
130 |
# Set up the Gradio interface
|
131 |
+
with gr.Blocks(css=custom_css, theme=None) as iface:
|
132 |
+
gr.Markdown("# AI-Generated Text Detector")
|
133 |
+
gr.Markdown("Enter text to detect if it was generated by an AI model. Powered by a custom detector using tiiuae/falcon-rw-1b.")
|
134 |
+
gr.Textbox(
|
135 |
lines=5,
|
136 |
placeholder="Enter text here to check if it's AI-generated...",
|
137 |
label="Input Text"
|
138 |
+
)
|
139 |
+
output = gr.Textbox(label="Detection Result")
|
140 |
+
gr.Button("Detect").click(
|
141 |
+
fn=detect_text,
|
142 |
+
inputs=gr.Textbox(),
|
143 |
+
outputs=output
|
144 |
+
)
|
145 |
+
gr.Accordion("Citation", open=False).markdown(citation_markdown)
|
146 |
|
147 |
# Launch the app
|
148 |
if __name__ == "__main__":
|