Spaces:
Running
Running
Add Dockerfile: BlueTTS v3.0.1 OpenAI-compatible server with the BlueV3-onnx bundle
Browse files- Dockerfile +36 -0
Dockerfile
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BlueV3 OpenAI-compatible TTS API, as a Hugging Face Docker Space.
|
| 2 |
+
# Serves POST /v1/audio/speech (examples/openai_server.py from BlueTTS) on port 7860.
|
| 3 |
+
FROM python:3.12-slim
|
| 4 |
+
|
| 5 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 6 |
+
git libsndfile1 espeak-ng ffmpeg \
|
| 7 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
+
|
| 9 |
+
COPY --from=ghcr.io/astral-sh/uv:0.11.6 /uv /usr/local/bin/uv
|
| 10 |
+
|
| 11 |
+
# HF Spaces run the container as uid 1000.
|
| 12 |
+
RUN useradd -m -u 1000 user && mkdir -p /home/user/app && chown user:user /home/user/app
|
| 13 |
+
USER user
|
| 14 |
+
ENV HOME=/home/user \
|
| 15 |
+
PATH=/home/user/.local/bin:$PATH \
|
| 16 |
+
PYTHONUNBUFFERED=1 \
|
| 17 |
+
UV_LINK_MODE=copy
|
| 18 |
+
WORKDIR /home/user/app
|
| 19 |
+
|
| 20 |
+
# Pinned to BlueTTS v3.0.1 (main @ e1ff5cd, 2026-11-18) so the arena hears a fixed model.
|
| 21 |
+
ARG BLUETTS_REF=e1ff5cdfc8aea7cbb866e397032bc89ddd58f377
|
| 22 |
+
RUN git init -q . \
|
| 23 |
+
&& git remote add origin https://github.com/maxmelichov/BlueTTS.git \
|
| 24 |
+
&& git fetch -q --depth 1 origin ${BLUETTS_REF} \
|
| 25 |
+
&& git checkout -q FETCH_HEAD \
|
| 26 |
+
&& uv sync --frozen --extra server --extra hebrew
|
| 27 |
+
|
| 28 |
+
# Bake the ONNX bundle (onnx graphs, voices, G2P front ends) into the image.
|
| 29 |
+
RUN uv run hf download notmax123/BlueV3-onnx \
|
| 30 |
+
--include "onnx/*" --include "voices/*" --include "frontend/*" \
|
| 31 |
+
--local-dir ./bluev3_onnx \
|
| 32 |
+
&& uv pip install --no-index --find-links ./bluev3_onnx/frontend polyg2p==0.1.0
|
| 33 |
+
|
| 34 |
+
EXPOSE 7860
|
| 35 |
+
CMD ["uv", "run", "python", "examples/openai_server.py", \
|
| 36 |
+
"--bundle", "bluev3_onnx", "--host", "0.0.0.0", "--port", "7860"]
|