Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ tts = pipeline("text-to-speech", model="Baghdad99/english_voice_tts")
|
|
13 |
# Define the function to translate speech
|
14 |
def translate_speech(audio):
|
15 |
# Use the speech recognition pipeline to transcribe the audio
|
16 |
-
transcription = pipe(audio)["transcription"]
|
17 |
|
18 |
# Use the translation pipeline to translate the transcription
|
19 |
translated_text = translator(transcription, return_tensors="pt", padding=True)
|
|
|
13 |
# Define the function to translate speech
|
14 |
def translate_speech(audio):
|
15 |
# Use the speech recognition pipeline to transcribe the audio
|
16 |
+
transcription = pipe(audio)[0]["transcription"]
|
17 |
|
18 |
# Use the translation pipeline to translate the transcription
|
19 |
translated_text = translator(transcription, return_tensors="pt", padding=True)
|