We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3fba13 commit 647223eCopy full SHA for 647223e
outlines/backends/outlines_core.py
@@ -179,7 +179,13 @@ def process_logits(
179
else:
180
for i in range(batch_size):
181
last_token_id = self.tensor_adapter.to_scalar(input_ids[i][-1]) # type: ignore
182
- if not self._guides[i].is_finished():
+ # This circumvents issue #227 in outlines_core
183
+ # Ideally, we would be able to advance all the times as the final
184
+ # state would accept the eos token leading to itself
185
+ if (
186
+ not self._guides[i].is_finished()
187
+ or self._guides[i].accepts_tokens([last_token_id])
188
+ ):
189
self._guides[i].advance(
190
token_id=last_token_id,
191
return_tokens=False
0 commit comments