Commit 7b63634
committed
fix: check XProvence before AutoConfig to prevent registry pollution
The previous fix still failed because __init__.py called AutoConfig.from_pretrained
before XProvenceModel was created. This polluted transformers' internal config
registry with XLMRobertaConfig, causing conflicts when XProvenceModel tried to
load the custom XProvenceConfig.
Solution:
- Add _is_xprovence_model() helper that reads config.json directly
- Check for XProvence BEFORE calling AutoConfig.from_pretrained
- This prevents transformers from caching the wrong config class1 parent cda8d79 commit 7b63634
File tree
1 file changed
+25
-7
lines changed- backends/python/server/text_embeddings_server/models
1 file changed
+25
-7
lines changedLines changed: 25 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
17 | 37 | | |
18 | 38 | | |
19 | 39 | | |
| |||
81 | 101 | | |
82 | 102 | | |
83 | 103 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
91 | 107 | | |
92 | 108 | | |
93 | 109 | | |
| 110 | + | |
| 111 | + | |
94 | 112 | | |
95 | 113 | | |
96 | 114 | | |
| |||
0 commit comments