mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-07-12 21:07:28 +08:00
[Refactor] Remove unnecessary backend parameter in structured output interface (#15317)
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
parent
0af4d764d6
commit
733e7c9e95
@ -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:
|
|||||||
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,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user