From 72d5e7f7dfb40a61c27e8c9094450bdca1525830 Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Tue, 3 Dec 2024 11:14:59 +0000 Subject: [PATCH] Fix --- packages/evalite-core/src/json-db.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/evalite-core/src/json-db.ts b/packages/evalite-core/src/json-db.ts index baa57aa..5a8ed76 100644 --- a/packages/evalite-core/src/json-db.ts +++ b/packages/evalite-core/src/json-db.ts @@ -41,7 +41,7 @@ export const appendToJsonDb = async (opts: { const jsonDbTask: JsonDBEval = { name: task.name, score: average(task.meta.evalite?.results || [], (t) => { - return average(t.scores, (s) => s.score); + return average(t.scores, (s) => s.score ?? 0); }), duration: task.meta.evalite?.duration ?? 0, results: [], @@ -58,7 +58,7 @@ export const appendToJsonDb = async (opts: { expected, scores, duration, - score: average(scores, (s) => s.score), + score: average(scores, (s) => s.score ?? 0), traces: task.meta.evalite.traces, }); }