mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-04-09 06:47:03 +08:00
Handle non-serializable objects in vllm bench (#21665)
This commit is contained in:
parent
eed2f463b2
commit
971948b846
@ -67,4 +67,9 @@ class InfEncoder(json.JSONEncoder):
|
||||
|
||||
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>",
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user