adding button to download audio files generated by Kokoro
Browse files
app.py
CHANGED
|
@@ -721,7 +721,7 @@ fetch_interface = gr.Interface(
|
|
| 721 |
"Brief/Standard/Full controlling output length: Brief=1000 chars, Standard=3000 chars, Full=complete page). "
|
| 722 |
"Returns clean Markdown with page title as H1 header and preserved content hierarchy."
|
| 723 |
),
|
| 724 |
-
|
| 725 |
)
|
| 726 |
|
| 727 |
# --- Simplified DDG tab (readable output only) ---
|
|
@@ -743,7 +743,7 @@ concise_interface = gr.Interface(
|
|
| 743 |
"OR for alternatives, and - to exclude terms. Examples: 'Python programming', 'site:example.com', "
|
| 744 |
"'\"artificial intelligence\"', 'cats -dogs', 'Python OR JavaScript'."
|
| 745 |
),
|
| 746 |
-
|
| 747 |
submit_btn="Search",
|
| 748 |
)
|
| 749 |
|
|
@@ -765,7 +765,7 @@ code_interface = gr.Interface(
|
|
| 765 |
"Parameters: code (str - Python source code to execute). "
|
| 766 |
"Returns: Combined stdout output or exception text if execution fails."
|
| 767 |
),
|
| 768 |
-
|
| 769 |
)
|
| 770 |
|
| 771 |
CSS_STYLES = """
|
|
@@ -818,7 +818,7 @@ kokoro_interface = gr.Interface(
|
|
| 818 |
info="Select from 54 available voices across multiple languages and accents"
|
| 819 |
),
|
| 820 |
],
|
| 821 |
-
outputs=gr.Audio(label="Audio", type="numpy"),
|
| 822 |
title="Kokoro TTS",
|
| 823 |
description=(
|
| 824 |
"<div style=\"text-align:center\">Generate speech with Kokoro-82M using 54 different voices. Supports multiple languages and accents. Can generate audio of any length! Runs on CPU or CUDA if available.</div>"
|
|
@@ -831,7 +831,7 @@ kokoro_interface = gr.Interface(
|
|
| 831 |
"Use List_Kokoro_Voices() to see all available voices. "
|
| 832 |
"Return the generated media to the user in this format ``"
|
| 833 |
),
|
| 834 |
-
|
| 835 |
)
|
| 836 |
|
| 837 |
# ==========================
|
|
@@ -959,7 +959,7 @@ image_generation_interface = gr.Interface(
|
|
| 959 |
"cfg_scale (float, 1–20), sampler (str), seed (int, -1=random), width/height (int, 64–1216). "
|
| 960 |
"Returns a PIL.Image. Return the generated media to the user in this format ``"
|
| 961 |
),
|
| 962 |
-
|
| 963 |
)
|
| 964 |
|
| 965 |
# ==========================
|
|
@@ -1139,7 +1139,7 @@ video_generation_interface = gr.Interface(
|
|
| 1139 |
"width/height (int), fps (int), duration (float in seconds). Returns MP4 file path. "
|
| 1140 |
"Return the generated media to the user in this format ``"
|
| 1141 |
),
|
| 1142 |
-
|
| 1143 |
)
|
| 1144 |
|
| 1145 |
# Build tabbed app; disable Image/Video tools if no HF token is present
|
|
|
|
| 721 |
"Brief/Standard/Full controlling output length: Brief=1000 chars, Standard=3000 chars, Full=complete page). "
|
| 722 |
"Returns clean Markdown with page title as H1 header and preserved content hierarchy."
|
| 723 |
),
|
| 724 |
+
flagging_mode="never",
|
| 725 |
)
|
| 726 |
|
| 727 |
# --- Simplified DDG tab (readable output only) ---
|
|
|
|
| 743 |
"OR for alternatives, and - to exclude terms. Examples: 'Python programming', 'site:example.com', "
|
| 744 |
"'\"artificial intelligence\"', 'cats -dogs', 'Python OR JavaScript'."
|
| 745 |
),
|
| 746 |
+
flagging_mode="never",
|
| 747 |
submit_btn="Search",
|
| 748 |
)
|
| 749 |
|
|
|
|
| 765 |
"Parameters: code (str - Python source code to execute). "
|
| 766 |
"Returns: Combined stdout output or exception text if execution fails."
|
| 767 |
),
|
| 768 |
+
flagging_mode="never",
|
| 769 |
)
|
| 770 |
|
| 771 |
CSS_STYLES = """
|
|
|
|
| 818 |
info="Select from 54 available voices across multiple languages and accents"
|
| 819 |
),
|
| 820 |
],
|
| 821 |
+
outputs=gr.Audio(label="Audio", type="numpy", format="wav", show_download_button=True),
|
| 822 |
title="Kokoro TTS",
|
| 823 |
description=(
|
| 824 |
"<div style=\"text-align:center\">Generate speech with Kokoro-82M using 54 different voices. Supports multiple languages and accents. Can generate audio of any length! Runs on CPU or CUDA if available.</div>"
|
|
|
|
| 831 |
"Use List_Kokoro_Voices() to see all available voices. "
|
| 832 |
"Return the generated media to the user in this format ``"
|
| 833 |
),
|
| 834 |
+
flagging_mode="never",
|
| 835 |
)
|
| 836 |
|
| 837 |
# ==========================
|
|
|
|
| 959 |
"cfg_scale (float, 1–20), sampler (str), seed (int, -1=random), width/height (int, 64–1216). "
|
| 960 |
"Returns a PIL.Image. Return the generated media to the user in this format ``"
|
| 961 |
),
|
| 962 |
+
flagging_mode="never",
|
| 963 |
)
|
| 964 |
|
| 965 |
# ==========================
|
|
|
|
| 1139 |
"width/height (int), fps (int), duration (float in seconds). Returns MP4 file path. "
|
| 1140 |
"Return the generated media to the user in this format ``"
|
| 1141 |
),
|
| 1142 |
+
flagging_mode="never",
|
| 1143 |
)
|
| 1144 |
|
| 1145 |
# Build tabbed app; disable Image/Video tools if no HF token is present
|