Coverage for src/lilbee/catalog/content.py: 100%
4 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-09-28 17:20 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-09-28 17:20 +0000
1"""Content flag for catalog rows, derived from HuggingFace repo tags."""
3from collections.abc import Iterable
5# Tag stems marking a safety-stripped (abliterated/uncensored) model.
6# Surveyed 2026-09-12 over 200 trending text-generation GGUF repos: uncensored
7# (38) and abliterated (28) dominate; decensored, nsfw, and heretic cover the
8# rest of the tag vocabulary, each a singleton-class tag in the sample.
9STRIPPED_TAG_STEMS: tuple[str, ...] = ("uncensor", "abliter", "decensor", "nsfw", "heretic")
12def is_safety_stripped(tags: Iterable[str]) -> bool:
13 """True when any tag names safety-stripped content (case-insensitive)."""
14 return any(stem in tag.lower() for tag in tags for stem in STRIPPED_TAG_STEMS)