Spaces:
Runtime error
Runtime error
Commit
·
a7a18e3
1
Parent(s):
77d9295
record realtime
Browse files
app.py
CHANGED
@@ -211,24 +211,23 @@ with gr.Blocks() as demo:
|
|
211 |
with gr.TabItem("Speech2text and Vi-En Translation"):
|
212 |
with gr.Row():
|
213 |
with gr.Column():
|
214 |
-
|
215 |
translate_button_vien_2 = gr.Button(value="Translate To English")
|
216 |
with gr.Column():
|
217 |
speech2text_vi1 = gr.Textbox(label="Vietnamese Text")
|
218 |
english_out_2 = gr.Textbox(label="English Text")
|
219 |
-
translate_button_vien_2.click(lambda vi_voice: inference_vien(vi_voice), inputs=
|
220 |
gr.Examples(examples=vi_example_voice,
|
221 |
-
inputs=[
|
222 |
|
223 |
with gr.TabItem("Vi-En Realtime Translation"):
|
224 |
with gr.Row():
|
225 |
with gr.Column():
|
226 |
-
|
227 |
-
translate_button_vien_2 = gr.Button(value="Translate To English")
|
228 |
with gr.Column():
|
229 |
speech2text_vi2 = gr.Textbox(label="Vietnamese Text")
|
230 |
english_out_3 = gr.Textbox(label="English Text")
|
231 |
-
|
232 |
|
233 |
|
234 |
with gr.Tabs():
|
@@ -259,7 +258,6 @@ with gr.Blocks() as demo:
|
|
259 |
with gr.Row():
|
260 |
with gr.Column():
|
261 |
en_audio_2 = gr.Audio(source="microphone", label="Input English Audio", type="filepath", streaming=True)
|
262 |
-
# translate_button_envi_2 = gr.Button(value="Translate To Vietnamese")
|
263 |
with gr.Column():
|
264 |
speech2text_en2 = gr.Textbox(label="English Text")
|
265 |
vietnamese_out_3 = gr.Textbox(label="Vietnamese Text")
|
|
|
211 |
with gr.TabItem("Speech2text and Vi-En Translation"):
|
212 |
with gr.Row():
|
213 |
with gr.Column():
|
214 |
+
vi_audio_1 = gr.Audio(source="microphone", label="Input Vietnamese Audio", type="file", streaming=False)
|
215 |
translate_button_vien_2 = gr.Button(value="Translate To English")
|
216 |
with gr.Column():
|
217 |
speech2text_vi1 = gr.Textbox(label="Vietnamese Text")
|
218 |
english_out_2 = gr.Textbox(label="English Text")
|
219 |
+
translate_button_vien_2.click(lambda vi_voice: inference_vien(vi_voice), inputs=vi_audio_1, outputs=[speech2text_vi1, english_out_2])
|
220 |
gr.Examples(examples=vi_example_voice,
|
221 |
+
inputs=[vi_audio_1])
|
222 |
|
223 |
with gr.TabItem("Vi-En Realtime Translation"):
|
224 |
with gr.Row():
|
225 |
with gr.Column():
|
226 |
+
vi_audio_2 = gr.Audio(source="microphone", label="Input Vietnamese Audio", type="file", streaming=True)
|
|
|
227 |
with gr.Column():
|
228 |
speech2text_vi2 = gr.Textbox(label="Vietnamese Text")
|
229 |
english_out_3 = gr.Textbox(label="English Text")
|
230 |
+
vi_audio_2.change(transcribe_vi, [vi_audio_2, speech2text_vi2, english_out_3], [speech2text_vi2, english_out_3])
|
231 |
|
232 |
|
233 |
with gr.Tabs():
|
|
|
258 |
with gr.Row():
|
259 |
with gr.Column():
|
260 |
en_audio_2 = gr.Audio(source="microphone", label="Input English Audio", type="filepath", streaming=True)
|
|
|
261 |
with gr.Column():
|
262 |
speech2text_en2 = gr.Textbox(label="English Text")
|
263 |
vietnamese_out_3 = gr.Textbox(label="Vietnamese Text")
|