openai/whisper
Dependencies
Runtime and development dependencies, with concrete usage notes.
Runtime dependencies
Declared in pyproject.toml and requirements.txt.
| Package | Where it's used |
|---|---|
more-itertools |
whisper/normalizers/english.py — windowed for the spelled-out-number sliding window. |
numba |
whisper/timing.py — @numba.jit(nopython=True, parallel=True) for dtw_cpu and backtrace. |
numpy |
Universal: array math, mel filters, alignment-head masks, DTW. |
tiktoken |
whisper/tokenizer.py — wraps tiktoken.Encoding with Whisper's special tokens. |
torch |
The model itself, plus torch.stft in whisper/audio.py. SDPA used opportunistically. |
tqdm |
whisper/__init__.py:_download (download progress) and whisper/transcribe.py (frame progress). |
triton>=2 |
x86_64 Linux only. whisper/triton_ops.py — DTW and median-filter kernels. Imported lazily; if missing, the CPU implementations are used. |
There is no networking, web framework, or database driver. The only system dependency is ffmpeg, which is invoked by whisper/audio.py:load_audio via subprocess.run.
Development dependencies
Declared as the dev extra in pyproject.toml.
| Package | Used for |
|---|---|
black |
Code formatting. Pre-commit hook + CI gate. |
flake8 |
Lint (--max-line-length 88 --ignore E203,E501,W503,W504). |
isort |
Import ordering (--profile black -l 88 --trailing-comma --multi-line 3). |
pytest |
Test runner. |
scipy |
tests/test_timing.py uses scipy.ndimage.median_filter to verify the CPU/CUDA median filter matches. |
Build / packaging
| Package | Where |
|---|---|
setuptools>=61.2 |
[build-system].requires in pyproject.toml. Required for PEP 621 packaging. |
setuptools-rust |
Optional, only when tiktoken has no prebuilt wheel for the platform. |
build |
Used by .github/workflows/python-publish.yml to produce the sdist. |
twine |
Same workflow, to upload to PyPI. |
Pre-commit
Hooks pinned to immutable commit hashes in .pre-commit-config.yaml:
pre-commit-hooks—check-json,end-of-file-fixer,trailing-whitespace,mixed-line-ending,check-added-large-files.psf/black— formatter.pycqa/isort— imports.pycqa/flake8— lint.
CI dependencies
GitHub Actions versions are pinned by SHA in .github/workflows/test.yml and managed by Dependabot (.github/dependabot.yml, grouped weekly).
The test matrix uses conda-incubator/setup-miniconda to install ffmpeg, then pip install for everything else. PyTorch CPU wheels are pulled from https://download.pytorch.org/whl/cpu.
Why these and not others
- No
librosa: the mel filterbanks are precomputed and committed aswhisper/assets/mel_filters.npz;torch.stftdoes the spectrogram. This avoids a heavy dependency. - No
ffmpeg-python: dropped inv20230918(#1242) in favor of a directsubprocess.run(["ffmpeg", ...])call. - No
transformers: the original tokenizer used HuggingFace; replaced bytiktokeninv20230314(#1044).
See also
- Tooling — how dependencies are wired into pre-commit and CI.
- By the numbers — how the dependency tree compares to the rest of the codebase.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.