dev-mode-orpheus-tts / Dockerfile
Tomtom84's picture
Update Dockerfile
b87e018 verified
raw
history blame
1.68 kB
# PyTorch + CUDA 12.1 + cuDNN 8 (passt zur L4)
FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
# -- System-Pakete minimal, aber was wir wirklich brauchen --
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git-lfs build-essential portaudio19-dev ffmpeg && \
rm -rf /var/lib/apt/lists/*
# Non-root-User (Spaces-Empfehlung)
RUN useradd -m -u 1000 user
USER user
WORKDIR /app
ENV PATH="/home/user/.local/bin:$PATH"
# Orpheus-/SNAC-Code + Server
COPY --chown=user . /app
ENV HF_HOME=/app/.cache
# GPU-freundliches Torch-Upgrade (falls gewΓΌnscht)
RUN pip install --no-cache-dir \
torch==2.3.1+cu121 torchaudio==2.3.1+cu121 \
--index-url https://download.pytorch.org/whl/cu121
RUN pip install --no-cache-dir vllm==0.9.0.post1
# Python-AbhΓ€ngigkeiten
COPY --chown=user requirements.txt .
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir "realtimetts[system]==0.3.1" --no-deps
EXPOSE 7860
# ───── Environment ───────────────────────────────────────
ENV MODEL_ID="SebastianBodza/Kartoffel_Orpheus-3B_german_natural-v0.1"
ENV ORPHEUS_API_URL=http://127.0.0.1:1234/v1/completions
# ───── Entrypoint ────────────────────────────────────────
CMD bash -c "\
python -m vllm.entrypoints.openai.api_server \
--model $MODEL_ID \
--port 1234 \
--dtype bfloat16 \
--gpu-memory-utilization 0.7 & \
uvicorn app:app --host 0.0.0.0 --port 7860"