docs: refresh module docstrings for the packaged layout and render contract
This commit is contained in:
parent
a0b1fbc0c1
commit
9e487bc2bf
3 changed files with 13 additions and 12 deletions
|
|
@ -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,
|
reports the rates that count: does it reach command-mode, does it terminate,
|
||||||
does the checker pass.
|
does the checker pass.
|
||||||
|
|
||||||
python eval.py --base <hf-dir> --adapter ./ckpt-mistral-r16 \
|
sekft-eval --base <hf-dir> --adapter ./ckpt-mistral-r16 \
|
||||||
--scenarios ./holdout-scenarios --n 10
|
--scenarios ./holdout-scenarios --n 10
|
||||||
|
|
||||||
Reuses the rollout loop with a *local* operator: the model formats and
|
Reuses the posix-sdc rollout loop with a *local* operator: the model renders and
|
||||||
generates in the same role-delimited render it was trained on (train == eval ==
|
generates with the same chat template it was trained on (train == eval == serve,
|
||||||
deploy, or the prompts go out of distribution). Prerequisites on the box: torch
|
via ``apply_chat_template`` + ``normalize_for_template``, or the prompts go out
|
||||||
+ transformers + peft, the ``sekft-dash`` image, and held-out SCENARIO bundles
|
of distribution). Prerequisites on the box: torch + transformers + peft, the
|
||||||
(from ``generate.py`` -- not trajectories; the eval stands up and verifies each).
|
``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
|
from __future__ import annotations
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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:
|
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 = 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.fit("~/sekft/trajectories", "~/sekft/ckpt-a", lora_r=16, lr=2e-4, epochs=3)
|
||||||
r.evaluate("~/sekft/ckpt-a", "~/sekft/holdout", n=10)
|
r.evaluate("~/sekft/ckpt-a", "~/sekft/holdout", n=10)
|
||||||
r.fit("~/sekft/trajectories", "~/sekft/ckpt-b", lora_r=32) # NO base reload
|
r.fit("~/sekft/trajectories", "~/sekft/ckpt-b", lora_r=32) # NO base reload
|
||||||
|
|
||||||
Or `python resident.py --base <dir> --selftest-data <stub_dir>` to prove the
|
Or `sekft-resident --base <dir> --selftest-data <stub_dir>` to prove the base
|
||||||
base loads once and two adapters train against it.
|
loads once and two adapters train against it.
|
||||||
"""
|
"""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
canonicalisation must run on the serving side. Everything else is standard
|
||||||
causal-LM SFT with an assistant-only loss mask.
|
causal-LM SFT with an assistant-only loss mask.
|
||||||
|
|
||||||
python sft.py --data ./trajectories --base <hf-model-dir> --out ./ckpt
|
sekft-train --data ./trajectories --base <hf-model-dir> --out ./ckpt
|
||||||
python sft.py --data ./trajectories --base <dir> --inspect # mask stats, no training
|
sekft-train --data ./trajectories --base <dir> --inspect # mask stats, no training
|
||||||
|
|
||||||
Training needs torch + transformers + peft (a GPU box). ``--inspect`` and the
|
Training needs torch + transformers + peft (a GPU box). ``--inspect`` and the
|
||||||
normalize/mask helpers run anywhere a tokenizer with a chat template is
|
normalize/mask helpers run anywhere a tokenizer with a chat template is
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue