Skip to content

Commit 6ace2f7

Browse files
authored
Fix writing benchmark results with tuple keys (#23633)
Signed-off-by: Huy Do <huydhn@gmail.com>
1 parent b00e69f commit 6ace2f7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

vllm/benchmarks/lib/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ class InfEncoder(json.JSONEncoder):
5454

5555
def clear_inf(self, o: Any):
5656
if isinstance(o, dict):
57-
return {k: self.clear_inf(v) for k, v in o.items()}
57+
return {
58+
str(k)
59+
if not isinstance(k, (str, int, float, bool, type(None)))
60+
else k: self.clear_inf(v)
61+
for k, v in o.items()
62+
}
5863
elif isinstance(o, list):
5964
return [self.clear_inf(v) for v in o]
6065
elif isinstance(o, float) and math.isinf(o):

0 commit comments

Comments
 (0)