Skip to content

Instantly share code, notes, and snippets.

@wilsonsilva
Created March 20, 2024 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wilsonsilva/4cae355111c46a048b7d7ec8c5a53638 to your computer and use it in GitHub Desktop.
Save wilsonsilva/4cae355111c46a048b7d7ec8c5a53638 to your computer and use it in GitHub Desktop.
whisper.cpp transcribe wav and serve wav
ffmpeg -i ~/Desktop/input.m4a -ar 16000 ~/Desktop/input.wav
pip install ane_transformers
pip install openai-whisper
pip install coremltools
gclone ggerganov/whisper.cpp
make clean
cmake -B build -DWHISPER_COREML=1
cmake --build build -j --config Release
./models/generate-coreml-model.sh medium.en
./models/generate-coreml-model.sh small.en
./build/bin/main --model models/ggml-medium.en.bin ~/Desktop/input.wav
./build/bin/server \
--model models/ggml-small.en.bin \
--threads 8 \
--processors 4 \
--print-colors \
--print-realtime \
--print-progress
# | jq is optional
# on desktop
curl 127.0.0.1:8080/inference \
-H "Content-Type: multipart/form-data" \
-F file="@./input.wav" \
-F temperature="0.0" \
-F temperature_inc="0.2" \
-F response_format="json" | jq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment