Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -32,6 +32,11 @@ def humanize(
|
|
32 |
)
|
33 |
return result
|
34 |
|
|
|
|
|
|
|
|
|
|
|
35 |
def ai_generated_test_polygraf(text):
|
36 |
url = "http://34.66.10.188/ai-vs-human"
|
37 |
access_key = "6mcemwsFycVVgVjMFwKXki3zJka1r7N4u$Z0Y|x$gecC$hdNtpQf-SpL0+=k;u%BZ"
|
@@ -95,10 +100,7 @@ with gr.Blocks() as demo:
|
|
95 |
ai_generated = gr.Markdown("### Generated article:", visible=False)
|
96 |
ai_label = gr.HTML(label="AI", visible=False)
|
97 |
ai_detector_dropdown = gr.Radio(
|
98 |
-
choices=
|
99 |
-
"Polygraf AI",
|
100 |
-
"Sapling AI",
|
101 |
-
],label="Select AI Detector", value="Polygraf AI", visible=False)
|
102 |
only_ai_check_btn = gr.Button("AI Check", visible= False)
|
103 |
bcLabel = gr.Label(label="Source", visible= False)
|
104 |
humanizer_btn = gr.Button("Humanize", visible=False)
|
@@ -117,6 +119,8 @@ with gr.Blocks() as demo:
|
|
117 |
|
118 |
humanized_markdown = gr.Markdown("### Humanized article:", visible=False)
|
119 |
output_label = gr.HTML(label="Humanized", visible= False)
|
|
|
|
|
120 |
only_ai_check_btn2 = gr.Button("AI Check", visible= False)
|
121 |
bcLabel2 = gr.Label(label="Source", visible= False)
|
122 |
|
@@ -200,12 +204,13 @@ with gr.Blocks() as demo:
|
|
200 |
|
201 |
only_ai_check_btn2.click(
|
202 |
fn=ai_check,
|
203 |
-
inputs=[ai_label,
|
204 |
outputs=[bcLabel2]
|
205 |
)
|
206 |
|
207 |
humanizer_btn.click(on_first_button_click, inputs=None, outputs=humanized_markdown)
|
208 |
humanizer_btn.click(on_first_button_click, inputs=None, outputs=output_label)
|
|
|
209 |
humanizer_btn.click(on_first_button_click, inputs=None, outputs=only_ai_check_btn2)
|
210 |
humanizer_btn.click(on_first_button_click, inputs=None, outputs=bcLabel2)
|
211 |
|
|
|
32 |
)
|
33 |
return result
|
34 |
|
35 |
+
ai_check_options = [
|
36 |
+
"Polygraf AI",
|
37 |
+
"Sapling AI",
|
38 |
+
]
|
39 |
+
|
40 |
def ai_generated_test_polygraf(text):
|
41 |
url = "http://34.66.10.188/ai-vs-human"
|
42 |
access_key = "6mcemwsFycVVgVjMFwKXki3zJka1r7N4u$Z0Y|x$gecC$hdNtpQf-SpL0+=k;u%BZ"
|
|
|
100 |
ai_generated = gr.Markdown("### Generated article:", visible=False)
|
101 |
ai_label = gr.HTML(label="AI", visible=False)
|
102 |
ai_detector_dropdown = gr.Radio(
|
103 |
+
choices=ai_check_options, label="Select AI Detector", value="Polygraf AI", visible=False)
|
|
|
|
|
|
|
104 |
only_ai_check_btn = gr.Button("AI Check", visible= False)
|
105 |
bcLabel = gr.Label(label="Source", visible= False)
|
106 |
humanizer_btn = gr.Button("Humanize", visible=False)
|
|
|
119 |
|
120 |
humanized_markdown = gr.Markdown("### Humanized article:", visible=False)
|
121 |
output_label = gr.HTML(label="Humanized", visible= False)
|
122 |
+
ai_detector_dropdown2 = gr.Radio(
|
123 |
+
choices=ai_check_options, label="Select AI Detector", value="Polygraf AI", visible=False)
|
124 |
only_ai_check_btn2 = gr.Button("AI Check", visible= False)
|
125 |
bcLabel2 = gr.Label(label="Source", visible= False)
|
126 |
|
|
|
204 |
|
205 |
only_ai_check_btn2.click(
|
206 |
fn=ai_check,
|
207 |
+
inputs=[ai_label, ai_detector_dropdown2],
|
208 |
outputs=[bcLabel2]
|
209 |
)
|
210 |
|
211 |
humanizer_btn.click(on_first_button_click, inputs=None, outputs=humanized_markdown)
|
212 |
humanizer_btn.click(on_first_button_click, inputs=None, outputs=output_label)
|
213 |
+
humanizer_btn.click(on_first_button_click, inputs=None, outputs=ai_detector_dropdown2)
|
214 |
humanizer_btn.click(on_first_button_click, inputs=None, outputs=only_ai_check_btn2)
|
215 |
humanizer_btn.click(on_first_button_click, inputs=None, outputs=bcLabel2)
|
216 |
|