Skip to content

Commit 70c6016

Browse files
Chenyaaangdbyoung18
authored andcommitted
[Bugfix] Fix bug when dataset is json (vllm-project#15899)
Signed-off-by: Chenyaaang <[email protected]>
1 parent 2cf5674 commit 70c6016

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

benchmarks/benchmark_serving_structured_output.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,11 @@ def sample_requests(tokenizer: PreTrainedTokenizerBase,
130130
"description":
131131
"An unique optional field to avoid cached schemas"
132132
}
133+
else:
134+
json_schemas = [schema] * args.num_prompts
133135

134136
def gen_prompt(index: int):
135-
schema = json_schemas[index % len(json_schemas)]
136-
return f"Generate an example of a user profile given the following schema: {json.dumps(schema)}" # noqa: E501
137+
return f"Generate an example of a user profile given the following schema: {json.dumps(get_schema(index))}" # noqa: E501
137138

138139
def get_schema(index: int):
139140
return json_schemas[index % len(json_schemas)]

0 commit comments

Comments
 (0)