Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,13 +41,13 @@ def generate(prompt,history):
|
|
| 41 |
for response in stream:
|
| 42 |
output += response.token.text
|
| 43 |
yield [(prompt,output)]
|
| 44 |
-
yield [(prompt,output)]
|
| 45 |
|
| 46 |
def load_mod(model):
|
| 47 |
yield f"Loading: {model}"
|
| 48 |
pp.load_mod(model)
|
| 49 |
yield f"Voice Loaded: {model}"
|
| 50 |
def tts(inp,names,length,noise,width,sen_pause):
|
|
|
|
| 51 |
yield from pp.stream_tts(inp[-1][-1],names,length,noise,width,sen_pause)
|
| 52 |
with gr.Blocks() as iface:
|
| 53 |
chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, layout="panel")
|
|
@@ -68,7 +68,7 @@ with gr.Blocks() as iface:
|
|
| 68 |
with gr.Row(visible=False):
|
| 69 |
stt=gr.Textbox()
|
| 70 |
iface.load(load_mod,names,msg)
|
| 71 |
-
sub_b = submit_b.click(generate, [prompt,chatbot],
|
| 72 |
names_change=names.change(load_mod,names,msg)
|
| 73 |
stop_b.click(None,None,None, cancels=[sub_b,names_change,aud])
|
| 74 |
iface.queue(default_concurrency_limit=10).launch(max_threads=40)
|
|
|
|
| 41 |
for response in stream:
|
| 42 |
output += response.token.text
|
| 43 |
yield [(prompt,output)]
|
|
|
|
| 44 |
|
| 45 |
def load_mod(model):
|
| 46 |
yield f"Loading: {model}"
|
| 47 |
pp.load_mod(model)
|
| 48 |
yield f"Voice Loaded: {model}"
|
| 49 |
def tts(inp,names,length,noise,width,sen_pause):
|
| 50 |
+
print(inp)
|
| 51 |
yield from pp.stream_tts(inp[-1][-1],names,length,noise,width,sen_pause)
|
| 52 |
with gr.Blocks() as iface:
|
| 53 |
chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, layout="panel")
|
|
|
|
| 68 |
with gr.Row(visible=False):
|
| 69 |
stt=gr.Textbox()
|
| 70 |
iface.load(load_mod,names,msg)
|
| 71 |
+
sub_b = submit_b.click(generate, [prompt,chatbot],chatbot).then(tts,[chatbot,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,names_change,aud])
|
| 74 |
iface.queue(default_concurrency_limit=10).launch(max_threads=40)
|