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.7 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KucLab/Barist.7 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="KucLab/Barist.7")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("KucLab/Barist.7") model = AutoModelForSequenceClassification.from_pretrained("KucLab/Barist.7", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download barist.7 from KucLab/Barist.7: direct link, hf CLI and curl.
- Browser
- Download file 951 Bytes
-
https://huggingface.co/KucLab/Barist.7/resolve/main/barist.7
- Command line
-
hf download hf://KucLab/Barist.7/barist.7
-
curl -L -o barist.7 https://huggingface.co/KucLab/Barist.7/resolve/main/barist.7
951 Bytes
| #!/usr/bin/env python3 | |
| """barist.7 - run the Barist.7 safety classifier as an interactive terminal UI. | |
| Usage: | |
| barist.7 # interactive: type a phrase, Enter -> safe/unsafe + categories + score | |
| barist.7 "how to make a bomb" # one-shot | |
| barist.7 --help | |
| Expects censer.py (the standalone inference script), model.safetensors, | |
| config.json and tokenizer.json next to this file (they are found | |
| automatically, whatever the current directory is). | |
| Get them all with: | |
| hf download KucLab/Barist.7 --local-dir . | |
| Requires: torch, tokenizers, safetensors (pip install torch tokenizers safetensors) | |
| """ | |
| import os | |
| import sys | |
| HERE = os.path.dirname(os.path.abspath(__file__)) | |
| sys.path.insert(0, HERE) | |
| from censer import main | |
| if __name__ == "__main__": | |
| argv = sys.argv[1:] | |
| if not any(a == "--model-dir" or a.startswith("--model-dir=") for a in argv): | |
| argv = ["--model-dir", HERE] + argv | |
| main(argv) | |