File size: 1,094 Bytes
c97bd71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# SyFox giant model — HuggingFace Spaces (Docker SDK)
# Builds the SI-substrate engine from source, then serves the v3 HTTP API
# on the port Spaces expects (7860). No transformer, no NN: decisions come
# from the C++ SI substrate (energy injection -> settle -> readout).
FROM python:3.11-slim AS enginebuild
RUN apt-get update && apt-get install -y --no-install-recommends \
        build-essential g++ make && rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY engine/ /src/
RUN make build/libsyfox_core.so && strip build/libsyfox_core.so

FROM python:3.11-slim
RUN pip install --no-cache-dir fastapi uvicorn
WORKDIR /app
COPY --from=enginebuild /src/build/libsyfox_core.so /app/build/libsyfox_core.so
COPY server/ /app/server/
COPY inference.py /app/inference.py
COPY model/ /app/model/
COPY datasets/ /app/datasets/
COPY docs/ /app/docs/
ENV PYTHONUNBUFFERED=1
EXPOSE 7860
# script routing: /app/model/giant -> /app/model/giant-latin, giant-bengali, ...
CMD ["python", "server/app.py", "--model", "model/giant", "--lang", "auto", \
     "--energy-norm", "--host", "0.0.0.0", "--port", "7860"]