File size: 1,057 Bytes
9a9ec03
 
 
 
 
 
c53fb02
9a9ec03
 
 
 
cf748a3
c53fb02
 
cf748a3
c53fb02
cf748a3
 
 
 
 
 
 
 
 
c53fb02
cf748a3
c53fb02
9a9ec03
 
 
 
 
2b1f2a1
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
FROM python:3.9-slim

WORKDIR /app

ENV MODEL_DIR=/app/pretrain_model
ENV HF_HUB_DISABLE_SYMLINKS_WARNING=1
ENV HF_TOKEN=""

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Pre-download all local models during build
RUN --mount=type=secret,id=HF_TOKEN \
    export HF_TOKEN=$(cat /run/secrets/HF_TOKEN) && \
    echo "--- Downloading Bielik-1.5B..." && \
    huggingface-cli download speakleash/Bielik-1.5B-v3.0-Instruct \
        --local-dir ${MODEL_DIR}/bielik-1.5b \
        --local-dir-use-symlinks=False && \
    echo "--- Downloading Qwen2.5-3B..." && \
    huggingface-cli download Qwen/Qwen2.5-3B-Instruct \
        --local-dir ${MODEL_DIR}/qwen2.5-3b \
        --local-dir-use-symlinks=False && \
    echo "--- Downloading Gemma-2-2B..." && \
    huggingface-cli download google/gemma-2-2b-it \
        --local-dir ${MODEL_DIR}/gemma-2-2b \
        --local-dir-use-symlinks=False && \
    echo "--- All models downloaded."


COPY . .

EXPOSE 8000

CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]