Skip to content

sanil-23/gline-rs-smoke

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gline-rs-smoke

Rust smoke harness for running a GLiNER relex ONNX bundle and decoding both entities and relations.

This is the TinyHumans-side proof harness for:

  • loading an exported gliner-relex ONNX model
  • building the joint <<ENT>> + <<REL>> prompt
  • decoding entity spans
  • decoding rel_idx / rel_logits / rel_mask directly

It does not rely on the stock gline-rs relation pipeline, because the exported relex model uses a different output shape than the token-mode relation helper.

Bundle Resolution

The CLI now resolves the bundle in this order:

  • --model-dir or GLINER_RELEX_MODEL_DIR
  • shared managed cache at ~/.openhuman/models/gliner-relex-large-v0.5-onnx
  • local dev export at _tmp/gliner-export/artifacts/gliner-relex-large-v0.5-onnx
  • automatic download from the TinyHumans GLiNER release into the shared managed cache

That means most developers can just pull the repo and run the command. Manual model setup is only needed if you want to override the bundle location.

The managed bundle contains:

  • model_quantized.onnx or model.onnx
  • tokenizer.json
  • tokenizer_config.json
  • gliner_config.json
  • platform runtime library when available (onnxruntime.dll on Windows, libonnxruntime.dylib on macOS)

Usage

cargo run --release -- `
  --text "Bill Gates co-founded Microsoft in 1975." `
  --entity-label person `
  --entity-label company `
  --relation-label co-founded `
  --relation-label founded

JSON output:

cargo run --release -- `
  --text "Bill Gates co-founded Microsoft in 1975." `
  --entity-label person `
  --entity-label company `
  --relation-label co-founded `
  --relation-label founded `
  --json

Override knobs:

  • GLINER_RELEX_MODEL_DIR
  • GLINER_RELEX_CACHE_DIR
  • GLINER_RELEX_BASE_URL
  • ORT_DYLIB_PATH
  • ORT_LIB_LOCATION

On Windows, the binary will also try to discover onnxruntime.dll from the local UV cache if ORT_DYLIB_PATH is not already set.

Notes

  • This repo is meant to stay small and reproducible.
  • The ONNX model bundle is intentionally not committed to this repo.
  • The upstream GLiNER exporter needed a small GCN normalization patch for the relex model to export cleanly to ONNX.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages