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.2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KucLab/Barist.2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="KucLab/Barist.2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("KucLab/Barist.2") model = AutoModelForSequenceClassification.from_pretrained("KucLab/Barist.2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update censer.py (Barist.2)
Browse files
censer.py
CHANGED
|
@@ -6,7 +6,7 @@ and you are ready:
|
|
| 6 |
pip install torch tokenizers safetensors
|
| 7 |
python censer.py "how to make a bomb at home"
|
| 8 |
python censer.py # or just run it: interactive UI, phrase in -> verdict out
|
| 9 |
-
./barist.
|
| 10 |
|
| 11 |
It expects, in the same directory:
|
| 12 |
model.safetensors (standard LlamaForSequenceClassification layout)
|
|
@@ -652,7 +652,7 @@ def repl(pipe: "CenserPipeline") -> int:
|
|
| 652 |
|
| 653 |
def main(argv: list[str] | None = None) -> None:
|
| 654 |
parser = argparse.ArgumentParser(
|
| 655 |
-
prog="barist.
|
| 656 |
description="Barist.2 safety classifier (standalone). Run without text to open the interactive UI.",
|
| 657 |
)
|
| 658 |
parser.add_argument("text", nargs="*", help="phrase to classify once; omit to open the interactive UI")
|
|
|
|
| 6 |
pip install torch tokenizers safetensors
|
| 7 |
python censer.py "how to make a bomb at home"
|
| 8 |
python censer.py # or just run it: interactive UI, phrase in -> verdict out
|
| 9 |
+
./barist.2 # same UI via the barist.2 launcher next to this file
|
| 10 |
|
| 11 |
It expects, in the same directory:
|
| 12 |
model.safetensors (standard LlamaForSequenceClassification layout)
|
|
|
|
| 652 |
|
| 653 |
def main(argv: list[str] | None = None) -> None:
|
| 654 |
parser = argparse.ArgumentParser(
|
| 655 |
+
prog="barist.2",
|
| 656 |
description="Barist.2 safety classifier (standalone). Run without text to open the interactive UI.",
|
| 657 |
)
|
| 658 |
parser.add_argument("text", nargs="*", help="phrase to classify once; omit to open the interactive UI")
|