uto1125 commited on
Commit
cab1c25
1 Parent(s): 74272e7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -16
app.py CHANGED
@@ -2,27 +2,45 @@ import argparse
2
  import subprocess
3
 
4
  def main():
5
- # 创建命令行参数解析器
6
- parser = argparse.ArgumentParser(description="启动 Fish Speech 应用")
7
- parser.add_argument("--llama-checkpoint-path", type=str, required=True, help="Llama 检查点路径")
8
- parser.add_argument("--decoder-checkpoint-path", type=str, required=True, help="解码器检查点路径")
9
- parser.add_argument("--decoder-config-name", type=str, required=True, help="解码器配置名称")
10
- parser.add_argument("--device", type=str, default="cpu", help="设备类型(cpu 或 cuda)")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
- # 解析参数
13
  args = parser.parse_args()
14
 
15
- # 构造命令
16
- command = [
17
- "python", "tools/webui.py",
 
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()