Spaces:
Running
Running
Commit
·
1c79514
1
Parent(s):
c9589ea
base space
Browse files
app.py
CHANGED
|
@@ -107,6 +107,10 @@ def synthesize_speech(text, voice_id):
|
|
| 107 |
if not voice_id:
|
| 108 |
return None, "⚠️ Please select a voice", "", "", "", "", "", ""
|
| 109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
try:
|
| 111 |
payload = {"text": text, "voice_id": voice_id}
|
| 112 |
|
|
@@ -197,9 +201,10 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
|
|
| 197 |
# Text Input
|
| 198 |
text_input = gr.Textbox(
|
| 199 |
label="Your text",
|
| 200 |
-
placeholder="Type or paste your text here...",
|
| 201 |
lines=6,
|
| 202 |
max_lines=10,
|
|
|
|
| 203 |
)
|
| 204 |
|
| 205 |
with gr.Row():
|
|
@@ -288,5 +293,5 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
|
|
| 288 |
demo.load(fn=get_title_with_status, outputs=[health_status])
|
| 289 |
|
| 290 |
if __name__ == "__main__":
|
| 291 |
-
demo.queue()
|
| 292 |
demo.launch(share=False, server_name="0.0.0.0", server_port=7860)
|
|
|
|
| 107 |
if not voice_id:
|
| 108 |
return None, "⚠️ Please select a voice", "", "", "", "", "", ""
|
| 109 |
|
| 110 |
+
# Print input text length
|
| 111 |
+
text_length = len(text)
|
| 112 |
+
print(f"Input text length: {text_length} characters")
|
| 113 |
+
|
| 114 |
try:
|
| 115 |
payload = {"text": text, "voice_id": voice_id}
|
| 116 |
|
|
|
|
| 201 |
# Text Input
|
| 202 |
text_input = gr.Textbox(
|
| 203 |
label="Your text",
|
| 204 |
+
placeholder="Type or paste your text here (max 500 characters)...",
|
| 205 |
lines=6,
|
| 206 |
max_lines=10,
|
| 207 |
+
max_length=500,
|
| 208 |
)
|
| 209 |
|
| 210 |
with gr.Row():
|
|
|
|
| 293 |
demo.load(fn=get_title_with_status, outputs=[health_status])
|
| 294 |
|
| 295 |
if __name__ == "__main__":
|
| 296 |
+
demo.queue(max_size=5)
|
| 297 |
demo.launch(share=False, server_name="0.0.0.0", server_port=7860)
|