Commit 39e94a8
fix: use outlines v1.2 get_regex_logits_processor API (#202)
The outlines v1.2 API requires:
1. Wrapping the HF model+tokenizer in outlines.Transformers
2. Calling get_regex_logits_processor(None, wrapped, regex)
Prior code tried to construct OutlinesLogitsProcessor directly with
a tokenizer= kwarg that doesn't exist in v1.2. The error was caught
and silently fell back to unconstrained generation.
Tests now verify the ACTUAL API surface (import paths + factory
function signature) instead of just checking class names exist.
This would have caught all three prior Outlines bugs:
- PR #197: wrong class name (RegexLogitsProcessor)
- PR #201: wrong constructor (tokenizer= kwarg)
- This PR: wrong API pattern (direct constructor vs factory)
33/33 tests pass with outlines 1.2.12 installed.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent b5c5e09 commit 39e94a8
2 files changed
Lines changed: 56 additions & 57 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
136 | 135 | | |
137 | | - | |
138 | | - | |
139 | 136 | | |
140 | 137 | | |
141 | 138 | | |
142 | 139 | | |
143 | 140 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
152 | 145 | | |
153 | | - | |
154 | 146 | | |
155 | 147 | | |
156 | 148 | | |
157 | 149 | | |
158 | | - | |
159 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
160 | 153 | | |
161 | 154 | | |
162 | 155 | | |
163 | 156 | | |
164 | 157 | | |
165 | | - | |
| 158 | + | |
166 | 159 | | |
167 | 160 | | |
168 | 161 | | |
169 | 162 | | |
170 | 163 | | |
171 | 164 | | |
172 | 165 | | |
173 | | - | |
| 166 | + | |
174 | 167 | | |
175 | 168 | | |
176 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
| 115 | + | |
| 116 | + | |
117 | 117 | | |
118 | | - | |
119 | | - | |
120 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
143 | 134 | | |
144 | | - | |
145 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
146 | 141 | | |
147 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
148 | 145 | | |
149 | | - | |
| 146 | + | |
150 | 147 | | |
151 | | - | |
152 | | - | |
153 | 148 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
162 | 168 | | |
163 | 169 | | |
164 | 170 | | |
| |||
0 commit comments