Spaces:
Running
Running
Commit
·
972cd21
1
Parent(s):
fdde86a
fix check cache
Browse files
app.py
CHANGED
@@ -679,14 +679,14 @@ def generate_tts():
|
|
679 |
model_a = candidate_models[i]
|
680 |
audio_a_path = find_cached_audio(str(model_a.id), text, reference_audio_path)
|
681 |
app.logger.warning(f"checking {audio_a_path}")
|
682 |
-
if not
|
683 |
continue
|
684 |
# 检测到a模型音频有效,继续检测b模型
|
685 |
for j in range(i + 1, len(candidate_models)):
|
686 |
model_b = candidate_models[j]
|
687 |
audio_b_path = find_cached_audio(str(model_b.id), text, reference_audio_path)
|
688 |
app.logger.warning(f"checking {audio_b_path}")
|
689 |
-
if not
|
690 |
continue
|
691 |
valid_pairs.append((model_a, audio_a_path, model_b, audio_b_path))
|
692 |
app.logger.warning(f"Found valid model pair: {model_a.name} and {model_b.name} for text '{text[:50]}...'")
|
|
|
679 |
model_a = candidate_models[i]
|
680 |
audio_a_path = find_cached_audio(str(model_a.id), text, reference_audio_path)
|
681 |
app.logger.warning(f"checking {audio_a_path}")
|
682 |
+
if not audio_a_path or has_long_silence(audio_a_path):
|
683 |
continue
|
684 |
# 检测到a模型音频有效,继续检测b模型
|
685 |
for j in range(i + 1, len(candidate_models)):
|
686 |
model_b = candidate_models[j]
|
687 |
audio_b_path = find_cached_audio(str(model_b.id), text, reference_audio_path)
|
688 |
app.logger.warning(f"checking {audio_b_path}")
|
689 |
+
if not audio_b_path or has_long_silence(audio_b_path):
|
690 |
continue
|
691 |
valid_pairs.append((model_a, audio_a_path, model_b, audio_b_path))
|
692 |
app.logger.warning(f"Found valid model pair: {model_a.name} and {model_b.name} for text '{text[:50]}...'")
|