-
Notifications
You must be signed in to change notification settings - Fork 243
/
Dockerfile.kaldi-vosk-server
65 lines (62 loc) · 1.96 KB
/
Dockerfile.kaldi-vosk-server
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM debian:10.4
ARG KALDI_MKL
RUN apt-get update && \
apt-get install -y --no-install-recommends \
g++ \
bzip2 \
unzip \
make \
wget \
git \
python3 \
python3-dev \
python3-websockets \
python3-setuptools \
python3-pip \
python3-wheel \
zlib1g-dev \
patch \
ca-certificates \
swig \
cmake \
xz-utils \
automake \
autoconf \
libtool \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
RUN \
git clone -b lookahead-1.8.0 --single-branch https://github.com/alphacep/kaldi /opt/kaldi \
&& cd /opt/kaldi/tools \
&& sed -i 's:status=0:exit 0:g' extras/check_dependencies.sh \
&& sed -i 's:--enable-ngram-fsts:--enable-ngram-fsts --disable-bin:g' Makefile \
&& make -j $(nproc) openfst cub \
&& if [ "x$KALDI_MKL" != "x1" ] ; then \
extras/install_openblas_clapack.sh; \
else \
extras/install_mkl.sh; \
fi \
\
&& cd /opt/kaldi/src \
&& if [ "x$KALDI_MKL" != "x1" ] ; then \
./configure --mathlib=OPENBLAS_CLAPACK --shared; \
else \
./configure --mathlib=MKL --shared; \
fi \
&& sed -i 's:-msse -msse2:-msse -msse2:g' kaldi.mk \
&& sed -i 's: -O1 : -O3 :g' kaldi.mk \
&& make -j $(nproc) online2 lm rnnlm \
\
&& git clone https://github.com/alphacep/vosk-api /opt/vosk-api \
&& cd /opt/vosk-api/python \
&& KALDI_MKL=$KALDI_MKL KALDI_ROOT=/opt/kaldi python3 ./setup.py install --single-version-externally-managed --root=/ \
\
&& git clone https://github.com/alphacep/vosk-server /opt/vosk-server \
&& pip3 install grpcio-tools \
&& cd /opt/vosk-server/grpc \
&& python3 -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. stt_service.proto \
\
&& rm -rf /opt/vosk-api \
&& rm -rf /opt/kaldi \
&& rm -rf /root/.cache \
&& rm -rf /var/lib/apt/lists/*