Laya, exported to ONNX

ONNX conversions of Laya by Convai Innovations: a decision model that takes a text (or JSON) and typed questions and returns calibrated probabilities over each question's options in a single forward pass, without generating text.

They exist for Layar, a Ruby gem that runs Laya with ONNX Runtime and downloads these files on first use. All credit for the models goes to Convai Innovations; this repository only changes their file format.

Folder Source checkpoint Encoder Size
multilingual/ convaiinnovations/laya, subfolder multilingual mmBERT-base 1.3 GB
english/ convaiinnovations/laya, repository root ModernBERT-large 1.7 GB

Source revision: 55cf4c4ebb4ebe31b2550e8bdf3bd21b99753851.

Each folder holds model.onnx + model.onnx.data (weights), plus tokenizer.json, tokenizer_config.json and rl_agent_config.json copied from the source checkpoint.

Using them

From Ruby:

gem "layar"
Layar.choice("I was charged twice this month", options: %w[billing bug account])  # downloads multilingual/

From anything else with ONNX Runtime: the model takes input_ids, attention_mask, marker_pos, marker_mask and qtype and returns logits (per option) and act_logits. Inputs must be built exactly as the laya Python package does (laya.common.build_sequence); Layar's lib/layar/laya.rb is a Ruby port.

Conversion and checks

Exported with script/laya/export.py (torch.onnx.export with dynamo=True, dynamic batch, sequence and option dimensions, opset 18). Checked against the PyTorch models with script/laya/parity.py: option probabilities agree to within 2e-6, including a 931-token input and a batch mixing choice, yes/no and score questions. Layar's Ruby port reproduces the Python package's token ids exactly and its probabilities to within 3e-6.

Licence

Apache-2.0, as the source models. See LICENSE and NOTICE.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for distinctinteractive/laya-onnx

Quantized
(36)
this model