playground / Dockerfile
fractben's picture
Fracture-Bench playground
cc3506e verified
Raw History Blame Contribute Delete
1.28 kB
# Fracture-Bench playground as a Hugging Face Space (Docker SDK).
FROM python:3.13-slim
# Spaces run the container as user 1000
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
PYTHONUNBUFFERED=1
WORKDIR /home/user/app
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt
# The trained weights (4.7 GB) are downloaded while the image is built, so a
# Space waking from sleep does not fetch them again. For a local test, point
# this at another copy: docker build --build-arg WEIGHTS=<url> ...
ARG WEIGHTS=https://huggingface.co/fracture-bench/weights/resolve/main/Fracture-Bench-weights
ENV FRACTURE_BENCH_WEIGHTS=$WEIGHTS
COPY --chown=user checkpoints/ checkpoints/
COPY --chown=user models/__init__.py models/weights.py models/
RUN python -m models.weights
COPY --chown=user . .
# the home page is the github.io site; the app opens on the playground
ENV FRACTURE_BENCH_SITE=https://fracture-bench.github.io/
EXPOSE 8501
# static/ (the poster) is not part of the Space, so static serving is off
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.headless=true", "--server.enableStaticServing=false", "--browser.gatherUsageStats=false"]