Laya (English) in ONNX

This is an ONNX export of the English checkpoint of convaiinnovations/laya, split into an encoder and a head the way laya-ts loads them. All credit for the model goes to its original authors. This repo only converts it.

Files

File Size SHA-256
encoder.onnx 3,434,607 12c8b0524467ff3c87cb8c5dcb60a5b47ece7aafe1571cb19c71b28bed2ce6cc
encoder.onnx.data 1,579,126,784 61a1014ece2bd0731b33f9d162e9d3e55ee8d1e311ee2318c422b53b75d117bc
head.onnx 297,983 a90dbacfdef90b939d009a83fa9948a5a1e61b5b778b32a94084569e369cc4fc
head.onnx.data 106,048,512 50b9932eba4d97fb2ca965a9262ea55ee126f260052871bd78a8f3a44e18a5a0
rl_agent_config.json 745 ae287b56bbcf5f8c4f4541ae9dfd00c914c4c48b940b8398c3058af37ba92bbd
tokenizer.json 3,583,228 6c8aaa9a542084f2457eab775d4eeb51f92a70c0fd9de28d5edb0ddec3c08d30

The .onnx files are the graphs, and their weights are in the .onnx.data files next to them. Keep all six files in one folder.

Changes from the original

  • Converted to ONNX. model.safetensors (English checkpoint) was exported with laya-ts/scripts/export_onnx.py --repo convaiinnovations/laya. That gives encoder.onnx and head.onnx. tokenizer.json and rl_agent_config.json are copied unchanged.
  • Patched to run on DirectML. PyTorch's ONNX exporter writes every reshape as a Reshape node with allowzero=1, which onnxruntime's DirectML provider rejects. The flag was cleared on each Reshape whose target shape can't contain a literal 0. This doesn't change the output for any non-empty input. Only the two small .onnx graphs were edited; the .onnx.data weights are as exported.

Use

With laya-ts, point Agent.load at the folder holding the six files:

import { Agent, Router } from "laya-ts";

const agent = await Agent.load("path/to/laya", { device: "cpu" }); // or "dml" / "cuda"
const router = new Router({ default: "english" });
router.attach("english", agent);

License

Apache License 2.0, the same as the original model. See LICENSE.

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 Samy0f/laya-onnx

Quantized
(97)
this model