Spaces:
Build error
Build error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import outetts
|
| 3 |
+
|
| 4 |
+
interface = outetts.Interface(
|
| 5 |
+
config=outetts.ModelConfig.auto_config(
|
| 6 |
+
model="OuteAI/OuteTTS-1.0-0.6B",
|
| 7 |
+
backend=outetts.Backend.HF
|
| 8 |
+
)
|
| 9 |
+
)
|
| 10 |
+
|
| 11 |
+
def tts(text):
|
| 12 |
+
speaker = interface.load_default_speaker("EN-FEMALE-1-NEUTRAL")
|
| 13 |
+
output = interface.generate(
|
| 14 |
+
config=outetts.GenerationConfig(
|
| 15 |
+
text=text,
|
| 16 |
+
speaker=speaker,
|
| 17 |
+
)
|
| 18 |
+
)
|
| 19 |
+
return output.audio
|
| 20 |
+
|
| 21 |
+
gr.Interface(
|
| 22 |
+
fn=tts,
|
| 23 |
+
inputs=gr.Textbox(label="Texte"),
|
| 24 |
+
outputs=gr.Audio(label="Voix générée"),
|
| 25 |
+
title="OuteTTS Cloud TTS"
|
| 26 |
+
).launch()
|