Unverified Commit 733e7c9e authored by Aaron Pham's avatar Aaron Pham Committed by GitHub
Browse files

[Refactor] Remove unnecessary backend parameter in structured output interface (#15317)


Signed-off-by: default avatarAaron Pham <contact@aarnphm.xyz>
parent 0af4d764
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
import multiprocessing import multiprocessing
from concurrent.futures import Future, ThreadPoolExecutor from concurrent.futures import ThreadPoolExecutor
from typing import TYPE_CHECKING, Optional from typing import TYPE_CHECKING, Optional
from vllm.config import VllmConfig from vllm.config import VllmConfig
...@@ -57,13 +57,13 @@ class StructuredOutputManager: ...@@ -57,13 +57,13 @@ class StructuredOutputManager:
raise ValueError( raise ValueError(
f"Unsupported structured output backend: {backend_name}") f"Unsupported structured output backend: {backend_name}")
grammar: Future[StructuredOutputGrammar] = self.executor.submit( grammar = self.executor.submit(self._async_create_grammar, request)
self._async_create_grammar, request, self.backend)
request.structured_output_request.grammar = grammar # type: ignore[assignment] request.structured_output_request.grammar = grammar # type: ignore[assignment]
def _async_create_grammar( def _async_create_grammar(
self, request: Request, self,
backend: StructuredOutputBackend) -> StructuredOutputGrammar: request: Request,
) -> StructuredOutputGrammar:
key = request.structured_output_request.structured_output_key # type: ignore[union-attr] key = request.structured_output_request.structured_output_key # type: ignore[union-attr]
# Note that the request was validated in the engine core client, # Note that the request was validated in the engine core client,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment