Text Classification
Transformers
ONNX
Safetensors
llama
safety
content-moderation
multi-label
multilingual
tiny-language-model
from-scratch
distilled
text-embeddings-inference
Instructions to use KucLab/Barist.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KucLab/Barist.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="KucLab/Barist.1")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("KucLab/Barist.1") model = AutoModelForSequenceClassification.from_pretrained("KucLab/Barist.1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Barist.1.1: update serve.py (fourth review, checkpoint b1q)
Browse files
serve.py
CHANGED
|
@@ -3,6 +3,13 @@
|
|
| 3 |
python serve.py --port 8000 # serves the local HF bundle dir (run from the bundle root)
|
| 4 |
CENSER_DIR=/path/to/bundle python scripts/serve.py
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
Endpoints:
|
| 7 |
GET /health -> {"status": "ok", "model": ...}
|
| 8 |
POST /classify -> {"texts": [...]} => {"results": [{label, unsafe, score, categories, chunks}]}
|
|
|
|
| 3 |
python serve.py --port 8000 # serves the local HF bundle dir (run from the bundle root)
|
| 4 |
CENSER_DIR=/path/to/bundle python scripts/serve.py
|
| 5 |
|
| 6 |
+
Response fields per text: `label` ("safe"/"unsafe"), `unsafe`, `score`,
|
| 7 |
+
`categories` (top-2 by priority: sexual_abuse > self_harm > violence/weapons > ... > hate;
|
| 8 |
+
unsafe always gets >=1 category), `override` ("must_catch" when the deterministic
|
| 9 |
+
pre-filter fired), `needs_review` (jailbreak/legally-ambiguous patterns — review, not a
|
| 10 |
+
block), `needs_support` (Linka bezpečí URL when self-harm is indicated, regex or
|
| 11 |
+
model score >= 0.3).
|
| 12 |
+
|
| 13 |
Endpoints:
|
| 14 |
GET /health -> {"status": "ok", "model": ...}
|
| 15 |
POST /classify -> {"texts": [...]} => {"results": [{label, unsafe, score, categories, chunks}]}
|