tianfengping.tfp commited on
Commit
2e98a27
·
1 Parent(s): d9bb010

check prompt path

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -123,7 +123,7 @@ audio_prompt = {
123
  "赵晓卉": "zhaoxiaohui",
124
  "徐志胜": "xuzhisheng"
125
  }
126
- audio_prompt_path = assets_dir
127
 
128
  def load_audio_and_convert_to_16bit(file_path, target_sample_rate=16000):
129
  audio = AudioSegment.from_file(file_path)
@@ -183,7 +183,7 @@ def generate_speech_speakerminus(tts_text, speed, speaker, key, ref_audio, ref_t
183
  # Ensure assets are loaded
184
  if assets_dir is None:
185
  load_assets()
186
- print("audio_prompt_path:", audio_prompt_path, "assets_dir:", assets_dir)
187
  if audio_prompt_path is None or assets_dir is None:
188
  raise ValueError("Audio prompt path is not available. Please wait a moment and try again, or provide reference audio and text.")
189
  ref_text = text_prompt.get(speaker, "")
@@ -859,6 +859,6 @@ if __name__ == "__main__":
859
  "share": False,
860
  }
861
  # Only add favicon if it was successfully downloaded
862
- if logo_path2 is not None:
863
- launch_kwargs["favicon_path"] = logo_path2
864
  demo.launch(**launch_kwargs)
 
123
  "赵晓卉": "zhaoxiaohui",
124
  "徐志胜": "xuzhisheng"
125
  }
126
+ # audio_prompt_path = assets_dir
127
 
128
  def load_audio_and_convert_to_16bit(file_path, target_sample_rate=16000):
129
  audio = AudioSegment.from_file(file_path)
 
183
  # Ensure assets are loaded
184
  if assets_dir is None:
185
  load_assets()
186
+ audio_prompt_path = assets_dir
187
  if audio_prompt_path is None or assets_dir is None:
188
  raise ValueError("Audio prompt path is not available. Please wait a moment and try again, or provide reference audio and text.")
189
  ref_text = text_prompt.get(speaker, "")
 
859
  "share": False,
860
  }
861
  # Only add favicon if it was successfully downloaded
862
+ if logo_path is not None or logo_path2 is not None:
863
+ launch_kwargs["favicon_path"] = logo_path
864
  demo.launch(**launch_kwargs)