[Feature][Frontend]: Deprecate --enable-reasoning (#17452)

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
This commit is contained in:
Chauncey
2025-05-01 06:46:16 -07:00
committed by GitHub
parent f5a3c655b2
commit 98060b001d
16 changed files with 49 additions and 91 deletions
@@ -103,7 +103,7 @@ async def get_guided_decoding_logits_processor(
reasoning_backend: str | None = None) -> LogitsProcessor | None:
reasoner = None
if reasoning_backend is not None:
if reasoning_backend:
reasoner_class = ReasoningParserManager.get_reasoning_parser(
reasoning_backend)
reasoner = reasoner_class(tokenizer)
@@ -146,7 +146,7 @@ def get_local_guided_decoding_logits_processor(
guided_params = maybe_backend_fallback(guided_params)
reasoner = None
if reasoning_backend is not None:
if reasoning_backend:
reasoner_class = ReasoningParserManager.get_reasoning_parser(
reasoning_backend)
reasoner = reasoner_class(tokenizer)
@@ -61,7 +61,7 @@ class BaseLogitsProcessor:
"""Use the FSM to bias the logits before sampling the next token."""
# Skip the structured logits processing if reasoning is not finished.
# reasoner is not None only when `--enable-reasoning` is set.
# reasoner is not None only when `--reasoning-parser` is set.
if self._reasoner is not None:
if not self._reasoner.is_reasoning_end(input_ids):
return scores
@@ -346,7 +346,7 @@ class XGrammarLogitsProcessor:
scores: torch.Tensor) -> torch.Tensor:
# Skip the structured logits processing if reasoning is not finished.
# reasoner is not None only when `--enable-reasoning` is set.
# reasoner is not None only when `--reasoning-parser` is set.
if self.reasoner is not None and \
not self.reasoner.is_reasoning_end(
input_ids):