Created
March 20, 2024 13:22
-
-
Save wilsonsilva/4cae355111c46a048b7d7ec8c5a53638 to your computer and use it in GitHub Desktop.
whisper.cpp transcribe wav and serve wav
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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