Installation
GLiFormer requires Python 3.10 or newer. Install the framework from PyPI:
pip install gliformer
The installation includes PyTorch, Transformers, and Pydantic. CPU inference uses eager attention. To install the optional CUDA attention kernels:
pip install "gliformer[flash]"
Optional Dependencies
Install extras for the features you need:
| Extra | Purpose |
|---|---|
flash | FlashDeBERTa attention support |
data | Dataset loading with Hugging Face Datasets |
pdf | PDF processing with PyMuPDF and pdfplumber |
demo | Gradio demos and comparison models |
vision | Torchvision utilities |
audio | Torchaudio utilities |
dev | pytest and Ruff |
all | All optional dependencies |
For example, to install the demo and PDF utilities:
pip install "gliformer[demo,pdf]"
Optional packages supply framework utilities; tasks also require a checkpoint trained with the corresponding heads.
Continue with the Quickstart to load Base v1 or Large v1.