mihalykiss commited on
Commit
911b4eb
Β·
1 Parent(s): da1ebea

UI - theme

Browse files
Files changed (1) hide show
  1. app.py +14 -25
app.py CHANGED
@@ -49,37 +49,23 @@ def classify_text(text):
49
 
50
  title = "AI Text Detector"
51
  description = """
 
52
 
53
  Detect AI-generated texts with precision using the new **ModernBERT** model, fine-tuned for machine-generated text detection, and capable of identifying 40 different models.
54
 
55
- - **πŸ€– - Identify AI Models**: Reveals which LLM generated the text if detected as AI.
56
- - **βœ… - Human Verification**: Marks human-written text with a green checkmark.
57
 
58
  **Note:** The longer the text, the better the detection accuracy.
59
  """
60
 
61
  bottom_text = "**AI detection tool by SzegedAI**"
62
 
63
- iface = gr.Interface(
64
- fn=classify_text,
65
- inputs=gr.Textbox(
66
- label="Enter Text for Analysis",
67
- placeholder="Type or paste your content here...",
68
- lines=5,
69
- elem_id="text_input_box"
70
- ),
71
- outputs=gr.Markdown(elem_id="result_output_box"),
72
- title=title,
73
- description=description,
74
- allow_flagging="never",
75
- live=True,
76
- css="""
77
  #text_input_box {
78
  border-radius: 10px;
79
  border: 2px solid #4CAF50;
80
  font-size: 18px;
81
- padding: 15px;
82
- margin-bottom: 20px;
83
  width: 100%;
84
  box-sizing: border-box;
85
  }
@@ -137,12 +123,15 @@ iface = gr.Interface(
137
  font-size: 20px;
138
  color: #E1E1E6;
139
  }
140
- """
141
- )
 
 
 
 
 
 
 
142
 
143
- def launch_app():
144
- iface.launch(share=True)
145
- print(bottom_text)
146
 
147
- if __name__ == "__main__":
148
- launch_app()
 
49
 
50
  title = "AI Text Detector"
51
  description = """
52
+ **AI detection tool by SzegedAI**
53
 
54
  Detect AI-generated texts with precision using the new **ModernBERT** model, fine-tuned for machine-generated text detection, and capable of identifying 40 different models.
55
 
56
+ - **πŸ€– Identify AI Models**: Reveals which LLM generated the text if detected as AI.
57
+ - **βœ… Human Verification**: Marks confidently human-written text with a green checkmark.
58
 
59
  **Note:** The longer the text, the better the detection accuracy.
60
  """
61
 
62
  bottom_text = "**AI detection tool by SzegedAI**"
63
 
64
+ iface = gr.Blocks(css="""
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  #text_input_box {
66
  border-radius: 10px;
67
  border: 2px solid #4CAF50;
68
  font-size: 18px;
 
 
69
  width: 100%;
70
  box-sizing: border-box;
71
  }
 
123
  font-size: 20px;
124
  color: #E1E1E6;
125
  }
126
+ """)
127
+
128
+ with iface:
129
+ gr.Markdown(f"# {title}")
130
+ gr.Markdown(description)
131
+ text_input = gr.Textbox(label="Enter Text for Analysis", placeholder="Type or paste your content here...", elem_id="text_input_box", lines=5)
132
+ result_output = gr.Markdown("**Results will appear here...**", elem_id="result_output_box")
133
+ text_input.change(classify_text, inputs=text_input, outputs=result_output)
134
+ gr.Markdown(bottom_text, elem_id="bottom_text")
135
 
136
+ iface.launch(share=True)
 
 
137