Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ from replaceWords import replace_words
|
|
17 |
|
18 |
transcriber_hindi_new = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-hindi_v1")
|
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):
|
|
|
17 |
|
18 |
transcriber_hindi_new = pipeline(task="automatic-speech-recognition", model="cdactvm/w2v-bert-2.0-hindi_v1")
|
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_v1")
|
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_v1", tokenizer=processor_with_lm, feature_extractor=processor_with_lm.feature_extractor, decoder=processor_with_lm.decoder)
|
34 |
|
35 |
|
36 |
def transcribe_hindi_new(audio):
|