@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 971948b846
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 23:45 UTC

Handle non-serializable objects in vllm bench (#21665)

Huy Do committed Jul 26, 2025 at 20:35 UTC 971948b846994819c50cb5c5f04a54822635e303
1 file changed +6 -1
vllm/benchmarks/utils.py
+6 -1
@@ -67,4 +67,9 @@ class InfEncoder(json.JSONEncoder):
67
68 def write_to_json(filename: str, records: list) -> None:
69 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 + )