ASG Models commited on
Commit
2e73d41
1 Parent(s): 2b181ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -214,11 +214,18 @@ def text_to_speech(text):
214
  yield modelspeech(pad_text)
215
  # for stream_wav in generate_audio(pad_text):
216
  # yield stream_wav
217
- def dash(text,state=''):
218
 
219
  response=get_answer_ai(text)
 
220
  for chunk in response:
221
- yield state+chunk.text
 
 
 
 
 
 
222
 
223
 
224
 
@@ -231,7 +238,7 @@ with gr.Blocks() as demo:
231
  gr.Markdown("# Text to Speech")
232
  text_input = gr.Textbox(label="Enter Text")
233
  text_out = gr.Textbox()
234
- text_input.submit(dash, [text_input,text_out], text_out)
235
  with gr.Tab("AI Speech"):
236
  gr.Markdown("# Text to Speech")
237
  text_input2 = gr.Textbox(label="Enter Text")
 
214
  yield modelspeech(pad_text)
215
  # for stream_wav in generate_audio(pad_text):
216
  # yield stream_wav
217
+ def dash(text,is_state=False):
218
 
219
  response=get_answer_ai(text)
220
+ txt=' '
221
  for chunk in response:
222
+ if is_state:
223
+ txt+=chunk.text
224
+ else
225
+ txt=chunk.text
226
+
227
+
228
+ yield txt
229
 
230
 
231
 
 
238
  gr.Markdown("# Text to Speech")
239
  text_input = gr.Textbox(label="Enter Text")
240
  text_out = gr.Textbox()
241
+ text_input.submit(dash, [text_input], text_out)
242
  with gr.Tab("AI Speech"):
243
  gr.Markdown("# Text to Speech")
244
  text_input2 = gr.Textbox(label="Enter Text")