A DeepSpeech webserver with resampling capabilities that run over websockets through Starlette.
Python 3.6+Starlette 0.12Uvicorn 0.7Gunicorn 19.9Scipy 1.3Webrtcvad 2.0
I'm using miniconda so:
$ conda create --name wsDSpeech python=3.6 # or 3.7
$ conda activate wsDSpeech
$ pip install -r requirements.txtFirst, set up the correct INPUT_SAMPLE_RATE in appConfig according to the audio file that will be streamed to the server.
Then, if you want to use the Dockerfile just run:
$ docker build -t deepspeech .
$ docker run -t deepspeechor locally:
$ cp appConfig app/appConfig
$ gunicorn -c guConfig.py app:appNow you can reach the server at:
http://127.0.0.1:5000
for a cutie hello world
Meanwhile a thread starts and downloads DeepSpeech models if not present.
In the example folder there are two simple clients.
- Choose how many connections:
nrClient=2
-
Just run it
cd examples/python python simpleClient.py
-
appConfigcontains all the settings used. -
On first run, DeepSpeech models will be downloaded under the
DEEPSPEECH_ROOT_PATH. -
If you want more verbosity, flag
VERBOSE/DEBUGtoTrue -
guConfigcontains all the settings related to GUnicorn, including the deepspeech model downloading part.
- Python client example with more connections
- Manage memory leaking (avoid to force workers restart)
- Handle async/future exceptions
- Use a lighter docker as base image (Alpine?)