Spaces:
Build error
Build error
1234567891011121314151617# --- 1. Use the official Ollama pre-built image ---FROM ollama/ollama# --- 2. Install Python & dependencies for our download script ---# The base image is Debian, so we can use apt-getRUN apt-get update && apt-get install -y python3 python3-pipRUN pip install huggingface_hub# --- 3. Download the GGUF model ---WORKDIR /appCOPY download_model.py .ARG HF_TOKENRUN --mount=type=secret,id=HF_TOKEN \python3 download_model.py# --- 4. Create the Ollama "Modelfile" ---# This file tells Ollama to use our downloaded GGUF123456789101112131415161718192021# --- 1. Use the official Ollama pre-built image ---FROM ollama/ollama# --- 2. Install Python, pip, and the venv package ---# The base image is Debian, so we can use apt-getRUN apt-get update && apt-get install -y python3 python3-pip python3-venv# --- 3. Download the GGUF model using a safe venv ---WORKDIR /appCOPY download_model.py .ARG HF_TOKEN# This command creates a venv, installs hf_hub, downloads the model,# and then the venv is discarded, keeping the system clean.RUN --mount=type=secret,id=HF_TOKEN \sh -c 'python3 -m venv /tmp/downloader-venv && \. /tmp/downloader-venv/bin/activate && \pip install huggingface_hub && \python3 download_model.py'# --- 4. Create the Ollama "Modelfile" ---# This file tells Ollama to use our downloaded GGUF
Dockerfile+9-5