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"]