Whisper-Tiny Example
This document explains how to use the QAI AppBuilder Python API to perform inference with the Whisper-Tiny speech recognition model using the Qualcomm® Hexagon™ Processor (NPU).
Supported devices
| Device | SoC |
|---|---|
| Fogwise® AIRbox Q900 | QCS9075 |
Install QAI AppBuilder
-
Install QAI AppBuilder by following the QAI AppBuilder installation guide.
-
Configure ADSP environment variables as described in Create ADSP environment variables.
Run the sample
Install dependencies
Install sample dependencies in the activated virtual environment:
pip3 install requests tqdm qai-hub py3-wget Pillow torch torchvision opencv-python-headless audio2numpy
Run the script
-
Enter the upstream samples directory
Devicecd qai-appbuilder/samples -
Prepare input data (use the sample input if provided, or pass script arguments)
input audio
-
Run inference
Devicepython3 audio/Speech_Recognition/whisper_tiny_en/whisper_tiny_en.py --chipset 9075
The default input is the bundled jfk.wav. On success the terminal prints a transcription such as:
Transcription: And so my fellow Americans ask not what your country can do for you, ask what you can do for your country.
The first run downloads encoder/decoder models via Qualcomm® AI Hub. Decoding needs the tiktoken vocabulary; if the device cannot reach openaipublic.blob.core.windows.net, pre-warm tiktoken.get_encoding("gpt2") on a machine with network access.
python3 run_inference.py --list
python3 run_inference.py --model whisper_tiny_en --args "--chipset 9075"