[Bugfix][Structured Output] Support outlines engine with reasoning outputs for DeepSeek R1 (#14114)

This commit is contained in:
Ce Gao
2025-03-06 03:49:20 +00:00
committed by GitHub
parent abcc61e0af
commit f5f7f00cd9
8 changed files with 147 additions and 12 deletions
@@ -392,7 +392,7 @@ class XGrammarLogitsProcessor:
def clone(self) -> XGrammarLogitsProcessor:
"""Create a new instance with shared compiled grammar
but separate state"""
new_processor = XGrammarLogitsProcessor(self.config)
new_processor = XGrammarLogitsProcessor(self.config, self.reasoner)
# Share the compiled grammar context (immutable after compilation)
new_processor.ctx = self.ctx