Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,19 +7,10 @@ import gradio as gr
|
|
7 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
8 |
|
9 |
|
10 |
-
def set_seed(seed: int):
|
11 |
-
torch.manual_seed(seed)
|
12 |
-
torch.cuda.manual_seed(seed)
|
13 |
-
torch.cuda.manual_seed_all(seed)
|
14 |
-
random.seed(seed)
|
15 |
-
np.random.seed(seed)
|
16 |
-
|
17 |
|
18 |
model = OratorTTS.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 |
|
24 |
wav = model.generate(
|
25 |
text,
|
@@ -35,7 +26,7 @@ with gr.Blocks() as demo:
|
|
35 |
with gr.Column():
|
36 |
text = gr.Textbox(value="I know what you're thinking. \"Did he fire six shots, or only five?\" Well, to tell you the truth, in all this excitement, I kind of lost track myself.", label="Text to synthesize")
|
37 |
ref_wav = gr.Audio(sources="upload", type="filepath", label="Reference Audio File", value=None)
|
38 |
-
exaggeration = gr.Slider(0.25, 2, step=.05, label="Exaggeration (extreme values
|
39 |
|
40 |
run_btn = gr.Button("Generate", variant="primary")
|
41 |
|
|
|
7 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
8 |
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
model = OratorTTS.from_pretrained(DEVICE)
|
12 |
|
13 |
def generate(text, audio_prompt_path, exaggeration, pace, temperature, seed_num):
|
|
|
|
|
14 |
|
15 |
wav = model.generate(
|
16 |
text,
|
|
|
26 |
with gr.Column():
|
27 |
text = gr.Textbox(value="I know what you're thinking. \"Did he fire six shots, or only five?\" Well, to tell you the truth, in all this excitement, I kind of lost track myself.", label="Text to synthesize")
|
28 |
ref_wav = gr.Audio(sources="upload", type="filepath", label="Reference Audio File", value=None)
|
29 |
+
exaggeration = gr.Slider(0.25, 2, step=.05, label="Exaggeration (extreme values can be unstable)", value=.7)
|
30 |
|
31 |
run_btn = gr.Button("Generate", variant="primary")
|
32 |
|