Spaces:
Running
Running
tianfengping.tfp
commited on
Commit
·
d9bb010
1
Parent(s):
d0e6152
check prompt path
Browse files
app.py
CHANGED
|
@@ -179,10 +179,11 @@ def generate_speech_speakerminus(tts_text, speed, speaker, key, ref_audio, ref_t
|
|
| 179 |
print("Loading CosyVoice (speakerminus) model...")
|
| 180 |
tts_speakerminus_global = CosyVoiceTTS_speakerminus(model_dir=local_model_path)
|
| 181 |
|
| 182 |
-
if not ref_audio
|
| 183 |
# Ensure assets are loaded
|
| 184 |
if assets_dir is None:
|
| 185 |
load_assets()
|
|
|
|
| 186 |
if audio_prompt_path is None or assets_dir is None:
|
| 187 |
raise ValueError("Audio prompt path is not available. Please wait a moment and try again, or provide reference audio and text.")
|
| 188 |
ref_text = text_prompt.get(speaker, "")
|
|
@@ -828,7 +829,7 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as demo:
|
|
| 828 |
|
| 829 |
gr.Markdown("""
|
| 830 |
<div class="footer">
|
| 831 |
-
<p>Marco-Voice text to speech v1.0 | based on
|
| 832 |
<p>attention: synthesised speech only use to tech share</p>
|
| 833 |
</div>
|
| 834 |
""")
|
|
|
|
| 179 |
print("Loading CosyVoice (speakerminus) model...")
|
| 180 |
tts_speakerminus_global = CosyVoiceTTS_speakerminus(model_dir=local_model_path)
|
| 181 |
|
| 182 |
+
if not ref_audio or not ref_text:
|
| 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, "")
|
|
|
|
| 829 |
|
| 830 |
gr.Markdown("""
|
| 831 |
<div class="footer">
|
| 832 |
+
<p>Marco-Voice text to speech v1.0 | based on an excelent open source tts model | tech support: tech@marco-voice.com</p>
|
| 833 |
<p>attention: synthesised speech only use to tech share</p>
|
| 834 |
</div>
|
| 835 |
""")
|