SamuelM0422's picture
Update app.py
cda6d2f verified
raw
history blame
670 Bytes
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()