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(hooks): the mental model must name all six lifecycle methods

Adeshina Lasisi2496b493dc97
diff --git a/docs/hooks/index.md b/docs/hooks/index.md
index f4b23393..f904adfa 100644
--- a/docs/hooks/index.md
+++ b/docs/hooks/index.md
@@ -74,10 +74,11 @@ There are three ideas.
1. **A hook is a callable or an object.** A plain function is convenient for one event; an
object is convenient for several. Only the object form goes to `hooks=` -- a plain callable
- there is refused at construction, because `hooks=` reads for lifecycle methods (`on_route`,
- `on_load`, `on_evict`, `on_predict_start`, `on_predict_end`) and a bare function has none of
- them. Pass a plain callable as `on_predict_start=` or `on_predict_end=`; those are the
- single-event parameters, so a callable is exactly what they take.
+ there is refused at construction, because `hooks=` reads for the six lifecycle methods
+ (`on_predict_start`, `on_predict_end`, `on_route`, `on_load`, `on_evict`, `on_error`) and a
+ bare function has none of them. Pass a plain callable as `on_predict_start=` or
+ `on_predict_end=`; those are the single-event parameters, so a callable is exactly what they
+ take.
2. **Every hook of one call shares one mutable `PredictContext`.** It carries the states,
questions, results, routing decision, model name, usage, timing and any error. A call can carry