nicolasembleton/gliner2.5-small-v1-onnx

Model

gliner2.5-small-v1-onnx

1

13 commits

1 linked in READMEs

updated Aug 27, 2026

See the code

README

gliner2.5-small-v1-onnx

ONNX export of fastino/gliner2.5-small-v1 (GLiNER 2.5 BoundaryExtractor) for onnxruntime-web / WebGPU. Revision 5 graphs plus attrs.onnx (score_explicit_spans).

One encoder pass. JointIE beam, classification implies/excludes, record assignment, and long-document chunking stay in JavaScript.

Host: Pastel-Org/gliner2.5-onnx-webgpu (live: gliner25-onnx-webgpu.pages.dev).

Files

FileRoleSize
onnx/model.onnxEncoder + entity pair path + classifier + text_states + candidate_states288.5 MB
onnx/heads.onnxSparseRelationScorer only (no encoder)5.9 MB
onnx/records.onnxRecordHead assignment (inst/field/cand projections + null column)0.60 MB
onnx/attrs.onnxscore_explicit_spans (dynamo; pad 512/8/16)5.80 MB

attrs.onnx

Dynamo export of head.score_explicit_spans. Traced at 512 words, 8 attribute queries, 16 spans. The JS host crops a 512-word window around the mention; that pad is not a document-length cap. ORT vs torch RMSE ~1e-6 (small) / ~2e-6 (base, multi). Overlay lookup is the fallback if this graph fails to load.

Decode notes (JS host, not this graph)

Attribute labels are packed with entity labels in one [E] block (sorted). Single-label attributes use softmax. ONNX pair_valid is all-true; the host drops start >= end slots before overlap.

Python max_len is 4096 words: classify_text / extract is one forward pass over the whole document. That is what Fastino means by long-context classification on CUDA/CPU.

This WebGPU export is not that:

CallWords in one GPU runMeasured here (M2 Max, onnxruntime-web)
classify_text / extractthe whole string (cap 4096)small finished 4096 words. base and multi died between 3500 and 3600 (createCommandEncoder / std::bad_alloc).
classify_text_long / extract_entities_long384, overlap 644096-word docs: 13 windows. base 2.75 s, multi 4.3 s. Merge is max-confidence (classify) or span overlap (NER).

A 4096-word classify_text_long never builds a 4096-word attention matrix. Use the *_long APIs for contracts on base/multi in the browser.

Still not in ONNX

Full Kleene classification AST is not ported; README implies / excludes is a JS beam. Latent / anchorless records are not exported.

Credits

boundary
gliner2
gliner2.5
onnx
relation-extraction
text-classification
token-classification
webgpu

nicolasembleton/gliner2.5-small-v1-onnx

Model

gliner2.5-small-v1-onnx

1

13 commits

1 linked in READMEs

updated Aug 27, 2026

See the code

README

gliner2.5-small-v1-onnx

ONNX export of fastino/gliner2.5-small-v1 (GLiNER 2.5 BoundaryExtractor) for onnxruntime-web / WebGPU. Revision 5 graphs plus attrs.onnx (score_explicit_spans).

One encoder pass. JointIE beam, classification implies/excludes, record assignment, and long-document chunking stay in JavaScript.

Host: Pastel-Org/gliner2.5-onnx-webgpu (live: gliner25-onnx-webgpu.pages.dev).

Files

FileRoleSize
onnx/model.onnxEncoder + entity pair path + classifier + text_states + candidate_states288.5 MB
onnx/heads.onnxSparseRelationScorer only (no encoder)5.9 MB
onnx/records.onnxRecordHead assignment (inst/field/cand projections + null column)0.60 MB
onnx/attrs.onnxscore_explicit_spans (dynamo; pad 512/8/16)5.80 MB

attrs.onnx

Dynamo export of head.score_explicit_spans. Traced at 512 words, 8 attribute queries, 16 spans. The JS host crops a 512-word window around the mention; that pad is not a document-length cap. ORT vs torch RMSE ~1e-6 (small) / ~2e-6 (base, multi). Overlay lookup is the fallback if this graph fails to load.

Decode notes (JS host, not this graph)

Attribute labels are packed with entity labels in one [E] block (sorted). Single-label attributes use softmax. ONNX pair_valid is all-true; the host drops start >= end slots before overlap.

Python max_len is 4096 words: classify_text / extract is one forward pass over the whole document. That is what Fastino means by long-context classification on CUDA/CPU.

This WebGPU export is not that:

CallWords in one GPU runMeasured here (M2 Max, onnxruntime-web)
classify_text / extractthe whole string (cap 4096)small finished 4096 words. base and multi died between 3500 and 3600 (createCommandEncoder / std::bad_alloc).
classify_text_long / extract_entities_long384, overlap 644096-word docs: 13 windows. base 2.75 s, multi 4.3 s. Merge is max-confidence (classify) or span overlap (NER).

A 4096-word classify_text_long never builds a 4096-word attention matrix. Use the *_long APIs for contracts on base/multi in the browser.

Still not in ONNX

Full Kleene classification AST is not ported; README implies / excludes is a JS beam. Latent / anchorless records are not exported.

Credits

boundary
gliner2
gliner2.5
onnx
relation-extraction
text-classification
token-classification
webgpu