Aashiue commited on
Commit
99e2cd1
1 Parent(s): a9683aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -2,6 +2,10 @@ import gradio as gr
2
  from transformers import pipeline
3
  from transformers import MBartForConditionalGeneration, MBart50TokenizerFast
4
  transcribe = pipeline("automatic-speech-recognition")
 
 
 
 
5
  def speech_to_text(audio):
6
  text = transcribe(audio)["text"]
7
 
 
2
  from transformers import pipeline
3
  from transformers import MBartForConditionalGeneration, MBart50TokenizerFast
4
  transcribe = pipeline("automatic-speech-recognition")
5
+
6
+ model = MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-50-one-to-many-mmt")
7
+
8
+ tokenizer = MBart50TokenizerFast.from_pretrained("facebook/mbart-large-50-one-to-many-mmt", src_lang="en_XX")
9
  def speech_to_text(audio):
10
  text = transcribe(audio)["text"]
11