rockdrigoma commited on
Commit
1785140
1 Parent(s): 57171e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -1,17 +1,18 @@
 
1
  import gradio as gr
2
- from TTS.tts.configs.xtts_config import XttsConfig
3
- from TTS.tts.models.xtts import Xtts
 
 
4
 
5
- config = XttsConfig()
6
- config.load_json("/model/config.json")
7
- model = Xtts.init_from_config(config)
8
- model.load_checkpoint(config, checkpoint_dir="/model/", eval=True)
9
- model.cuda()
10
 
11
 
12
  def generateVoice(prompt):
13
  outputs = model.synthesize(
14
- "It took me quite a long time to develop a voice and now that I have it I am not going to be silent.",
15
  config,
16
  speaker_wav="/guide_recording/guide.wav",
17
  gpt_cond_len=3,
 
1
+ import spaces
2
  import gradio as gr
3
+ import torch
4
+ from TTS.api import TTS
5
+ import os
6
+ os.environ["COQUI_TOS_AGREED"] = "1"
7
 
8
+ device = "cuda"
9
+
10
+ tts = TTS("tts_models/multilingual/multi-dataset/xtts_bill_spa").to(device)
 
 
11
 
12
 
13
  def generateVoice(prompt):
14
  outputs = model.synthesize(
15
+ "Hola amigos, bienvenidos a mi canal",
16
  config,
17
  speaker_wav="/guide_recording/guide.wav",
18
  gpt_cond_len=3,