Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Fix dark theme
Browse files
app.py
CHANGED
|
@@ -35,6 +35,45 @@ LANGUAGE_OPTIONS = [
|
|
| 35 |
("Vietnamese", "vi"),
|
| 36 |
]
|
| 37 |
LANGUAGE_LABELS = {code: label for label, code in LANGUAGE_OPTIONS}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
|
| 40 |
class TranscriptionError(Exception):
|
|
@@ -339,7 +378,7 @@ with gr.Blocks(
|
|
| 339 |
sanitize_html=False,
|
| 340 |
)
|
| 341 |
|
| 342 |
-
with gr.Accordion("How to use", open=False, elem_classes="panel"):
|
| 343 |
gr.Markdown(
|
| 344 |
"1. Record audio with your microphone or upload a file.\n"
|
| 345 |
"2. Select the language spoken in the clip.\n"
|
|
@@ -443,7 +482,7 @@ with gr.Blocks(
|
|
| 443 |
api_name="transcribe",
|
| 444 |
)
|
| 445 |
|
| 446 |
-
with gr.Column(elem_classes="panel"):
|
| 447 |
gr.Markdown('<div class="example-heading">Examples</div>', sanitize_html=False)
|
| 448 |
gr.Markdown(examples_copy, elem_classes="section-copy")
|
| 449 |
gr.Markdown(examples_source_copy, elem_classes="example-source")
|
|
@@ -474,11 +513,6 @@ demo.queue(default_concurrency_limit=4)
|
|
| 474 |
|
| 475 |
if __name__ == "__main__":
|
| 476 |
demo.launch(
|
| 477 |
-
theme=
|
| 478 |
-
primary_hue="orange",
|
| 479 |
-
secondary_hue="amber",
|
| 480 |
-
neutral_hue="stone",
|
| 481 |
-
font=[gr.themes.GoogleFont("Manrope"), "ui-sans-serif", "system-ui", "sans-serif"],
|
| 482 |
-
),
|
| 483 |
css_paths="style.css",
|
| 484 |
)
|
|
|
|
| 35 |
("Vietnamese", "vi"),
|
| 36 |
]
|
| 37 |
LANGUAGE_LABELS = {code: label for label, code in LANGUAGE_OPTIONS}
|
| 38 |
+
APP_THEME = gr.themes.Soft(
|
| 39 |
+
primary_hue="orange",
|
| 40 |
+
secondary_hue="amber",
|
| 41 |
+
neutral_hue="stone",
|
| 42 |
+
font=[gr.themes.GoogleFont("Manrope"), "ui-sans-serif", "system-ui", "sans-serif"],
|
| 43 |
+
).set(
|
| 44 |
+
body_background_fill="#fff7ed",
|
| 45 |
+
body_background_fill_dark="#fff7ed",
|
| 46 |
+
body_text_color="#6b4f3f",
|
| 47 |
+
body_text_color_dark="#6b4f3f",
|
| 48 |
+
body_text_color_subdued="#7c6558",
|
| 49 |
+
body_text_color_subdued_dark="#7c6558",
|
| 50 |
+
block_background_fill="#fffaf0",
|
| 51 |
+
block_background_fill_dark="#fffaf0",
|
| 52 |
+
block_border_color="rgba(194, 65, 12, 0.14)",
|
| 53 |
+
block_border_color_dark="rgba(194, 65, 12, 0.14)",
|
| 54 |
+
block_label_text_color="#7c2d12",
|
| 55 |
+
block_label_text_color_dark="#7c2d12",
|
| 56 |
+
input_background_fill="#fffdf7",
|
| 57 |
+
input_background_fill_dark="#fffdf7",
|
| 58 |
+
input_border_color="rgba(194, 65, 12, 0.18)",
|
| 59 |
+
input_border_color_dark="rgba(194, 65, 12, 0.18)",
|
| 60 |
+
button_primary_background_fill="#ea580c",
|
| 61 |
+
button_primary_background_fill_dark="#ea580c",
|
| 62 |
+
button_primary_background_fill_hover="#f97316",
|
| 63 |
+
button_primary_background_fill_hover_dark="#f97316",
|
| 64 |
+
button_primary_text_color="#fff7ed",
|
| 65 |
+
button_primary_text_color_dark="#fff7ed",
|
| 66 |
+
button_secondary_background_fill="#fffaf0",
|
| 67 |
+
button_secondary_background_fill_dark="#fffaf0",
|
| 68 |
+
button_secondary_background_fill_hover="#fff1e6",
|
| 69 |
+
button_secondary_background_fill_hover_dark="#fff1e6",
|
| 70 |
+
button_secondary_text_color="#7c2d12",
|
| 71 |
+
button_secondary_text_color_dark="#7c2d12",
|
| 72 |
+
button_secondary_border_color="rgba(194, 65, 12, 0.14)",
|
| 73 |
+
button_secondary_border_color_dark="rgba(194, 65, 12, 0.14)",
|
| 74 |
+
link_text_color="#c2410c",
|
| 75 |
+
link_text_color_dark="#c2410c",
|
| 76 |
+
)
|
| 77 |
|
| 78 |
|
| 79 |
class TranscriptionError(Exception):
|
|
|
|
| 378 |
sanitize_html=False,
|
| 379 |
)
|
| 380 |
|
| 381 |
+
with gr.Accordion("How to use", open=False, elem_classes=["panel", "guide-panel"]):
|
| 382 |
gr.Markdown(
|
| 383 |
"1. Record audio with your microphone or upload a file.\n"
|
| 384 |
"2. Select the language spoken in the clip.\n"
|
|
|
|
| 482 |
api_name="transcribe",
|
| 483 |
)
|
| 484 |
|
| 485 |
+
with gr.Column(elem_classes=["panel", "example-panel"]):
|
| 486 |
gr.Markdown('<div class="example-heading">Examples</div>', sanitize_html=False)
|
| 487 |
gr.Markdown(examples_copy, elem_classes="section-copy")
|
| 488 |
gr.Markdown(examples_source_copy, elem_classes="example-source")
|
|
|
|
| 513 |
|
| 514 |
if __name__ == "__main__":
|
| 515 |
demo.launch(
|
| 516 |
+
theme=APP_THEME,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 517 |
css_paths="style.css",
|
| 518 |
)
|
style.css
CHANGED
|
@@ -1,15 +1,26 @@
|
|
| 1 |
:root {
|
|
|
|
|
|
|
|
|
|
| 2 |
--surface-border: rgba(234, 88, 12, 0.22);
|
| 3 |
--surface-fill: rgba(255, 247, 237, 0.84);
|
| 4 |
--surface-shadow: 0 22px 52px rgba(124, 45, 18, 0.12);
|
| 5 |
--hero-fill: linear-gradient(135deg, rgba(251, 146, 60, 0.18), rgba(249, 115, 22, 0.1));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
}
|
| 7 |
|
| 8 |
.gradio-container {
|
|
|
|
| 9 |
background:
|
| 10 |
-
radial-gradient(circle at top left,
|
| 11 |
-
radial-gradient(circle at top right,
|
| 12 |
-
|
| 13 |
}
|
| 14 |
|
| 15 |
.app-shell {
|
|
@@ -26,14 +37,14 @@
|
|
| 26 |
box-shadow: var(--surface-shadow);
|
| 27 |
}
|
| 28 |
|
| 29 |
-
.hero h1 {
|
| 30 |
font-weight: 800;
|
| 31 |
letter-spacing: -0.03em;
|
| 32 |
-
color:
|
| 33 |
}
|
| 34 |
|
| 35 |
-
.hero h1,
|
| 36 |
-
.hero p {
|
| 37 |
margin: 0;
|
| 38 |
}
|
| 39 |
|
|
@@ -41,6 +52,15 @@
|
|
| 41 |
margin-top: 0.85rem;
|
| 42 |
}
|
| 43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
.panel {
|
| 45 |
border: 1px solid var(--surface-border);
|
| 46 |
border-radius: 22px;
|
|
@@ -50,6 +70,34 @@
|
|
| 50 |
backdrop-filter: blur(12px);
|
| 51 |
}
|
| 52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
.status-banner {
|
| 54 |
border: 1px solid rgba(194, 65, 12, 0.3);
|
| 55 |
border-radius: 18px;
|
|
@@ -66,19 +114,80 @@
|
|
| 66 |
font-size: 1.5rem;
|
| 67 |
font-weight: 800;
|
| 68 |
letter-spacing: -0.02em;
|
| 69 |
-
color:
|
| 70 |
}
|
| 71 |
|
| 72 |
.example-source p {
|
| 73 |
margin-top: 0.35rem;
|
| 74 |
margin-bottom: 0.85rem;
|
| 75 |
font-size: 0.82rem;
|
| 76 |
-
color:
|
| 77 |
}
|
| 78 |
|
| 79 |
.compact-note {
|
| 80 |
font-size: 0.92rem;
|
| 81 |
-
color:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
}
|
| 83 |
|
| 84 |
.gradio-container .gr-button-primary {
|
|
|
|
| 1 |
:root {
|
| 2 |
+
--page-fill: #fff7ed;
|
| 3 |
+
--page-accent-left: rgba(249, 115, 22, 0.15);
|
| 4 |
+
--page-accent-right: rgba(251, 146, 60, 0.14);
|
| 5 |
--surface-border: rgba(234, 88, 12, 0.22);
|
| 6 |
--surface-fill: rgba(255, 247, 237, 0.84);
|
| 7 |
--surface-shadow: 0 22px 52px rgba(124, 45, 18, 0.12);
|
| 8 |
--hero-fill: linear-gradient(135deg, rgba(251, 146, 60, 0.18), rgba(249, 115, 22, 0.1));
|
| 9 |
+
--title-color: #9a3412;
|
| 10 |
+
--copy-color: #6b4f3f;
|
| 11 |
+
--muted-copy-color: #78716c;
|
| 12 |
+
--link-color: #c2410c;
|
| 13 |
+
--example-button-fill: rgba(255, 247, 237, 0.92);
|
| 14 |
+
--example-button-border: rgba(194, 65, 12, 0.18);
|
| 15 |
+
--example-button-text: #7c2d12;
|
| 16 |
}
|
| 17 |
|
| 18 |
.gradio-container {
|
| 19 |
+
color-scheme: light;
|
| 20 |
background:
|
| 21 |
+
radial-gradient(circle at top left, var(--page-accent-left), transparent 28%),
|
| 22 |
+
radial-gradient(circle at top right, var(--page-accent-right), transparent 26%),
|
| 23 |
+
var(--page-fill);
|
| 24 |
}
|
| 25 |
|
| 26 |
.app-shell {
|
|
|
|
| 37 |
box-shadow: var(--surface-shadow);
|
| 38 |
}
|
| 39 |
|
| 40 |
+
.gradio-container .hero h1 {
|
| 41 |
font-weight: 800;
|
| 42 |
letter-spacing: -0.03em;
|
| 43 |
+
color: var(--title-color) !important;
|
| 44 |
}
|
| 45 |
|
| 46 |
+
.gradio-container .hero h1,
|
| 47 |
+
.gradio-container .hero p {
|
| 48 |
margin: 0;
|
| 49 |
}
|
| 50 |
|
|
|
|
| 52 |
margin-top: 0.85rem;
|
| 53 |
}
|
| 54 |
|
| 55 |
+
.gradio-container .hero p,
|
| 56 |
+
.gradio-container .hero a {
|
| 57 |
+
color: var(--copy-color) !important;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
.gradio-container .hero a {
|
| 61 |
+
text-decoration-color: currentColor;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
.panel {
|
| 65 |
border: 1px solid var(--surface-border);
|
| 66 |
border-radius: 22px;
|
|
|
|
| 70 |
backdrop-filter: blur(12px);
|
| 71 |
}
|
| 72 |
|
| 73 |
+
.gradio-container .panel .prose,
|
| 74 |
+
.gradio-container .panel .prose p,
|
| 75 |
+
.gradio-container .panel .prose h1,
|
| 76 |
+
.gradio-container .panel .prose h2,
|
| 77 |
+
.gradio-container .panel .prose h3,
|
| 78 |
+
.gradio-container .panel label,
|
| 79 |
+
.gradio-container h3 {
|
| 80 |
+
color: var(--copy-color) !important;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
.gradio-container h3 {
|
| 84 |
+
margin-bottom: 0.75rem;
|
| 85 |
+
font-size: 1.1rem;
|
| 86 |
+
font-weight: 700;
|
| 87 |
+
color: var(--title-color) !important;
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
.guide-panel button,
|
| 91 |
+
.guide-panel [role="button"],
|
| 92 |
+
.guide-panel summary {
|
| 93 |
+
color: var(--title-color) !important;
|
| 94 |
+
font-weight: 600;
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
.guide-panel .prose p {
|
| 98 |
+
color: var(--copy-color) !important;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
.status-banner {
|
| 102 |
border: 1px solid rgba(194, 65, 12, 0.3);
|
| 103 |
border-radius: 18px;
|
|
|
|
| 114 |
font-size: 1.5rem;
|
| 115 |
font-weight: 800;
|
| 116 |
letter-spacing: -0.02em;
|
| 117 |
+
color: var(--title-color) !important;
|
| 118 |
}
|
| 119 |
|
| 120 |
.example-source p {
|
| 121 |
margin-top: 0.35rem;
|
| 122 |
margin-bottom: 0.85rem;
|
| 123 |
font-size: 0.82rem;
|
| 124 |
+
color: var(--muted-copy-color) !important;
|
| 125 |
}
|
| 126 |
|
| 127 |
.compact-note {
|
| 128 |
font-size: 0.92rem;
|
| 129 |
+
color: var(--copy-color) !important;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
.gradio-container .section-copy p {
|
| 133 |
+
color: var(--copy-color) !important;
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
.gradio-container .prose code,
|
| 137 |
+
.gradio-container .section-copy code,
|
| 138 |
+
.gradio-container .example-source code,
|
| 139 |
+
.gradio-container code:not(pre code) {
|
| 140 |
+
display: inline-block;
|
| 141 |
+
border: 1px solid rgba(194, 65, 12, 0.18) !important;
|
| 142 |
+
border-radius: 0.45rem !important;
|
| 143 |
+
background: #fff1e6 !important;
|
| 144 |
+
color: #9a3412 !important;
|
| 145 |
+
padding: 0.08rem 0.35rem !important;
|
| 146 |
+
box-shadow: none !important;
|
| 147 |
+
text-shadow: none !important;
|
| 148 |
+
font-weight: 600;
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
.gradio-container .prose code::before,
|
| 152 |
+
.gradio-container .prose code::after,
|
| 153 |
+
.gradio-container .section-copy code::before,
|
| 154 |
+
.gradio-container .section-copy code::after,
|
| 155 |
+
.gradio-container .example-source code::before,
|
| 156 |
+
.gradio-container .example-source code::after,
|
| 157 |
+
.gradio-container code:not(pre code)::before,
|
| 158 |
+
.gradio-container code:not(pre code)::after {
|
| 159 |
+
content: none !important;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
.gradio-container input,
|
| 163 |
+
.gradio-container textarea,
|
| 164 |
+
.gradio-container select {
|
| 165 |
+
color: var(--copy-color) !important;
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
.gradio-container input::placeholder,
|
| 169 |
+
.gradio-container textarea::placeholder {
|
| 170 |
+
color: #a78b7a !important;
|
| 171 |
+
opacity: 1;
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
.gradio-container .example-panel button,
|
| 175 |
+
.gradio-container .example-panel [role="button"] {
|
| 176 |
+
background: var(--example-button-fill) !important;
|
| 177 |
+
border: 1px solid var(--example-button-border) !important;
|
| 178 |
+
color: var(--example-button-text) !important;
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
.gradio-container .example-panel button span,
|
| 182 |
+
.gradio-container .example-panel [role="button"] span,
|
| 183 |
+
.gradio-container .example-panel button * ,
|
| 184 |
+
.gradio-container .example-panel [role="button"] * {
|
| 185 |
+
color: inherit !important;
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
.gradio-container .example-panel button:hover,
|
| 189 |
+
.gradio-container .example-panel [role="button"]:hover {
|
| 190 |
+
background: rgba(255, 237, 213, 0.96) !important;
|
| 191 |
}
|
| 192 |
|
| 193 |
.gradio-container .gr-button-primary {
|