Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -203,25 +203,17 @@ with gr.Blocks() as demo:
|
|
203 |
gr.Markdown(description)
|
204 |
with gr.Tabs():
|
205 |
with gr.TabItem("Text - Audio"):
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
description="Model in text to audio mode",
|
212 |
-
allow_flagging='never',
|
213 |
-
)
|
214 |
-
text_to_audio_interface.render()
|
215 |
with gr.TabItem("Audio - Text"):
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
description="Model in audio to text mode",
|
222 |
-
allow_flagging='never'
|
223 |
-
)
|
224 |
-
audio_to_text_interface.render()
|
225 |
|
226 |
# Launch the demo
|
227 |
demo.launch(share=True)
|
|
|
203 |
gr.Markdown(description)
|
204 |
with gr.Tabs():
|
205 |
with gr.TabItem("Text - Audio"):
|
206 |
+
gr.Markdown("### Text-to-Speech (T2S) Mode")
|
207 |
+
input_text = gr.Textbox(label="Input Text")
|
208 |
+
output_audio = gr.Audio(label="Audio Answer")
|
209 |
+
generate_button = gr.Button("Generate")
|
210 |
+
generate_button.click(infer_text_to_audio, inputs=input_text, outputs=output_audio)
|
|
|
|
|
|
|
|
|
211 |
with gr.TabItem("Audio - Text"):
|
212 |
+
gr.Markdown("### Speech-to-Text (S2T) Mode")
|
213 |
+
input_audio = gr.Audio(type="filepath", label="Input Audio")
|
214 |
+
output_text = gr.Textbox(label="Text Answer")
|
215 |
+
generate_button = gr.Button("Generate")
|
216 |
+
generate_button.click(infer_audio_to_text, inputs=input_audio, outputs=output_text)
|
|
|
|
|
|
|
|
|
217 |
|
218 |
# Launch the demo
|
219 |
demo.launch(share=True)
|