Spaces:
Sleeping
Sleeping
ASG Models
commited on
Update app.py
Browse files
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,
|
| 218 |
|
| 219 |
response=get_answer_ai(text)
|
|
|
|
| 220 |
for chunk in response:
|
| 221 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|
| 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")
|