The automatic speech recognition pipeline can also be used to translate speech in just a couple lines of code
thon

from datasets import load_dataset
from transformers import pipeline
librispeech_en = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
asr = pipeline(
     "automatic-speech-recognition",
     model="facebook/s2t-wav2vec2-large-en-de",
     feature_extractor="facebook/s2t-wav2vec2-large-en-de",
 )
translation_de = asr(librispeech_en[0]["file"])