mirror of
https://github.com/onestardao/WFGY.git
synced 2026-04-29 20:20:01 +00:00
Update example_01_basic_run.py
This commit is contained in:
parent
86ff90973b
commit
2108c8a6cc
1 changed files with 21 additions and 24 deletions
|
|
@ -1,29 +1,26 @@
|
||||||
from wfgy_core import WFGYRunner
|
# example_01_basic_run.py
|
||||||
|
# Basic WFGY smoke test (local, deterministic)
|
||||||
|
# Run: python examples/example_01_basic_run.py
|
||||||
|
|
||||||
# Create the runner
|
import numpy as np
|
||||||
runner = WFGYRunner()
|
import wfgy_sdk as w
|
||||||
|
|
||||||
# Test prompt
|
|
||||||
prompt = "Why don't AIs like to take showers?"
|
prompt = "Why don't AIs like to take showers?"
|
||||||
|
# Mock semantic vectors (demo purpose only)
|
||||||
|
I = np.random.randn(64)
|
||||||
|
G = np.random.randn(64)
|
||||||
|
logits = np.random.randn(32000)
|
||||||
|
|
||||||
# Run the model
|
engine = w.get_engine(reload=True) # singleton; debug ON by default
|
||||||
result = runner.run(prompt)
|
state = engine.run(
|
||||||
|
input_vec=I,
|
||||||
|
ground_vec=G,
|
||||||
|
logits=logits,
|
||||||
|
return_all=True
|
||||||
|
)
|
||||||
|
|
||||||
# Output results
|
print("\n=== Prompt ===")
|
||||||
print("=== Prompt ===")
|
print(prompt)
|
||||||
print(result["prompt"])
|
print("=== Modulated logits (slice) ===")
|
||||||
|
print(state["logits_mod"][:10])
|
||||||
print("=== Output ===")
|
print(f"=== Residue ‖B‖ = {state['B_norm']:.4f} | f_S = {state['f_S']:.4f} | collapse = {state['_collapse']}")
|
||||||
print(result["output"])
|
|
||||||
|
|
||||||
print("=== BBMC Residue ===")
|
|
||||||
print(result["BBMC_residue"])
|
|
||||||
|
|
||||||
print("=== BBPF Paths ===")
|
|
||||||
print(result["BBPF_paths"])
|
|
||||||
|
|
||||||
print("=== BBCR Reset State ===")
|
|
||||||
print(result["BBCR_reset_state"])
|
|
||||||
|
|
||||||
print("=== BBAM Modulated ===")
|
|
||||||
print(result["BBAM_modulated"])
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue