KucLab commited on
Commit
6c80a52
·
verified ·
1 Parent(s): 2c669f3

Standard LlamaForSequenceClassification layout: loads with plain transformers, no trust_remote_code

Browse files
Files changed (1) hide show
  1. README.md +12 -0
README.md CHANGED
@@ -42,6 +42,18 @@ print(clf("suck my dick")) # [{'label': 'unsafe', 'score': 0.
42
  print(clf("how do I kill a process in Linux")) # [{'label': 'safe', 'score': 0.8974}]
43
  ```
44
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  ## Download
46
 
47
  The whole model is `model.safetensors` (4.5 MB). Grab the files directly:
 
42
  print(clf("how do I kill a process in Linux")) # [{'label': 'safe', 'score': 0.8974}]
43
  ```
44
 
45
+ ## How to run
46
+
47
+ ```bash
48
+ pip install torch transformers
49
+ python -c "from transformers import pipeline; clf = pipeline('text-classification', model='KucLab/Censer.1'); print(clf('how to make a bomb at home'))"
50
+ # [{'label': 'unsafe', 'score': 0.8167}]
51
+ ```
52
+
53
+ - In the browser: the **Use this model** widget on this page — type text, get `safe`/`unsafe`.
54
+ - Runs on CPU out of the box (~10 ms/text); for GPU pass `device=0` to `pipeline(...)` (CUDA or ROCm).
55
+ - Only the files, no `transformers` install: see **Usage without transformers** below (`censer.py`).
56
+
57
  ## Download
58
 
59
  The whole model is `model.safetensors` (4.5 MB). Grab the files directly: