zheqiushui's picture
AX8860 llama.cpp package
8d0d264 verified
Raw History Blame Contribute Delete
871 Bytes
#!/bin/sh
# VoxCPM2 on AX8860, llama.cpp + ggml-axera.
# ./run.sh <text> [out.wav] [reference.wav] [reference_text]
# reference.wav is optional; without it the default preset voice is used.
# reference_text enables continuation-style zero-shot cloning when supplied.
H=$(cd "$(dirname "$0")" && pwd)
[ $# -ge 1 ] || { sed -n 2,6p "$0"; exit 2; }
text=$1
out=${2:-out.wav}
ref=${3:-}
reftext=${4:-}
export LD_LIBRARY_PATH=/opt/lib
export GGML_AXERA_KERNEL_DIR=$H/kernels
base=$H/gguf/VoxCPM2-BaseLM-F16.gguf
acoustic=$H/gguf/VoxCPM2-Acoustic-F16.gguf
set -- "$H/bin/llama-tts" \
--voxcpm2-base-lm "$base" \
--voxcpm2-acoustic "$acoustic" \
-ngl 99 -c 8192 -n 200 \
-p "$text" -o "$out"
if [ -n "$ref" ]; then
set -- "$@" --tts-speaker-file "$ref"
if [ -n "$reftext" ]; then
set -- "$@" --tts-ref-text "$reftext"
fi
fi
exec "$@"