Move EEG panels below chat and analysis
Browse files
AGENTS.md
CHANGED
|
@@ -159,7 +159,7 @@ Main project badge paths (brain pivot):
|
|
| 159 |
|
| 160 |
- **Modal** `gemma-brain` app β two classes `BaseGemma` + `OblitGemma` (L40S), each loads its model + precomputed brain bundle, streams `fire`/`token`/`done` SSE. Hook path `model.language_model.layers`, hooks [12,24,36].
|
| 161 |
- **Interpreter** `activation-brain-interpreter` Modal app β serves the published `build-small-hackathon/activation-brain-interpreter` LoRA adapter on `mistralai/Ministral-8B-Instruct-2410`; `/api/analyze` proxies prompt + both responses + baseline-corrected deltas + native meters to generate varied plain-English analysis. Deterministic frontend analysis remains fallback.
|
| 162 |
-
- **Frontend** `brain_app.py` (Gradio + FastAPI) β per-model same-origin proxy routes `/api/{neurons,init,stream}/{model}` plus `/api/analyze`, serves `static/brain_engine.js` (dual EEG + comparison analysis UI). **Dual concurrent mode (no dropdown):** one Send opens TWO parallel SSE streams (base + oblit); each drives its own EEG strip (right column), both model responses are shown labeled in chat
|
| 163 |
- **Fingerprints** built by `fingerprint_model.py` (model-agnostic; shared UMAP fit on base, transform on oblit) β `gemma4_{base,oblit}_{neurons.json,brain_bundle.pt}` on Modal volume `avatars-cache`.
|
| 164 |
- Note: Gradio mounts `gr.HTML` asynchronously, so `brain_engine.js` must poll for `#ab-brain` before init (boot poller) β otherwise the canvas stays blank.
|
| 165 |
|
|
|
|
| 159 |
|
| 160 |
- **Modal** `gemma-brain` app β two classes `BaseGemma` + `OblitGemma` (L40S), each loads its model + precomputed brain bundle, streams `fire`/`token`/`done` SSE. Hook path `model.language_model.layers`, hooks [12,24,36].
|
| 161 |
- **Interpreter** `activation-brain-interpreter` Modal app β serves the published `build-small-hackathon/activation-brain-interpreter` LoRA adapter on `mistralai/Ministral-8B-Instruct-2410`; `/api/analyze` proxies prompt + both responses + baseline-corrected deltas + native meters to generate varied plain-English analysis. Deterministic frontend analysis remains fallback.
|
| 162 |
+
- **Frontend** `brain_app.py` (Gradio + FastAPI) β per-model same-origin proxy routes `/api/{neurons,init,stream}/{model}` plus `/api/analyze`, serves `static/brain_engine.js` (dual EEG + comparison analysis UI). **Dual concurrent mode (no dropdown):** one Send opens TWO parallel SSE streams (base + oblit); each drives its own EEG strip (right column), both model responses are shown labeled in chat; the top row places chat/stats beside the live plain-English comparison-analysis card, and the two EEG/model panels sit beneath them; the analysis emphasizes what the divergence means for tone, warmth, caution, uncertainty, and shared-manifold trajectory rather than only listing metric values. Each EEG includes baseline-corrected emotion activation deltas (positive excess over the first 8 fire events of that response, not argmax counts) plus a calibrated baseline-corrected model-native state meter derived from live weights: uniform 0β100 Valence, Activation, Uncertainty, Constraint, activity-gated Conflict, and Warmth. `mdLite()` renders safe markdown + collapses degenerate loops. `/api/stream/{model}` uses an immediate SSE heartbeat and non-buffered synchronous upstream streaming so HF/Gradio proxies open the response before Modal emits first tokens.
|
| 163 |
- **Fingerprints** built by `fingerprint_model.py` (model-agnostic; shared UMAP fit on base, transform on oblit) β `gemma4_{base,oblit}_{neurons.json,brain_bundle.pt}` on Modal volume `avatars-cache`.
|
| 164 |
- Note: Gradio mounts `gr.HTML` asynchronously, so `brain_engine.js` must poll for `#ab-brain` before init (boot poller) β otherwise the canvas stays blank.
|
| 165 |
|