Start by creating a [pipeline] and specify the inference task:

from transformers import pipeline
transcriber = pipeline(task="automatic-speech-recognition")

Pass your input to the [pipeline]. In the case of speech recognition, this is an audio input file:

transcriber("https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac")
{'text': 'I HAVE A DREAM BUT ONE DAY THIS NATION WILL RISE UP LIVE UP THE TRUE MEANING OF ITS TREES'}