File size: 1,156 Bytes
3a79c61
 
5ea0041
3a79c61
d6af7f4
 
3a79c61
 
5ea0041
 
 
3a79c61
5ea0041
 
 
 
 
 
 
 
 
 
 
 
46fe8de
 
 
 
 
 
 
 
 
 
5ea0041
 
 
 
 
 
 
 
 
3a79c61
 
5ea0041
3a79c61
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
36
37
38
39
40
41
42
43
44
45
46
47
import generate_text
import gradio
import audio

def gentext():
    result = generate_text.call_llm()
    return result

def genaudio():
    result = audio.generate_voice(text, voice_name, model_name)

generate_text_gr = gradio.Interface(
    fn=gentext,
    inputs=None,
    outputs="text",
    title="Generate Character and Dialogue Text",
    description="An API to generate text"
)

out_audio = gradio.Audio(
    label="Generated Voice",
    type="numpy", 
    elem_id="out_audio"
)

input_text = gr.Textbox(
    label="Input Text (250 characters max)", 
    lines=2, 
    value="Hahaha OHH MY GOD! This is SOOO funny, I-I am Eleven a text-to-speech system!",
    elem_id="input_text"
)

input_voice = "Arnold"
input_model = "eleven_monolingual_v1"
        
inputs = [input_text, input_voice, model_name]
outputs = [out_audio]
generate_audio_gr = gradio.Interface(
    fn=genvoice,
    inputs=inputs,
    outputs=outputs,
    title="Generate Audio",
    description="An API to generate audio"
)

genesis_app = gradio.TabbedInterface([generate_text_gr, generate_audio_gr], ["Generate Character and Dialogue Text", "Generate Audio"])
genesis_app.launch()