Debian Codegraph @

generate/silero/convert-silero-vad-to-ggml.sh

raw
1 #!/bin/bash
2
3 # generate/silero/convert-silero-vad-to-ggml.sh
4 # Anastasia Shchupak, 16 March 2026
5 #
6 # Shell script that installs an original Silero VAD v6.2.0 model and converts it to GGML binary format,
7 # using the python script convert-silero-vad-to-ggml.py.
8 #
9 # Usage: convert-silero-vad-to-ggml.sh <silero-vad-version>
10 # Example: convert-silero-vad-to-ggml.sh v6.2.0
11
12 set -e # stop if any command fails
13
14 # check if a version is provided
15 if [ -z "$1" ]; then
16 echo "Usage: $0 <silero-vad-version>"
17 echo "Example: $0 v6.2.0"
18 exit 1
19 fi
20
21 VERSION="$1"
22
23 echo "Creating virtual environment..."
24 python3 -m venv venv
25
26 echo "Activating virtual environment..."
27 source venv/bin/activate
28
29 echo "Installing silero-vad and dependencies..."
30 pip install "silero-vad==$VERSION" numpy
31
32 echo "Converting Silero VAD model..."
33 python3 convert-silero-vad-to-ggml.py --output ggml-silero.bin
34
35 echo "Deactivating virtual environment..."
36 deactivate
37
38 echo "Done. Silero VAD $VERSION is installed and converted to GGML binary format."