Commit 8f1701e
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 5298c30 commit 8f1701e
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 | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
147 | 149 | | |
148 | 150 | | |
149 | | - | |
| 151 | + | |
| 152 | + | |
150 | 153 | | |
151 | | - | |
152 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
153 | 166 | | |
154 | | - | |
| 167 | + | |
| 168 | + | |
155 | 169 | | |
156 | 170 | | |
157 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2030 | 2030 | | |
2031 | 2031 | | |
2032 | 2032 | | |
| 2033 | + | |
| 2034 | + | |
2033 | 2035 | | |
2034 | 2036 | | |
2035 | 2037 | | |
| |||
0 commit comments