Created
January 7, 2026 21:37
-
-
Save ConorShore/e2f713c3d903595c9b3397071efa157a to your computer and use it in GitHub Desktop.
faster whisper for Nvidia Spark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| docker build -t spark-faster-whisper:latest . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| whisper: | |
| container_name: spark-faster-whisper | |
| image: spark-faster-whisper:latest | |
| build: | |
| dockerfile: Dockerfile | |
| environment: | |
| - TZ=Europe/London | |
| - WHIPSER_BEAM=16 | |
| ports: | |
| - 10300:10300 | |
| volumes: | |
| - ./data:/data | |
| restart: unless-stopped | |
| command: --model large-v3-turbo --language en --device=cuda | |
| deploy: | |
| resources: | |
| reservations: | |
| devices: | |
| - driver: nvidia | |
| count: all | |
| capabilities: [gpu] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM nvidia/cuda:12.8.1-devel-ubuntu22.04 | |
| ARG TARGETARCH | |
| ARG TARGETVARIANT | |
| WORKDIR /usr/src | |
| # build ctranslate2 on arm64 with cuda backend | |
| RUN \ | |
| apt update \ | |
| && apt install -y --no-install-recommends \ | |
| git \ | |
| cmake \ | |
| make \ | |
| libomp-dev \ | |
| python3-dev | |
| RUN \ | |
| git clone --depth 1 --branch v4.6.3 --recursive https://github.com/OpenNMT/CTranslate2.git | |
| RUN \ | |
| cd CTranslate2 && \ | |
| mkdir build && \ | |
| cd build && \ | |
| cmake -DWITH_MKL=OFF -DOPENMP_RUNTIME=COMP -DWITH_CUDA=ON -DWITH_CUDNN=OFF -DCUDA_DYNAMIC_LOADING=ON -DCUDA_NVCC_FLAGS="-Xfatbin=-compress-all" -DCUDA_ARCH_LIST="Common" .. && \ | |
| make -j20 && \ | |
| make install && \ | |
| ldconfig | |
| # Setup python environment | |
| RUN \ | |
| apt update \ | |
| && apt-get install -y --no-install-recommends \ | |
| python3 \ | |
| python3-pip \ | |
| python3-venv \ | |
| \ | |
| && python3 -m venv .venv \ | |
| && .venv/bin/pip3 install --no-cache-dir -U \ | |
| setuptools \ | |
| wheel | |
| # Install faster-whisper | |
| COPY ./pyproject.toml ./ | |
| RUN \ | |
| .venv/bin/pip3 install --no-cache-dir \ | |
| --extra-index-url 'https://download.pytorch.org/whl/cu128' \ | |
| 'torch==2.6.0' \ | |
| \ | |
| && .venv/bin/pip3 install --no-cache-dir \ | |
| # --extra-index-url https://www.piwheels.org/simple \ | |
| -e '.[transformers,sherpa,onnx-asr]' | |
| # Install the built CTranslate2 python bindings | |
| RUN \ | |
| /usr/src/.venv/bin/pip3 uninstall -y ctranslate2 && \ | |
| cd CTranslate2 && \ | |
| cd python && \ | |
| /usr/src/.venv/bin/pip3 install -r install_requirements.txt && \ | |
| /usr/src/.venv/bin/python3 setup.py bdist_wheel && \ | |
| /usr/src/.venv/bin/pip3 install dist/*.whl | |
| RUN \ | |
| apt remove -y \ | |
| git \ | |
| make \ | |
| cmake | |
| COPY ./ ./ | |
| EXPOSE 10300 | |
| ENTRYPOINT ["bash", "docker_run.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment