Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -19,6 +19,9 @@ p2 = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-h
|
|
19 |
os.system('git clone https://github.com/irshadbhat/indic-trans.git')
|
20 |
os.system('pip install ./indic-trans/.')
|
21 |
|
|
|
|
|
|
|
22 |
from indictrans import Transliterator
|
23 |
trn = Transliterator(source='ori', target='eng', build_lookup=True)
|
24 |
def transcribe_odiya(speech):
|
@@ -323,7 +326,9 @@ demo=gr.Interface(
|
|
323 |
"textbox"
|
324 |
# #"state"
|
325 |
],
|
326 |
-
allow_flagging="
|
|
|
|
|
327 |
title="Automatic Speech Recognition",
|
328 |
description = "Demo for Automatic Speech Recognition. Use microphone to record speech. Please press Record button. Initially it will take some time to load the model. The recognized text will appear in the output textbox",
|
329 |
).launch()
|
|
|
19 |
os.system('git clone https://github.com/irshadbhat/indic-trans.git')
|
20 |
os.system('pip install ./indic-trans/.')
|
21 |
|
22 |
+
HF_TOKEN = os.getenv('HF_TOKEN')
|
23 |
+
hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "asr_demo")
|
24 |
+
|
25 |
from indictrans import Transliterator
|
26 |
trn = Transliterator(source='ori', target='eng', build_lookup=True)
|
27 |
def transcribe_odiya(speech):
|
|
|
326 |
"textbox"
|
327 |
# #"state"
|
328 |
],
|
329 |
+
allow_flagging="manual",
|
330 |
+
flagging_options=["Language error", "English transliteration error", "Other"],
|
331 |
+
flagging_callback=hf_writer
|
332 |
title="Automatic Speech Recognition",
|
333 |
description = "Demo for Automatic Speech Recognition. Use microphone to record speech. Please press Record button. Initially it will take some time to load the model. The recognized text will appear in the output textbox",
|
334 |
).launch()
|