fix(privacy-filter)!: resolve labels from modelName, fix fromCustomModel identity collapse#1198
Merged
Merged
Conversation
…Model identity collapse PrivacyFilterModelSources had labelNames/viterbiBiases on it but the usePrivacyFilter hook deps only watched modelName/modelSource/tokenizerSource, so swapping labels with the same sources collapsed to the same identity and the runner kept the old config silently. fromCustomModel hardcoded modelName: 'custom' which made the collapse the default for any custom load. Match the ObjectDetection/Segmentation shape: drop labelNames/viterbiBiases from PrivacyFilterModelSources, resolve labels from modelName via an internal lookup, and keep custom-label support only on fromCustomModel (unreachable from the hook). The hook's existing deps now fully cover the prop surface. Closes #1116
…iases/ PrivacyFilterModelSources is now a type alias (union of preset variants), so typedoc generates it under 06-api-reference/type-aliases/, not under interfaces/. Fix the doc link to avoid Docusaurus broken-link failure.
benITo47
approved these changes
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
PrivacyFilterModelSourcescarriedlabelNames/viterbiBiaseson it butusePrivacyFilter's deps only watchedmodelName/modelSource/tokenizerSource, so two custom loads with the same sources but different labels collapsed to the same identity and the runner kept the old config silently.fromCustomModelmade it worse by hardcodingmodelName: 'custom'.Followed @chmjkb's suggestion on #1116: match the
ObjectDetection/Segmentationshape — droplabelNames/viterbiBiasesfromPrivacyFilterModelSources, resolve them frommodelNamevia an internal lookup, and keep custom-label support only onfromCustomModel(unreachable from the hook). The hook's existing deps now fully cover the prop surface, so the collapse is gone.Introduces a breaking change?
(
labelNames/viterbiBiasesare no longer accepted as fields onPrivacyFilterModelSourcesor on thePRIVACY_FILTER_*constants. Custom label spaces and Viterbi tuning move toPrivacyFilterModule.fromCustomModel.)Type of change
Tested on
Testing instructions
Related issues
Closes #1116
Checklist