modelchorus-evals / Dockerfile
brycemeetkai's picture
Mirror evals/ from 960edac5ee66
723e4db verified
FROM python:3.12-slim
# Build context expectation: this Dockerfile lives at `evals/spaces/Dockerfile`
# in the monorepo, but `.github/workflows/mirror-evals-to-hf.yml` uploads
# it to the Space *root* and uploads `evals/<everything else>` to a sibling
# `evals/` subdir under the Space root. So the COPY paths below are
# relative to the Space root and reference the `evals/` subdir — which
# would look puzzling if you were reading this Dockerfile in the monorepo
# without knowing about the mirror's path remapping.
# build-essential covers torch/sentence-transformers C extensions; git is
# required by huggingface_hub for some Hub operations (lfs, refs).
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app/evals
# Cache layer: install deps before copying source so source changes don't
# bust the slow torch/lm-eval install.
COPY evals/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# nltk corpora used by some lm-eval tasks (BLEU, tokenizers). Bake into the
# image so jobs don't pay the download tax on every run.
RUN python -c "import nltk; nltk.download('punkt_tab', quiet=True); nltk.download('punkt', quiet=True)"
COPY evals/ .
# HF Jobs always supplies an explicit command — no ENTRYPOINT/CMD needed.
# Dispatcher passes ["python", "run_eval.py", "--from-convex", "--models", X].