Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files12345678910111213141516171819202122232425262728293031323334# ============================================================# Dockerfile β Qwen3.5-0.8B CPU-Only API for HF Spaces# No GPU required. Port 7860.# ============================================================FROM python:3.11-slim# ββ System deps ββRUN apt-get update && \apt-get install -y --no-install-recommends git && \rm -rf /var/lib/apt/lists/*# ββ Python deps (CPU-only torch β no CUDA bloat) ββRUN pip install --no-cache-dir \torch --index-url https://download.pytorch.org/whl/cpuRUN pip install --no-cache-dir \transformers \accelerate \fastapi \uvicorn \pydantic \huggingface_hub# ββ Pre-download model at build time (~1.8 GB baked into image) ββENV HF_HOME=/tmp/hf_cacheRUN python3 -c "\from huggingface_hub import snapshot_download; \snapshot_download('Qwen/Qwen3.5-0.8B', cache_dir='/tmp/hf_cache')"# ββ Copy app ββWORKDIR /appCOPY app.py .12345678910111213141516FROM python:3.11-slimRUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*# CPU-only torchRUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpuRUN pip install --no-cache-dir \transformers \fastapi \uvicorn \pydanticWORKDIR /appCOPY app.py .
Dockerfile+4-22