Spaces:
Sleeping
Sleeping
import gradio as gr | |
with gr.Blocks(title = "AIvatar") as ai_avatar: | |
with gr.Row(): | |
audio_file = gr.Audio() | |
with gr.Row(): | |
input_text = gr.Textbox(label="Input text") | |
# source_language = gr.Dropdown(list(constants.flores_codes.keys()), value='English', label='Source (Autoselected)', interactive=True) | |
with gr.Row(): | |
output_text = gr.Textbox(label='Translated text') | |
# target_language = gr.Dropdown(list(constants.flores_codes.keys()), value='German', label='Target', interactive=True) | |
with gr.Row(): | |
output_speech = gr.Audio(label='Translated speech') | |
translate_button = gr.Button('Translate') | |
with gr.Row(): | |
enhance_audio = gr.Radio(['yes', 'no'], value='yes', label='Enhance input voice', interactive=True) | |
input_type = gr.Radio(['Whole text', 'Sentence-wise'],value='Sentence-wise', label="Translation Mode", interactive=True) | |
output_audio_type = gr.Radio(['standard speaker', 'voice transfer'], value='voice transfer', label='Enhance output voice', interactive=True) | |
# audio_file.change(speech_to_text, | |
# inputs=[audio_file], | |
# outputs=[input_text, source_language]) | |
# translate_button.click(translation, | |
# inputs=[audio_file, input_text, | |
# source_language, target_language, | |
# output_audio_type, input_type], | |
# outputs=[output_text, output_speech]) | |
ai_avatar.launch(share=False) |