mirror of
https://github.com/wassname/jsteer.git
synced 2026-10-28 15:51:34 +08:00
User: dont fabricate think tokens; show raw so it's debuggable. The chat template already emits real <think>/</think> -- parsing them out and re-wrapping with my own tags hid the raw text and invented tokens. Now decode with special tokens on and print the model's output verbatim (real <think>, <|im_end|>). Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
16 lines
678 B
Python
16 lines
678 B
Python
"""jsteer: fit a model's full Jacobian once, then steer any word or persona.
|
|
|
|
from jsteer import Jacobian
|
|
jac = Jacobian.fit(model, tok, prompts) # expensive, once, cacheable
|
|
v = jac.word_vector(model, tok, ["authority"]) # instant matvec
|
|
with v(model, C=8): # steering-lite runtime
|
|
model.generate(**inputs)
|
|
"""
|
|
from . import applies # noqa: F401 -- registers methods into steering-lite's REGISTRY
|
|
from .demo import chat_input, show_steer
|
|
from .jacobian import Jacobian
|
|
from .vjp import pullback_vjp, word_vector_vjp
|
|
|
|
__all__ = ["Jacobian", "pullback_vjp", "word_vector_vjp",
|
|
"show_steer", "chat_input"]
|