Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
# Docker DeepSpeech Server

This is a dockerfile to serve a [deepspeech server](https://github.com/MainRo/deepspeech-server).

# How to use this image
Create a deepspeech server configuration file as specified in config.example.yaml. Download and copy
a model tflite and a scorer file and run the following command:

docker run -dt --name deepspeech -p 0.0.0.0:8080:8080 -v [host-model-path]:/opt/deepspeech romainsah/deepspeech-server:latest
docker run -dt --name deepspeech \
-p 0.0.0.0:8080:8080 \
-v [host-model-path]:/opt/deepspeech \
romainsah/deepspeech-server:latest

where [host-model-path] is a host directory that contains the deepspeech server
configuration file, the model file, and the scorer file.
configuration file (e.g. config.yaml), the model file (e.g. model.tflite), and the scorer file (e.g. huge-vocabulary.scorer).

## Running on GPU
Change the tag of the docker image in above command to latest-gpu, like this:

docker run -dt --name deepspeech \
-p 0.0.0.0:8080:8080 \
-v [host-model-path]:/opt/deepspeech \
romainsah/deepspeech-server:latest-gpu

## How to get the models

The latest docker image was tested with the following model and scorer files:

https://github.com/coqui-ai/STT-models/releases/download/english/coqui/v1.0.0-huge-vocab/model.tflite

https://github.com/coqui-ai/STT-models/releases/download/english/coqui/v1.0.0-huge-vocab/huge-vocabulary.scorer

## How to build this image

docker run -dt --gpus all --name deepspeech -p 0.0.0.0:8080:8080 -v [host-model-path]:/opt/deepspeech romainsah/deepspeech-server:latest-gpu
cd cpu && \
docker build -t deepspeech-server:latest .

cd gpu && \
docker build -t deepspeech-server:latest-gpu .
15 changes: 15 additions & 0 deletions config.example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
coqui:
model: model.tflite
scorer: huge-vocabulary.scorer
beam_width: 500
lm_alpha: 0.931289039105002
lm_beta: 1.1834137581510284
server:
http:
host: "0.0.0.0"
port: 8080
request_max_size: 1048576
log:
level:
- logger: deepspeech_server
level: DEBUG
13 changes: 8 additions & 5 deletions cpu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
FROM tensorflow/tensorflow:1.15.2-py3
FROM tensorflow/tensorflow:2.17.0

RUN pip3 install --upgrade pip
COPY requirements.txt /tmp

COPY cpu/requirements.txt /tmp
RUN pip3 install --no-cache-dir -r /tmp/requirements.txt
RUN apt update && apt install python3-pip -y

ENTRYPOINT deepspeech-server --config /opt/deepspeech/config.json
RUN python3 -m pip install --upgrade pip

RUN python3 -m pip install --no-cache-dir -r /tmp/requirements.txt

ENTRYPOINT ["deepspeech-server", "--config", "/opt/deepspeech/config.yaml"]
7 changes: 5 additions & 2 deletions cpu/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
deepspeech==0.8.2
deepspeech-server==2.1.0
deepspeech-server>=3.0.1
numpy<2
cyclotron~=1.2
cyclotron-aiohttp~=1.0
cyclotron-std~=1.0
13 changes: 8 additions & 5 deletions gpu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
FROM tensorflow/tensorflow:1.15.2-gpu-py3
FROM tensorflow/tensorflow:2.17.0-gpu

RUN pip3 install --upgrade pip
COPY requirements.txt /tmp

COPY gpu/requirements.txt /tmp
RUN pip3 install --no-cache-dir -r /tmp/requirements.txt
RUN apt update && apt install python3-pip -y

ENTRYPOINT deepspeech-server --config /opt/deepspeech/config.json
RUN python3 -m pip install --upgrade pip

RUN python3 -m pip install --no-cache-dir -r /tmp/requirements.txt

ENTRYPOINT ["deepspeech-server", "--config", "/opt/deepspeech/config.yaml"]
7 changes: 5 additions & 2 deletions gpu/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
deepspeech-gpu==0.8.2
deepspeech-server==2.1.0
deepspeech-server>=3.0.1
numpy<2
cyclotron~=1.2
cyclotron-aiohttp~=1.0
cyclotron-std~=1.0