-
Notifications
You must be signed in to change notification settings - Fork 324
Expand file tree
/
Copy pathDockerfile.rocm
More file actions
53 lines (43 loc) · 1.76 KB
/
Copy pathDockerfile.rocm
File metadata and controls
53 lines (43 loc) · 1.76 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM docker.io/rocm/dev-ubuntu-22.04:latest
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive
# Set the Hugging Face home directory for better model caching
ENV HF_HOME=/app/hf_cache
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libsndfile1 \
ffmpeg \
python3 \
python3-pip \
python3-dev \
python3-venv \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Create a symlink for python3 to be python for convenience
RUN ln -sf /usr/bin/python3 /usr/bin/python
# Set up working directory
WORKDIR /app
# Copy requirements first to leverage Docker cache
COPY requirements-rocm-init.txt ./requirements-rocm-init.txt
COPY requirements-rocm.txt ./requirements-rocm.txt
# Install dependencies in correct order:
# 1. ROCm PyTorch stack first (from PyTorch's ROCm 6.1 index)
# 2. Remaining dependencies (without torch to avoid overwrite)
# 3. Chatterbox with --no-deps (to prevent pip replacing ROCm torch with CPU torch)
RUN python3 -m pip install --no-cache-dir --upgrade pip && \
python3 -m pip install --no-cache-dir -r requirements-rocm-init.txt && \
python3 -m pip install --no-cache-dir -r requirements-rocm.txt && \
python3 -m pip install --no-cache-dir --no-deps git+https://github.com/devnen/chatterbox-v2.git@master s3tokenizer==0.3.0 onnx==1.16.0 && \
python3 -m pip install --no-cache-dir "protobuf>=4.25.0"
# Copy the rest of the application code
COPY . .
# Create required directories for the application
RUN mkdir -p model_cache reference_audio outputs voices logs hf_cache
# Expose the port the application will run on
EXPOSE 8004
# Command to run the application
CMD ["python3", "server.py"]