Spaces:
Running
on
Zero
Running
on
Zero
Den Pavloff
commited on
Commit
·
26adaf1
1
Parent(s):
164603c
player
Browse files
app.py
CHANGED
|
@@ -51,17 +51,17 @@ models_configs = {
|
|
| 51 |
}
|
| 52 |
|
| 53 |
# Global variables for models (loaded once)
|
| 54 |
-
player =
|
| 55 |
models = {}
|
| 56 |
|
| 57 |
def initialize_models():
|
| 58 |
"""Initialize models globally to avoid reloading"""
|
| 59 |
-
global
|
| 60 |
|
| 61 |
-
if player is None:
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
|
| 66 |
if not models:
|
| 67 |
print("Loading TTS models...")
|
|
@@ -116,7 +116,7 @@ def validate_input(text, model_choice):
|
|
| 116 |
return f"✅ Ready to generate with {model_choice}"
|
| 117 |
|
| 118 |
# Create Gradio interface
|
| 119 |
-
with gr.Blocks(title="KaniTTS - Text to Speech", theme=gr.themes.
|
| 120 |
gr.Markdown("# 🎤 KaniTTS - Text to Speech with Zero GPU")
|
| 121 |
gr.Markdown("Select a model and enter text to generate high-quality speech")
|
| 122 |
|
|
|
|
| 51 |
}
|
| 52 |
|
| 53 |
# Global variables for models (loaded once)
|
| 54 |
+
player = NemoAudioPlayer(Config())
|
| 55 |
models = {}
|
| 56 |
|
| 57 |
def initialize_models():
|
| 58 |
"""Initialize models globally to avoid reloading"""
|
| 59 |
+
global models
|
| 60 |
|
| 61 |
+
# if player is None:
|
| 62 |
+
# print("Initializing NeMo Audio Player...")
|
| 63 |
+
# player = NemoAudioPlayer(Config())
|
| 64 |
+
# print("NeMo Audio Player initialized!")
|
| 65 |
|
| 66 |
if not models:
|
| 67 |
print("Loading TTS models...")
|
|
|
|
| 116 |
return f"✅ Ready to generate with {model_choice}"
|
| 117 |
|
| 118 |
# Create Gradio interface
|
| 119 |
+
with gr.Blocks(title="KaniTTS - Text to Speech", theme=gr.themes.Default()) as demo:
|
| 120 |
gr.Markdown("# 🎤 KaniTTS - Text to Speech with Zero GPU")
|
| 121 |
gr.Markdown("Select a model and enter text to generate high-quality speech")
|
| 122 |
|