@@ -108,17 +108,17 @@ def test_guided_json_completion(guided_decoding_backend: str,
108
108
"max_tokens" : 500 ,
109
109
})
110
110
111
- backwoards_compatibility_kwargs = {}
111
+ runner_kwargs = {
112
+ "seed" : 0 ,
113
+ }
112
114
if vllm_version_is ("0.10.2" ):
113
- backwoards_compatibility_kwargs [
114
- "guided_decoding_backend" ] = guided_decoding_backend
115
+ runner_kwargs ["guided_decoding_backend" ] = guided_decoding_backend
115
116
else :
116
- backwoards_compatibility_kwargs ["structured_outputs_config" ] = {
117
+ runner_kwargs ["structured_outputs_config" ] = {
117
118
"backend" : guided_decoding_backend
118
119
}
119
120
120
- with VllmRunner (MODEL_NAME , seed = 0 ,
121
- ** backwoards_compatibility_kwargs ) as vllm_model :
121
+ with VllmRunner (MODEL_NAME , ** runner_kwargs ) as vllm_model :
122
122
prompts = [
123
123
f"Give an example JSON for an employee profile "
124
124
f"that fits this schema: { sample_json_schema } "
@@ -147,22 +147,23 @@ def test_guided_regex(guided_decoding_backend: str, sample_regex):
147
147
if guided_decoding_backend == "outlines" :
148
148
pytest .skip ("Outlines doesn't support regex-based guided decoding." )
149
149
150
- struct_output_params = StructuredOutputsParams (json = sample_json_schema , )
150
+ struct_output_params = StructuredOutputsParams (json = sample_regex , )
151
151
sampling_params = construct_sampling_params (struct_output_params , {
152
152
"temperature" : 0.8 ,
153
153
"top_p" : 0.95 ,
154
154
})
155
- backwoards_compatibility_kwargs = {}
155
+
156
+ runner_kwargs = {
157
+ "seed" : 0 ,
158
+ }
156
159
if vllm_version_is ("0.10.2" ):
157
- backwoards_compatibility_kwargs [
158
- "guided_decoding_backend" ] = guided_decoding_backend
160
+ runner_kwargs ["guided_decoding_backend" ] = guided_decoding_backend
159
161
else :
160
- backwoards_compatibility_kwargs ["structured_outputs_config" ] = {
162
+ runner_kwargs ["structured_outputs_config" ] = {
161
163
"backend" : guided_decoding_backend
162
164
}
163
165
164
- with VllmRunner (MODEL_NAME , seed = 0 ,
165
- ** backwoards_compatibility_kwargs ) as vllm_model :
166
+ with VllmRunner (MODEL_NAME , ** runner_kwargs ) as vllm_model :
166
167
prompts = [
167
168
f"Give an example IPv4 address with this regex: { sample_regex } "
168
169
] * 2
0 commit comments