- Change torch to stable 2.4.0, add torchvision for compatibility - Update Dockerfile to use specific ROCm PyTorch image version
36 lines
785 B
Docker
36 lines
785 B
Docker
# Use ROCm PyTorch base image with compatible PyTorch
|
|
FROM rocm/pytorch:2.4.0-rocm6.0-cxx11-ubuntu22.04
|
|
|
|
# Set environment variables for ROCm and Python
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV PYTHONPATH=/app
|
|
ENV HF_HOME=/app/.cache/huggingface
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
build-essential \
|
|
ffmpeg \
|
|
libsndfile1 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy project files
|
|
COPY . .
|
|
|
|
# Install Python dependencies
|
|
RUN pip install --upgrade pip
|
|
RUN pip install -e .
|
|
|
|
# Expose port
|
|
EXPOSE 8000
|
|
|
|
# Set default environment variables
|
|
ENV WHISPERX_MODEL=turbo
|
|
ENV WHISPERX_DEVICE=cuda
|
|
ENV WHISPERX_COMPUTE_TYPE=float16
|
|
|
|
# Start the server
|
|
CMD ["python", "-m", "whisperx.api.serve"] |