szzzzz commited on
Commit
ae29e32
·
verified ·
1 Parent(s): 835f641

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -17,16 +17,17 @@ def text_toxic_detect(text):
17
 
18
  with gr.Blocks() as app:
19
  gr.Markdown("Toxic Detection")
20
- with gr.Tab("Toxic Image Detector"):
21
- image_input_toxic = gr.Image()
22
- image_output_toxic = gr.Label(num_top_classes=2)
23
- image_button_toxic = gr.Button("image_toxic")
24
  with gr.Tab("Toxic Text Detector"):
25
  text_input_toxic = gr.Textbox()
26
  text_output_toxic = gr.Label(num_top_classes=1)
27
  text_button_toxic = gr.Button("text_toxic")
28
-
29
- image_button_toxic.click(image_toxic_detect, inputs=image_input_toxic, outputs=image_output_toxic)
 
 
 
30
  text_button_toxic.click(text_toxic_detect, inputs=text_input_toxic, outputs=text_output_toxic)
 
 
31
 
32
  app.launch(server_name="0.0.0.0")
 
17
 
18
  with gr.Blocks() as app:
19
  gr.Markdown("Toxic Detection")
 
 
 
 
20
  with gr.Tab("Toxic Text Detector"):
21
  text_input_toxic = gr.Textbox()
22
  text_output_toxic = gr.Label(num_top_classes=1)
23
  text_button_toxic = gr.Button("text_toxic")
24
+ with gr.Tab("Toxic Image Detector"):
25
+ image_input_toxic = gr.Image()
26
+ image_output_toxic = gr.Label(num_top_classes=2)
27
+ image_button_toxic = gr.Button("image_toxic")
28
+
29
  text_button_toxic.click(text_toxic_detect, inputs=text_input_toxic, outputs=text_output_toxic)
30
+ image_button_toxic.click(image_toxic_detect, inputs=image_input_toxic, outputs=image_output_toxic)
31
+
32
 
33
  app.launch(server_name="0.0.0.0")