move to /rust-whisper.d with a download_models.sh
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -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
|
||||||
|
|||||||
10
rust-whisper.d/download_models.sh
Executable file
10
rust-whisper.d/download_models.sh
Executable 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
|
||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user