File size: 1,130 Bytes
4942de1
301d155
4942de1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import gradio as gr
from ts_utilities import transcribe_speech, transcribe_long_form, text_to_speech

# Gradio App
app = gr.TabbedInterface(
    [
        # Transcribe Speech
        gr.Interface(
            fn=transcribe_speech,
            inputs=gr.Audio(type="filepath"),
            outputs=gr.Textbox(label="Transcription", lines=5),
            title="Transcribe Speech",
            allow_flagging="never",
        ),
        # Long-Form Transcription
        gr.Interface(
            fn=transcribe_long_form,
            inputs=gr.Audio(type="filepath"),
            outputs=gr.Textbox(label="Transcription", lines=10),
            title="Long-Form Transcription",
            allow_flagging="never",
        ),
        # Text-to-Speech
        gr.Interface(
            fn=text_to_speech,
            inputs=gr.Textbox(label="Enter Text", placeholder="Type your text here...", lines=5),
            outputs=gr.Audio(label="Generated Speech"),
            title="Text-to-Speech",
            allow_flagging="never",
        )
    ],
    ["Transcribe Speech", "Long-Form Transcription", "Text-to-Speech"]
)
app.launch()