Downloads · 30 days
29
15% of all-time downloads
mircq/GLINER-INT8
GLINER-INT8 is a machine learning model from mircq. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for gliner2-onnx. The card lists the license as mit.
Experimental ONNX build - Unofficial ONNX export of fastino/gliner2-multi-v1.
Downloads · 30 days
29
15% of all-time downloads
All-time downloads
189
Public
Repo size
382 MB
Likes
0
Public
Click a slice to open those files.
.onnx365 MB · 96%
From the Hugging Face model README
Experimental ONNX build - Unofficial ONNX export of fastino/gliner2-multi-v1.
GLiNER2 ONNX runtime for Python. Runs GLiNER2 models without PyTorch.
This library is experimental. The API may change between versions.
All other GLiNER2 features such as JSON export are not supported.
pip install gliner2-onnx
from gliner2_onnx import GLiNER2ONNXRuntime
runtime = GLiNER2ONNXRuntime.from_pretrained("lmo3/gliner2-large-v1-onnx")
entities = runtime.extract_entities(
"John works at Google in Seattle",
["person", "organization", "location"]
)
# [
# Entity(text='John', label='person', start=0, end=4, score=0.98),
# Entity(text='Google', label='organization', start=14, end=20, score=0.97),
# Entity(text='Seattle', label='location', start=24, end=31, score=0.96)
# ]
from gliner2_onnx import GLiNER2ONNXRuntime
runtime = GLiNER2ONNXRuntime.from_pretrained("lmo3/gliner2-large-v1-onnx")
# Single-label classification
result = runtime.classify(
"Buy milk from the store",
["shopping", "work", "entertainment"]
)
# {'shopping': 0.95}
# Multi-label classification
result = runtime.classify(
"Buy milk and finish the report",
["shopping", "work", "entertainment"],
threshold=0.3,
multi_label=True
)
# {'shopping': 0.85, 'work': 0.72}
To use CUDA for GPU acceleration:
runtime = GLiNER2ONNXRuntime.from_pretrained(
"lmo3/gliner2-large-v1-onnx",
providers=["CUDAExecutionProvider", "CPUExecutionProvider"]
)
Both FP32 and FP16 models are supported. Only the requested precision is downloaded.
runtime = GLiNER2ONNXRuntime.from_pretrained(
"lmo3/gliner2-large-v1-onnx",
precision="fp16"
)
Pre-exported ONNX models:
| Model | HuggingFace |
|---|---|
| gliner2-large-v1 | lmo3/gliner2-large-v1-onnx |
| gliner2-multi-v1 | lmo3/gliner2-multi-v1-onnx |
Note: gliner2-base-v1 is not supported (uses a different architecture).
To export your own models, clone the repository and use make:
git clone https://github.com/lmoe/gliner2-onnx
cd gliner2-onnx
# FP32 only
make onnx-export MODEL=fastino/gliner2-large-v1
# FP32 + FP16
make onnx-export MODEL=fastino/gliner2-large-v1 QUANTIZE=fp16
Output is saved to model_out/<model-name>/.
For Node.js, see @lmoe/gliner-onnx.js.
MIT