Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -48,6 +48,7 @@ def load_mod(model):
|
|
48 |
yield f"Voice Loaded: {model}"
|
49 |
|
50 |
with gr.Blocks() as iface:
|
|
|
51 |
aud=gr.Audio(streaming=True,autoplay=True)
|
52 |
chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, layout="panel")
|
53 |
prompt = gr.Textbox()
|
@@ -63,13 +64,11 @@ with gr.Blocks() as iface:
|
|
63 |
width=gr.Slider(label="Noise Width", minimum=0.01, maximum=3.0, value=0.5)
|
64 |
sen_pause=gr.Slider(label="Sentence Pause", minimum=0.1, maximum=10.0, value=1)
|
65 |
upd_btn=gr.Button("Update")
|
66 |
-
with gr.Row(visible=False):
|
67 |
-
stt=gr.Textbox(visible=True)
|
68 |
|
69 |
iface.load(load_mod,names,msg)
|
70 |
sub_b = submit_b.click(generate, [prompt,chatbot],[chatbot,stt])
|
71 |
-
|
72 |
-
stt.change(pp.stream_tts,[stt,names,length,noise,width,sen_pause],aud)
|
73 |
names_change=names.change(load_mod,names,msg)
|
74 |
-
stop_b.click(None,None,None, cancels=[sub_b,names_change])
|
75 |
iface.queue(default_concurrency_limit=10).launch()
|
|
|
48 |
yield f"Voice Loaded: {model}"
|
49 |
|
50 |
with gr.Blocks() as iface:
|
51 |
+
stt=gr.State()
|
52 |
aud=gr.Audio(streaming=True,autoplay=True)
|
53 |
chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, layout="panel")
|
54 |
prompt = gr.Textbox()
|
|
|
64 |
width=gr.Slider(label="Noise Width", minimum=0.01, maximum=3.0, value=0.5)
|
65 |
sen_pause=gr.Slider(label="Sentence Pause", minimum=0.1, maximum=10.0, value=1)
|
66 |
upd_btn=gr.Button("Update")
|
|
|
|
|
67 |
|
68 |
iface.load(load_mod,names,msg)
|
69 |
sub_b = submit_b.click(generate, [prompt,chatbot],[chatbot,stt])
|
70 |
+
sub_e = prompt.submit(generate, [prompt, chatbot], [chatbot,stt])
|
71 |
+
aud_out = stt.change(pp.stream_tts,[stt,names,length,noise,width,sen_pause],aud)
|
72 |
names_change=names.change(load_mod,names,msg)
|
73 |
+
stop_b.click(None,None,None, cancels=[sub_b,sub_e,aud_out,names_change])
|
74 |
iface.queue(default_concurrency_limit=10).launch()
|