File size: 1,363 Bytes
d2d85c7
 
 
 
8e081da
 
 
 
 
 
 
d2d85c7
 
 
 
 
 
 
 
 
 
 
8adc301
 
 
d2d85c7
 
7e88224
 
 
 
d2d85c7
7e88224
 
d2d85c7
 
7e88224
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM python:3.11-slim

WORKDIR /app

# git is needed for `pip install` from github URLs (the qverify install
# below uses pip's git fetcher). python:3.11-slim does not ship git, so
# install it explicitly and clean up apt lists in the same layer.
RUN apt-get update \
    && apt-get install -y --no-install-recommends git \
    && rm -rf /var/lib/apt/lists/*

# Install verifier-only Python deps. requirements.txt deliberately omits
# torch / transformers / outlines because the Space does not load Gemma.
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Install qverify itself without its declared dependencies (those include
# torch / transformers, which the verifier-only Space does not need).
RUN pip install --no-cache-dir --no-deps \
    "qverify @ git+https://github.com/Quantum-Labor/qverify.git@main"

COPY app.py .
COPY safety.py .
COPY assets/ ./assets/
COPY benchmarks/ ./benchmarks/

# HuggingFace Spaces expect the app to listen on 0.0.0.0:7860.
# PYTHONUNBUFFERED + `python -u` so cold-import progress (pennylane,
# qiskit, qiskit-ibm-runtime — ~60–120 s on CPU Basic) is visible in
# the Space's container logs in real time, instead of appearing only
# after Gradio finishes booting.
ENV GRADIO_SERVER_NAME=0.0.0.0 \
    GRADIO_SERVER_PORT=7860 \
    PYTHONUNBUFFERED=1
EXPOSE 7860

CMD ["python", "-u", "app.py"]