Views
No views yet
fastino/gliner2-privacy-filter-PII-multi,
the multilingual PII detection model built on GLiNER2 by Fastino AI.gliner2-multi-v1-onnx base release, this repo ships the V2 fused IOBinding variant. Gather, ArgMax, MatMul operations are fused directly into the ONNX graphs so that tensors never leave the GPU/NPU VRAM, bypassing the PCIe bus and cutting inference latency by ~30 % on discrete GPUs.| Variant | Use case | Notes |
|---|---|---|
fp16_v2 (recommended) | NVIDIA CUDA · AMD ROCm · Apple CoreML · Qualcomm QNN | Zero-Copy VRAM (IOBinding), full FP16 IO, fused ops |
fp32_v2 | CPU (AVX2 / XNNPACK / ARM NEON) | High precision V2 fusions for CPU |
fp16 (standard) | Legacy compatible, all EPs | FP32 IO (CoreML-compatible), slower on CUDA due to PCIe round-trips |
fp32 (standard) | Universal fallback | Legacy Float32 |
encoder_{precision}.onnx ~530–1060 MB
token_gather_{precision}.onnx ~ <1 MB
span_rep_{precision}.onnx ~32–63 MB
schema_gather_{precision}.onnx ~ <1 MB
count_pred_argmax_{precision}.onnx ~2–5 MB
count_lstm_fixed_{precision}.onnx ~20–41 MB
scorer_{precision}.onnx ~ <1 MB
classifier_{precision}.onnx ~2–5 MBperson, full_name, first_name, middle_name, last_name, date_of_birthemail, phone_number, address, street_address, city, state_or_region, postal_code, countrygovernment_id, national_id_number, passport_number, drivers_license_number, license_number, tax_id, tax_numberbank_account, account_number, routing_number, iban, payment_card, card_number, card_expiry, card_cvvusername, ip_address, account_id, sensitive_account_idpassword, secret, api_key, access_token, recovery_codesensitive_date, document_date, expiration_date, transaction_dategliner2-rs)1use gliner2_inference::{Gliner2Engine, ModelType, SchemaTask};
2
3// Auto-downloads the V2 FP16 fragments from this HuggingFace repo
4// and switches to the high-performance IOBinding engine.
5let engine = Gliner2Engine::from_pretrained(
6 "jugaadsrl/gliner2-privacy-filter-PII-multi-onnx",
7 Some("fp16_v2"),
8 ModelType::HuggingFace,
9)?;
10
11let text = "Please contact Maria Jensen at maria.jensen@example.dk or +45 20 12 34 56.";
12let tasks = vec![
13 SchemaTask::Entities(vec![
14 "person".into(), "email".into(), "phone_number".into(),
15 ])
16];
17
18let (entities, _, _) = engine.extract(text, &tasks)?;gliner2-rs >= 0.4.1 for automatic V2 detection / IOBinding routing.gliner2-inference, the original engine, which
is the one with from_pretrained and therefore the one that pulls these files
from the Hub for you.gliner2-privacy is the newer alternative: it reads this export's fp16_v2/
layout unchanged, carries the 42 labels below as typed groups, and adds redaction
helpers. It takes a local directory rather than a Hub id.1use gliner2_core::{SpanConfig, SpanEngine};
2use gliner2_privacy::{Group, redact};
3
4let mut engine = SpanEngine::new(SpanConfig::new("path/to/this/export"))?;
5let out = engine.extract(text, &[Group::Person.task(), Group::Contact.task()])?;
6println!("{}", redact(text, &out.entities));onnxruntime)gliner2 dependency needed):1import onnxruntime as ort
2
3# Per fragment (example for the encoder, CUDA backend)
4encoder = ort.InferenceSession(
5 "encoder_fp16_iobinding.onnx",
6 providers=["CUDAExecutionProvider"],
7)
8# ...load the other 7 fragments analogously...
9
10# Chain them via IOBinding (see validate_onnx_v2.py for a full reference impl)gliner2 Python package on fastino/gliner2-privacy-filter-PII-multi; this ONNX repo is optimised for production deployment without Python.encoder_fp16_iobinding.onnx
│
├─ token_gather_fp16_iobinding.onnx
│ └─ span_rep_fp16_iobinding.onnx
│
└─ schema_gather_fp16_iobinding.onnx
├─ count_pred_argmax_fp16_iobinding.onnx → pred_count (int64)
└─ count_lstm_fixed_fp16_iobinding.onnx
└─ scorer_fp16_iobinding.onnx → entity_scores
classifier_fp16_iobinding.onnx (only for classification tasks)count_lstm_fixed exports the GRU unrolled to 20 fixed steps at tracing time → compatible with execution providers that don't support dynamic loops (Apple CoreML, Qualcomm QNN).scorer uses fused Reshape + MatMul + Transpose instead of Einsum for compatibility with QNN/CoreML FP16.fastino/gliner2-privacy-filter-PII-multi by Fastino AI.gliner2-multi-v1-onnx.1@misc{fastino2026gliner2pii,
2 title = {GLiNER2-PII: Multilingual PII Extraction via Synthetic Fine-Tuning},
3 author = {{Fastino AI Team}},
4 year = {2026},
5 url = {https://huggingface.co/fastino/gliner2-privacy-filter-PII-multi}
6}
7
8@inproceedings{zaratiana-etal-2025-gliner2,
9 title = {GLiNER2: Schema-Driven Multi-Task Learning for Structured Information Extraction},
10 author = {Zaratiana, Urchade and Pasternak, Gil and Boyd, Oliver and Hurn-Maloney, George and Lewis, Ash},
11 booktitle = {Proceedings of EMNLP 2025: System Demonstrations},
12 year = {2025}
13}