diff --git a/docs/source/en/model_doc/whisper.md b/docs/source/en/model_doc/whisper.md index 6c83407f76669c..58e641a5d0e03d 100644 --- a/docs/source/en/model_doc/whisper.md +++ b/docs/source/en/model_doc/whisper.md @@ -27,6 +27,27 @@ The abstract from the paper is the following: This model was contributed by [Arthur Zucker](https://huggingface.co/ArthurZ). The Tensorflow version of this model was contributed by [amyeroberts](https://huggingface.co/amyeroberts). The original code can be found [here](https://github.com/openai/whisper). +## Quick usage + +You can run Whisper in less than 4 lines of code and transcribe in less than a minute! + +```python +# pip install transformers torch + +import torch +from transformers import pipeline + +whisper = pipeline("automatic-speech-recognition", "openai/whisper-large-v3", torch_dtype=torch.float16, device="cuda:0") + +transcription = whisper("") + +print(transcription["text"]) +``` + +Voila! You can swap the model with any [Whisper checkpoints](https://huggingface.co/models?other=whisper&sort=downloads) on the Hugging Face Hub with the same pipeline based on your needs. + +Bonus: You can replace `"cuda"` with `"mps"` to make it seamlessly work on Macs. + ## Usage tips - The model usually performs well without requiring any finetuning.