Spaces:
Running on Zero
Running on Zero
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -20,10 +20,7 @@ from maya3 import hub
|
|
| 20 |
|
| 21 |
RELEASE = "maya-research/maya2-native"
|
| 22 |
_paths = hub.resolve(RELEASE) # downloads model shards + kyutai/mimi + speechbrain ECAPA
|
| 23 |
-
|
| 24 |
-
MIMI_DIR = _paths["mimi_dir"]
|
| 25 |
-
ECAPA_DIR = _paths["ecapa_dir"]
|
| 26 |
-
CKPT_DIR = _paths["ckpt"]
|
| 27 |
|
| 28 |
import gradio as gr
|
| 29 |
import numpy as np
|
|
@@ -55,13 +52,10 @@ def _get_tts():
|
|
| 55 |
|
| 56 |
t0 = time.perf_counter()
|
| 57 |
_tts = Maya3TTS.from_pretrained(
|
| 58 |
-
CKPT_DIR,
|
| 59 |
-
backbone_dir=BACKBONE_DIR,
|
| 60 |
-
mimi_dir=MIMI_DIR,
|
| 61 |
-
ecapa_dir=ECAPA_DIR,
|
| 62 |
device="cuda",
|
| 63 |
-
max_seats=1,
|
| 64 |
-
capacity=1024,
|
| 65 |
)
|
| 66 |
print(f"[maya2] engine ready in {time.perf_counter() - t0:.1f}s", flush=True)
|
| 67 |
return _tts
|
|
@@ -161,7 +155,7 @@ with gr.Blocks(theme=gr.themes.Citrus(), css=CSS) as demo:
|
|
| 161 |
filterable=True,
|
| 162 |
info="Named voices ship with the model; or clone your own below.",
|
| 163 |
)
|
| 164 |
-
audio_out = gr.Audio(label="Generated speech", type="filepath"
|
| 165 |
btn = gr.Button("Generate speech", variant="primary")
|
| 166 |
with gr.Column(scale=2):
|
| 167 |
gr.Markdown("### Clone a voice (optional)")
|
|
|
|
| 20 |
|
| 21 |
RELEASE = "maya-research/maya2-native"
|
| 22 |
_paths = hub.resolve(RELEASE) # downloads model shards + kyutai/mimi + speechbrain ECAPA
|
| 23 |
+
CKPT_DIR = _paths["ckpt"] # release dir; from_pretrained re-resolves offline-first
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
import gradio as gr
|
| 26 |
import numpy as np
|
|
|
|
| 52 |
|
| 53 |
t0 = time.perf_counter()
|
| 54 |
_tts = Maya3TTS.from_pretrained(
|
| 55 |
+
CKPT_DIR, # release dir; re-resolves (offline-first) + registers named voices
|
|
|
|
|
|
|
|
|
|
| 56 |
device="cuda",
|
| 57 |
+
max_seats=1, # smallest graph grid; demo serves one request at a time
|
| 58 |
+
capacity=1024, # halves KV cache vs default; still ~80 s of audio per piece
|
| 59 |
)
|
| 60 |
print(f"[maya2] engine ready in {time.perf_counter() - t0:.1f}s", flush=True)
|
| 61 |
return _tts
|
|
|
|
| 155 |
filterable=True,
|
| 156 |
info="Named voices ship with the model; or clone your own below.",
|
| 157 |
)
|
| 158 |
+
audio_out = gr.Audio(label="Generated speech", type="filepath")
|
| 159 |
btn = gr.Button("Generate speech", variant="primary")
|
| 160 |
with gr.Column(scale=2):
|
| 161 |
gr.Markdown("### Clone a voice (optional)")
|