Update app.py
Browse files
app.py
CHANGED
@@ -15,9 +15,9 @@ from isNumber import is_number
|
|
15 |
from processDoubles import process_doubles
|
16 |
from replaceWords import replace_words
|
17 |
|
18 |
-
transcriber_hindi_new = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-
|
19 |
transcriber_hindi_old = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-hindi_old")
|
20 |
-
processor = AutoProcessor.from_pretrained("cdactvm/w2v-bert-2.0-
|
21 |
vocab_dict = processor.tokenizer.get_vocab()
|
22 |
sorted_vocab_dict = {k.lower(): v for k, v in sorted(vocab_dict.items(), key=lambda item: item[1])}
|
23 |
decoder = build_ctcdecoder(
|
@@ -30,7 +30,7 @@ processor_with_lm = Wav2Vec2ProcessorWithLM(
|
|
30 |
decoder=decoder
|
31 |
)
|
32 |
processor.feature_extractor._processor_class = "Wav2Vec2ProcessorWithLM"
|
33 |
-
transcriber_hindi_lm = pipeline("automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-
|
34 |
|
35 |
|
36 |
def transcribe_hindi_new(audio):
|
|
|
15 |
from processDoubles import process_doubles
|
16 |
from replaceWords import replace_words
|
17 |
|
18 |
+
transcriber_hindi_new = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-hindi_new")
|
19 |
transcriber_hindi_old = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-hindi_old")
|
20 |
+
processor = AutoProcessor.from_pretrained("cdactvm/w2v-bert-2.0-hindi_new")
|
21 |
vocab_dict = processor.tokenizer.get_vocab()
|
22 |
sorted_vocab_dict = {k.lower(): v for k, v in sorted(vocab_dict.items(), key=lambda item: item[1])}
|
23 |
decoder = build_ctcdecoder(
|
|
|
30 |
decoder=decoder
|
31 |
)
|
32 |
processor.feature_extractor._processor_class = "Wav2Vec2ProcessorWithLM"
|
33 |
+
transcriber_hindi_lm = pipeline("automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-hindi_new", tokenizer=processor_with_lm, feature_extractor=processor_with_lm.feature_extractor, decoder=processor_with_lm.decoder)
|
34 |
|
35 |
|
36 |
def transcribe_hindi_new(audio):
|