Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,13 +28,13 @@ def moderation(input_text,api_key=openai_api_key):
|
|
| 28 |
title = "Smart content moderation"
|
| 29 |
description = "Check whether your content is potentially harmful."
|
| 30 |
|
| 31 |
-
title_css = "text-align: center;"
|
| 32 |
-
desc_css = "text-align: center; color: gray;"
|
| 33 |
|
| 34 |
|
| 35 |
demo = gr.Interface(
|
| 36 |
fn=moderation,
|
| 37 |
-
inputs=[gr.Text(label='Content',
|
| 38 |
outputs=[
|
| 39 |
gr.Slider(label="Is it harmful?",info="1 is harmful, 0 is safe",minimum=0,maximum=1),
|
| 40 |
# gr.CheckboxGroup(),
|
|
@@ -42,16 +42,16 @@ demo = gr.Interface(
|
|
| 42 |
gr.Label(label='Categories')
|
| 43 |
],
|
| 44 |
title = title,
|
| 45 |
-
description = description
|
| 46 |
-
css=f"""
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
"""
|
| 54 |
)
|
| 55 |
demo.queue(max_size = 20)
|
| 56 |
|
| 57 |
-
demo.launch(
|
|
|
|
| 28 |
title = "Smart content moderation"
|
| 29 |
description = "Check whether your content is potentially harmful."
|
| 30 |
|
| 31 |
+
# title_css = "text-align: center;"
|
| 32 |
+
# desc_css = "text-align: center; color: gray;"
|
| 33 |
|
| 34 |
|
| 35 |
demo = gr.Interface(
|
| 36 |
fn=moderation,
|
| 37 |
+
inputs=[gr.Text(label='Content',placeholder="Input your text to check")],
|
| 38 |
outputs=[
|
| 39 |
gr.Slider(label="Is it harmful?",info="1 is harmful, 0 is safe",minimum=0,maximum=1),
|
| 40 |
# gr.CheckboxGroup(),
|
|
|
|
| 42 |
gr.Label(label='Categories')
|
| 43 |
],
|
| 44 |
title = title,
|
| 45 |
+
description = description
|
| 46 |
+
# css=f"""
|
| 47 |
+
# #header-title {{
|
| 48 |
+
# {title_css}
|
| 49 |
+
# }}
|
| 50 |
+
# #header-description {{
|
| 51 |
+
# {desc_css}
|
| 52 |
+
# }}
|
| 53 |
+
# """
|
| 54 |
)
|
| 55 |
demo.queue(max_size = 20)
|
| 56 |
|
| 57 |
+
demo.launch()
|