move to /rust-whisper.d with a download_models.sh

master
bel 2023-03-31 16:41:46 -06:00
parent 4e5212a9b7
commit b109b0144d
8 changed files with 14 additions and 2 deletions

2
.gitignore vendored
View File

@ -1,5 +1,7 @@
**/*.sw* **/*.sw*
/whisper-cpp-2023/rust.d/target /whisper-cpp-2023/rust.d/target
/rust-whisper.d/target
/rust-whisper.d/models
snowboy-2022/snowboy snowboy-2022/snowboy
**/*.git.d **/*.git.d
**/*.wav **/*.wav

View File

@ -0,0 +1,10 @@
#!/bin/bash
src="https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml"
d="${1:-"$PWD"/models}"
mkdir -p "$d"
# Whisper models
for model in "tiny.en" "base.en" "small.en" "medium.en"; do
test -f "$d"/ggml-$model.bin || wget --quiet --show-progress -O "$d"/ggml-$model.bin "$src-$model.bin"
done

View File

@ -5,7 +5,7 @@ if [ ! -d ./git.d/.git ]; then
fi fi
cd ./git.d cd ./git.d
if [ ! -f ./samples/gb1.wav ]; then if [ ! -f ./samples/jfk.wav ]; then
make samples make samples
fi fi
if [ ! -f ./main ]; then if [ ! -f ./main ]; then
@ -20,5 +20,5 @@ fi
if [ -n "$STREAM" ]; then if [ -n "$STREAM" ]; then
./stream -m ./models/ggml-${MODEL:-tiny.en}.bin -t 8 --step 500 --length ${MIC_TIMEOUT:-2}000 $(test -n "$MIC_ID" && echo -c "$MIC_ID") ./stream -m ./models/ggml-${MODEL:-tiny.en}.bin -t 8 --step 500 --length ${MIC_TIMEOUT:-2}000 $(test -n "$MIC_ID" && echo -c "$MIC_ID")
else else
time ./main -m ./models/ggml-${MODEL:-tiny.en}.bin -f ./samples/gb1.wav -t 4 time ./main -m ./models/ggml-${MODEL:-tiny.en}.bin -f ./samples/jfk.wav -t 4
fi fi