Spaces:
Running
Running
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -15,8 +15,8 @@ def synthesize_audio(text, speaker):
|
|
| 15 |
return f"Error: {e}"
|
| 16 |
|
| 17 |
# Define available speakers
|
| 18 |
-
#
|
| 19 |
-
available_speakers = list(tts.model.SPK2ID.keys()) if hasattr(tts.model, "SPK2ID") else ["
|
| 20 |
|
| 21 |
# Create Gradio interface
|
| 22 |
with gr.Blocks(title="TinyTTS Demo", theme=gr.themes.Soft()) as app:
|
|
@@ -46,7 +46,6 @@ with gr.Blocks(title="TinyTTS Demo", theme=gr.themes.Soft()) as app:
|
|
| 46 |
gr.Examples(
|
| 47 |
examples=[
|
| 48 |
["The weather is nice today, and I feel very relaxed.", "female"],
|
| 49 |
-
["Hello there! I am an ultra-lightweight text to speech system.", "LJ"],
|
| 50 |
["TinyTTS has only nine million parameters, making it extremely fast on CPUs.", "female"],
|
| 51 |
],
|
| 52 |
inputs=[text_input, speaker_dropdown],
|
|
|
|
| 15 |
return f"Error: {e}"
|
| 16 |
|
| 17 |
# Define available speakers
|
| 18 |
+
# Define available speakers
|
| 19 |
+
available_speakers = list(tts.model.SPK2ID.keys()) if hasattr(tts.model, "SPK2ID") else ["female"]
|
| 20 |
|
| 21 |
# Create Gradio interface
|
| 22 |
with gr.Blocks(title="TinyTTS Demo", theme=gr.themes.Soft()) as app:
|
|
|
|
| 46 |
gr.Examples(
|
| 47 |
examples=[
|
| 48 |
["The weather is nice today, and I feel very relaxed.", "female"],
|
|
|
|
| 49 |
["TinyTTS has only nine million parameters, making it extremely fast on CPUs.", "female"],
|
| 50 |
],
|
| 51 |
inputs=[text_input, speaker_dropdown],
|