Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ def chat_hf(audio, custom_token, language):
|
|
40 |
|
41 |
# to voice
|
42 |
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
|
43 |
-
coquiTTS.get_tts(
|
44 |
|
45 |
return whisper_text, gpt_response, fp.name
|
46 |
|
@@ -85,9 +85,10 @@ with gr.Blocks() as blocks:
|
|
85 |
)
|
86 |
with gr.Row():# mobile_collapse=False
|
87 |
submit = gr.Button("Submit", variant="primary")
|
88 |
-
|
89 |
-
|
90 |
-
|
|
|
91 |
#gr.Markdown(info)
|
92 |
#gr.Markdown("<center>"
|
93 |
# +f'<img src={badge} alt="visitors badge"/>'
|
@@ -99,7 +100,7 @@ with gr.Blocks() as blocks:
|
|
99 |
[audio_file, custom_token, radio],
|
100 |
[text1, text2, audio],
|
101 |
)
|
102 |
-
radio.change(lambda lang: CoquiTTS.langs[lang]["sentence"], radio,
|
103 |
|
104 |
|
105 |
blocks.launch(debug=True)
|
|
|
40 |
|
41 |
# to voice
|
42 |
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
|
43 |
+
coquiTTS.get_tts(gpt_response, fp, speaker = {"language" : language})
|
44 |
|
45 |
return whisper_text, gpt_response, fp.name
|
46 |
|
|
|
85 |
)
|
86 |
with gr.Row():# mobile_collapse=False
|
87 |
submit = gr.Button("Submit", variant="primary")
|
88 |
+
with gr.Column():
|
89 |
+
text1 = gr.Textbox(label="Speech to Text")
|
90 |
+
text2 = gr.Textbox(label="chatGPT response")
|
91 |
+
audio = gr.Audio(label="Output", interactive=False)
|
92 |
#gr.Markdown(info)
|
93 |
#gr.Markdown("<center>"
|
94 |
# +f'<img src={badge} alt="visitors badge"/>'
|
|
|
100 |
[audio_file, custom_token, radio],
|
101 |
[text1, text2, audio],
|
102 |
)
|
103 |
+
radio.change(lambda lang: CoquiTTS.langs[lang]["sentence"], radio, text2)
|
104 |
|
105 |
|
106 |
blocks.launch(debug=True)
|