SAD43W commited on
Commit
b7ce2e4
·
verified ·
1 Parent(s): cbe00bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -1,17 +1,17 @@
1
  import os
2
- os.environ["COQUI_TOS_AGREED"] = "1" # Auto-accept license
3
-
4
  import gradio as gr
5
  from TTS.api import TTS
6
- import torch
7
 
8
- # Load model (note .to() instead of gpu=True)
 
 
 
9
  tts = TTS(model_name="tts_models/multilingual/multi-dataset/xtts_v2")
10
  tts.to("cuda" if torch.cuda.is_available() else "cpu")
11
 
12
  def generate(text, lang, speaker_wav=None):
13
  out_path = "output.wav"
14
-
15
  if speaker_wav:
16
  tts.tts_to_file(
17
  text=text,
@@ -30,13 +30,13 @@ def generate(text, lang, speaker_wav=None):
30
  demo = gr.Interface(
31
  fn=generate,
32
  inputs=[
33
- gr.Textbox(label="👻 Enter horror text here"),
34
  gr.Dropdown(choices=["en", "es", "fr", "de", "it", "pt"], label="Language", value="en"),
35
- gr.Audio(source="upload", type="filepath", label="🎙️ Voice Clone (optional)")
36
  ],
37
  outputs=gr.Audio(type="filepath"),
38
  title="🩸 XTTS Horror Voice Generator",
39
- description="Summon realistic demonic speech from your text, clone voices, and whisper like a beast from the void."
40
  )
41
 
42
  demo.launch()
 
1
  import os
2
+ import torch
 
3
  import gradio as gr
4
  from TTS.api import TTS
 
5
 
6
+ # Accept license
7
+ os.environ["COQUI_TOS_AGREED"] = "1"
8
+
9
+ # Load model
10
  tts = TTS(model_name="tts_models/multilingual/multi-dataset/xtts_v2")
11
  tts.to("cuda" if torch.cuda.is_available() else "cpu")
12
 
13
  def generate(text, lang, speaker_wav=None):
14
  out_path = "output.wav"
 
15
  if speaker_wav:
16
  tts.tts_to_file(
17
  text=text,
 
30
  demo = gr.Interface(
31
  fn=generate,
32
  inputs=[
33
+ gr.Textbox(label="💀 Type horror line"),
34
  gr.Dropdown(choices=["en", "es", "fr", "de", "it", "pt"], label="Language", value="en"),
35
+ gr.File(file_types=["audio"], label="🎙️ Voice Clone (optional)")
36
  ],
37
  outputs=gr.Audio(type="filepath"),
38
  title="🩸 XTTS Horror Voice Generator",
39
+ description="Summon cursed voices from the void using cloned horror whispers. Multilingual. GPU-powered. Creepy as hell."
40
  )
41
 
42
  demo.launch()