Instructions to use Samy0f/laya-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use Samy0f/laya-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 (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 withlaya-ts/scripts/export_onnx.py --repo convaiinnovations/laya. That givesencoder.onnxandhead.onnx.tokenizer.jsonandrl_agent_config.jsonare copied unchanged. - Patched to run on DirectML. PyTorch's ONNX exporter writes every reshape as a
Reshapenode withallowzero=1, which onnxruntime's DirectML provider rejects. The flag was cleared on eachReshapewhose target shape can't contain a literal0. This doesn't change the output for any non-empty input. Only the two small.onnxgraphs were edited; the.onnx.dataweights 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.
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support
Model tree for Samy0f/laya-onnx
Base model
convaiinnovations/laya