DeepSeek_Math_V2 / Dockerfile
memmywinks's picture
Upload 6 files
aa11c99 verified
Raw
History Blame Contribute Delete
2.44 kB
FROM ubuntu:24.04
# โ”€โ”€ System dependencies โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
curl \
wget \
ca-certificates \
python3 \
python3-pip \
python3-dev \
python3-venv \
git \
&& rm -rf /var/lib/apt/lists/*
# โ”€โ”€ Python env โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
# PyTorch CPU (conversion only โ€” no GPU needed)
RUN pip install --upgrade pip && \
pip install --no-cache-dir \
torch==2.5.1+cpu \
--index-url https://download.pytorch.org/whl/cpu
# HF ecosystem + conversion deps
RUN pip install --no-cache-dir \
transformers \
huggingface_hub[cli] \
safetensors \
sentencepiece \
tiktoken \
gguf \
numpy \
tqdm
# โ”€โ”€ Clone llama.cpp (fast โ€” no compile here, that happens at container start) โ”€
# We need the source for two things:
# 1. convert_hf_to_gguf.py (Python, runs immediately)
# 2. llama-quantize source (compiled at runtime to avoid build timeout)
RUN git clone --depth 1 https://github.com/ggml-org/llama.cpp.git /opt/llama.cpp
RUN pip install --no-cache-dir -r /opt/llama.cpp/requirements.txt || true
# โ”€โ”€ Runtime secrets โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
ENV HF_TOKEN=""
ENV HF_DATASET_REPO=""
ENV LLAMA_CPP_DIR="/opt/llama.cpp"
# โ”€โ”€ Working directories โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
RUN mkdir -p /workspace/model-fp8 \
/workspace/model-bf16 \
/workspace/model-gguf \
/workspace/output
WORKDIR /workspace
COPY scripts/ /workspace/scripts/
RUN chmod +x /workspace/scripts/*.sh
ENTRYPOINT ["/bin/bash", "/workspace/scripts/entrypoint.sh"]