From 9e487bc2bf4ece65e21f9d8c218796e7efbd77b6 Mon Sep 17 00:00:00 2001 From: Tiara Rodney Date: Tue, 16 Jun 2026 23:49:02 +0200 Subject: [PATCH] docs: refresh module docstrings for the packaged layout and render contract --- src/tiararodney/sekft/eval.py | 15 ++++++++------- src/tiararodney/sekft/resident.py | 6 +++--- src/tiararodney/sekft/sft.py | 4 ++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/tiararodney/sekft/eval.py b/src/tiararodney/sekft/eval.py index b381385..4438134 100644 --- a/src/tiararodney/sekft/eval.py +++ b/src/tiararodney/sekft/eval.py @@ -6,14 +6,15 @@ scenarios with NO scaffold (the trained behaviour must stand on its own), and reports the rates that count: does it reach command-mode, does it terminate, does the checker pass. - python eval.py --base --adapter ./ckpt-mistral-r16 \ - --scenarios ./holdout-scenarios --n 10 + sekft-eval --base --adapter ./ckpt-mistral-r16 \ + --scenarios ./holdout-scenarios --n 10 -Reuses the rollout loop with a *local* operator: the model formats and -generates in the same role-delimited render it was trained on (train == eval == -deploy, or the prompts go out of distribution). Prerequisites on the box: torch -+ transformers + peft, the ``sekft-dash`` image, and held-out SCENARIO bundles -(from ``generate.py`` -- not trajectories; the eval stands up and verifies each). +Reuses the posix-sdc rollout loop with a *local* operator: the model renders and +generates with the same chat template it was trained on (train == eval == serve, +via ``apply_chat_template`` + ``normalize_for_template``, or the prompts go out +of distribution). Prerequisites on the box: torch + transformers + peft, the +``sekft-dash`` image, and held-out SCENARIO bundles from the posix-sdc factory +(not trajectories; the eval stands up and verifies each). """ from __future__ import annotations diff --git a/src/tiararodney/sekft/resident.py b/src/tiararodney/sekft/resident.py index c56979b..c295d48 100644 --- a/src/tiararodney/sekft/resident.py +++ b/src/tiararodney/sekft/resident.py @@ -8,14 +8,14 @@ fresh LoRA adapter on the resident base and ``unload``s it back to clean; each Interactive (IPython on the GPU box) is the intended use: - from resident import Resident + from tiararodney.sekft.resident import Resident r = Resident("~/llm-models/mistral-7b-instruct-v0.2", load_4bit=True) r.fit("~/sekft/trajectories", "~/sekft/ckpt-a", lora_r=16, lr=2e-4, epochs=3) r.evaluate("~/sekft/ckpt-a", "~/sekft/holdout", n=10) r.fit("~/sekft/trajectories", "~/sekft/ckpt-b", lora_r=32) # NO base reload -Or `python resident.py --base --selftest-data ` to prove the -base loads once and two adapters train against it. +Or `sekft-resident --base --selftest-data ` to prove the base +loads once and two adapters train against it. """ from __future__ import annotations diff --git a/src/tiararodney/sekft/sft.py b/src/tiararodney/sekft/sft.py index db5df3b..5ac8633 100644 --- a/src/tiararodney/sekft/sft.py +++ b/src/tiararodney/sekft/sft.py @@ -17,8 +17,8 @@ system role and require strict user/assistant alternation. That same canonicalisation must run on the serving side. Everything else is standard causal-LM SFT with an assistant-only loss mask. - python sft.py --data ./trajectories --base --out ./ckpt - python sft.py --data ./trajectories --base --inspect # mask stats, no training + sekft-train --data ./trajectories --base --out ./ckpt + sekft-train --data ./trajectories --base --inspect # mask stats, no training Training needs torch + transformers + peft (a GPU box). ``--inspect`` and the normalize/mask helpers run anywhere a tokenizer with a chat template is