3v324v23's picture
Serialize A10G generation requests
ee3b233
Raw
History Blame Contribute Delete
3.21 kB
FROM lmsysorg/sglang:v0.5.8-cu129-amd64-runtime@sha256:85feb856fb76c986cc31001b438d9d243c805378a9e63254fdaaf6cb1740d332
USER root
RUN apt-get update && \
apt-get install -y --no-install-recommends curl git libsndfile1 ninja-build && \
rm -rf /var/lib/apt/lists/* && \
mkdir -p /home/user/app /models /opt/sglang-omni /opt/audio8-tts \
/tmp/audio8-flashinfer /tmp/audio8-torchinductor && \
chown -R 1000:1000 /home/user /models \
/tmp/audio8-flashinfer /tmp/audio8-torchinductor
WORKDIR /home/user/app
ARG SGLANG_OMNI_REVISION=68a572348837f7b004857b4b07993c20ade4c017
ARG AUDIO8_TTS_REVISION=59ca6d27d441302eaa568bcb140b63c50a879859
COPY patches/disable_streaming.patch /tmp/audio8-disable-streaming.patch
RUN git init /opt/sglang-omni && \
git -C /opt/sglang-omni remote add origin https://github.com/sgl-project/sglang-omni.git && \
git -C /opt/sglang-omni fetch --depth 1 origin "${SGLANG_OMNI_REVISION}" && \
git -C /opt/sglang-omni checkout --detach FETCH_HEAD && \
git init /opt/audio8-tts && \
git -C /opt/audio8-tts remote add origin https://github.com/Audio8-AI/Audio8_TTS.git && \
git -C /opt/audio8-tts fetch --depth 1 origin "${AUDIO8_TTS_REVISION}" && \
git -C /opt/audio8-tts checkout --detach FETCH_HEAD && \
git -C /opt/audio8-tts apply /tmp/audio8-disable-streaming.patch && \
rm -rf /opt/sglang-omni/.git /opt/audio8-tts/.git
RUN pip install --no-cache-dir \
"accelerate==1.14.0" \
"av==17.1.0" \
"fastapi==0.139.0" \
"huggingface-hub==0.36.2" \
"httpx==0.28.1" \
"librosa==0.11.0" \
"msgpack==1.2.1" \
"numba==0.63.1" \
"python-multipart==0.0.32" \
"qwen-vl-utils==0.0.11" \
"soundfile==0.13.1" \
"transformers==4.57.1" \
"typer==0.26.8" \
"uvicorn==0.49.0" \
"xxhash==3.8.0" \
"pyzmq==27.1.0"
ENV PYTHONPATH=/opt/sglang-omni
RUN /opt/audio8-tts/sglang_omni/scripts/install_adapter.sh /opt/sglang-omni
COPY --chown=1000:1000 app.py ./app.py
COPY --chown=1000:1000 static ./static
COPY --chown=1000:1000 examples ./examples
COPY --chown=1000:1000 assets ./assets
COPY --chown=1000:1000 scripts ./scripts
RUN chmod +x ./scripts/*.sh
USER 1000
ARG MODEL_REPO=Audio8/Audio8-TTS-Preview-0.6b
ARG MODEL_REVISION=1b17c91db5f4dccb6914aa4aa5cb0e56661a6c17
RUN python3 -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='${MODEL_REPO}', revision='${MODEL_REVISION}', local_dir='/models/audio8-tts-0.6b')"
ENV HOME=/home/user \
HF_HOME=/home/user/.cache/huggingface \
MODEL_PATH=/models/audio8-tts-0.6b \
PORT=7860 \
BACKEND_HOST=127.0.0.1 \
BACKEND_PORT=8010 \
AUDIO8_TTS_MEM_FRACTION_STATIC=0.60 \
AUDIO8_TTS_MAX_RUNNING_REQUESTS=1 \
AUDIO8_TTS_MAX_TEXT_UNITS=150 \
AUDIO8_TTS_MAX_RAW_TEXT_CHARS=1000 \
AUDIO8_TTS_MAX_NEW_TOKENS=1024 \
UI_MAX_CONCURRENCY=1 \
AUDIO8_TTS_DISABLE_CUDA_GRAPH=0 \
AUDIO8_TTS_ENABLE_TORCH_COMPILE=1 \
AUDIO8_TTS_VERIFY_FAST_KV=1 \
FLASHINFER_WORKSPACE_BASE=/tmp/audio8-flashinfer \
TORCHINDUCTOR_CACHE_DIR=/tmp/audio8-torchinductor \
PYTHONUNBUFFERED=1
EXPOSE 7860
CMD ["/home/user/app/scripts/start.sh"]