Skip to content

Commit aa93d19

Browse files
huydhnx22x22
authored andcommitted
Handle non-serializable objects in vllm bench (vllm-project#21665)
Signed-off-by: x22x22 <[email protected]>
1 parent 186db1b commit aa93d19

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

vllm/benchmarks/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,9 @@ def iterencode(self, o: Any, *args, **kwargs) -> Any:
6767

6868
def write_to_json(filename: str, records: list) -> None:
6969
with open(filename, "w") as f:
70-
json.dump(records, f, cls=InfEncoder)
70+
json.dump(
71+
records,
72+
f,
73+
cls=InfEncoder,
74+
default=lambda o: f"<{type(o).__name__} is not JSON serializable>",
75+
)

0 commit comments

Comments
 (0)