Karl Qiu
Switch to Qwen2.5-14B-Instruct from Qwen2.5-3B-Instruct
7912365
Raw History Blame Contribute Delete
1.37 kB
"""
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