PEFT
Safetensors
Transformers
GLiNER
GLiNER2
lora
prompt-safety
prompt-injection
llm-guardrails
ai-safety
Instructions to use clallier/guardrails-GLiNER2-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use clallier/guardrails-GLiNER2-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForSequenceClassification base_model = AutoModelForSequenceClassification.from_pretrained("fastino/gliguard-LLMGuardrails-300M") model = PeftModel.from_pretrained(base_model, "clallier/guardrails-GLiNER2-lora") - Transformers
How to use clallier/guardrails-GLiNER2-lora with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("clallier/guardrails-GLiNER2-lora", dtype="auto") - GLiNER
How to use clallier/guardrails-GLiNER2-lora with GLiNER:
from gliner import GLiNER model = GLiNER.from_pretrained("clallier/guardrails-GLiNER2-lora") - GLiNER2
How to use clallier/guardrails-GLiNER2-lora with GLiNER2:
from gliner2 import GLiNER2 model = GLiNER2.from_pretrained("clallier/guardrails-GLiNER2-lora") # Extract entities text = "Apple CEO Tim Cook announced iPhone 15 in Cupertino yesterday." result = extractor.extract_entities(text, ["company", "person", "product", "location"]) print(result) - Notebooks
- Google Colab
- Kaggle
Ctrl+K