Spaces:
Runtime error
Runtime error
datnth1709
commited on
Commit
·
ad6ff47
1
Parent(s):
e00f0bb
update speech2text module
Browse files- app.py +10 -10
- requirements.txt +2 -0
app.py
CHANGED
@@ -106,16 +106,16 @@ with gr.Blocks() as demo:
|
|
106 |
gr.Examples(examples=vi_example_text,
|
107 |
inputs=[vietnamese])
|
108 |
with gr.TabItem("Speech2text and translation"):
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
|
120 |
if __name__ == "__main__":
|
121 |
demo.launch()
|
|
|
106 |
gr.Examples(examples=vi_example_text,
|
107 |
inputs=[vietnamese])
|
108 |
with gr.TabItem("Speech2text and translation"):
|
109 |
+
with gr.Row():
|
110 |
+
with gr.Column():
|
111 |
+
audio = gr.Audio(source="microphone", label="Input Audio", type="filepath")
|
112 |
+
translate_button = gr.Button(value="Translate To English")
|
113 |
+
with gr.Column():
|
114 |
+
enlish = gr.Textbox(label="English Text")
|
115 |
+
|
116 |
+
translate_button.click(lambda voice: inference(voice), inputs=audio, outputs=english)
|
117 |
+
gr.Examples(examples=vi_example_voice,
|
118 |
+
inputs=[audio])
|
119 |
|
120 |
if __name__ == "__main__":
|
121 |
demo.launch()
|
requirements.txt
CHANGED
@@ -5,6 +5,8 @@ datasets==1.11.0
|
|
5 |
pyctcdecode==v0.1.0
|
6 |
speechbrain
|
7 |
pydub
|
|
|
|
|
8 |
soundfile
|
9 |
ffmpeg-python
|
10 |
gradio
|
|
|
5 |
pyctcdecode==v0.1.0
|
6 |
speechbrain
|
7 |
pydub
|
8 |
+
kenlm
|
9 |
+
pyctcdecode
|
10 |
soundfile
|
11 |
ffmpeg-python
|
12 |
gradio
|