Codingo / Dockerfile
husseinelsaadi
Use faster-whisper 1.1.1 + wheeled av 13.1.0 (av 11 had no wheels and failed to compile on modern ffmpeg)
ed131b8
Raw
History Blame Contribute Delete
1.36 kB
# CPU-only image for Hugging Face Spaces (free tier).
# Nothing in the app requires a GPU: the LLM is the Groq API, Whisper runs on
# CPU, edge-tts is a cloud service, and embeddings use the small MiniLM model.
FROM python:3.10-slim
ENV OMP_NUM_THREADS=1 \
DEBIAN_FRONTEND=noninteractive \
PIP_NO_CACHE_DIR=1 \
PYTHONUNBUFFERED=1 \
# Keep all model/cache downloads inside the writable /tmp dir on Spaces.
HF_HOME=/tmp/huggingface \
TRANSFORMERS_CACHE=/tmp/huggingface/transformers \
HUGGINGFACE_HUB_CACHE=/tmp/huggingface/hub
# System libraries:
# ffmpeg / libsndfile1 - audio decode for whisper, soundfile, librosa
# git, build-essential - building any source-only wheels
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg git libsndfile1 build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install the CPU build of PyTorch first so the heavy CUDA wheel is never
# pulled in by transitive dependencies.
RUN pip install --upgrade pip && \
pip install torch==2.1.2 --index-url https://download.pytorch.org/whl/cpu
COPY requirements.txt .
RUN pip install -r requirements.txt
# Pre-download the small spaCy English model used by the resume parser.
RUN python -m spacy download en_core_web_sm
# Copy the application code.
COPY . /app
WORKDIR /app
EXPOSE 7860
CMD ["python3", "app.py"]