Skip to content

armgit / laya

Public Imported from GitHub
0

Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.

docs(examples): example 03 must show the whole usage block it sends readers to

Aashish976880751612
diff --git a/examples/03_reading_the_result.py b/examples/03_reading_the_result.py
index 22505fb4..0a9073e4 100644
--- a/examples/03_reading_the_result.py
+++ b/examples/03_reading_the_result.py
@@ -13,7 +13,9 @@ banner("03", "Reading the result", """
{"model": "laya-rl-agent",
"answers": {<question id>: <answer>, ...},
- "usage": {"input_tokens": <batch total>, "output_tokens": 0}}
+ "usage": {"input_tokens": <batch total>, "output_tokens": 0,
+ "state_tokens": <the whole state>, "state_tokens_dropped": <worst case>,
+ "truncated": <bool>, "truncated_questions": [<question id>, ...]}}
`answers` is keyed by the ids you chose, so glue code can index it directly instead of
zipping a list back onto the questions. Each answer carries a `type` matching its
@@ -22,7 +24,13 @@ banner("03", "Reading the result", """
`usage` is the part readers misread: `input_tokens` is the whole batch, with the state
counted once per question, so it grows with the number of questions rather than being a
- context length. `output_tokens` is always 0 -- Laya never generates text.
+ context length. `output_tokens` is always 0 -- Laya never generates text. The four keys
+ after them are how much of your state the model actually read: `state_tokens` is the whole
+ serialized state, `state_tokens_dropped` the most of it any one question's head gave up,
+ and `truncated` / `truncated_questions` name the questions that gave something up. A seventh
+ key, `options`, appears only when the head budget was tight enough to leave some question's
+ options sharing a token span -- that question can no longer tell those options apart, and
+ `usage["options"]` is where the call says so.
""")
agent = load("english")