kemuririn
commited on
Commit
Β·
33551a3
1
Parent(s):
515f8e3
debug for hf space
Browse files
webui.py
CHANGED
|
@@ -22,11 +22,13 @@ tts = None
|
|
| 22 |
|
| 23 |
os.makedirs("outputs/tasks",exist_ok=True)
|
| 24 |
os.makedirs("prompts",exist_ok=True)
|
|
|
|
| 25 |
@spaces.GPU
|
| 26 |
def init():
|
| 27 |
global tts
|
| 28 |
if not tts:
|
| 29 |
tts = IndexTTS(model_dir="checkpoints", cfg_path="checkpoints/config.yaml")
|
|
|
|
| 30 |
|
| 31 |
@spaces.GPU
|
| 32 |
def infer(voice, text,output_path=None):
|
|
@@ -77,7 +79,8 @@ with gr.Blocks() as demo:
|
|
| 77 |
|
| 78 |
|
| 79 |
def main():
|
| 80 |
-
|
|
|
|
| 81 |
tts.load_normalizer()
|
| 82 |
demo.queue(20)
|
| 83 |
demo.launch(server_name="0.0.0.0")
|
|
|
|
| 22 |
|
| 23 |
os.makedirs("outputs/tasks",exist_ok=True)
|
| 24 |
os.makedirs("prompts",exist_ok=True)
|
| 25 |
+
|
| 26 |
@spaces.GPU
|
| 27 |
def init():
|
| 28 |
global tts
|
| 29 |
if not tts:
|
| 30 |
tts = IndexTTS(model_dir="checkpoints", cfg_path="checkpoints/config.yaml")
|
| 31 |
+
return tts
|
| 32 |
|
| 33 |
@spaces.GPU
|
| 34 |
def infer(voice, text,output_path=None):
|
|
|
|
| 79 |
|
| 80 |
|
| 81 |
def main():
|
| 82 |
+
global tts
|
| 83 |
+
tts = init()
|
| 84 |
tts.load_normalizer()
|
| 85 |
demo.queue(20)
|
| 86 |
demo.launch(server_name="0.0.0.0")
|