|
import gradio as gr |
|
from asr import transcribe |
|
from tts import synthesize_speech |
|
from lid import identify_language |
|
|
|
def main(): |
|
tts_interface = gr.Interface( |
|
fn=synthesize_speech, |
|
inputs="text", |
|
outputs="audio", |
|
title="Teldutala", |
|
description="Royn føroysku teldutaluna hjá Meta" |
|
) |
|
asr_interface = gr.Interface( |
|
fn=transcribe, |
|
inputs=gr.Audio(type="filepath"), |
|
outputs="text", |
|
title="Talukennari", |
|
description="Royn føroyska talukennaran hjá Meta" |
|
) |
|
lid_interface = gr.Interface( |
|
fn=identify_language, |
|
inputs=gr.Audio(type="filepath"), |
|
outputs="label", |
|
title="Máleyðmerkjari", |
|
description="Her kanst tú snakka tað málið, tú vilt, og máleyðmerkjarin gitir, hvat mál tað er." |
|
) |
|
|
|
demo = gr.TabbedInterface([tts_interface, asr_interface, lid_interface], ["Teldutala", "Talukennari", "Máleyðmerkjari"]) |
|
demo.launch() |
|
|
|
if __name__ == "__main__": |
|
main() |
|
|