actual demo server on Docker, dark text fix, port 7860
Browse files- Dockerfile +2 -49
- README.md +0 -2
- experiments/demo_server.py +8 -8
Dockerfile
CHANGED
|
@@ -2,59 +2,12 @@ FROM python:3.11-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
|
|
|
|
| 6 |
|
| 7 |
COPY src/ src/
|
| 8 |
COPY checkpoints/ checkpoints/
|
| 9 |
COPY experiments/ experiments/
|
| 10 |
-
COPY data/ data/
|
| 11 |
-
|
| 12 |
-
RUN pip install --no-cache-dir numpy
|
| 13 |
-
|
| 14 |
-
# Fix the dark text issue and brand properly
|
| 15 |
-
RUN python -c "
|
| 16 |
-
import re
|
| 17 |
-
src = open('experiments/demo_server.py').read()
|
| 18 |
-
|
| 19 |
-
# Fix: dark ink on light backgrounds, ensure readable everywhere
|
| 20 |
-
# The issue is the CSS uses --ink: #1c1e26 (dark) but some elements
|
| 21 |
-
# inherit white from Gradio containers. We need to force it.
|
| 22 |
-
|
| 23 |
-
# 1. Force dark text everywhere
|
| 24 |
-
src = src.replace(
|
| 25 |
-
'body{margin:0;background:var(--bg);color:var(--ink);',
|
| 26 |
-
'body{margin:0;background:var(--bg);color:#1c1e26 !important;')
|
| 27 |
-
|
| 28 |
-
# 2. Force readable stat numbers (dark on light)
|
| 29 |
-
src = src.replace(
|
| 30 |
-
'.stat b{display:block;font-size:22px;font-weight:600;font-variant-numeric:tabular-nums}',
|
| 31 |
-
'.stat b{display:block;font-size:22px;font-weight:600;font-variant-numeric:tabular-nums;color:#0e8a5f}')
|
| 32 |
-
|
| 33 |
-
# 3. Force table text dark
|
| 34 |
-
src = src.replace(
|
| 35 |
-
'table{width:100%;border-collapse:collapse;font-size:13.5px;margin-top:6px;font-variant-numeric:tabular-nums}',
|
| 36 |
-
'table{width:100%;border-collapse:collapse;font-size:13.5px;margin-top:6px;font-variant-numeric:tabular-nums;color:#1c1e26}')
|
| 37 |
-
|
| 38 |
-
# 4. Update branding
|
| 39 |
-
src = src.replace(
|
| 40 |
-
'<h1 class=\"serif\">μLattice — the growing memory, running</h1>',
|
| 41 |
-
'<h1 class=\"serif\">μLattice — AI memory that grows without the cost growing</h1>')
|
| 42 |
-
|
| 43 |
-
src = src.replace(
|
| 44 |
-
'<div class=\"kicker\">Live proof · real weights · nothing canned</div>',
|
| 45 |
-
'<div class=\"kicker\">Tensorbend Research · Eric E. · live proof · real weights</div>')
|
| 46 |
-
|
| 47 |
-
src = src.replace(
|
| 48 |
-
'This page drives the actual trained checkpoint on the GPU.',
|
| 49 |
-
'This page drives three trained checkpoints on CPU. Every number is measured on request.')
|
| 50 |
-
|
| 51 |
-
src = src.replace(
|
| 52 |
-
'model: capacity8k.pt · loading…',
|
| 53 |
-
'3 models loaded: capacity8k · forgetting · realtext · 4.2M parameters')
|
| 54 |
-
|
| 55 |
-
open('experiments/demo_server.py', 'w').write(src)
|
| 56 |
-
print('demo_server.py patched for readability')
|
| 57 |
-
"
|
| 58 |
|
| 59 |
EXPOSE 7860
|
| 60 |
ENV DEVICE=cpu
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu && \
|
| 6 |
+
pip install --no-cache-dir numpy
|
| 7 |
|
| 8 |
COPY src/ src/
|
| 9 |
COPY checkpoints/ checkpoints/
|
| 10 |
COPY experiments/ experiments/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
EXPOSE 7860
|
| 13 |
ENV DEVICE=cpu
|
README.md
CHANGED
|
@@ -13,5 +13,3 @@ short_description: AI memory that grows without the cost growing
|
|
| 13 |
# μLattice
|
| 14 |
|
| 15 |
AI memory that grows without the cost growing.
|
| 16 |
-
|
| 17 |
-
Three trained models: capacity (8,192 pairs), forgetting (overwrite), realtext (259K real-text retrieval).
|
|
|
|
| 13 |
# μLattice
|
| 14 |
|
| 15 |
AI memory that grows without the cost growing.
|
|
|
|
|
|
experiments/demo_server.py
CHANGED
|
@@ -270,7 +270,7 @@ PAGE = r"""<!doctype html>
|
|
| 270 |
:root{--ink:#1c1e26;--mut:#6b7280;--hair:#e5e7eb;--bg:#fcfcfa;--card:#ffffff;
|
| 271 |
--acc:#2547d0;--ok:#0e8a5f;--bad:#c2413b;--upd:#b07807;--soft:#f4f4f0}
|
| 272 |
*{box-sizing:border-box}
|
| 273 |
-
body{margin:0;background:var(--bg);color:
|
| 274 |
font:15px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Helvetica,Arial,sans-serif;
|
| 275 |
-webkit-font-smoothing:antialiased}
|
| 276 |
.serif{font-family:Charter,Georgia,"Times New Roman",serif}
|
|
@@ -305,10 +305,10 @@ PAGE = r"""<!doctype html>
|
|
| 305 |
.prow .del{border:0;background:none;color:var(--bad);font-size:17px;cursor:pointer;padding:4px}
|
| 306 |
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(128px,1fr));gap:10px;margin:16px 0 4px}
|
| 307 |
.stat{background:var(--soft);border-radius:10px;padding:12px 14px}
|
| 308 |
-
.stat b{display:block;font-size:22px;font-weight:600;font-variant-numeric:tabular-nums}
|
| 309 |
.stat span{font-size:11.5px;color:var(--mut);letter-spacing:.04em;text-transform:uppercase}
|
| 310 |
-
table{width:100%;border-collapse:collapse;font-size:13.5px;margin-top:6px;font-variant-numeric:tabular-nums}
|
| 311 |
-
th{font-size:11.5px;text-transform:uppercase;letter-spacing:.06em;color:
|
| 312 |
border-bottom:1px solid var(--hair);padding:6px 8px}
|
| 313 |
td{padding:6px 8px;border-bottom:1px solid var(--soft)}
|
| 314 |
.y{color:var(--ok);font-weight:600}.n{color:var(--bad);font-weight:600}.updv{color:var(--upd)}
|
|
@@ -325,12 +325,12 @@ PAGE = r"""<!doctype html>
|
|
| 325 |
</style></head><body>
|
| 326 |
|
| 327 |
<header>
|
| 328 |
-
<div class="kicker">
|
| 329 |
<h1 class="serif">μLattice: the growing memory, running</h1>
|
| 330 |
<p class="dek serif">A one-million-parameter lattice mixer that stores associations while it
|
| 331 |
reads, overwrites them on sight, and answers from memory — at constant cost per token.
|
| 332 |
-
This page drives
|
| 333 |
-
<div class="meta" id="meta">
|
| 334 |
</header>
|
| 335 |
<main>
|
| 336 |
|
|
@@ -604,7 +604,7 @@ class H(BaseHTTPRequestHandler):
|
|
| 604 |
|
| 605 |
|
| 606 |
if __name__ == "__main__":
|
| 607 |
-
port = int(os.environ.get("PORT", "
|
| 608 |
# ThreadingHTTPServer: the single-threaded server hangs on browsers'
|
| 609 |
# speculative idle connections (page "loads once, then never again").
|
| 610 |
srv = ThreadingHTTPServer(("0.0.0.0", port), H)
|
|
|
|
| 270 |
:root{--ink:#1c1e26;--mut:#6b7280;--hair:#e5e7eb;--bg:#fcfcfa;--card:#ffffff;
|
| 271 |
--acc:#2547d0;--ok:#0e8a5f;--bad:#c2413b;--upd:#b07807;--soft:#f4f4f0}
|
| 272 |
*{box-sizing:border-box}
|
| 273 |
+
body{margin:0;background:var(--bg);color:#1c1e26;
|
| 274 |
font:15px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Helvetica,Arial,sans-serif;
|
| 275 |
-webkit-font-smoothing:antialiased}
|
| 276 |
.serif{font-family:Charter,Georgia,"Times New Roman",serif}
|
|
|
|
| 305 |
.prow .del{border:0;background:none;color:var(--bad);font-size:17px;cursor:pointer;padding:4px}
|
| 306 |
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(128px,1fr));gap:10px;margin:16px 0 4px}
|
| 307 |
.stat{background:var(--soft);border-radius:10px;padding:12px 14px}
|
| 308 |
+
.stat b{display:block;font-size:22px;font-weight:600;font-variant-numeric:tabular-nums;color:#0e8a5f}
|
| 309 |
.stat span{font-size:11.5px;color:var(--mut);letter-spacing:.04em;text-transform:uppercase}
|
| 310 |
+
table{width:100%;border-collapse:collapse;font-size:13.5px;margin-top:6px;font-variant-numeric:tabular-nums;color:#1c1e26}
|
| 311 |
+
th{font-size:11.5px;text-transform:uppercase;letter-spacing:.06em;color:#6b7280;text-align:left;
|
| 312 |
border-bottom:1px solid var(--hair);padding:6px 8px}
|
| 313 |
td{padding:6px 8px;border-bottom:1px solid var(--soft)}
|
| 314 |
.y{color:var(--ok);font-weight:600}.n{color:var(--bad);font-weight:600}.updv{color:var(--upd)}
|
|
|
|
| 325 |
</style></head><body>
|
| 326 |
|
| 327 |
<header>
|
| 328 |
+
<div class="kicker">Tensorbend Research · Eric E. · live proof · real weights</div>
|
| 329 |
<h1 class="serif">μLattice: the growing memory, running</h1>
|
| 330 |
<p class="dek serif">A one-million-parameter lattice mixer that stores associations while it
|
| 331 |
reads, overwrites them on sight, and answers from memory — at constant cost per token.
|
| 332 |
+
This page drives three trained checkpoints. Every number is measured on request.</p>
|
| 333 |
+
<div class="meta" id="meta">3 models loaded · 4.2M parameters</div>
|
| 334 |
</header>
|
| 335 |
<main>
|
| 336 |
|
|
|
|
| 604 |
|
| 605 |
|
| 606 |
if __name__ == "__main__":
|
| 607 |
+
port = int(os.environ.get("PORT", "7860"))
|
| 608 |
# ThreadingHTTPServer: the single-threaded server hangs on browsers'
|
| 609 |
# speculative idle connections (page "loads once, then never again").
|
| 610 |
srv = ThreadingHTTPServer(("0.0.0.0", port), H)
|