Spaces:
Sleeping
Sleeping
Fix syntax error in TTS stage and complete pipeline
Browse files
app.py
CHANGED
|
@@ -404,14 +404,13 @@ def full_speech_translation_pipeline(audio_input_path: str):
|
|
| 404 |
print("STT: Extracting features and transcribing...")
|
| 405 |
inputs = stt_processor(audio_array_stt, sampling_rate=target_sr_stt, return_tensors="pt").input_features.to(DEVICE)
|
| 406 |
|
| 407 |
-
forced_ids = stt_processor.get_decoder_prompt_ids(language="arabic", task="transcribe")
|
| 408 |
-
|
| 409 |
with torch.no_grad():
|
| 410 |
-
#
|
| 411 |
generated_ids = stt_model.generate(
|
| 412 |
inputs,
|
| 413 |
-
|
| 414 |
-
|
|
|
|
| 415 |
)
|
| 416 |
|
| 417 |
# Use batch_decode for robustness
|
|
|
|
| 404 |
print("STT: Extracting features and transcribing...")
|
| 405 |
inputs = stt_processor(audio_array_stt, sampling_rate=target_sr_stt, return_tensors="pt").input_features.to(DEVICE)
|
| 406 |
|
|
|
|
|
|
|
| 407 |
with torch.no_grad():
|
| 408 |
+
# Generate without forced_decoder_ids to avoid compatibility issues
|
| 409 |
generated_ids = stt_model.generate(
|
| 410 |
inputs,
|
| 411 |
+
max_length=448,
|
| 412 |
+
language="arabic",
|
| 413 |
+
task="transcribe"
|
| 414 |
)
|
| 415 |
|
| 416 |
# Use batch_decode for robustness
|