File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ def _build_generation_args(
118118 ) -> "SamplingParams" :
119119 """Create the `SamplingParams` object to pass to the `generate` method
120120 of the `vllm.LLM` model."""
121- from vllm .sampling_params import GuidedDecodingParams , SamplingParams
121+ from vllm .sampling_params import StructuredOutputsParams , SamplingParams
122122
123123 sampling_params = inference_kwargs .pop ("sampling_params" , None )
124124
@@ -127,7 +127,9 @@ def _build_generation_args(
127127
128128 output_type_args = self .type_adapter .format_output_type (output_type )
129129 if output_type_args :
130- sampling_params .guided_decoding = GuidedDecodingParams (** output_type_args )
130+ original_sampling_params_dict = {f : getattr (sampling_params , f ) for f in sampling_params .__struct_fields__ }
131+ sampling_params_dict = {** original_sampling_params_dict , "structured_outputs" : StructuredOutputsParams (** output_type_args )}
132+ sampling_params = SamplingParams (** sampling_params_dict )
131133
132134 return sampling_params
133135
You can’t perform that action at this time.
0 commit comments