mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 05:40:26 +02:00
feat: Add USE_GPU argument to Dockerfile and docker-compose for GPU support
This commit is contained in:
@@ -8,6 +8,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
|
|||||||
|
|
||||||
ARG TORCH_INDEX_URL=https://download.pytorch.org/whl/cu124
|
ARG TORCH_INDEX_URL=https://download.pytorch.org/whl/cu124
|
||||||
ARG TORCH_VERSION=
|
ARG TORCH_VERSION=
|
||||||
|
ARG USE_GPU=true
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||||
@@ -38,6 +39,12 @@ RUN pip install --upgrade pip \
|
|||||||
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl \
|
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl \
|
||||||
&& pip install --no-cache-dir "mutagen>=1.47.0"
|
&& pip install --no-cache-dir "mutagen>=1.47.0"
|
||||||
|
|
||||||
|
# Install onnxruntime-gpu for CUDA acceleration (supertonic uses ONNX Runtime)
|
||||||
|
# Set USE_GPU=false to skip this for CPU-only deployments
|
||||||
|
RUN if [ "$USE_GPU" = "true" ]; then \
|
||||||
|
pip install --no-cache-dir onnxruntime-gpu; \
|
||||||
|
fi
|
||||||
|
|
||||||
ENV ABOGEN_HOST=0.0.0.0 \
|
ENV ABOGEN_HOST=0.0.0.0 \
|
||||||
ABOGEN_PORT=8808
|
ABOGEN_PORT=8808
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ services:
|
|||||||
args:
|
args:
|
||||||
TORCH_INDEX_URL: ${TORCH_INDEX_URL:-https://download.pytorch.org/whl/cu124}
|
TORCH_INDEX_URL: ${TORCH_INDEX_URL:-https://download.pytorch.org/whl/cu124}
|
||||||
TORCH_VERSION: ${TORCH_VERSION:-}
|
TORCH_VERSION: ${TORCH_VERSION:-}
|
||||||
|
USE_GPU: ${USE_GPU:-true}
|
||||||
image: abogen:latest
|
image: abogen:latest
|
||||||
user: "${ABOGEN_UID:-1000}:${ABOGEN_GID:-1000}"
|
user: "${ABOGEN_UID:-1000}:${ABOGEN_GID:-1000}"
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
Reference in New Issue
Block a user