Repository navigation
Calibration fix for large choice questions, closer parity with upstream laya, and a new answer_confidence field.
Calibration
choicequestions with 11+ options are no longer ~99% confident. The upstream checkpoint shipschoice:11+ = 0.1006, which multiplied those logits by ~10 (#10). The published bundle (receptron/laya-onnx) now uses 0.945, the held-out fit for the English checkpoint (NandhaKishorM/laya#1245). The cached config refreshes on the nextLaya.load()with network access.- Temperatures are clamped to [0.5, 5] at load and again at the point of use, so a malformed bundle or a later edit to
laya.configcannot bypass it. Out-of-range or invalid values print a warning; an invalid per-option entry falls back to the question type's temperature. Bundles withouttemperature_by_options(fine-tuned exports) now load (#11, thanks @kuishou68). export/export_onnx.pyreplaces the known-badchoice:11+value, so a re-export reproduces the published config.
Confidences for 11+ option choice questions intentionally differ from the Python laya package, which clamps the same entry to 0.5.
New
answer_confidenceon every answer (choice,score,noul):max(p), the probability of the reported answer. It is the quantity the temperatures are fitted for and means the same thing across question types, so use it for confidence gating.confidenceonchoice/scoreis still 1 − normalized entropy.
Fixes (parity with upstream laya)
- A single-option
choiceno longer crashes in the ONNX graph's TopK node. - Object
instructionsare serialized with Pythonjson.dumpsseparators, matching the reference tokenization. - A list (conversation) state that does not fit keeps its newest turns, as in training.
Behavior changes
- Duplicate or null labels in a list-form
choice(["a", "a"],["1", 1]) now throw instead of being silently merged into fewer options. - Long array states are truncated from the start instead of the end.
- Answers for object-valued
instructionsshift slightly (they now match Python).
Full changelog: v0.1.2...v0.2.0