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.4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KucLab/Barist.4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="KucLab/Barist.4")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("KucLab/Barist.4") model = AutoModelForSequenceClassification.from_pretrained("KucLab/Barist.4", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Add tests/test_regex_gate.py
Browse files- tests/test_regex_gate.py +13 -0
tests/test_regex_gate.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json, subprocess, sys
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
|
| 4 |
+
ROOT = Path(__file__).resolve().parent.parent
|
| 5 |
+
|
| 6 |
+
def test_regex_gate_passes():
|
| 7 |
+
r = subprocess.run([sys.executable, str(ROOT / "scripts/test_regex.py")],
|
| 8 |
+
capture_output=True, text=True, cwd=ROOT)
|
| 9 |
+
assert r.returncode == 0, r.stdout + r.stderr
|
| 10 |
+
rep = json.loads((ROOT / "reports/regex_gate.json").read_text())
|
| 11 |
+
assert rep["n_benign"] >= 200
|
| 12 |
+
assert rep["hard_FP"] == 0
|
| 13 |
+
assert rep["misses"] == []
|