""" 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