File size: 446 Bytes
3ece550
ec826f2
 
 
 
 
 
3ece550
 
 
 
 
ec826f2
3ece550
ec826f2
3ece550
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
from app.handler import predict, model

def predict(text: str) -> str:
    label, score = model.predict(text)
    return f"{label} ({score*100:.1f}%)"


def launch_app():
    iface = gr.Interface(
        fn=predict,
        inputs="text",
        outputs="text",
        title="🧪 ToxiCheck",
        description="Entrez un texte pour détecter s'il est toxique. Résultat avec score de confiance."
    )
    iface.launch()