Thinking-Jev-RMT / example.py
yixuanzheng's picture
Release v0.1.0: Thinking-Jev Q1 engineering checkpoint (sealed package, unmodified)
bfa7eb6 verified
Raw History Blame Contribute Delete
945 Bytes
from jev_latent import LatentJev
m = LatentJev.from_pretrained(".")
story = ("There are five boxes, numbered 1 to 5. Box 1 holds the red ball. Box 2 holds the blue cube. Box 3 holds the green ring. "
"Box 4 holds the yellow coin. Box 5 holds the white shell.\n"
"The contents of box 1 and box 2 are exchanged.\nThe contents of box 2 and box 5 are exchanged.\nThe contents of box 3 and box 5 are exchanged.\n")
q = {"where": {"type": "choice", "instructions": "After all the swaps, which box holds the red ball?", "criteria": {f"box {b}": None for b in range(1, 6)}}}
for r in m.decide(story, q, max_depth=4)["by_depth"]:
print(r["depth"], r["answers"]["where"]["choice"], r["answers"]["where"]["probabilities"])
# stop and think branches from one saved prefix
s = m.step(m.start(story))
m.save(s, "prefix.safetensors")
s = m.load("prefix.safetensors")
print("stop ", m.answer(s, q))
print("think", m.answer(m.step(s), q))