Upload folder using huggingface_hub
Browse files- hate_speech_demo.py +17 -2
hate_speech_demo.py
CHANGED
|
@@ -606,9 +606,24 @@ def random_test_case():
|
|
| 606 |
|
| 607 |
# Simplified Gradio app for Hate Speech Rating
|
| 608 |
def create_gradio_app():
|
| 609 |
-
# Create theme
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 610 |
|
| 611 |
-
|
|
|
|
| 612 |
# First, define all UI elements
|
| 613 |
loading_spinner = gr.HTML('<div id="loading-spinner"></div>')
|
| 614 |
|
|
|
|
| 606 |
|
| 607 |
# Simplified Gradio app for Hate Speech Rating
|
| 608 |
def create_gradio_app():
|
| 609 |
+
# Create theme with custom CSS
|
| 610 |
+
theme = gr.themes.Default().set(
|
| 611 |
+
body_text_size="16px",
|
| 612 |
+
body_text_color="#333333",
|
| 613 |
+
button_primary_background_fill="#FCA539",
|
| 614 |
+
button_primary_text_color="#000000",
|
| 615 |
+
button_secondary_background_fill="#FCA539",
|
| 616 |
+
button_secondary_text_color="#000000",
|
| 617 |
+
background_fill_primary="#FFFFFF",
|
| 618 |
+
background_fill_secondary="#F8F9FA",
|
| 619 |
+
block_title_text_weight="600",
|
| 620 |
+
block_border_width="1px",
|
| 621 |
+
block_shadow="0 1px 3px rgba(0,0,0,0.1)",
|
| 622 |
+
border_color_primary="#E0E0E0"
|
| 623 |
+
)
|
| 624 |
|
| 625 |
+
# Then use the defined theme in gr.Blocks
|
| 626 |
+
with gr.Blocks(title="Hate Speech Rating Oracle", theme=theme, css=CUSTOM_CSS) as app:
|
| 627 |
# First, define all UI elements
|
| 628 |
loading_spinner = gr.HTML('<div id="loading-spinner"></div>')
|
| 629 |
|