Instructions to use Foreverstorm/radiochat-laya-multilingual-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use Foreverstorm/radiochat-laya-multilingual-onnx with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Laya multilingual β ONNX, 8-bit (for in-browser moderation)
A browser-ready export of convaiinnovations/laya-multilingual
(revision e4e9ddf21a7b1903b7acffd8814ad4307bf63a67), the multilingual
checkpoint of Laya by Convai Innovations β a non-autoregressive decision
model that answers typed questions (choice, score, yes/no) in one forward
pass. All credit for the model goes to its authors; see the
Laya repository. Licensed Apache-2.0,
like the original.
Used by RadioChat to moderate chat messages on the user's own device.
Files
The split layout that laya-ts loads:
| file | size | contents |
|---|---|---|
encoder.onnx |
250 MB | mmBERT-base encoder β 8-bit weight-only layers (MatMulNBits, block 32), 4-bit vocabulary table (GatherBlockQuantized, block 32) |
head.onnx |
28 MB | decision head β 8-bit weight-only |
tokenizer.json, rl_agent_config.json |
unchanged from the checkpoint |
How it was made
laya-ts/scripts/export_onnx.py --repo convaiinnovations/laya-multilingual(laya commit9d95567), which checks the ONNX outputs against PyTorch (max logit difference ~2e-6).- ONNX Runtime 1.30
MatMulNBitsQuantizer(symmetric, block 32): MatMul weights 8-bit, the token-embedding Gather 4-bit; the head's MatMuls 8-bit. Each file is saved without external data (the browser loader fetches one file per graph).
Accuracy vs the full-precision model
Measured with laya-ts on onnxruntime-web (WASM) over 80 hand-labelled chat
messages Γ 2 moderation decisions (offensive?, spam?):
| variant | encoder | agrees with full model | correct vs labels |
|---|---|---|---|
| full precision | 1.17 GB | 160/160 | 152/160 |
| this (8-bit layers, 4-bit vocabulary, 8-bit head) | 250 MB | 158/160 | 150/160 |
| 4-bit layers | 195 MB | 153/160 | 146/160 |
4-bit layers cost clearly more accuracy; ONNX Runtime can't run 3-bit weights.
Model tree for Foreverstorm/radiochat-laya-multilingual-onnx
Base model
convaiinnovations/laya-multilingual