Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ def set_seed(seed: int):
|
|
17 |
|
18 |
model = ChatterboxTTS.from_pretrained(DEVICE)
|
19 |
|
20 |
-
def generate(text, audio_prompt_path, exaggeration, pace, temperature, seed_num):
|
21 |
if seed_num != 0:
|
22 |
set_seed(int(seed_num))
|
23 |
|
@@ -27,6 +27,7 @@ def generate(text, audio_prompt_path, exaggeration, pace, temperature, seed_num)
|
|
27 |
exaggeration=exaggeration,
|
28 |
pace=pace,
|
29 |
temperature=temperature,
|
|
|
30 |
)
|
31 |
return model.sr, wav.squeeze(0).numpy()
|
32 |
|
@@ -36,7 +37,9 @@ with gr.Blocks() as demo:
|
|
36 |
with gr.Column():
|
37 |
text = gr.Textbox(value="What does the fox say?", label="Text to synthesize")
|
38 |
ref_wav = gr.Audio(sources="upload", type="filepath", label="Reference Audio File", value=None)
|
39 |
-
exaggeration = gr.Slider(0.25, 2, step=.05, label="
|
|
|
|
|
40 |
|
41 |
with gr.Accordion("More options", open=False):
|
42 |
seed_num = gr.Number(value=0, label="Random seed (0 for random)")
|
@@ -57,6 +60,7 @@ with gr.Blocks() as demo:
|
|
57 |
pace,
|
58 |
temp,
|
59 |
seed_num,
|
|
|
60 |
],
|
61 |
outputs=audio_output,
|
62 |
)
|
|
|
17 |
|
18 |
model = ChatterboxTTS.from_pretrained(DEVICE)
|
19 |
|
20 |
+
def generate(text, audio_prompt_path, exaggeration, pace, temperature, seed_num, cfg_weight):
|
21 |
if seed_num != 0:
|
22 |
set_seed(int(seed_num))
|
23 |
|
|
|
27 |
exaggeration=exaggeration,
|
28 |
pace=pace,
|
29 |
temperature=temperature,
|
30 |
+
cfg_weight=cfg_weight,
|
31 |
)
|
32 |
return model.sr, wav.squeeze(0).numpy()
|
33 |
|
|
|
37 |
with gr.Column():
|
38 |
text = gr.Textbox(value="What does the fox say?", label="Text to synthesize")
|
39 |
ref_wav = gr.Audio(sources="upload", type="filepath", label="Reference Audio File", value=None)
|
40 |
+
exaggeration = gr.Slider(0.25, 2, step=.05, label="Exaggeration (Neutral = 0.5, extreme values can be unstable)", value=.5)
|
41 |
+
cfg_weight = gr.Slider(0.0, 5, step=.05, label="CFG/Pace", value=1.0)
|
42 |
+
|
43 |
|
44 |
with gr.Accordion("More options", open=False):
|
45 |
seed_num = gr.Number(value=0, label="Random seed (0 for random)")
|
|
|
60 |
pace,
|
61 |
temp,
|
62 |
seed_num,
|
63 |
+
cfg_weight,
|
64 |
],
|
65 |
outputs=audio_output,
|
66 |
)
|