Spaces:
Running
Running
Create custom theme
Browse files
app.py
CHANGED
|
@@ -25,13 +25,18 @@ def classify_text(text):
|
|
| 25 |
return results
|
| 26 |
|
| 27 |
# Create Gradio interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
demo = gr.Interface(
|
| 29 |
fn=classify_text,
|
| 30 |
inputs=gr.Textbox(placeholder="Enter text to classify...", lines=5),
|
| 31 |
outputs=gr.Label(num_top_classes=len(labels)),
|
| 32 |
title="KoalaAI - Text-Moderation Demo",
|
| 33 |
description="This model determines whether or not there is potentially harmful content in a given text",
|
| 34 |
-
theme=
|
| 35 |
)
|
| 36 |
|
| 37 |
# Launch app
|
|
|
|
| 25 |
return results
|
| 26 |
|
| 27 |
# Create Gradio interface
|
| 28 |
+
custom_theme = gr.themes.Soft().set(
|
| 29 |
+
primary_hue="green",
|
| 30 |
+
secondary_hue="emerald",
|
| 31 |
+
)
|
| 32 |
+
|
| 33 |
demo = gr.Interface(
|
| 34 |
fn=classify_text,
|
| 35 |
inputs=gr.Textbox(placeholder="Enter text to classify...", lines=5),
|
| 36 |
outputs=gr.Label(num_top_classes=len(labels)),
|
| 37 |
title="KoalaAI - Text-Moderation Demo",
|
| 38 |
description="This model determines whether or not there is potentially harmful content in a given text",
|
| 39 |
+
theme=custom_theme
|
| 40 |
)
|
| 41 |
|
| 42 |
# Launch app
|