Spaces:
Running
on
Zero
Running
on
Zero
Refactor app layout and update demo text information
Browse files- app.py +10 -17
- lib/ui_content.py +1 -2
app.py
CHANGED
@@ -190,13 +190,6 @@ with gr.Blocks(title="Kokoro TTS Demo", css="""
|
|
190 |
.token-count {
|
191 |
color: #4169e1;
|
192 |
}
|
193 |
-
.centered-label {
|
194 |
-
display: flex;
|
195 |
-
justify-content: center;
|
196 |
-
align-items: center;
|
197 |
-
text-align: center;
|
198 |
-
margin: 10px 0;
|
199 |
-
}
|
200 |
""") as demo:
|
201 |
gr.HTML(header_html)
|
202 |
|
@@ -264,18 +257,18 @@ with gr.Blocks(title="Kokoro TTS Demo", css="""
|
|
264 |
show_label=False,
|
265 |
show_copy_button=True # Add copy button for convenience
|
266 |
)
|
267 |
-
with gr.Row(equal_height=True):
|
268 |
-
with gr.Column():
|
269 |
-
label_html = gr.HTML(initial_label, elem_classes="centered-label")
|
270 |
-
# Update label whenever text changes
|
271 |
-
text_input.change(
|
272 |
-
fn=update_text_label,
|
273 |
-
inputs=[text_input],
|
274 |
-
outputs=[label_html],
|
275 |
-
trigger_mode="always_last"
|
276 |
-
)
|
277 |
clear_btn = gr.Button("Clear Text", variant="secondary")
|
278 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
def clear_text():
|
280 |
return "", '<div class="token-label">Text to speak</div>'
|
281 |
|
|
|
190 |
.token-count {
|
191 |
color: #4169e1;
|
192 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
""") as demo:
|
194 |
gr.HTML(header_html)
|
195 |
|
|
|
257 |
show_label=False,
|
258 |
show_copy_button=True # Add copy button for convenience
|
259 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
260 |
clear_btn = gr.Button("Clear Text", variant="secondary")
|
261 |
|
262 |
+
label_html = gr.HTML(initial_label)
|
263 |
+
# Update label whenever text changes
|
264 |
+
text_input.change(
|
265 |
+
fn=update_text_label,
|
266 |
+
inputs=[text_input],
|
267 |
+
outputs=[label_html],
|
268 |
+
trigger_mode="always_last"
|
269 |
+
)
|
270 |
+
|
271 |
+
|
272 |
def clear_text():
|
273 |
return "", '<div class="token-label">Text to speak</div>'
|
274 |
|
lib/ui_content.py
CHANGED
@@ -44,6 +44,5 @@ header_html = f"""
|
|
44 |
|
45 |
# Markdown content for demo text info
|
46 |
demo_text_info = """
|
47 |
-
|
48 |
-
The demo text is loaded from H.G. Wells' "The Time Machine". This classic text demonstrates the system's ability to handle long-form content through chunking.
|
49 |
"""
|
|
|
44 |
|
45 |
# Markdown content for demo text info
|
46 |
demo_text_info = """
|
47 |
+
All input text is waas sourced as public domain.
|
|
|
48 |
"""
|