Skip to content

Commit 4c020b6

Browse files
authored
Merge pull request #89 from bcrochet/catch-keyerror
fix: catch KeyError in mt_bench_branch
2 parents 3504b6d + a0c2bc8 commit 4c020b6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/instructlab/eval/mt_bench_branch_generator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ def generate(judge_model_name, branch, taxonomy_dir, output_dir):
5656
print(f"failed to load {qna_file}. skipping...")
5757
continue
5858
for ex in examples:
59-
q, a = ex["question"], ex["answer"]
59+
q, a = ex.get("question"), ex.get("answer")
6060
if q is None or a is None:
61+
logger.warning("Skipping malformed file %s", qna_file)
6162
continue
6263

6364
c = ex.get("context")

0 commit comments

Comments
 (0)