Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -35,17 +35,22 @@ def load_set(set_file):
|
|
35 |
return(gr.update(value=set_json['model']),gr.update(value=set_json['length']),
|
36 |
gr.update(value=set_json['noise']),gr.update(value=set_json['width']),
|
37 |
gr.update(value=set_json['pause']))
|
38 |
-
|
39 |
-
|
40 |
exp_file=f"./example/en_US-ljspeech-high__1__1__0_5__1.json"
|
41 |
return(gr.update(value=txt),gr.update(value=exp_file))
|
|
|
|
|
|
|
42 |
|
43 |
with gr.Blocks(theme="Hev832/Applio-Theme") as b:
|
44 |
state1=gr.State()
|
45 |
with gr.Row():
|
46 |
with gr.Column(scale=1):
|
47 |
exp1=gr.Button("Example 1")
|
48 |
-
|
|
|
|
|
49 |
with gr.Column(scale=2):
|
50 |
in_txt=gr.Textbox(label="Text",lines=10)
|
51 |
names=gr.Dropdown()
|
@@ -66,7 +71,8 @@ with gr.Blocks(theme="Hev832/Applio-Theme") as b:
|
|
66 |
load_file=gr.File()
|
67 |
load_file.change(load_set,load_file,[names,length,noise,width,sen_pause])
|
68 |
#load_btn=gr.Button("Load").click(load_set,load_file,[names,length,noise,width,sen_pause])
|
69 |
-
exp1.click(
|
|
|
70 |
names.change(load_mod,names,json_ob)
|
71 |
sub_btn.click(pp.tts,[in_txt,names,length,noise,width,sen_pause],out_aud)
|
72 |
b.load(init,None,names)
|
|
|
35 |
return(gr.update(value=set_json['model']),gr.update(value=set_json['length']),
|
36 |
gr.update(value=set_json['noise']),gr.update(value=set_json['width']),
|
37 |
gr.update(value=set_json['pause']))
|
38 |
+
txt="""PiperTTS is a powerful text-to-speech TTS node designed to convert written text into high-quality spoken audio. This node leverages advanced voice synthesis models to generate natural-sounding speech, making it an invaluable tool for AI developers looking to add a vocal element to their projects."""
|
39 |
+
def exp1(exp_file):
|
40 |
exp_file=f"./example/en_US-ljspeech-high__1__1__0_5__1.json"
|
41 |
return(gr.update(value=txt),gr.update(value=exp_file))
|
42 |
+
def exp2(exp_file):
|
43 |
+
exp_file=f"./example/en_US-ryan-high__1__0_6__0_01__1.json"
|
44 |
+
return(gr.update(value=txt),gr.update(value=exp_file))
|
45 |
|
46 |
with gr.Blocks(theme="Hev832/Applio-Theme") as b:
|
47 |
state1=gr.State()
|
48 |
with gr.Row():
|
49 |
with gr.Column(scale=1):
|
50 |
exp1=gr.Button("Example 1")
|
51 |
+
exp2=gr.Button("Example 2")
|
52 |
+
with gr.Accordion("Model Config"):
|
53 |
+
json_ob=gr.JSON(label="JSON")
|
54 |
with gr.Column(scale=2):
|
55 |
in_txt=gr.Textbox(label="Text",lines=10)
|
56 |
names=gr.Dropdown()
|
|
|
71 |
load_file=gr.File()
|
72 |
load_file.change(load_set,load_file,[names,length,noise,width,sen_pause])
|
73 |
#load_btn=gr.Button("Load").click(load_set,load_file,[names,length,noise,width,sen_pause])
|
74 |
+
exp1.click(exp1,None,[in_txt,load_file])
|
75 |
+
exp2.click(exp2,None,[in_txt,load_file])
|
76 |
names.change(load_mod,names,json_ob)
|
77 |
sub_btn.click(pp.tts,[in_txt,names,length,noise,width,sen_pause],out_aud)
|
78 |
b.load(init,None,names)
|