- Base image: rocm/dev-ubuntu-22.04:6.1 → 7.2 - Python 3.10 → 3.11 via deadsnakes PPA - torch/torchaudio: 2.5.1 → 2.11.0 - torchvision: 0.20.1 → 0.26.0 - pytorch_triton_rocm: 3.1.0 → 3.3.0 - transformers: 4.46.3 → >=4.50.0 - diffusers: 0.29.0 → >=0.32.0 - safetensors: >=0.4.1 → >=0.4.5 - config: temperature 0.8→0.9, seed 0→1960 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
54 lines
1.6 KiB
Docker
54 lines
1.6 KiB
Docker
FROM rocm/dev-ubuntu-22.04:7.2
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \
|
|
PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
HF_HOME=/app/hf_cache \
|
|
PIP_NO_CACHE_DIR=1
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
software-properties-common \
|
|
&& add-apt-repository ppa:deadsnakes/ppa \
|
|
&& apt-get update && apt-get install -y --no-install-recommends \
|
|
python3.11 \
|
|
python3.11-dev \
|
|
python3.11-distutils \
|
|
git \
|
|
ffmpeg \
|
|
libsndfile1 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install pip for Python 3.11
|
|
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11
|
|
|
|
# Make python3.11 the default python3
|
|
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 \
|
|
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
|
|
|
|
WORKDIR /app
|
|
|
|
# Step 1: Install ROCm-compatible PyTorch stack first.
|
|
# This must happen before anything else to prevent pip from pulling CPU wheels.
|
|
COPY requirements-rocm-init.txt .
|
|
RUN python3 -m pip install -r requirements-rocm-init.txt
|
|
|
|
# Step 2: Install remaining dependencies (pinned to avoid overwriting torch).
|
|
COPY requirements-rocm.txt .
|
|
RUN python3 -m pip install -r requirements-rocm.txt
|
|
|
|
# Step 3: Install chatterbox with --no-deps so pip cannot replace ROCm torch.
|
|
RUN python3 -m pip install --no-deps chatterbox-tts
|
|
|
|
# Application source
|
|
COPY engine.py config.py wyoming_handler.py wyoming_voices.py main.py ./
|
|
|
|
# Default config (can be overridden by volume mount)
|
|
COPY config.yaml .
|
|
|
|
# Create default directories
|
|
RUN mkdir -p voices reference_audio hf_cache
|
|
|
|
EXPOSE 10200
|
|
|
|
CMD ["python3", "main.py"]
|