laxsvips commited on
Commit
5ea0041
·
1 Parent(s): 8abd987

Initial commit

Browse files
Files changed (1) hide show
  1. app.py +26 -6
app.py CHANGED
@@ -1,17 +1,37 @@
1
  import generate_text
2
  import gradio
 
3
 
4
  def gentext():
5
  result = generate_text.call_llm()
6
  return result
7
 
 
 
 
8
  generate_text_gr = gradio.Interface(
9
- fn=gentext,
10
- inputs=None,
11
- outputs="text",
12
- title="Generate Character and Dialogue",
13
- description="An API to check if the API is working"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  )
15
 
16
- genesis_app = gradio.TabbedInterface([generate_text_gr], ["Generate Character and Dialogue"])
17
  genesis_app.launch()
 
1
  import generate_text
2
  import gradio
3
+ import audio
4
 
5
  def gentext():
6
  result = generate_text.call_llm()
7
  return result
8
 
9
+ def genaudio():
10
+ result = audio.generate_voice(text, voice_name, model_name)
11
+
12
  generate_text_gr = gradio.Interface(
13
+ fn=gentext,
14
+ inputs=None,
15
+ outputs="text",
16
+ title="Generate Character and Dialogue Text",
17
+ description="An API to generate text"
18
+ )
19
+
20
+ out_audio = gradio.Audio(
21
+ label="Generated Voice",
22
+ type="numpy",
23
+ elem_id="out_audio"
24
+ )
25
+
26
+ inputs = [input_text, input_voice, model_name]
27
+ outputs = [out_audio]
28
+ generate_audio_gr = gradio.Interface(
29
+ fn=genvoice,
30
+ inputs=inputs,
31
+ outputs=outputs,
32
+ title="Generate Audio",
33
+ description="An API to generate audio"
34
  )
35
 
36
+ genesis_app = gradio.TabbedInterface([generate_text_gr, generate_audio_gr], ["Generate Character and Dialogue Text", "Generate Audio"])
37
  genesis_app.launch()