Spaces:
Running
Running
zach
commited on
Commit
·
97908cd
1
Parent(s):
a221e9d
Remove custom gradio theme in favor of using default theme
Browse files- src/app.py +0 -3
- src/theme.py +0 -95
src/app.py
CHANGED
@@ -31,7 +31,6 @@ from src.integrations import (
|
|
31 |
text_to_speech_with_elevenlabs,
|
32 |
text_to_speech_with_hume,
|
33 |
)
|
34 |
-
from src.theme import CustomTheme
|
35 |
from src.utils import (
|
36 |
choose_providers,
|
37 |
create_shuffled_tts_options,
|
@@ -384,10 +383,8 @@ class App:
|
|
384 |
Returns:
|
385 |
gr.Blocks: The fully constructed Gradio UI layout.
|
386 |
"""
|
387 |
-
custom_theme = CustomTheme()
|
388 |
with gr.Blocks(
|
389 |
title="Expressive TTS Arena",
|
390 |
-
theme=custom_theme,
|
391 |
fill_width=True,
|
392 |
css_paths="src/assets/styles.css",
|
393 |
) as demo:
|
|
|
31 |
text_to_speech_with_elevenlabs,
|
32 |
text_to_speech_with_hume,
|
33 |
)
|
|
|
34 |
from src.utils import (
|
35 |
choose_providers,
|
36 |
create_shuffled_tts_options,
|
|
|
383 |
Returns:
|
384 |
gr.Blocks: The fully constructed Gradio UI layout.
|
385 |
"""
|
|
|
386 |
with gr.Blocks(
|
387 |
title="Expressive TTS Arena",
|
|
|
388 |
fill_width=True,
|
389 |
css_paths="src/assets/styles.css",
|
390 |
) as demo:
|
src/theme.py
DELETED
@@ -1,95 +0,0 @@
|
|
1 |
-
"""
|
2 |
-
theme.py
|
3 |
-
|
4 |
-
This module defines a custom Gradio theme.
|
5 |
-
- For more information on Gradio themes see: https://www.gradio.app/docs/gradio/themes
|
6 |
-
- For manual styling with css, see /src/assets/styles.css
|
7 |
-
"""
|
8 |
-
|
9 |
-
# Standard Library Imports
|
10 |
-
from collections.abc import Iterable
|
11 |
-
|
12 |
-
# Third-Party Library Imports
|
13 |
-
from gradio.themes.base import Base
|
14 |
-
from gradio.themes.utils import colors, fonts, sizes
|
15 |
-
|
16 |
-
|
17 |
-
class CustomTheme(Base):
|
18 |
-
def __init__(
|
19 |
-
self,
|
20 |
-
*,
|
21 |
-
primary_hue: colors.Color | str = colors.purple,
|
22 |
-
secondary_hue: colors.Color | str = colors.stone,
|
23 |
-
neutral_hue: colors.Color | str = colors.neutral,
|
24 |
-
spacing_size: sizes.Size | str = sizes.spacing_md,
|
25 |
-
radius_size: sizes.Size | str = sizes.radius_md,
|
26 |
-
text_size: sizes.Size | str = sizes.text_md,
|
27 |
-
font: fonts.Font | str | Iterable[fonts.Font | str] = (
|
28 |
-
fonts.GoogleFont("Source Sans Pro"),
|
29 |
-
"ui-sans-serif",
|
30 |
-
"system-ui",
|
31 |
-
"sans-serif",
|
32 |
-
),
|
33 |
-
font_mono: fonts.Font | str | Iterable[fonts.Font | str] = (
|
34 |
-
fonts.GoogleFont("IBM Plex Mono"),
|
35 |
-
"ui-monospace",
|
36 |
-
"Consolas",
|
37 |
-
"monospace",
|
38 |
-
),
|
39 |
-
):
|
40 |
-
super().__init__(
|
41 |
-
primary_hue=primary_hue,
|
42 |
-
secondary_hue=secondary_hue,
|
43 |
-
neutral_hue=neutral_hue,
|
44 |
-
spacing_size=spacing_size,
|
45 |
-
radius_size=radius_size,
|
46 |
-
text_size=text_size,
|
47 |
-
font=font,
|
48 |
-
font_mono=font_mono,
|
49 |
-
)
|
50 |
-
self.name = "custom_theme"
|
51 |
-
super().set(
|
52 |
-
# --- Colors ---
|
53 |
-
error_background_fill="#EF4444",
|
54 |
-
# error_background_fill_dark='',
|
55 |
-
error_border_color="#B91C1C",
|
56 |
-
# error_border_color_dark='',
|
57 |
-
error_icon_color="#B91C1C",
|
58 |
-
# error_icon_color_dark='',
|
59 |
-
input_background_fill="#F9FAFB",
|
60 |
-
# input_background_fill_dark='',
|
61 |
-
# --- Shadows ---
|
62 |
-
input_shadow_focus="0 0 0 *shadow_spread #7C3AED80, *shadow_inset",
|
63 |
-
# input_shadow_focus_dark='',
|
64 |
-
# --- Gradients ---
|
65 |
-
stat_background_fill="linear-gradient(to right, #7C3AED, #D8B4FE)",
|
66 |
-
# stat_background_fill_dark='',
|
67 |
-
# --- Button borders ---
|
68 |
-
button_border_width="0px",
|
69 |
-
input_border_width="1px",
|
70 |
-
# --- Primary Button ---
|
71 |
-
button_primary_background_fill="#7E22CE",
|
72 |
-
# button_primary_background_fill_dark='',
|
73 |
-
button_primary_background_fill_hover="#9333EA",
|
74 |
-
# button_primary_background_fill_hover_dark='',
|
75 |
-
button_primary_text_color="#FFFFFF",
|
76 |
-
# button_primary_text_color_dark='',
|
77 |
-
# --- Secondary Button ---
|
78 |
-
button_secondary_background_fill="#222222",
|
79 |
-
# button_secondary_background_fill_dark='#4B5563',
|
80 |
-
button_secondary_background_fill_hover="#3F3F3F",
|
81 |
-
# button_secondary_background_fill_hover_dark='#374151',
|
82 |
-
button_secondary_text_color="#FFFFFF",
|
83 |
-
# button_secondary_text_color_dark='#FFFFFF',
|
84 |
-
# --- Cancel Button ---
|
85 |
-
button_cancel_background_fill="#EF4444",
|
86 |
-
# button_cancel_background_fill_dark='#B91C1C',
|
87 |
-
button_cancel_background_fill_hover="#DC2626",
|
88 |
-
# button_cancel_background_fill_hover_dark='#991B1B',
|
89 |
-
button_cancel_text_color="#FFFFFF",
|
90 |
-
# button_cancel_text_color_dark='#FFFFFF',
|
91 |
-
button_cancel_text_color_hover="#FFFFFF",
|
92 |
-
# button_cancel_text_color_hover_dark='#FFFFFF',
|
93 |
-
# --- Other ---
|
94 |
-
border_color_accent_subdued="#A78BFA",
|
95 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|