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.

Merge pull request #936 from sathariels/fix/ts-predict-batch-hook-options

Nandakishor20f294f014cd
diff --cc laya-ts/src/router.ts
index 8ad6b7e0,d3654153..a5cd0e6a
--- a/laya-ts/src/router.ts
+++ b/laya-ts/src/router.ts
@@@ -762,10 -769,10 +769,12 @@@ export class Router extends HookRegistr
}
const results: (RoutedResult | null)[] = new Array(requests.length).fill(null);
- // Same composition and raise policy as `predict`. `routeBatch` has already validated
- // `opts.hooks`; start/end are validated here, after routing and before any checkpoint loads.
+ // `composeHooks`, not `this.hooks`: `setDefaultHooks` defaults, then installed hooks,
- // then per-call `opts.hooks`. The instance list alone would drop every default `predict` keeps.
- const active = composeHooks(this.hooks, opts.hooks);
- const raiseErrors = this.hooksRaise;
++ // then per-call `opts.hooks`, then `opts.onPredictStart` / `opts.onPredictEnd`. The instance
++ // list alone would drop every default `predict` keeps. `routeBatch` has already validated
++ // `opts.hooks`; start and end are validated here, after routing and before a checkpoint loads.
+ const active = composeHooks(this.hooks, opts.hooks, opts.onPredictStart, opts.onPredictEnd);
+ const raiseErrors = opts.hooksRaise ?? this.hooksRaise;
for (const [modelName, indices] of groups) {
const agent = (await this.load(modelName)) as {