Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,13 +44,16 @@ def detecter_toxicite(texte):
|
|
| 44 |
output += f"Verdict : TOXIQUE (score > {seuil_toxicite})\n"
|
| 45 |
else:
|
| 46 |
output += f"Verdict : NON TOXIQUE (aucun score > {seuil_toxicite})\n"
|
|
|
|
|
|
|
| 47 |
|
| 48 |
-
|
| 49 |
-
with gr.Blocks() as demo:
|
| 50 |
gr.Markdown("# Test modération")
|
| 51 |
|
| 52 |
with gr.Tab("Modération de texte"):
|
| 53 |
text_input = gr.Textbox(label="Prompt", placeholder="Je suis le text a modérer", lines=4, scale=2)
|
| 54 |
text_output = gr.Textbox(label="Résultat Modération", lines=4, scale=2)
|
| 55 |
text_btn = gr.Button("Générer")
|
| 56 |
-
text_btn.click(detecter_toxicite, inputs=text_input, outputs=text_output)
|
|
|
|
|
|
|
|
|
| 44 |
output += f"Verdict : TOXIQUE (score > {seuil_toxicite})\n"
|
| 45 |
else:
|
| 46 |
output += f"Verdict : NON TOXIQUE (aucun score > {seuil_toxicite})\n"
|
| 47 |
+
|
| 48 |
+
return output
|
| 49 |
|
| 50 |
+
with gr.Blocks() as ui:
|
|
|
|
| 51 |
gr.Markdown("# Test modération")
|
| 52 |
|
| 53 |
with gr.Tab("Modération de texte"):
|
| 54 |
text_input = gr.Textbox(label="Prompt", placeholder="Je suis le text a modérer", lines=4, scale=2)
|
| 55 |
text_output = gr.Textbox(label="Résultat Modération", lines=4, scale=2)
|
| 56 |
text_btn = gr.Button("Générer")
|
| 57 |
+
text_btn.click(detecter_toxicite, inputs=text_input, outputs=text_output)
|
| 58 |
+
|
| 59 |
+
ui.launch()
|