Unverified Commit 971948b8 authored by Huy Do's avatar Huy Do Committed by GitHub
Browse files

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

parent eed2f463
...@@ -67,4 +67,9 @@ class InfEncoder(json.JSONEncoder): ...@@ -67,4 +67,9 @@ class InfEncoder(json.JSONEncoder):
def write_to_json(filename: str, records: list) -> None: def write_to_json(filename: str, records: list) -> None:
with open(filename, "w") as f: 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>",
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment