diff --git a/vllm/benchmarks/utils.py b/vllm/benchmarks/utils.py index f0bb99326ab4..5f95fdcc7582 100644 --- a/vllm/benchmarks/utils.py +++ b/vllm/benchmarks/utils.py @@ -67,4 +67,9 @@ def iterencode(self, o: Any, *args, **kwargs) -> Any: def write_to_json(filename: str, records: list) -> None: with open(filename, "w") as f: - json.dump(records, f, cls=InfEncoder) + json.dump( + records, + f, + cls=InfEncoder, + default=lambda o: f"<{type(o).__name__} is not JSON serializable>", + )