Skip to content

Commit 3062207

Browse files
committed
chore: reduce diff
Signed-off-by: Aaron Pham <[email protected]>
1 parent fb1c551 commit 3062207

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

docs/source/features/structured_outputs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ You can see the complete list of supported parameters on the [OpenAI-Compatible
2424

2525
Structured outputs are supported by default in the OpenAI-Compatible Server. You
2626
may choose to specify the backend to use by setting the
27-
`--structured-output-config '{"backend": '<supported_backend>'}'` flag to `vllm serve`. The default backend is `auto`,
27+
`--structured-output-config '{"backend": "<supported_backend>"}'` flag to `vllm serve`. The default backend is `auto`,
2828
which will try to choose an appropriate backend based on the details of the
2929
request. You may also choose a specific backend, along with
3030
some options. A full set of options is available in the `vllm serve --help`

tests/v1/entrypoints/llm/test_struct_output_generate.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,15 @@ def test_structured_output(
105105
enforce_eager = bool(not current_platform.is_tpu())
106106
# Use a single LLM instance for several scenarios to
107107
# speed up the test suite.
108-
llm = LLM(
109-
model=model_name,
110-
enforce_eager=enforce_eager,
111-
max_model_len=1024,
112-
tokenizer_mode=tokenizer_mode,
113-
speculative_config=speculative_config,
114-
structured_output_config={
115-
"backend": structured_output_backend,
116-
"disable_any_whitespace": True,
117-
},
118-
)
108+
llm = LLM(model=model_name,
109+
enforce_eager=enforce_eager,
110+
max_model_len=1024,
111+
structured_output_config={
112+
"backend": structured_output_backend,
113+
"disable_any_whitespace": True,
114+
},
115+
tokenizer_mode=tokenizer_mode,
116+
speculative_config=speculative_config)
119117

120118
#
121119
# Test 1: Generate JSON output based on a provided schema
@@ -619,8 +617,8 @@ def test_structured_output_auto_mode(
619617

620618
llm = LLM(model=model_name,
621619
max_model_len=1024,
622-
tokenizer_mode=tokenizer_mode,
623-
structured_output_config={"backend": "auto"})
620+
structured_output_config={"backend": "auto"},
621+
tokenizer_mode=tokenizer_mode)
624622

625623
sampling_params = SamplingParams(
626624
temperature=1.0,

vllm/engine/llm_engine.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,20 +2090,20 @@ def _build_logits_processors(
20902090
"LLMEngine. Params: %s", guided_decoding)
20912091

20922092
tokenizer = self.get_tokenizer(lora_request=lora_request)
2093-
guided_decoding.backend = guided_decoding.backend or self.structured_output_config.backend # noqa: E501
2093+
guided_decoding.backend = guided_decoding.backend or \
2094+
self.structured_output_config.backend
20942095

20952096
if self.structured_output_config.reasoning_backend:
20962097
logger.debug("Building with reasoning backend %s",
20972098
self.structured_output_config.reasoning_backend)
20982099

2099-
# yapf: disable
21002100
processor = get_local_guided_decoding_logits_processor(
21012101
guided_params=guided_decoding,
21022102
tokenizer=tokenizer,
21032103
model_config=self.model_config,
2104-
reasoning_backend=self.structured_output_config.reasoning_backend,
2104+
reasoning_backend=self.structured_output_config.
2105+
reasoning_backend,
21052106
)
2106-
# yapf: enable
21072107
if processor:
21082108
logits_processors.append(processor)
21092109

0 commit comments

Comments
 (0)