Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,24 +1,27 @@
|
|
1 |
import warnings
|
2 |
warnings.filterwarnings("ignore")
|
3 |
-
os.system('git clone https://github.com/irshadbhat/indic-trans.git')
|
4 |
-
os.system('pip install ./indic-trans/.')
|
5 |
import gradio as gr
|
6 |
from transformers import pipeline
|
7 |
-
|
8 |
import os
|
9 |
import re
|
10 |
import torchaudio
|
11 |
|
12 |
|
13 |
# Initialize the speech recognition pipeline and transliterator
|
14 |
-
|
15 |
-
# os.system('pip install ./indic-trans/.')
|
16 |
pipe = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-odia_v1")
|
17 |
-
|
18 |
|
19 |
p1 = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-odia_v1")
|
20 |
p2 = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-hindi_v1")
|
|
|
|
|
21 |
|
|
|
|
|
22 |
def transcribe_odiya(speech):
|
23 |
text = p1(speech)["text"]
|
24 |
if text is None:
|
|
|
1 |
import warnings
|
2 |
warnings.filterwarnings("ignore")
|
3 |
+
#os.system('git clone https://github.com/irshadbhat/indic-trans.git')
|
4 |
+
#os.system('pip install ./indic-trans/.')
|
5 |
import gradio as gr
|
6 |
from transformers import pipeline
|
7 |
+
|
8 |
import os
|
9 |
import re
|
10 |
import torchaudio
|
11 |
|
12 |
|
13 |
# Initialize the speech recognition pipeline and transliterator
|
14 |
+
|
|
|
15 |
pipe = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-odia_v1")
|
16 |
+
|
17 |
|
18 |
p1 = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-odia_v1")
|
19 |
p2 = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-hindi_v1")
|
20 |
+
os.system('git clone https://github.com/irshadbhat/indic-trans.git')
|
21 |
+
os.system('pip install ./indic-trans/.')
|
22 |
|
23 |
+
from indictrans import Transliterator
|
24 |
+
trn = Transliterator(source='ori', target='eng', build_lookup=True)
|
25 |
def transcribe_odiya(speech):
|
26 |
text = p1(speech)["text"]
|
27 |
if text is None:
|