broadfield commited on
Commit
c5c3727
·
verified ·
1 Parent(s): 60d1cd9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -7
app.py CHANGED
@@ -44,8 +44,9 @@ def generate(prompt,history,max_new_tokens,seed):
44
  output += response.token.text
45
  #print(output)
46
  #yield output
47
- def tts(inp):
48
- yield from pp.stream_tts(inp)
 
49
  with gr.Blocks() as iface:
50
  stt=gr.State()
51
  gr.HTML("""""")
@@ -57,11 +58,15 @@ with gr.Blocks() as iface:
57
  submit_b = gr.Button()
58
  stop_b = gr.Button("Stop")
59
  clear = gr.ClearButton([msg, chatbot])
60
- sumbox=gr.Textbox("Summary", max_lines=100)
61
- with gr.Column():
62
- sum_out_box=gr.JSON(label="Summaries")
63
- hist_out_box=gr.JSON(label="History")
64
- stt.change(tts,stt,aud)
 
 
 
 
65
  #sub_b = submit_b.click(generate, [msg,chatbot],[msg,chatbot,sumbox,sum_out_box,hist_out_box])
66
  #sub_e = msg.submit(generate, [msg, chatbot], [msg, chatbot,sumbox,sum_out_box,hist_out_box])
67
  sub_b = submit_b.click(generate, [msg,chatbot],[chatbot,stt])
 
44
  output += response.token.text
45
  #print(output)
46
  #yield output
47
+ def search(inp,voice,length,noise,width,sen_pause):
48
+ yield from pp.stream_tts(inp,voice,length,noise,width,sen_pause)
49
+
50
  with gr.Blocks() as iface:
51
  stt=gr.State()
52
  gr.HTML("""""")
 
58
  submit_b = gr.Button()
59
  stop_b = gr.Button("Stop")
60
  clear = gr.ClearButton([msg, chatbot])
61
+ with gr.Accordion("Voice Controls",open=False):
62
+ names=gr.Dropdown(label="Voice", choices=pp.key_list,value="en_US-lessac-high")
63
+ length=gr.Slider(label="Length", minimum=0.01, maximum=10.0, value=1)
64
+ noise=gr.Slider(label="Noise", minimum=0.01, maximum=3.0, value=0.5)
65
+ width=gr.Slider(label="Noise Width", minimum=0.01, maximum=3.0, value=0.5)
66
+ sen_pause=gr.Slider(label="Sentence Pause", minimum=0.1, maximum=10.0, value=1)
67
+ upd_btn=gr.Button("Update")
68
+ upd_btn.click(pp.load_mod,names,None)
69
+ stt.change(tts,[stt,names,length,noise,width,se_pause],aud)
70
  #sub_b = submit_b.click(generate, [msg,chatbot],[msg,chatbot,sumbox,sum_out_box,hist_out_box])
71
  #sub_e = msg.submit(generate, [msg, chatbot], [msg, chatbot,sumbox,sum_out_box,hist_out_box])
72
  sub_b = submit_b.click(generate, [msg,chatbot],[chatbot,stt])