Commit
Β·
dd205e4
1
Parent(s):
229bbd8
debug for hf space
Browse files
webui.py
CHANGED
|
@@ -23,8 +23,11 @@ tts = None
|
|
| 23 |
os.makedirs("outputs/tasks",exist_ok=True)
|
| 24 |
os.makedirs("prompts",exist_ok=True)
|
| 25 |
|
|
|
|
| 26 |
def infer(voice, text,output_path=None):
|
| 27 |
-
|
|
|
|
|
|
|
| 28 |
if not output_path:
|
| 29 |
output_path = os.path.join("outputs", f"spk_{int(time.time())}.wav")
|
| 30 |
tts.infer(voice, text, output_path)
|
|
@@ -68,11 +71,8 @@ with gr.Blocks() as demo:
|
|
| 68 |
inputs=[prompt_audio, input_text_single],
|
| 69 |
outputs=[output_audio])
|
| 70 |
|
| 71 |
-
|
| 72 |
def main():
|
| 73 |
-
global tts
|
| 74 |
-
if not tts:
|
| 75 |
-
tts = IndexTTS(model_dir="checkpoints", cfg_path="checkpoints/config.yaml")
|
| 76 |
demo.queue(20)
|
| 77 |
demo.launch(server_name="0.0.0.0")
|
| 78 |
|
|
|
|
| 23 |
os.makedirs("outputs/tasks",exist_ok=True)
|
| 24 |
os.makedirs("prompts",exist_ok=True)
|
| 25 |
|
| 26 |
+
@spaces.GPU
|
| 27 |
def infer(voice, text,output_path=None):
|
| 28 |
+
global tts
|
| 29 |
+
if not tts:
|
| 30 |
+
tts = IndexTTS(model_dir="checkpoints", cfg_path="checkpoints/config.yaml")
|
| 31 |
if not output_path:
|
| 32 |
output_path = os.path.join("outputs", f"spk_{int(time.time())}.wav")
|
| 33 |
tts.infer(voice, text, output_path)
|
|
|
|
| 71 |
inputs=[prompt_audio, input_text_single],
|
| 72 |
outputs=[output_audio])
|
| 73 |
|
| 74 |
+
|
| 75 |
def main():
|
|
|
|
|
|
|
|
|
|
| 76 |
demo.queue(20)
|
| 77 |
demo.launch(server_name="0.0.0.0")
|
| 78 |
|