File size: 1,064 Bytes
3a79c61
 
5ea0041
3a79c61
d6af7f4
 
3a79c61
 
46cbc2c
3ae5971
0ed64e9
5ea0041
3a79c61
5ea0041
 
 
 
 
 
 
 
 
 
 
 
46fe8de
f3614da
3ae5971
46fe8de
9316d35
46fe8de
 
 
3ae5971
 
5ea0041
3ae5971
5ea0041
 
ce0ee22
5ea0041
9316d35
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
48
import generate_text
import gradio
import audio

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

def genaudio(text):
    result = audio.generate_voice(text)
    return result

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 = gradio.Textbox(
    label="Input Text", 
    lines=2, 
    value="There are 7 days in a week",
    elem_id="input_text"
)

# input_voice = "Arnold"
# input_model = "eleven_monolingual_v1"
        
inputs = [input_text]
outputs = [out_audio]
generate_audio_gr = gradio.Interface(
    fn=genaudio,
    inputs=inputs,
    outputs="text",
    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()