Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
|