Files
civitai__civitai/docs
Manuel Emilio Urena 62a7ee9ff1 fix(trainer): stop bare "fu"/"fk" tags blocking LoRA submission (#4883)
* fix(trainer): stop bare "fu"/"fk" tags blocking LoRA submission

obscenity's `fuck` phrase carries the patterns `|fu|` and `|fk`, so a bare `fu`
or `fk` token matches. Legitimate Danbooru dataset tags hit that: a creator with
"fu manchu mustache" was hard-blocked from submitting, by a toast reading
"Reason: fuck" over a tag list containing no such word.

- `LIBRARY_OVERMATCH_TOKENS` excuses the exact tokens `fu` and `fk`, unioned into
  the filter's whitelist set. Deliberately not in `whitelist-words.json`, because
  `moderatorWhitelist` REPLACES that file: a list-only fix would reach the prompt
  audit and not the search gate, and a moderator emptying the row would re-break
  it. Only the bare token is excused; `fuk`, `fkin` and every `f?ck` spelling
  still fire.

- The profanity block now reports the word the INPUT carried rather than the
  dataset word it matched, so a `fagus` tag is blocked for `fagus`, not `fag`.

- The trainer splits severity through the existing `isSoftBlock`, so a
  profanity-only failure becomes the click-through the rest of the app already
  offers rather than a wall. The decision moved out of the component into
  `auditTrainingLabels`, which is unit-testable.

Docs: the whitelist section named one source of three, the minimum-length rule
was scoped to our own list only (obscenity's dataset is added wholesale and does
ship 2-character patterns), `analyze()`'s documented return shape omitted
`matchedWords`, and Compromise was claimed as a dependency in five places with
zero imports anywhere in `src/`.

ClickUp 868m5agjq, Freshdesk 72556.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(trainer): name the flagged field in the soft-block modal

A trigger-word-only profanity hit marks no image card, so a modal worded
"These labels look like they might be inappropriate" pointed the creator at
labels that were all fine. The title, body and cancel button now name whichever
of labels / trigger word was actually flagged.

Also narrows the moderator blocklist copy: it claimed the code-level token
exemption applies "on every path", but `clean()` consults no whitelist at all,
so rendered text is still censored. That contradicted both the feature doc and
the test pinning it in this same change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(profanity): drop "fk" from the overmatch exemption

Measured against the Tag corpus: 143 rows carry a standalone `fu` — `fu hua`,
`fu xuan`, `fu'ri'na`, `fu manchu`, `fu dog` — so excusing it buys real tags.
`fk` has 3 rows (`fk`, `fk zero`, `sexy attire fk`), none used on any model, so
it excused nothing and only let the abbreviation through.

`fk` is blocked again, which the tests now pin alongside `fkin`/`fking`/`fkn`.
The constant records what was rejected and why, so the next token is measured
rather than guessed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-16 20:05:01 -04:00
..
2026-04-21 17:28:15 -06:00
2026-03-27 11:25:47 -04:00
2026-03-13 17:31:05 -04:00
2026-04-24 15:34:42 -06:00
2026-06-11 10:33:01 -06:00
2026-06-11 10:33:01 -06:00
2026-03-23 19:49:29 -06:00