Text Classification
GLiNER2
Safetensors
multilingual
extractor
guardrails
safety
prompt-injection
jailbreak
pii
content-moderation
Instructions to use FrostWolfAI/Frost-Defend-Guardrails-PII with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- GLiNER2
How to use FrostWolfAI/Frost-Defend-Guardrails-PII with GLiNER2:
from gliner2 import AutoExtractor extractor = AutoExtractor.from_pretrained("FrostWolfAI/Frost-Defend-Guardrails-PII") # 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
Download install.sh from FrostWolfAI/Frost-Defend-Guardrails-PII: direct link, hf CLI and curl.
- Browser
- Download file 1.48 kB
-
https://huggingface.co/FrostWolfAI/Frost-Defend-Guardrails-PII/resolve/main/install.sh
- Command line
-
hf download hf://FrostWolfAI/Frost-Defend-Guardrails-PII/install.sh
-
curl -L -o install.sh https://huggingface.co/FrostWolfAI/Frost-Defend-Guardrails-PII/resolve/main/install.sh
1.48 kB
| # Frost-Defend-Guardrails-PII: one-step setup. | |
| # bash install.sh # GPU if available (Linux: CUDA build of PyTorch) | |
| # bash install.sh --cpu # CPU-only PyTorch (smaller download, no GPU needed) | |
| # Creates ./.venv, installs gliner2 + PyTorch, downloads the model and runs a quick demo. | |
| set -euo pipefail | |
| CPU=0 | |
| [[ "${1:-}" == "--cpu" ]] && CPU=1 | |
| cd "$(dirname "$0")" | |
| PY="" | |
| for c in python3.12 python3.11 python3.10 python3 python; do | |
| if command -v "$c" >/dev/null 2>&1 && "$c" -c 'import sys; sys.exit(0 if sys.version_info >= (3, 10) else 1)'; then | |
| PY="$c"; break | |
| fi | |
| done | |
| [[ -z "$PY" ]] && { echo "Python 3.10+ is required (https://www.python.org/downloads/)"; exit 1; } | |
| echo ">> using $($PY --version)" | |
| $PY -m venv .venv | |
| if [[ -f .venv/bin/activate ]]; then source .venv/bin/activate; else source .venv/Scripts/activate; fi | |
| python -m pip install -q --upgrade pip | |
| if [[ $CPU == 1 ]]; then | |
| echo ">> installing PyTorch (CPU)" | |
| python -m pip install -q torch --index-url https://download.pytorch.org/whl/cpu | |
| fi | |
| echo ">> installing gliner2" | |
| python -m pip install -q "gliner2[local]==2.1.0" huggingface_hub | |
| echo ">> downloading the model and running the demo" | |
| python frost_defend.py | |
| echo | |
| echo "Done. Next time: source .venv/bin/activate (Windows Git Bash: source .venv/Scripts/activate)" | |
| echo "Then in Python: from frost_defend import FrostDefend" | |
| echo "Or try it in a browser: python frost_defend.py serve -> http://127.0.0.1:4460/" | |