Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,27 +2,45 @@ import argparse
|
|
| 2 |
import subprocess
|
| 3 |
|
| 4 |
def main():
|
| 5 |
-
#
|
| 6 |
-
parser = argparse.ArgumentParser(description="启动
|
| 7 |
-
parser.add_argument(
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
#
|
| 13 |
args = parser.parse_args()
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
|
| 17 |
-
"python",
|
|
|
|
| 18 |
"--llama-checkpoint-path", args.llama_checkpoint_path,
|
| 19 |
"--decoder-checkpoint-path", args.decoder_checkpoint_path,
|
| 20 |
"--decoder-config-name", args.decoder_config_name,
|
| 21 |
-
"--device", args.device
|
| 22 |
-
]
|
| 23 |
-
|
| 24 |
-
# 运行命令
|
| 25 |
-
subprocess.run(command)
|
| 26 |
|
| 27 |
if __name__ == "__main__":
|
| 28 |
-
main()
|
|
|
|
| 2 |
import subprocess
|
| 3 |
|
| 4 |
def main():
|
| 5 |
+
# 设置命令行参数解析器
|
| 6 |
+
parser = argparse.ArgumentParser(description="启动 WebUI")
|
| 7 |
+
parser.add_argument(
|
| 8 |
+
"--llama-checkpoint-path",
|
| 9 |
+
type=str,
|
| 10 |
+
default="checkpoints/fish-speech-1.4-sft-yth-lora",
|
| 11 |
+
help="Llama 检查点路径",
|
| 12 |
+
)
|
| 13 |
+
parser.add_argument(
|
| 14 |
+
"--decoder-checkpoint-path",
|
| 15 |
+
type=str,
|
| 16 |
+
default="checkpoints/fish-speech-1.4/firefly-gan-vq-fsq-8x1024-21hz-generator.pth",
|
| 17 |
+
help="解码器检查点路径",
|
| 18 |
+
)
|
| 19 |
+
parser.add_argument(
|
| 20 |
+
"--decoder-config-name",
|
| 21 |
+
type=str,
|
| 22 |
+
default="firefly_gan_vq",
|
| 23 |
+
help="解码器配置名称",
|
| 24 |
+
)
|
| 25 |
+
parser.add_argument(
|
| 26 |
+
"--device",
|
| 27 |
+
type=str,
|
| 28 |
+
default="cpu",
|
| 29 |
+
help="设备类型",
|
| 30 |
+
)
|
| 31 |
|
| 32 |
+
# 解析命令行参数
|
| 33 |
args = parser.parse_args()
|
| 34 |
|
| 35 |
+
# 启动 WebUI
|
| 36 |
+
subprocess.run([
|
| 37 |
+
"python",
|
| 38 |
+
"tools/webui.py",
|
| 39 |
"--llama-checkpoint-path", args.llama_checkpoint_path,
|
| 40 |
"--decoder-checkpoint-path", args.decoder_checkpoint_path,
|
| 41 |
"--decoder-config-name", args.decoder_config_name,
|
| 42 |
+
"--device", args.device,
|
| 43 |
+
])
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
if __name__ == "__main__":
|
| 46 |
+
main()
|