ASR-API is an application serving REST and WebSocket endpoints for the transcription of audio files.
REST API: The API is based on HTTP requests that handles the transcription of files in an async workflow, enabling user to send an audio file in a first request and receive the transcription via a second request as soon as the transcript is ready. See REST Documentation
WebSocket API: The API does provide streaming capabilities. See WebSocket Documentation
Clone this repository to your local machine:
git clone https://github.com/shuffle-project/asr-api.git
docker-compose up
Besides the local Docker Compose stack, there is an option to run both services directory on your local machine.
Before you begin, ensure you have installed the following tools:
pip install -r ./requirements.txt
Locally for a development environment the websocket and the flask api are started seperatly.
python ./app.py
The configuration of the ASR-API is done in the config.yml
and config.local.yml
file. These files are read by the src/config.py
module, which is providing configurations to the service logic.
The config.local.yml
is used for local development.
Please make sure to set the required options:
See the config-files for more information.
The following options are important:
VS Code Extension: https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff
Linting is done with Ruff (https://github.com/astral-sh/ruff) for all *.py
files checked in to Git.
ruff check .
Ruff allows formatting as well.
ruff format .
To test our code we are writing tests utilizing the official Python recommendation: pytest. Each subfolder in /src
has its own /test
folder holding the testfiles. We are thriving to keep a coverage of 80% of our /src
folder.
Shared test functionality, which is used in multiple test files can be found in src/helper/test_base
.
ASR-API is delivered and deployed as a docker container. Depending on the usage of GPU or CPU, there are different factors that come in play. See Deployment Documentation
We are maintaining our code following trunk based development. This means we are working on features branches, integrating into one trunk, the main branch. Please keep your side branches small, and bring them back to main as soon as possible.
This project is licensed under the MIT License - see the LICENSE file for details.