Skip to content

Development

Development Environment

Install poetry with following command:

pip3 install poetry

Installation

Install packages:

poetry install

Note

By default, this will install the CPU version of PyTorch. For GPU support, you'll need to install the appropriate CUDA version of PyTorch separately:

# For CUDA support (example for CUDA 11.8):
pip3 install torch==2.6.0 --index-url https://download.pytorch.org/whl/cu121

Run

Starting the Webservice:

poetry run whisper-asr-webservice --host 0.0.0.0 --port 9000

Build

With Dockerfile:

# Build Image
docker build -t whisper-asr-webservice .

# Run Container
docker run -d -p 9000:9000 whisper-asr-webservice
# or with specific model
docker run -d -p 9000:9000 -e ASR_MODEL=base whisper-asr-webservice
# Build Image
docker build -f Dockerfile.gpu -t whisper-asr-webservice-gpu .

# Run Container
docker run -d --gpus all -p 9000:9000 whisper-asr-webservice-gpu
# or with specific model
docker run -d --gpus all -p 9000:9000 -e ASR_MODEL=base whisper-asr-webservice-gpu

With docker-compose:

docker-compose up --build
docker-compose -f docker-compose.gpu.yml up --build

Build .whl package

poetry build