CoolFace
Modelpublic

Yoctottainc/gliner-relex-large-v1.0-onnx

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes
Model Card

gliner-relex-large-v1.0-onnx

ONNX export of `knowledgator/gliner-relex-large-v1.0`.

The weights are upstream's and unmodified — only the conversion to ONNX is ours. Upstream publishes no ONNX build for this checkpoint, which is the entire reason this repo exists.

Exported with the gliner package's own export_to_onnx rather than a hand-rolled torch.onnx.export, so the graph signature is the one the library itself produces.

Files

tokenizer.json
onnx/model.onnx
gliner_config.json

float32, opset 14, dynamic batch and sequence axes.

Graph signature

inputs : input_ids, attention_mask, words_mask, text_lengths,
         span_idx, span_mask
outputs: logits, rel_idx, rel_logits, rel_mask, entity_spans

Using it from Kaman

rust
OnnxRelexExtractor::load_from_hub("Yoctottainc/gliner-relex-large-v1.0-onnx", "model.onnx").await?

Read this before decoding it yourself

This export carries a fifth output, `entity_spans`, which the stock gliner exporter does not emit. It is not optional.

rel_idx does not index the enumerated span list. Inside the model, select_span_target_embedding compacts the enumerated spans down to those clearing the entity threshold, and rel_idx counts positions in that compacted list. entity_spans (B, E, 2) is the only thing that maps those positions back to word coordinates.

The reference decoder has a fallback for a missing entity_spans: it treats rel_idx as indices into the full span list. For this model that is simply wrong — the two lists differ in length and order — and it fails silently, emitting confident relations between arbitrary pairs of spans. Any decoder reading this graph should refuse to guess when entity_spans is absent.

Known ceiling

The relation head allocates buffers sized by the example the graph was traced on, so there is a maximum number of entities per pass baked in. It was traced on an entity-dense paragraph to push that ceiling as high as tracing allows, but beyond it the graph raises ScatterND ... invalid indice found rather than truncating. Treat a session failure as "fall back to another relation source", not as a fatal error.

Licence

Apache-2.0, inherited from the base model. See `knowledgator/gliner-relex-large-v1.0` for the model card, training data and intended use.