Skip to content

Commit 9c4651b

Browse files
committed
filter out unsupported payload values from dataclass on Benchmark records
Signed-off-by: Ian Eaves <ian.k.eaves@gmail.com>
1 parent 8a47398 commit 9c4651b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ramalama/benchmarks/schemas.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import platform
22
import socket
3-
from dataclasses import dataclass, field
3+
from dataclasses import dataclass, field, fields
44
from datetime import datetime, timezone
55
from functools import lru_cache
66
from typing import Any, ClassVar, Literal, TypeVar, overload
@@ -88,6 +88,7 @@ class LlamaBenchResultV1(LlamaBenchResult):
8888
embeddings: int | None = None
8989
no_op_offload: int | None = None
9090
no_host: int | None = None
91+
use_direct_io: int | None = None
9192
n_prompt: int | None = None
9293
n_gen: int | None = None
9394
n_depth: int | None = None
@@ -102,7 +103,7 @@ class LlamaBenchResultV1(LlamaBenchResult):
102103
@classmethod
103104
def from_payload(cls, payload: dict) -> "LlamaBenchResult":
104105
"""Build a result from a llama-bench JSON/JSONL object."""
105-
return cls(**payload)
106+
return cls(**{f.name: payload[f.name] for f in fields(cls) if f.name in payload})
106107

107108

108109
@dataclass

0 commit comments

Comments
 (0)