File size: 1,368 Bytes
fb62a11
 
 
 
 
 
 
 
 
 
7912365
 
 
 
 
 
fb62a11
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""
config.py β€” Single source of truth for the Spaces deployment.
"""

# ── Decision labels ───────────────────────────────────────────
DECISION_BLOCK = "BLOCK"
DECISION_ALLOW = "ALLOW"

# ── Model identifiers ────────────────────────────────────────
CLASSIFIER_MODEL_NAME = "martin-ha/toxic-comment-model"      # DistilBERT, ~270 MB
LLM_MODEL_NAME        = "Qwen/Qwen2.5-14B-Instruct"         # NF4, ~8 GB

# ── Quantization ──────────────────────────────────────────────
# NF4 via bitsandbytes compresses 14B params from ~28 GB (bf16)
# to ~8 GB, fitting comfortably on a ZeroGPU A100 slice.
LLM_QUANTIZATION = "4bit"

# ── Generation parameters ─────────────────────────────────────
LLM_MAX_NEW_TOKENS = 5
LLM_TEMPERATURE    = 0.0

# ── Confidence thresholds (ML β†’ LLM escalation) ──────────────
CONFIDENCE_HIGH = 0.85   # above β†’ trust the ML classifier
CONFIDENCE_LOW  = 0.15   # below β†’ trust the ML classifier (safe)
# Between LOW and HIGH β†’ grey zone β†’ escalate to LLM