Python, Data Science, AI, NLP, Programming.
librispeech_samples = load_dataset("librispeech_asr", "clean", split="test.100") # load audio and pad/trim it to fit 30 seconds audio = librispeech_samples[0]["audio"]["array"] audio = whisper.pad_or_trim(audio) # make log-Mel spectrogram and move to the same device as the model mel =