Prepare whisper.cpp and verify the model
Prepare whisper.cpp and verify the model — Free local transcription with Whisper and FFmpeg. A reproducible tool directory; Weights are not the executable; A launch check without path confusion. Practical assignment: Prepare whisper.cpp and verify the model.
Demo edition. The materials are undergoing editorial review.
Topics covered
- A reproducible tool directory
- Weights are not the executable
- A launch check without path confusion
A reproducible tool directory
This teaching example uses a Linux or macOS shell with Git, CMake, a C++ compiler and FFmpeg. Windows executable paths and build steps can differ; consult the official platform instructions. These commands are lesson material, not actions already performed for you. Create asr-lab with a separate whisper.cpp directory so source code does not mix with recordings. CMake configures build, then the compiler creates whisper-cli. If cmake is unavailable, repair that prerequisite: randomly adding sudo neither installs a compiler nor resolves missing dependencies. For a failed build, inspect the first substantive error rather than only the final “build failed” line. Record the Git commit and CMake version in toolchain.txt to distinguish software changes from audio changes. Preserve a known working build when testing an update.
mkdir asr-lab
cd asr-lab
mkdir originals work reviewed
git clone https://github.com/ggml-org/whisper.cpp.git
cmake -S whisper.cpp -B whisper.cpp/build
cmake --build whisper.cpp/build -j 2 --config Release
git -C whisper.cpp rev-parse HEAD
Weights are not the executable
whisper-cli needs weights in a format supported by whisper.cpp. A directory of Python weights does not automatically become a ggml model. Use the official download script for base from the whisper.cpp directory. The subshell returns to asr-lab, so later paths again start at the training project root. Expect whisper.cpp/models/ggml-base.bin; file existence alone does not prove a complete download. Check download messages, size and a source checksum when one is provided. An HTML error saved as .bin is not a model. Do not substitute unknown “accelerated” executables for weights. Record model filename, source, download date and your copy’s digest. A digest supports reproducibility but cannot authenticate origin when its reference comes from an unverified location. Fix one local case before starting a batch.
(cd whisper.cpp && sh ./models/download-ggml-model.sh base)
./whisper.cpp/build/bin/whisper-cli -h
A launch check without path confusion
The -h command must show options for the whisper-cli you actually built. Save help beside toolchain.txt because versions can change formats and flags. Our baseline uses 16-bit PCM WAV even when a build accepts MP3 directly, making preparation easier to inspect. If the shell reports “No such file,” first check the working directory and build/bin rather than downloading weights again. If the program starts but cannot load the model, inspect the -m path. For a GPU error, consult help for a supported CPU mode; that is diagnosis, not a speed guarantee. Do not expose a model server on the network for file transcription. This route needs no ports, API keys or external account. Verify executable, model and input separately before the next lesson, since different failures can look superficially similar.
Practical assignment
Prepare whisper.cpp and verify the model
Continue to learning