ONNX
Safetensors
GGUF
GLiNER2
antfly-inference
extractor
deberta
named-entity-recognition
zero-shot
relation-extraction
structured-extraction
antfly
Instructions to use antflydb/gliner2-base-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- GLiNER2
How to use antflydb/gliner2-base-v1 with GLiNER2:
from gliner2 import GLiNER2 model = GLiNER2.from_pretrained("antflydb/gliner2-base-v1") # Extract entities text = "Apple CEO Tim Cook announced iPhone 15 in Cupertino yesterday." result = extractor.extract_entities(text, ["company", "person", "product", "location"]) print(result) - llama-cpp-python
How to use antflydb/gliner2-base-v1 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="antflydb/gliner2-base-v1", filename="gliner2-encoder.Q4_K.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use antflydb/gliner2-base-v1 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf antflydb/gliner2-base-v1 # Run inference directly in the terminal: llama cli -hf antflydb/gliner2-base-v1
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf antflydb/gliner2-base-v1 # Run inference directly in the terminal: llama cli -hf antflydb/gliner2-base-v1
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf antflydb/gliner2-base-v1 # Run inference directly in the terminal: ./llama-cli -hf antflydb/gliner2-base-v1
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf antflydb/gliner2-base-v1 # Run inference directly in the terminal: ./build/bin/llama-cli -hf antflydb/gliner2-base-v1
Use Docker
docker model run hf.co/antflydb/gliner2-base-v1
- LM Studio
- Jan
- Ollama
How to use antflydb/gliner2-base-v1 with Ollama:
ollama run hf.co/antflydb/gliner2-base-v1
- Unsloth Studio
How to use antflydb/gliner2-base-v1 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for antflydb/gliner2-base-v1 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for antflydb/gliner2-base-v1 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for antflydb/gliner2-base-v1 to start chatting
- Atomic Chat new
- Docker Model Runner
How to use antflydb/gliner2-base-v1 with Docker Model Runner:
docker model run hf.co/antflydb/gliner2-base-v1
- Lemonade
How to use antflydb/gliner2-base-v1 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull antflydb/gliner2-base-v1
Run and chat with the model
lemonade run user.gliner2-base-v1-{{QUANT_TAG}}List all available models
lemonade list
| { | |
| "added_tokens_decoder": { | |
| "0": { | |
| "content": "[PAD]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "1": { | |
| "content": "[CLS]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "2": { | |
| "content": "[SEP]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "3": { | |
| "content": "[UNK]", | |
| "lstrip": false, | |
| "normalized": true, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "128000": { | |
| "content": "[MASK]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "128001": { | |
| "content": "[SEP_STRUCT]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "128002": { | |
| "content": "[SEP_TEXT]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "128003": { | |
| "content": "[P]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "128004": { | |
| "content": "[C]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "128005": { | |
| "content": "[E]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "128006": { | |
| "content": "[R]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "128007": { | |
| "content": "[L]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "128008": { | |
| "content": "[EXAMPLE]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "128009": { | |
| "content": "[OUTPUT]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| }, | |
| "128010": { | |
| "content": "[DESCRIPTION]", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false, | |
| "special": true | |
| } | |
| }, | |
| "additional_special_tokens": [ | |
| "[SEP_STRUCT]", | |
| "[SEP_TEXT]", | |
| "[P]", | |
| "[C]", | |
| "[E]", | |
| "[R]", | |
| "[L]", | |
| "[EXAMPLE]", | |
| "[OUTPUT]", | |
| "[DESCRIPTION]" | |
| ], | |
| "bos_token": "[CLS]", | |
| "clean_up_tokenization_spaces": false, | |
| "cls_token": "[CLS]", | |
| "do_lower_case": false, | |
| "eos_token": "[SEP]", | |
| "extra_special_tokens": {}, | |
| "mask_token": "[MASK]", | |
| "model_max_length": 1000000000000000019884624838656, | |
| "pad_token": "[PAD]", | |
| "sep_token": "[SEP]", | |
| "sp_model_kwargs": {}, | |
| "split_by_punct": false, | |
| "tokenizer_class": "DebertaV2Tokenizer", | |
| "unk_token": "[UNK]", | |
| "vocab_type": "spm" | |
| } | |