Spaces:
Sleeping
Sleeping
Fix syntax error in TTS stage and complete pipeline
Browse files
app.py
CHANGED
|
@@ -447,6 +447,14 @@ def full_speech_translation_pipeline(audio_input_path: str):
|
|
| 447 |
if generated_mel is not None and generated_mel.numel() > 0:
|
| 448 |
mel_for_vocoder = generated_mel.detach().squeeze(0).transpose(0, 1)
|
| 449 |
audio_tensor = inverse_mel_spec_to_wav(mel_for_vocoder)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 450 |
|
| 451 |
# --- Part 4: Gradio Interface Definition ---
|
| 452 |
# (Same as before)
|
|
|
|
| 447 |
if generated_mel is not None and generated_mel.numel() > 0:
|
| 448 |
mel_for_vocoder = generated_mel.detach().squeeze(0).transpose(0, 1)
|
| 449 |
audio_tensor = inverse_mel_spec_to_wav(mel_for_vocoder)
|
| 450 |
+
synthesized_audio_np = audio_tensor.cpu().numpy()
|
| 451 |
+
print(f"TTS: Synthesized audio shape: {synthesized_audio_np.shape}")
|
| 452 |
+
except Exception as e:
|
| 453 |
+
print(f"TTS Error: {e}")
|
| 454 |
+
|
| 455 |
+
print(f"--- PIPELINE END ---")
|
| 456 |
+
return arabic_transcript, english_translation, (hp.sr, synthesized_audio_np)
|
| 457 |
+
|
| 458 |
|
| 459 |
# --- Part 4: Gradio Interface Definition ---
|
| 460 |
# (Same as before)
|