Spaces:
Runtime error
Runtime error
show expected result
Browse files
app.py
CHANGED
@@ -172,7 +172,6 @@ def client(audio_data: np.array, sample_rate: int, default_lang: str):
|
|
172 |
|
173 |
def stt(default_lang: str, audio: Tuple[int, np.array], state=None):
|
174 |
sample_rate, audio = audio
|
175 |
-
use_scorer = False
|
176 |
|
177 |
recognized_result = client(audio, sample_rate, default_lang)
|
178 |
|
@@ -194,30 +193,29 @@ def _convert_audio(audio_data: np.array, sample_rate: int):
|
|
194 |
output_audio.seek(0)
|
195 |
return output_audio
|
196 |
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
es_iface = iface('es')
|
222 |
|
223 |
-
|
|
|
172 |
|
173 |
def stt(default_lang: str, audio: Tuple[int, np.array], state=None):
|
174 |
sample_rate, audio = audio
|
|
|
175 |
|
176 |
recognized_result = client(audio, sample_rate, default_lang)
|
177 |
|
|
|
193 |
output_audio.seek(0)
|
194 |
return output_audio
|
195 |
|
196 |
+
ui_language = 'es'
|
197 |
+
|
198 |
+
iface = gr.Interface(
|
199 |
+
fn=stt,
|
200 |
+
inputs=[
|
201 |
+
gr.inputs.Radio(choices=("chatino", "mixteco", "totonaco"), default="mixteco", label=UI_STRINGS["labels"]["target"][ui_language]),
|
202 |
+
gr.inputs.Audio(type="numpy", label=UI_STRINGS["labels"]["input"][ui_language], source="microphone", optional=False),
|
203 |
+
gr.inputs.State(label="Resultado esperado")
|
204 |
+
],
|
205 |
+
outputs=[
|
206 |
+
gr.outputs.Textbox(label=UI_STRINGS["labels"]["output"][ui_language]),
|
207 |
+
gr.outputs.State(label="Resultado esperado")
|
208 |
+
],
|
209 |
+
title=UI_STRINGS["title"][ui_language],
|
210 |
+
theme="huggingface",
|
211 |
+
description=UI_STRINGS["description"][ui_language],
|
212 |
+
examples=[["mixteco", "ejemplos/espanol1-Yolox_BotFl_CTB501-FEF537-EGS503_40202-Acanthaceae-Ruellia_2017-01-05-h.wav", "español: "],
|
213 |
+
["mixteco", "ejemplos/espanol2-Yolox_BotFl_CTB501-FEF537-EGS503_40202-Acanthaceae-Ruellia_2017-01-05-h.wav", "español: "],
|
214 |
+
["mixteco", "ejemplos/mixteco1-Yolox_BotFl_CTB501-FEF537-EGS503_40202-Acanthaceae-Ruellia_2017-01-05-h.wav", "mixteco: "],
|
215 |
+
["mixteco", "ejemplos/mixteco2-Yolox_BotFl_CTB501-FEF537-EGS503_40202-Acanthaceae-Ruellia_2017-01-05-h.wav", "mixteco: "],
|
216 |
+
["totonaco", "ejemplos/totonaco1-Zongo_Botan_Acanthaceae-Justicia-spicigera_SLC388-IPN389_2018-07-26-i.wav", "totonaco: "],
|
217 |
+
["totonaco", "ejemplos/totonaco2-Zongo_Botan_Acanthaceae-Justicia-spicigera_SLC388-IPN389_2018-07-26-i.wav", "totonaco: "]],
|
218 |
+
article=UI_STRINGS["title"][ui_language],
|
219 |
+
)
|
|
|
220 |
|
221 |
+
iface.launch()
|