Skip to main content

Audio tasks

Adapted for this playbook from the 🤗 Transformers documentation by Hugging Face. Official page: https://huggingface.co/docs/transformers/tasks/asr. Images © Hugging Face (documentation-images) unless noted. This is not a substitute for the upstream docs — verify against the current version.

Covers Hugging Face pages: tasks/asr, audio_classification, audio_text_to_text, text-to-speech

TaskOfficial guide
Automatic speech recognitionASR
Audio classificationaudio_classification
Audio-text-to-textaudio_text_to_text
Text to speechtext-to-speech

Practical notes​

  • Resample to the model’s expected rate (often 16 kHz for ASR)
  • Prefer Pipeline for batch transcription prototypes
  • See flagship Whisper
from transformers import pipeline
asr = pipeline("automatic-speech-recognition", model="openai/whisper-small")
print(asr("https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac"))

Discussion

Comments​

Share feedback or questions about this page. No account required.

Loading comments…