Commit 4d1a44b
committed
fix(pii): add fallback to ModernBERT for backward compatibility
Implement graceful fallback strategy for PII initialization:
1. Try auto-detecting InitCandleBertTokenClassifier (enables LoRA)
2. Fallback to InitModernBertPIITokenClassifier if auto-detect fails
This maintains backward compatibility with existing ModernBERT models
that have incomplete configs (e.g., missing hidden_act field) while
still enabling LoRA PII models when available.
Also disable PII for caching tests (not needed for those test cases).
Resolves test failures while preserving the 27% → 73% improvement.
Signed-off-by: Yossi Ovadia <[email protected]>1 parent 6efce63 commit 4d1a44b
File tree
2 files changed
+21
-5
lines changed- src/semantic-router/pkg
- classification
- extproc
2 files changed
+21
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
146 | 148 | | |
147 | 149 | | |
148 | | - | |
| 150 | + | |
| 151 | + | |
149 | 152 | | |
150 | | - | |
151 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
152 | 165 | | |
153 | | - | |
| 166 | + | |
| 167 | + | |
154 | 168 | | |
155 | 169 | | |
156 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2696 | 2696 | | |
2697 | 2697 | | |
2698 | 2698 | | |
| 2699 | + | |
| 2700 | + | |
2699 | 2701 | | |
2700 | 2702 | | |
2701 | 2703 | | |
| |||
0 commit comments