kemuririn
commited on
Commit
Β·
a1bcb2b
1
Parent(s):
019bf54
debug for hf space
Browse files- indextts/infer.py +3 -0
- webui.py +1 -1
indextts/infer.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import os
|
| 2 |
import re
|
| 3 |
import sys
|
|
@@ -16,6 +17,7 @@ from indextts.BigVGAN.models import BigVGAN as Generator
|
|
| 16 |
|
| 17 |
|
| 18 |
class IndexTTS:
|
|
|
|
| 19 |
def __init__(self, cfg_path='checkpoints/config.yaml', model_dir='checkpoints'):
|
| 20 |
self.cfg = OmegaConf.load(cfg_path)
|
| 21 |
self.device = 'cuda:0'
|
|
@@ -49,6 +51,7 @@ class IndexTTS:
|
|
| 49 |
def preprocess_text(self, text):
|
| 50 |
return self.normalizer.infer(text)
|
| 51 |
|
|
|
|
| 52 |
def infer(self, audio_prompt, text, output_path):
|
| 53 |
text = self.preprocess_text(text)
|
| 54 |
|
|
|
|
| 1 |
+
import spaces
|
| 2 |
import os
|
| 3 |
import re
|
| 4 |
import sys
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
class IndexTTS:
|
| 20 |
+
@spaces.GPU
|
| 21 |
def __init__(self, cfg_path='checkpoints/config.yaml', model_dir='checkpoints'):
|
| 22 |
self.cfg = OmegaConf.load(cfg_path)
|
| 23 |
self.device = 'cuda:0'
|
|
|
|
| 51 |
def preprocess_text(self, text):
|
| 52 |
return self.normalizer.infer(text)
|
| 53 |
|
| 54 |
+
@spaces.GPU
|
| 55 |
def infer(self, audio_prompt, text, output_path):
|
| 56 |
text = self.preprocess_text(text)
|
| 57 |
|
webui.py
CHANGED
|
@@ -23,7 +23,7 @@ tts = None
|
|
| 23 |
os.makedirs("outputs/tasks",exist_ok=True)
|
| 24 |
os.makedirs("prompts",exist_ok=True)
|
| 25 |
|
| 26 |
-
|
| 27 |
def infer(voice, text,output_path=None):
|
| 28 |
global tts
|
| 29 |
if not tts:
|
|
|
|
| 23 |
os.makedirs("outputs/tasks",exist_ok=True)
|
| 24 |
os.makedirs("prompts",exist_ok=True)
|
| 25 |
|
| 26 |
+
|
| 27 |
def infer(voice, text,output_path=None):
|
| 28 |
global tts
|
| 29 |
if not tts:
|