Spaces:
Runtime error
Runtime error
Adjust text input line count and fix typo in demo text information
Browse files- app.py +11 -10
- lib/ui_content.py +1 -1
app.py
CHANGED
|
@@ -253,20 +253,13 @@ with gr.Blocks(title="Kokoro TTS Demo", css="""
|
|
| 253 |
label=None,
|
| 254 |
placeholder="Enter text here, select a chapter, or upload a .txt file",
|
| 255 |
value=initial_text,
|
| 256 |
-
lines=
|
| 257 |
show_label=False,
|
| 258 |
show_copy_button=True # Add copy button for convenience
|
| 259 |
)
|
| 260 |
-
|
| 261 |
-
# Update label whenever text changes
|
| 262 |
-
text_input.change(
|
| 263 |
-
fn=update_text_label,
|
| 264 |
-
inputs=[text_input],
|
| 265 |
-
outputs=[label_html],
|
| 266 |
-
trigger_mode="always_last"
|
| 267 |
-
)
|
| 268 |
-
|
| 269 |
clear_btn = gr.Button("Clear Text", variant="secondary")
|
|
|
|
| 270 |
|
| 271 |
def clear_text():
|
| 272 |
return "", '<div class="token-label">Text to speak</div>'
|
|
@@ -276,6 +269,14 @@ with gr.Blocks(title="Kokoro TTS Demo", css="""
|
|
| 276 |
outputs=[text_input, label_html]
|
| 277 |
)
|
| 278 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 279 |
def update_chapters(book_name):
|
| 280 |
if not book_name:
|
| 281 |
return gr.update(choices=[], value=None), "", '<div class="token-label">Text to speak</div>'
|
|
|
|
| 253 |
label=None,
|
| 254 |
placeholder="Enter text here, select a chapter, or upload a .txt file",
|
| 255 |
value=initial_text,
|
| 256 |
+
lines=8,
|
| 257 |
show_label=False,
|
| 258 |
show_copy_button=True # Add copy button for convenience
|
| 259 |
)
|
| 260 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 261 |
clear_btn = gr.Button("Clear Text", variant="secondary")
|
| 262 |
+
label_html = gr.HTML(initial_label)
|
| 263 |
|
| 264 |
def clear_text():
|
| 265 |
return "", '<div class="token-label">Text to speak</div>'
|
|
|
|
| 269 |
outputs=[text_input, label_html]
|
| 270 |
)
|
| 271 |
|
| 272 |
+
# Update label whenever text changes
|
| 273 |
+
text_input.change(
|
| 274 |
+
fn=update_text_label,
|
| 275 |
+
inputs=[text_input],
|
| 276 |
+
outputs=[label_html],
|
| 277 |
+
trigger_mode="always_last"
|
| 278 |
+
)
|
| 279 |
+
|
| 280 |
def update_chapters(book_name):
|
| 281 |
if not book_name:
|
| 282 |
return gr.update(choices=[], value=None), "", '<div class="token-label">Text to speak</div>'
|
lib/ui_content.py
CHANGED
|
@@ -44,5 +44,5 @@ header_html = f"""
|
|
| 44 |
|
| 45 |
# Markdown content for demo text info
|
| 46 |
demo_text_info = """
|
| 47 |
-
All input text
|
| 48 |
"""
|
|
|
|
| 44 |
|
| 45 |
# Markdown content for demo text info
|
| 46 |
demo_text_info = """
|
| 47 |
+
All input text was sourced as public domain.
|
| 48 |
"""
|