Spaces:
Running
Running
File size: 670 Bytes
943fd9a cce7a51 cda6d2f cce7a51 943fd9a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import gradio as gr
from helper_function import speech_to_speech_translation
from pathlib import Path
examples = list(Path('').rglob('*mp3'))
examples.sort()
demo = gr.Blocks()
title = 'Audio translator 🇧🇷 ➡️ 🇺🇸'
description = 'A stacked aproach for translating audios from Portuguese to English'
translate = gr.Interface(
fn=speech_to_speech_translation,
inputs=gr.Audio(label='Input', sources=['upload', 'microphone'], type='filepath'),
outputs=[gr.Audio(label='Output', type='numpy'), gr.Textbox(label="Tradução")],
flagging_mode='never',
examples=examples,
title=title,
description=description
)
translate.launch()
|