drewThomasson commited on
Commit
e44094d
1 Parent(s): f01cf5b

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -0
app.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from outetts.v0_1.interface import InterfaceHF
3
+
4
+ # Initialize the OuteTTS interface
5
+ interface = InterfaceHF("OuteAI/OuteTTS-0.1-350M")
6
+
7
+ def generate_tts(text, temperature, repetition_penalty, max_length):
8
+ output = interface.generate(
9
+ text=text,
10
+ temperature=temperature,
11
+ repetition_penalty=repetition_penalty,
12
+ max_lenght=max_length
13
+ )
14
+ return output # Gradio will play the audio directly
15
+
16
+ # Gradio interface components
17
+ gr.Interface(
18
+ fn=generate_tts,
19
+ inputs=[
20
+ gr.Textbox(label="Text Input", placeholder="Enter the text for TTS generation"),
21
+ gr.Slider(0.1, 1.0, value=0.1, step=0.01, label="Temperature"),
22
+ gr.Slider(0.5, 2.0, value=1.1, step=0.1, label="Repetition Penalty"),
23
+ gr.Slider(256, 4096, value=1024, step=256, label="Max Length")
24
+ ],
25
+ outputs=gr.Audio(label="Generated Speech"),
26
+ title="OuteTTS - Text to Speech Interface",
27
+ description="Generate speech from text using the OuteTTS model."
28
+ ).launch()