Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ import re
|
|
13 |
#p1 = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-odia_v1")
|
14 |
#odia_model2 = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-odia_v1")
|
15 |
p2 = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-hindi_v1")
|
16 |
-
|
17 |
punjaib_modle_75000=pipeline(task="automatic-speech-recognition", model="cdactvm/wav2vec-bert-punjabi-75000-model")
|
18 |
#p3 = pipeline(task="automatic-speech-recognition", model="cdactvm/kannada_w2v-bert_model")
|
19 |
#p4 = pipeline(task="automatic-speech-recognition", model="cdactvm/telugu_w2v-bert_model")
|
@@ -267,7 +267,7 @@ def process_transcription(input_sentence):
|
|
267 |
###########################################
|
268 |
|
269 |
def transcribe_punjabi_30000(speech):
|
270 |
-
text =
|
271 |
text = text.replace("[PAD]","")
|
272 |
if text is None:
|
273 |
return "Error: ASR returned None"
|
@@ -275,7 +275,7 @@ def transcribe_punjabi_30000(speech):
|
|
275 |
|
276 |
def transcribe_punjabi_eng_model_30000(speech):
|
277 |
trn = Transliterator(source='pan', target='eng', build_lookup=True)
|
278 |
-
text =
|
279 |
text = text.replace("[PAD]","")
|
280 |
if text is None:
|
281 |
return "Error: ASR returned None"
|
|
|
13 |
#p1 = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-odia_v1")
|
14 |
#odia_model2 = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-odia_v1")
|
15 |
p2 = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-hindi_v1")
|
16 |
+
punjaib_modle_155750=pipeline(task="automatic-speech-recognition", model="cdactvm/wav2vec-bert-punjabi-155750-model")
|
17 |
punjaib_modle_75000=pipeline(task="automatic-speech-recognition", model="cdactvm/wav2vec-bert-punjabi-75000-model")
|
18 |
#p3 = pipeline(task="automatic-speech-recognition", model="cdactvm/kannada_w2v-bert_model")
|
19 |
#p4 = pipeline(task="automatic-speech-recognition", model="cdactvm/telugu_w2v-bert_model")
|
|
|
267 |
###########################################
|
268 |
|
269 |
def transcribe_punjabi_30000(speech):
|
270 |
+
text = punjaib_modle_155750(speech)["text"]
|
271 |
text = text.replace("[PAD]","")
|
272 |
if text is None:
|
273 |
return "Error: ASR returned None"
|
|
|
275 |
|
276 |
def transcribe_punjabi_eng_model_30000(speech):
|
277 |
trn = Transliterator(source='pan', target='eng', build_lookup=True)
|
278 |
+
text = punjaib_modle_155750(speech)["text"]
|
279 |
text = text.replace("[PAD]","")
|
280 |
if text is None:
|
281 |
return "Error: ASR returned None"
|