show expected result
Browse files
app.py
CHANGED
@@ -93,7 +93,7 @@ UI_STRINGS = {
|
|
93 |
"en": "Audio",
|
94 |
},
|
95 |
"output": {
|
96 |
-
"es": "
|
97 |
"en": "Result",
|
98 |
}
|
99 |
}
|
@@ -170,7 +170,7 @@ def client(audio_data: np.array, sample_rate: int, default_lang: str):
|
|
170 |
return f"{text_lab}: {result}"
|
171 |
|
172 |
|
173 |
-
def stt(default_lang: str, audio: Tuple[int, np.array]):
|
174 |
sample_rate, audio = audio
|
175 |
use_scorer = False
|
176 |
|
@@ -200,18 +200,18 @@ def iface(ui_language):
|
|
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()
|
204 |
],
|
205 |
outputs=gr.outputs.Textbox(label=UI_STRINGS["labels"]["output"][ui_language]),
|
206 |
title=UI_STRINGS["title"][ui_language],
|
207 |
theme="huggingface",
|
208 |
description=UI_STRINGS["description"][ui_language],
|
209 |
-
examples=[["mixteco", "ejemplos/espanol1.wav", "español: "],
|
210 |
-
["mixteco", "ejemplos/espanol2-Yolox_BotFl_CTB501-FEF537-EGS503_40202-Acanthaceae-Ruellia_2017-01-05-h.wav"],
|
211 |
-
["mixteco", "ejemplos/mixteco1-Yolox_BotFl_CTB501-FEF537-EGS503_40202-Acanthaceae-Ruellia_2017-01-05-h.wav"],
|
212 |
-
["mixteco", "ejemplos/mixteco2-Yolox_BotFl_CTB501-FEF537-EGS503_40202-Acanthaceae-Ruellia_2017-01-05-h.wav"],
|
213 |
-
["totonaco", "ejemplos/totonaco1-Zongo_Botan_Acanthaceae-Justicia-spicigera_SLC388-IPN389_2018-07-26-i.wav"],
|
214 |
-
["totonaco", "ejemplos/totonaco2-Zongo_Botan_Acanthaceae-Justicia-spicigera_SLC388-IPN389_2018-07-26-i.wav"]],
|
215 |
article=UI_STRINGS["title"][ui_language],
|
216 |
)
|
217 |
|
|
|
93 |
"en": "Audio",
|
94 |
},
|
95 |
"output": {
|
96 |
+
"es": "Resultado",
|
97 |
"en": "Result",
|
98 |
}
|
99 |
}
|
|
|
170 |
return f"{text_lab}: {result}"
|
171 |
|
172 |
|
173 |
+
def stt(default_lang: str, audio: Tuple[int, np.array], state=None):
|
174 |
sample_rate, audio = audio
|
175 |
use_scorer = False
|
176 |
|
|
|
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=gr.outputs.Textbox(label=UI_STRINGS["labels"]["output"][ui_language]),
|
206 |
title=UI_STRINGS["title"][ui_language],
|
207 |
theme="huggingface",
|
208 |
description=UI_STRINGS["description"][ui_language],
|
209 |
+
examples=[["mixteco", "ejemplos/espanol1-Yolox_BotFl_CTB501-FEF537-EGS503_40202-Acanthaceae-Ruellia_2017-01-05-h.wav", "español: "],
|
210 |
+
["mixteco", "ejemplos/espanol2-Yolox_BotFl_CTB501-FEF537-EGS503_40202-Acanthaceae-Ruellia_2017-01-05-h.wav", "español: "],
|
211 |
+
["mixteco", "ejemplos/mixteco1-Yolox_BotFl_CTB501-FEF537-EGS503_40202-Acanthaceae-Ruellia_2017-01-05-h.wav", "mixteco: "],
|
212 |
+
["mixteco", "ejemplos/mixteco2-Yolox_BotFl_CTB501-FEF537-EGS503_40202-Acanthaceae-Ruellia_2017-01-05-h.wav", "mixteco: "],
|
213 |
+
["totonaco", "ejemplos/totonaco1-Zongo_Botan_Acanthaceae-Justicia-spicigera_SLC388-IPN389_2018-07-26-i.wav", "totonaco: "],
|
214 |
+
["totonaco", "ejemplos/totonaco2-Zongo_Botan_Acanthaceae-Justicia-spicigera_SLC388-IPN389_2018-07-26-i.wav", "totonaco: "]],
|
215 |
article=UI_STRINGS["title"][ui_language],
|
216 |
)
|
217 |
|