From 99b50695bdaa1d1a3b5e59addd30ae0902db68b1 Mon Sep 17 00:00:00 2001 From: wassname <1103714+wassname@users.noreply.github.com> Date: Fri, 10 Jul 2026 19:24:51 +0800 Subject: [PATCH] config: docstrings say default is pre-fitted RAW lens, chat_corpus is fallback-only Fresh-eyes caught stale framing: the module/chat_corpus docstrings still sold chat- templated fitting as the corpus convention. The default demo path now loads the authors' pre-fitted raw-wikitext lens; chat_corpus only feeds the local-fit fallback, and chat-vs-raw was never compared head-to-head (run-524 used chat), so it's flagged unresolved rather than claimed better. Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com> --- config.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/config.py b/config.py index 0611352..8cfb5b4 100644 --- a/config.py +++ b/config.py @@ -1,10 +1,10 @@ -"""Repo-local paths, slug/cache conventions, and the fit corpus, shared by -scripts/ and notebooks. +"""Repo-local paths, slug/cache conventions, and the pre-fitted lens map, shared +by scripts/ and notebooks. NOT imported by the jsteer library (which stays path-agnostic so `pip install -jsteer` never needs a repo root). The corpus content is jlens's own WikiText -(`load_wikitext_prompts`, not hand-rolled), but wrapped in the model's chat -template -- see chat_corpus for why. +jsteer` never needs a repo root). The default demo path LOADS a pre-fitted lens +(HUB_LENS_FILE, raw Salesforce-wikitext); chat_corpus is only for the local-fit +fallback (scripts/fit.py) and is an untested alternative to raw -- see its docstring. """ from pathlib import Path @@ -49,10 +49,13 @@ def hub_lens_file(model_name: str) -> str: def chat_corpus(tok, n_prompts: int) -> list[str]: - """jlens's WikiText prompts wrapped in the chat template. Fitting on chat- - formatted text (not raw documents) puts J closer to the distribution the - model steers in; run-524's verified vectors were fit this way too. Called - via a lambda in fit_cached, so it only downloads WikiText on a cache miss.""" + """jlens's WikiText prompts wrapped in the chat template, for the LOCAL-FIT + fallback only (the default demo path loads the authors' pre-fitted RAW-wikitext + lens). Hypothesis: fitting on chat-formatted text puts J closer to the + distribution we steer in; run-524's verified vectors were fit this way, but it + was never compared head-to-head with a raw fit, so treat chat-vs-raw as + unresolved. Called via a lambda in fit_cached, so WikiText only downloads on a + cache miss.""" from jlens.examples import load_wikitext_prompts return [tok.apply_chat_template([{"role": "user", "content": p}], add_generation_prompt=True, tokenize=False,