File size: 983 Bytes
a30aa25
 
 
 
299c7b3
a30aa25
 
 
 
 
 
386eb5c
a30aa25
 
 
386eb5c
 
2353df0
386eb5c
 
 
 
 
 
a30aa25
299c7b3
2353df0
a30aa25
 
 
 
 
299c7b3
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
FROM python:3.10-slim

WORKDIR /app

# 1. Install system tools
RUN apt-get update && apt-get install -y \
    git \
    git-lfs \
    && git lfs install \
    && rm -rf /var/lib/apt/lists/*

# 2. Install requirements (ensuring huggingface_hub is installed)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# 3. Use the Python module path to run the download
# This avoids "not found" errors regardless of how the CLI is named
RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \
    python3 -c "from huggingface_hub import snapshot_download; \
    snapshot_download(repo_id='CooLLaMACEO/Overflow-100B', \
    local_dir='/app/model', \
    token=open('/run/secrets/HF_TOKEN').read().strip(), \
    ignore_patterns=['README.md', '.gitattributes'], \
    local_dir_use_symlinks=False)"

# 4. Copy the rest of the app
COPY . .

# Force CPU mode
ENV CUDA_VISIBLE_DEVICES=""
EXPOSE 7860

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