KucLab commited on
Commit
4701278
·
verified ·
1 Parent(s): b68addc

Barist.1.1: update serve.py (fourth review, checkpoint b1q)

Browse files
Files changed (1) hide show
  1. serve.py +7 -0
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}]}