Skip to main content

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:

ExtraPurpose
flashFlashDeBERTa attention support
dataDataset loading with Hugging Face Datasets
pdfPDF processing with PyMuPDF and pdfplumber
demoGradio demos and comparison models
visionTorchvision utilities
audioTorchaudio utilities
devpytest and Ruff
allAll 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.