onnxruntime instead of PyTorch.keep_io_types=True)model_fp16.onnx + model_fp16.onnx_data)1from gliner import GLiNER
2
3model = GLiNER.from_pretrained(
4 "peterchou26/gliner-pii-onnx",
5 load_onnx_model=True,
6 load_tokenizer=True,
7 onnx_model_file="model_fp16.onnx",
8)
9ents = model.predict_entities(text, labels=[...], threshold=0.5)| File | Purpose |
|---|---|
model_fp16.onnx | ONNX graph (small — references external weights) |
model_fp16.onnx_data | fp16 weight tensors (must sit next to the .onnx) |
gliner_config.json | GLiNER head config (labels, max_len, max_width) |
tokenizer.json, tokenizer_config.json | DeBERTa-v3 sentencepiece tokenizer |
export_gliner_onnx.py in
id-scrubber-bundle:GLiNER.from_pretrained("nvidia/gliner-pii").model.export_to_onnx(...) → fp32 model.onnx.onnxruntime.transformers.float16.convert_float_to_float16(..., keep_io_types=True) → model_fp16.onnx.