File size: 1,359 Bytes
41604f6
 
 
 
227e456
41604f6
 
 
 
 
 
 
 
b5d3943
ef5d955
ed131b8
 
41604f6
ed131b8
36f3374
227e456
41604f6
 
 
 
 
22b00f2
41604f6
 
 
 
227e456
41604f6
36f3374
 
22b00f2
41604f6
 
46f8dfe
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
# 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"]