Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ def transcribe(filepath):
|
|
16 |
# Assuming the file is named 'audio.wav'
|
17 |
# Run the transcription
|
18 |
transcript = asr_pipeline(filepath)
|
19 |
-
return transcript, tokenizer.decode(translation_model
|
20 |
|
21 |
|
22 |
demo = gr.Interface(fn=transcribe, inputs=[gr.Audio(type='filepath')], outputs=[gr.Text("transcript"), gr.Text("translation")])
|
|
|
16 |
# Assuming the file is named 'audio.wav'
|
17 |
# Run the transcription
|
18 |
transcript = asr_pipeline(filepath)
|
19 |
+
return transcript, tokenizer.decode(translation_model(**tokenizer(transcript['text'], return_tensors="pt", padding=True))[0], skip_special_tokens=True)
|
20 |
|
21 |
|
22 |
demo = gr.Interface(fn=transcribe, inputs=[gr.Audio(type='filepath')], outputs=[gr.Text("transcript"), gr.Text("translation")])
|