Add OpenAI-compatible API and Docker deployment
- Add FastAPI-based API in whisperx/api/ - Implement transcription endpoint compatible with OpenAI - Added Dockerfile and docker-compose.yml for easy deployment - Updated README with Docker instructions - Added new script whisperx-serve for running the API
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
# Use ROCm PyTorch base image
|
||||
FROM rocm/pytorch:latest
|
||||
|
||||
# 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"]
|
||||
Reference in New Issue
Block a user