Vosk ASR Docker images with GPU for Jetson boards, PCs, M1 laptops and GPC
APACHE-2.0 License
Vosk docker images with GPU for Jetson Nano / Xavier NX boards and PCs with NVIDIA cards.
Pull an existing image with a required tag.
docker pull sskorol/vosk-api:$TAG
Use it as a baseline in your app's Dockerfile:
FROM sskorol/vosk-api:$TAG
Clone sources and check a build file help:
git clone https://github.com/sskorol/vosk-api-gpu.git
cd vosk-api-gpu
Run a build script with the required args depending on your platform, e.g.:
cd jetson && ./build.sh -m nano -i ml -t 0.3.37
You can check the available NVIDIA base image tags here and here.
To build images for PC, use the following script:
cd pc && ./build.sh -c 11.3.1-devel-ubuntu20.04 -t 0.3.37
Here, you have to provide a base cuda image tag and the output container's tag. You can read more by running the script with -h
flag.
This script will build 2 images: base and a sample Vosk server.
To build images (w/o GPU) for Apple M1, use the following script:
cd m1 && ./build.sh -t 0.3.37
To build Kaldi and Vosk API locally (w/o Docker), use the following script (thanks to @aivoicesystems):
cd m1 && ./build-local.sh
Note that there's a required software check when you start this script. If you see missing requirements, chances are you'll need to install the following packages:
brew install autoconf cmake automake libtool
Also note that this script installs Vosk API globally. If you want to use it for a specific project, just activate virtual env before running the script.
To test images on GCP with NVIDIA Tesla T4, use the following steps:
cd gcp && terraform init && terraform apply
Note that you'll be prompted to type your GCP project name and zone. When a new instance is deployed, you can now ssh to it:
gcloud compute ssh --project $PROJECT_NAME --zone $ZONE gpu
Clone this repo and build Vosk images on a relatively powerful machine:
git clone https://github.com/sskorol/vosk-api-gpu && cd vosk-api-gpu/gcp
./build.sh -c 11.3.1-devel-ubuntu20.04 -t 0.3.37 -m vosk-model-en-us-0.22
See build script's help for more details regarding input arguments.
The following script will start docker-compose, install requirements and run a simple test:
./test.sh $TAG $WAV_FILE
./model
folder first, unless you use a GCP instance.en.wav
is used by default.rnnlm
folder from model
.rnnlm
, make sure you allocated at least 12Gb of RAM to your Docker instance (16Gb is optimal).min-active
flag from model/conf/model.conf
ivector.conf
from big EN model