KaixuanGuo commited on
Commit
757a770
·
verified ·
1 Parent(s): cc6b557

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -137,10 +137,12 @@ def generate_voice_clone(s1_wav, s1_txt, text, lang, model_name):
137
  prompt_wav_record=handle_file(s1_wav),
138
  instruct_text="You are a helpful assistant. 请非常开心地说一句话。<|endofprompt|>",
139
  seed=0,
140
- stream="false",
141
  ui_lang="Zh",
142
  api_name="/generate_audio"
143
- )
 
 
144
  else:
145
  raise
146
  print(result)
@@ -336,17 +338,17 @@ def build_ui():
336
  # 示例:假设 soulx 不支持 podcast 和 voice clone
337
  # is_invalid = (model == soulx_name and mode in ["customvoice", "voice clone", "style instruction"])
338
  if model == soulx_name:
339
- is_invalid = mode in ["customvoice", "voice clone", "style instruction"]
340
  elif model == qwen3tts_name:
341
- is_invalid = mode in ["podcast"]
342
  elif model == cosy_name:
343
- is_invalid = mode in ["customvoice", "style instruction", "podcast"]
344
  elif model == mosstts_name1:
345
- is_invalid = mode in ["customvoice", "style instruction", "podcast"]
346
  elif model == mosstts_name2:
347
- is_invalid = mode in ["customvoice", "voice clone", "style instruction"]
348
  elif model == mosstts_name3:
349
- is_invalid = mode in ["customvoice", "voice clone", "podcast"]
350
  else:
351
  raise
352
  if is_invalid:
 
137
  prompt_wav_record=handle_file(s1_wav),
138
  instruct_text="You are a helpful assistant. 请非常开心地说一句话。<|endofprompt|>",
139
  seed=0,
140
+ stream=False,
141
  ui_lang="Zh",
142
  api_name="/generate_audio"
143
+ )
144
+ if isinstance(result, str):
145
+ result = (result, "voice clone successfully!")
146
  else:
147
  raise
148
  print(result)
 
338
  # 示例:假设 soulx 不支持 podcast 和 voice clone
339
  # is_invalid = (model == soulx_name and mode in ["customvoice", "voice clone", "style instruction"])
340
  if model == soulx_name:
341
+ is_invalid = mode in ["customvoice", "voice clone", "style instruction", "tta"]
342
  elif model == qwen3tts_name:
343
+ is_invalid = mode in ["podcast", "tta"]
344
  elif model == cosy_name:
345
+ is_invalid = mode in ["customvoice", "style instruction", "podcast", "tta"]
346
  elif model == mosstts_name1:
347
+ is_invalid = mode in ["customvoice", "style instruction", "podcast", "tta"]
348
  elif model == mosstts_name2:
349
+ is_invalid = mode in ["customvoice", "voice clone", "style instruction", "tta"]
350
  elif model == mosstts_name3:
351
+ is_invalid = mode in ["customvoice", "voice clone", "podcast", "tta"]
352
  else:
353
  raise
354
  if is_invalid: