Skip to content

Latest commit

 

History

History

django_api_streaming

Django API Streaming

Implementation of an API to stream audio files for transcription in Django using the REST Framework.

Installation

If you want to try the server inside a virtual environment.

   pip install -r requirements.txt

Usage

Using docker-compose

Update docker-compose.yml to point to your models path under services:stt:volumes.

Build the stack using docker-compose.

docker-compose up -d

Then collect staticfiles.

docker-compose run --rm stt /app/manage.py collectstatic --no-input

Go to http://0.0.0.0/stt/.

Running in a local environment

Before you run the server, you need to update the configuration located at stt_app/config/config.json with the path to your desired models.

{
    "stt": {
      "model" :"path/to/models/output_graph.tflite",
      "lm": "path/to/models/kenlm.scorer",
      "audiofiledir": "/path/to/tmp_dir_audio",
      "audiofilelength": "10",
      "debug": "1"
    }
}

Run the server in local for testing (HTTP).

   python manage.py runserver

Run the server in local for production (HTTPS).

   python manage.py runsslserver

Contributions

This project was inspired and uses modified code from: