Skip to content

Commit 38eafd2

Browse files
committed
fix: allow load_gen_results to load error
1 parent c95ee0c commit 38eafd2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/tfbench/load.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ def load_tfb_from_hf(split: str = "base") -> list[BenchmarkTask]:
3535

3636
def load_gen_results_jsonl(result_file: str) -> list[LMAnswer | None]:
3737
"""load generation results from a jsonl file"""
38-
objs: list[dict[str, str | None]] = orjsonl.load(result_file) # type: ignore
39-
return [from_dict(LMAnswer, obj) for obj in objs]
38+
objs: list[dict[str, str]] = orjsonl.load(result_file) # type: ignore
39+
return [from_dict(LMAnswer, obj) if "answer" in obj else None for obj in objs]

0 commit comments

Comments
 (0)