Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import os
|
| 3 |
from core.cloner import KokoClone
|
| 4 |
|
| 5 |
# 1. Initialize the cloner globally so models load only once when the server starts
|
|
@@ -28,18 +27,18 @@ def clone_voice(text, lang, ref_audio_path):
|
|
| 28 |
raise gr.Error(f"An error occurred during generation: {str(e)}")
|
| 29 |
|
| 30 |
# 2. Build the Gradio UI using Blocks
|
| 31 |
-
# Gradio 6.0 fix: Removed theme from here
|
| 32 |
with gr.Blocks() as demo:
|
| 33 |
-
gr.
|
| 34 |
-
|
| 35 |
-
<div style="text-align: center;">
|
| 36 |
-
<h1>🎧 KokoClone</h1>
|
| 37 |
-
<p
|
| 38 |
-
|
| 39 |
-
|
|
|
|
|
|
|
| 40 |
</div>
|
| 41 |
-
|
| 42 |
-
)
|
| 43 |
|
| 44 |
with gr.Row():
|
| 45 |
# LEFT COLUMN: Inputs
|
|
@@ -102,5 +101,4 @@ with gr.Blocks() as demo:
|
|
| 102 |
|
| 103 |
# 4. Launch the app
|
| 104 |
if __name__ == "__main__":
|
| 105 |
-
# Gradio 6.0 fix: Moved theme here and removed show_api
|
| 106 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
from core.cloner import KokoClone
|
| 3 |
|
| 4 |
# 1. Initialize the cloner globally so models load only once when the server starts
|
|
|
|
| 27 |
raise gr.Error(f"An error occurred during generation: {str(e)}")
|
| 28 |
|
| 29 |
# 2. Build the Gradio UI using Blocks
|
|
|
|
| 30 |
with gr.Blocks() as demo:
|
| 31 |
+
# Using gr.HTML for the header ensures CSS styles like text-align are respected
|
| 32 |
+
gr.HTML("""
|
| 33 |
+
<div style="text-align: center; margin-bottom: 20px;">
|
| 34 |
+
<h1 style="margin: 0;">🎧 KokoClone</h1>
|
| 35 |
+
<p style="margin: 10px 0; color: #666;">
|
| 36 |
+
Voice Cloning, Now Inside Kokoro.<br>
|
| 37 |
+
Generate natural multilingual speech and clone any target voice with ease.<br>
|
| 38 |
+
<i>Built on Kokoro TTS.</i>
|
| 39 |
+
</p>
|
| 40 |
</div>
|
| 41 |
+
""")
|
|
|
|
| 42 |
|
| 43 |
with gr.Row():
|
| 44 |
# LEFT COLUMN: Inputs
|
|
|
|
| 101 |
|
| 102 |
# 4. Launch the app
|
| 103 |
if __name__ == "__main__":
|
|
|
|
| 104 |
demo.launch()
|