Skip to content

Commit

Permalink
expose custom params for Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
janaab11 committed Dec 20, 2024
1 parent 7adb1a7 commit 662ad3a
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,36 @@ RUN conda install portaudio pysoundfile ffmpeg -c conda-forge
RUN pip install -e .

# Expose the port the app runs on
EXPOSE 8080
EXPOSE 7007

# Define environment variable to prevent Python from buffering stdout/stderr
# and writing byte code to file
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1

CMD ["python", "-m", "diart.console.serve", "--host", "0.0.0.0", "--port", "7007", "--segmentation", "pyannote/segmentation-3.0", "--embedding", "speechbrain/spkrec-resnet-voxceleb", "--tau-active", "0.45", "--rho-update", "0.25", "--delta-new", "0.6", "--latency", "5", "--max-speakers", "3"]
# Define custom options as env variables with defaults
ENV HOST=0.0.0.0
ENV PORT=7007
ENV SEGMENTATION=pyannote/segmentation-3.0
ENV EMBEDDING=speechbrain/spkrec-resnet-voxceleb
ENV TAU_ACTIVE=0.45
ENV RHO_UPDATE=0.25
ENV DELTA_NEW=0.6
ENV LATENCY=5
ENV MAX_SPEAKERS=3

CMD ["sh", "-c", "python -m diart.console.serve --host ${HOST} --port ${PORT} --segmentation ${SEGMENTATION} --embedding ${EMBEDDING} --tau-active ${TAU_ACTIVE} --rho-update ${RHO_UPDATE} --delta-new ${DELTA_NEW} --latency ${LATENCY} --max-speakers ${MAX_SPEAKERS}"]

# Example run command with environment variables:
# docker run -p 7007:7007 --restart unless-stopped --gpus all \
# -e HF_TOKEN=<token> \
# -e HOST=0.0.0.0 \
# -e PORT=7007 \
# -e SEGMENTATION=pyannote/segmentation-3.0 \
# -e EMBEDDING=speechbrain/spkrec-resnet-voxceleb \
# -e TAU_ACTIVE=0.45 \
# -e RHO_UPDATE=0.25 \
# -e DELTA_NEW=0.6 \
# -e LATENCY=5 \
# -e MAX_SPEAKERS=3 \
# diart-image

0 comments on commit 662ad3a

Please sign in to comment.