kemuririn
commited on
Commit
Β·
fe90cff
1
Parent(s):
33551a3
debug for hf space
Browse files
webui.py
CHANGED
|
@@ -18,18 +18,11 @@ from tools.i18n.i18n import I18nAuto
|
|
| 18 |
i18n = I18nAuto(language="zh_CN")
|
| 19 |
MODE = 'local'
|
| 20 |
snapshot_download("IndexTeam/Index-TTS",local_dir="checkpoints",)
|
| 21 |
-
tts =
|
| 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):
|
| 35 |
if not tts:
|
|
@@ -79,8 +72,6 @@ with gr.Blocks() as demo:
|
|
| 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")
|
|
|
|
| 18 |
i18n = I18nAuto(language="zh_CN")
|
| 19 |
MODE = 'local'
|
| 20 |
snapshot_download("IndexTeam/Index-TTS",local_dir="checkpoints",)
|
| 21 |
+
tts = IndexTTS(model_dir="checkpoints", cfg_path="checkpoints/config.yaml")
|
| 22 |
|
| 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 |
if not tts:
|
|
|
|
| 72 |
|
| 73 |
|
| 74 |
def main():
|
|
|
|
|
|
|
| 75 |
tts.load_normalizer()
|
| 76 |
demo.queue(20)
|
| 77 |
demo.launch(server_name="0.0.0.0")
|