Downloads · 30 days
54
41% of all-time downloads
m1rhan/laya-typed-decisions-ONNX
laya-typed-decisions-ONNX is a fill-mask model from m1rhan. Use it when you need the model to fill a missing word. It is set up for transformers.js. The card lists the license as apache-2.0.
ONNX export of convaiinnovations/laya, typed-decisions checkpoint — a ModernBERT-large encoder (421M params) with a small custom decision head, tuned specifically for typed choice / score / noul decisions (0.766 acc o…
Downloads · 30 days
54
41% of all-time downloads
All-time downloads
133
Public
Repo size
449 MB
Likes
0
Public
Click a slice to open those files.
.onnx449 MB · 99%
From the Hugging Face model README
ONNX export of convaiinnovations/laya, typed-decisions checkpoint — a ModernBERT-large encoder (421M params) with a small custom decision head, tuned specifically for typed choice / score / noul decisions (0.766 acc on that task family). All credit for the model itself goes to the original authors; this repo only adds ONNX conversion and quantization for in-browser (transformers.js / onnxruntime-web / WebGPU) use.
| File | Size | Notes |
|---|---|---|
onnx/model_q4.onnx | 428 MB | 4-bit weight-only quantized (MatMulNBitsQuantizer, block_size=32, symmetric). Verified against 6 real decision fixtures spanning every temperature-calibration bucket: 6/6 argmax matches on both the decision head and the act-gate head. |
Plain fp32 and int8 are not included:
onnxruntime.quantization.quantize_dynamic) fails during its own internal shape-inference pass on this graph (ShapeInferenceError: Inferred shape and existing shape differ in dimension 0: (1028) vs (256)), reproduced identically across two onnxruntime versions (1.23.2, 1.30.0) and two machines. Not a config issue — a real tooling incompatibility with this graph.Where/Gemm op types, blocking MatMulNBits/DynamicQuantizeLinear — and hit the same graph type-consistency error each time (Type (tensor(float16)) ... does not match expected type (tensor(float)) on the model's mixed-type Where output node). Looks like a real bug in onnxconverter_common's handling of this dynamo-exported graph shape, not a one-line fix. Not included.The model takes 5 inputs and returns 2 outputs:
input_ids (int64), attention_mask (int64), marker_pos (int64), marker_mask (bool), qtype (int64, 0=choice/1=score/2=noul)logits (float32, one score per marker), act_logits (float32, 2-way escalate/answer gate)Sequence construction (state + typed instructions + markers) and decode (temperature calibration → softmax → argmax/expected-value) follow the original SDK's build_sequence / Agent.system_one logic — see convaiinnovations/laya for the reference implementation.
torch.onnx.export(..., dynamo=True, dynamic_shapes=<torch.export.Dim-based>, opset_version=18) — the legacy TorchScript exporter (dynamo=False) silently bakes in the traced sequence length despite declaring dynamic_axes, which is a real trap if only verified at one shape. This export is verified across varying real sequence lengths (50–133 tokens) and marker counts (2–14).onnxruntime.quantization.matmul_nbits_quantizer.MatMulNBitsQuantizer.