Spaces:
Sleeping
Sleeping
Commit
·
dd534ea
1
Parent(s):
d3c4c72
Add mic & upload tabs with numpy audio
Browse files
app.py
CHANGED
@@ -16,10 +16,8 @@ def init_models():
|
|
16 |
from transformers import AutoProcessor, AutoModelForCTC
|
17 |
from pyctcdecode import build_ctcdecoder
|
18 |
|
19 |
-
processor =
|
20 |
-
|
21 |
-
model =
|
22 |
-
AutoModelForCTC.from_pretrained("ai4bharat/indicwav2vec-hindi")
|
23 |
|
24 |
vocab = processor.tokenizer.get_vocab()
|
25 |
sorted_vocab = sorted(vocab.items(), key=lambda kv: kv[1])
|
@@ -61,8 +59,7 @@ iface = gr.Interface(
|
|
61 |
inputs=gr.Audio(type="filepath", label="Upload a WAV file"),
|
62 |
outputs="text",
|
63 |
title="Indic ASR Demo (Hindi)",
|
64 |
-
description="Upload a Hindi audio file (.wav) to see the
|
65 |
-
transcription."
|
66 |
)
|
67 |
|
68 |
if __name__ == "__main__":
|
|
|
16 |
from transformers import AutoProcessor, AutoModelForCTC
|
17 |
from pyctcdecode import build_ctcdecoder
|
18 |
|
19 |
+
processor = AutoProcessor.from_pretrained("ai4bharat/indicwav2vec-hindi")
|
20 |
+
model = AutoModelForCTC.from_pretrained("ai4bharat/indicwav2vec-hindi")
|
|
|
|
|
21 |
|
22 |
vocab = processor.tokenizer.get_vocab()
|
23 |
sorted_vocab = sorted(vocab.items(), key=lambda kv: kv[1])
|
|
|
59 |
inputs=gr.Audio(type="filepath", label="Upload a WAV file"),
|
60 |
outputs="text",
|
61 |
title="Indic ASR Demo (Hindi)",
|
62 |
+
description="Upload a Hindi audio file (.wav) to see the transcription."
|
|
|
63 |
)
|
64 |
|
65 |
if __name__ == "__main__":
|