File size: 1,506 Bytes
c288efe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# BlueV3 OpenAI-compatible TTS API, as a Hugging Face Docker Space.
# Serves POST /v1/audio/speech (examples/openai_server.py from BlueTTS) on port 7860.
FROM python:3.12-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
        git libsndfile1 espeak-ng ffmpeg \
    && rm -rf /var/lib/apt/lists/*

COPY --from=ghcr.io/astral-sh/uv:0.11.6 /uv /usr/local/bin/uv

# HF Spaces run the container as uid 1000.
RUN useradd -m -u 1000 user && mkdir -p /home/user/app && chown user:user /home/user/app
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH \
    PYTHONUNBUFFERED=1 \
    UV_LINK_MODE=copy
WORKDIR /home/user/app

# Pinned to BlueTTS v3.0.1 (main @ e1ff5cd, 2026-11-18) so the arena hears a fixed model.
ARG BLUETTS_REF=e1ff5cdfc8aea7cbb866e397032bc89ddd58f377
RUN git init -q . \
    && git remote add origin https://github.com/maxmelichov/BlueTTS.git \
    && git fetch -q --depth 1 origin ${BLUETTS_REF} \
    && git checkout -q FETCH_HEAD \
    && uv sync --frozen --extra server --extra hebrew

# Bake the ONNX bundle (onnx graphs, voices, G2P front ends) into the image.
RUN uv run hf download notmax123/BlueV3-onnx \
        --include "onnx/*" --include "voices/*" --include "frontend/*" \
        --local-dir ./bluev3_onnx \
    && uv pip install --no-index --find-links ./bluev3_onnx/frontend polyg2p==0.1.0

EXPOSE 7860
CMD ["uv", "run", "python", "examples/openai_server.py", \
     "--bundle", "bluev3_onnx", "--host", "0.0.0.0", "--port", "7860"]