Commit
•
cfb1536
1
Parent(s):
974f879
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -48,7 +48,7 @@ def synthesize_speech(text):
|
|
48 |
return gr.Audio.update(value=(16000, speech.cpu().numpy()))
|
49 |
|
50 |
def translate(audio):
|
51 |
-
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "
|
52 |
return outputs["text"]
|
53 |
|
54 |
|
@@ -68,8 +68,8 @@ def speech_to_speech_translation(audio):
|
|
68 |
|
69 |
title = "Cascaded STST"
|
70 |
description = """
|
71 |
-
Demo for cascaded speech-to-speech translation (STST), mapping from source speech in any language to target speech in
|
72 |
-
[SpeechT5 TTS](https://huggingface.co/microsoft/speecht5_tts) model for text-to-speech:
|
73 |
![Cascaded STST](https://huggingface.co/datasets/huggingface-course/audio-course-images/resolve/main/s2st_cascaded.png "Diagram of cascaded speech to speech translation")
|
74 |
"""
|
75 |
|
|
|
48 |
return gr.Audio.update(value=(16000, speech.cpu().numpy()))
|
49 |
|
50 |
def translate(audio):
|
51 |
+
outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "italian"})
|
52 |
return outputs["text"]
|
53 |
|
54 |
|
|
|
68 |
|
69 |
title = "Cascaded STST"
|
70 |
description = """
|
71 |
+
Demo for cascaded speech-to-speech translation (STST), mapping from source speech in any language to target speech in Italian. Demo uses OpenAI's [Whisper Large v2](https://huggingface.co/openai/whisper-large-v2) model for speech translation, and [Sandiago21/speecht5_finetuned_voxpopuli_it] checkpoint for text-to-speech, which is based on Microsoft's
|
72 |
+
[SpeechT5 TTS](https://huggingface.co/microsoft/speecht5_tts) model for text-to-speech, fine-tuned in Italian Audio dataset:
|
73 |
![Cascaded STST](https://huggingface.co/datasets/huggingface-course/audio-course-images/resolve/main/s2st_cascaded.png "Diagram of cascaded speech to speech translation")
|
74 |
"""
|
75 |
|