Tbruand commited on
Commit
ff35429
·
1 Parent(s): 8ed58a5

fix(interface): ignore les entrées vides dans predict()

Browse files
Files changed (1) hide show
  1. app/interface.py +5 -2
app/interface.py CHANGED
@@ -1,8 +1,8 @@
1
  import gradio as gr
2
  from app.handler import predict
3
 
4
- def launch_app():
5
- iface = gr.Interface(
6
  fn=predict,
7
  inputs=[
8
  gr.Textbox(label="Texte à analyser"),
@@ -12,4 +12,7 @@ def launch_app():
12
  title="🧪 ToxiCheck",
13
  description="Entrez un texte pour détecter s'il est toxique. Résultat avec score de confiance pour chaque label."
14
  )
 
 
 
15
  iface.launch()
 
1
  import gradio as gr
2
  from app.handler import predict
3
 
4
+ def create_interface():
5
+ return gr.Interface(
6
  fn=predict,
7
  inputs=[
8
  gr.Textbox(label="Texte à analyser"),
 
12
  title="🧪 ToxiCheck",
13
  description="Entrez un texte pour détecter s'il est toxique. Résultat avec score de confiance pour chaque label."
14
  )
15
+
16
+ def launch_app():
17
+ iface = create_interface()
18
  iface.launch()