-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·24 lines (18 loc) · 947 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
build_type=release
# As of this writing, whisper.cpp's Metal support depends on the presence of
# this environment variable at runtime. So until it's patched to be more
# flexible in its configuration, this is how we enable Metal.
export GGML_METAL_PATH_RESOURCES="$(find "target/$build_type" -type d -name 'whisper.cpp' -print -quit)"
if [[ -z "$GGML_METAL_PATH_RESOURCES" ]]; then
echo "GGML_METAL_PATH_RESOURCES not found, try running cargo build"
exit 1
fi
# Additionally, whisper-rs doesn't capture Metal-specific logs for some reason.
# So you'll still see those in the log output, even if you're suppressing.
export RUST_LOG=whisper_sys_log=error,voice=debug,server=info
# The address on which the HTTP server should listen (e.g. localhost:PORT)
addr="$1"
# See the whisper.cpp repo for details on how to get a model. I recommend using
# base or small for best results.
model_path="$2"
voice-server run-daemon --serve "$addr"