The [pipeline] can also iterate over an entire dataset for any task you like. For this example, let's choose automatic speech recognition as our task:

import torch
from transformers import pipeline
speech_recognizer = pipeline("automatic-speech-recognition", model="facebook/wav2vec2-base-960h")

Load an audio dataset (see the 🤗 Datasets Quick Start for more details) you'd like to iterate over. For example, load the MInDS-14 dataset: