Spaces:
Running on Zero
Running on Zero
Download config.py from VanillaVector/Hybrid-Comment-Moderation: direct link, hf CLI and curl.
- Browser
- Download file 1.37 kB
-
https://huggingface.co/spaces/VanillaVector/Hybrid-Comment-Moderation/resolve/main/config.py
- Command line
-
hf download hf://spaces/VanillaVector/Hybrid-Comment-Moderation/config.py
-
curl -L -o config.py https://huggingface.co/spaces/VanillaVector/Hybrid-Comment-Moderation/resolve/main/config.py
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 |